[PATCH] rtl_tcp: rtl_tcp_source_c.cc: Adds explicit cast

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/.

Mike Morris michael.patrick.morris at gmail.com
Thu Jan 4 06:31:28 UTC 2018


To prevent build errors on macOS 10.13.2
---
 lib/rtl_tcp/rtl_tcp_source_c.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/rtl_tcp/rtl_tcp_source_c.cc b/lib/rtl_tcp/rtl_tcp_source_c.cc
index ecdeee0..c962dd8 100644
--- a/lib/rtl_tcp/rtl_tcp_source_c.cc
+++ b/lib/rtl_tcp/rtl_tcp_source_c.cc
@@ -298,17 +298,17 @@ rtl_tcp_source_c::rtl_tcp_source_c(const std::string &args) :
   // set direct sampling
   struct command cmd;
 
-  cmd = { 0x09, htonl(direct_samp) };
+  cmd = (struct command){ 0x09, htonl(direct_samp) };
   send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
   if (direct_samp)
     _no_tuner = true;
 
   // set offset tuning
-  cmd = { 0x0a, htonl(offset_tune) };
+  cmd = (struct command){ 0x0a, htonl(offset_tune) };
   send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
 
   // set bias tee
-  cmd = { 0x0e, htonl(bias_tee) };
+  cmd = (struct command){ 0x0e, htonl(bias_tee) };
   send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
 }
 
@@ -567,7 +567,7 @@ bool rtl_tcp_source_c::set_gain_mode( bool automatic, size_t chan )
   send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
 
   // AGC mode
-  cmd = { 0x08, htonl(automatic) };
+  cmd = (struct command){ 0x08, htonl(automatic) };
   send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
 
   _auto_gain = automatic;
-- 
2.15.1




More information about the osmocom-sdr mailing list