diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-08-30 20:45:14 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-09-10 10:30:06 +0200 |
commit | 5e68cde779dc6ef4f84f32422c25c558dea650d3 (patch) | |
tree | b2b54681ef2569fb226c8f683b4bbfd53eb9ebcf /Transceiver52M | |
parent | 1f4a009c67d61bca2d7b150492fb3b7e25867820 (diff) |
SigProcLib: Use available copyTo Vector API instead of memcopy
This change allows to remove some wrong use of code as per compilation
warning:
osmo-trx/Transceiver52M/sigProcLib.cpp:1266:40: error:
‘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]
midMidamble->size() * sizeof(complex));
Change-Id: Id446711349bec70fa4e7c8efe0f7f9faf7e4f277
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index e94170b..2040b36 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -1262,8 +1262,7 @@ static bool generateMidamble(int sps, int tsc) data = (complex *) convolve_h_alloc(midMidamble->size()); _midMidamble = new signalVector(data, 0, midMidamble->size()); _midMidamble->setAligned(true); - memcpy(_midMidamble->begin(), midMidamble->begin(), - midMidamble->size() * sizeof(complex)); + midMidamble->copyTo(*_midMidamble); autocorr = convolve(midamble, _midMidamble, NULL, NO_DELAY); if (!autocorr) { @@ -1319,8 +1318,7 @@ static CorrelationSequence *generateEdgeMidamble(int tsc) data = (complex *) convolve_h_alloc(midamble->size()); _midamble = new signalVector(data, 0, midamble->size()); _midamble->setAligned(true); - memcpy(_midamble->begin(), midamble->begin(), - midamble->size() * sizeof(complex)); + midamble->copyTo(*_midamble); /* Channel gain is an empirically measured value */ seq = new CorrelationSequence; @@ -1360,7 +1358,7 @@ static bool generateRACHSequence(int sps) data = (complex *) convolve_h_alloc(seq1->size()); _seq1 = new signalVector(data, 0, seq1->size()); _seq1->setAligned(true); - memcpy(_seq1->begin(), seq1->begin(), seq1->size() * sizeof(complex)); + seq1->copyTo(*_seq1); autocorr = convolve(seq0, _seq1, autocorr, NO_DELAY); if (!autocorr) { @@ -1457,7 +1455,7 @@ static signalVector *downsampleBurst(const signalVector &burst) { signalVector in(DOWNSAMPLE_IN_LEN, dnsampler->len()); signalVector *out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in.begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); + burst.copyToSegment(in, 0, DOWNSAMPLE_IN_LEN); if (dnsampler->rotate((float *) in.begin(), DOWNSAMPLE_IN_LEN, (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { |