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/gerrit-log@lists.osmocom.org/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10720
Change subject: radioInterfaceMulti:pullBuffer: Sanely convert float array to complex array
......................................................................
radioInterfaceMulti:pullBuffer: Sanely convert float array to complex array
Fixes this type of compilation warning:
‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class Complex<float>’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
Change-Id: Ibb2380a0a335ce798fe87221519fbbebade53054
---
M Transceiver52M/radioInterfaceMulti.cpp
1 file changed, 16 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/10720/1
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp
index b3add21..0823419 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -230,6 +230,7 @@
bool local_underrun;
size_t num;
float *buf;
+ unsigned int i;
if (recvBuffer[0]->getFreeSegments() <= 0)
return;
@@ -273,10 +274,22 @@
buf = channelizer->outputBuffer(pchan);
size_t cLen = channelizer->outputLen();
size_t hLen = dnsampler->len();
- size_t hSize = 2 * hLen * sizeof(float);
- memcpy(&buf[2 * -hLen], history[lchan]->begin(), hSize);
- memcpy(history[lchan]->begin(), &buf[2 * (cLen - hLen)], hSize);
+ float *fdst = &buf[2 * -hLen];
+ complex *src = history[lchan]->begin();
+ for (i = 0; i < hLen; i++) {
+ fdst[0] = src->real();
+ fdst[1] = src->imag();
+ src++;
+ fdst += 2;
+ }
+ complex *dst = history[lchan]->begin();
+ float *fsrc = &buf[2 * (cLen - hLen)];
+ for (i = 0; i < hLen; i++) {
+ *dst = complex(fdst[0], fdst[1]);
+ fsrc += 2;
+ dst++;
+ }
float *wr_segment = recvBuffer[lchan]->getWriteSegment();
--
To view, visit https://gerrit.osmocom.org/10720
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb2380a0a335ce798fe87221519fbbebade53054
Gerrit-Change-Number: 10720
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180831/017a899f/attachment.htm>