mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-14 23:43:43 -04:00
DATV: Replace DVB-S2 SOF VLA buffer with std::vector
Replace the variable-length array used for SOF symbol buffering in the DVB-S2 frame receiver with a std::vector allocation. Use vector::data() when passing the buffer to the existing pointer-based conjugate product function. This removes another non-standard VLA usage and improves C++ portability without changing behavior. Signed-off-by: Robin Getz <rgetz503@gmail.com>
This commit is contained in:
@@ -1450,7 +1450,7 @@ struct s2_frame_receiver : runnable
|
||||
{
|
||||
sampler_state ss = *pss;
|
||||
float power = 0;
|
||||
std::complex<T> symbs[sof.LENGTH];
|
||||
std::vector<std::complex<T>> symbs(sof.LENGTH);
|
||||
|
||||
for (int i=0; i<sof.LENGTH; ++i)
|
||||
{
|
||||
@@ -1458,7 +1458,7 @@ struct s2_frame_receiver : runnable
|
||||
power += cnorm2(symbs[i]);
|
||||
}
|
||||
|
||||
std::complex<float> c = conjprod(sof.symbols, symbs, sof.LENGTH);
|
||||
std::complex<float> c = conjprod(sof.symbols, symbs.data(), sof.LENGTH);
|
||||
c *= 1.0f / sof.LENGTH;
|
||||
align_phase(pss, c);
|
||||
float signal_amp = sqrtf(power/sof.LENGTH);
|
||||
|
||||
Reference in New Issue
Block a user