[PATCH] rtl_tcp: put new DEFAULT_* constants in defines

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Oliver Smith osmith at sysmocom.de
Wed Aug 18 07:09:25 UTC 2021


Fix failures with some GCC versions:
  /usr/src/packages/BUILD/src/rtl_tcp.c:90:24: error: initializer element is not constant
   static int llbuf_num = DEFAULT_MAX_NUM_BUFFERS;

Fixes: 641c22 ("rtl_tcp: Extracted some constants out of printf strings")
Change-Id: Ia9e18d4c22d957f561dcdaf2657bb6d201374375
---
 src/rtl_tcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index ad930c8..89b1fb9 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -56,9 +56,9 @@ typedef int socklen_t;
 #define SOCKET_ERROR -1
 #endif
 
-static const char*    DEFAULT_PORT_STR = "1234";
-static const uint32_t DEFAULT_SAMPLE_RATE_HZ = 2048000;
-static const int      DEFAULT_MAX_NUM_BUFFERS = 500;
+#define DEFAULT_PORT_STR "1234"
+#define DEFAULT_SAMPLE_RATE_HZ 2048000
+#define DEFAULT_MAX_NUM_BUFFERS 500
 
 static SOCKET s;
 
-- 
2.20.1




More information about the osmocom-sdr mailing list