osmith has uploaded this change for review.
USRPDevice: fix cast of short to uint32_t
Fix building with --enable-werror and GCC 12:
USRPDevice.cpp:591:30: error: 'data' is used uninitialized [-Werror=uninitialized]
591 | *wordPtr = host_to_usrp_u32(*wordPtr);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~
Related: OS#6057
Change-Id: I806d8c1432cb20efca1830a2752a4cbc70384b54
---
M Transceiver52M/device/usrp1/USRPDevice.cpp
1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/37/33737/1
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 5c40aa8..bf114b6 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -587,8 +587,7 @@
{
#ifndef SWLOOPBACK
short data[] = {0x00,0x02,0x00,0x00};
- uint32_t *wordPtr = (uint32_t *) data;
- *wordPtr = host_to_usrp_u32(*wordPtr);
+ *data = host_to_usrp_short(*data);
bool tmpUnderrun;
std::vector<short *> buf(1, data);
To view, visit change 33737. To unsubscribe, or for help writing mail filters, visit settings.