Browse Source

test_psk31: Fix signedness warning in sample loop

Resolve GCC -Wsign-compare by matching the loop index type to
the unsigned size returned by the container. This avoids
signed/unsigned comparison errors and potential incorrect loop
bounds when processing sample buffers.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 1 month ago
parent
commit
cc8bbac4a4
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      sdrbench/test_psk31.cpp

2
sdrbench/test_psk31.cpp

@ -338,7 +338,7 @@ QString runChannelTrial(
} }
constexpr int blockSize = 1000; constexpr int blockSize = 1000;
for (int i = 0; i < samples.size(); i += blockSize) { for (std::size_t i = 0; i < samples.size(); i += blockSize) {
demod.feed(samples.begin() + i, samples.begin() + std::min<int>(i + blockSize, samples.size())); demod.feed(samples.begin() + i, samples.begin() + std::min<int>(i + blockSize, samples.size()));
} }

Loading…
Cancel
Save