1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-07 10:43:58 +00:00

Fix bugprone-too-small-loop-variable clang-tidy check warnings

This commit is contained in:
Carles Fernandez
2019-08-24 17:34:12 +02:00
parent d36e9e431c
commit df05c7418e
34 changed files with 103 additions and 102 deletions

View File

@@ -268,10 +268,10 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain)
g += r.step;
}
}
for (unsigned stage = 1; stage <= gains.size(); stage++)
for (size_t stage = 1; stage <= gains.size(); stage++)
{
int stage_gain = static_cast<int>(gains[stage] * 10);
unsigned param = (stage << 16) | (stage_gain & 0xffff);
size_t param = (stage << 16) | (stage_gain & 0xffff);
boost::system::error_code ec = rtl_tcp_command(RTL_TCP_SET_IF_GAIN, param, socket_);
if (ec)
{

View File

@@ -164,7 +164,7 @@ int unpack_2bit_samples::work(int noutput_items,
{
if (swap_endian_bytes_)
{
for (unsigned int i = 0; i < ninput_bytes; ++i)
for (size_t i = 0; i < ninput_bytes; ++i)
{
// Read packed input sample (1 byte = 4 samples)
raw_byte.byte = in[i];
@@ -177,7 +177,7 @@ int unpack_2bit_samples::work(int noutput_items,
}
else
{
for (unsigned int i = 0; i < ninput_bytes; ++i)
for (size_t i = 0; i < ninput_bytes; ++i)
{
// Read packed input sample (1 byte = 4 samples)
raw_byte.byte = in[i];
@@ -193,7 +193,7 @@ int unpack_2bit_samples::work(int noutput_items,
{
if (swap_endian_bytes_)
{
for (unsigned int i = 0; i < ninput_bytes; ++i)
for (size_t i = 0; i < ninput_bytes; ++i)
{
// Read packed input sample (1 byte = 4 samples)
raw_byte.byte = in[i];
@@ -206,7 +206,7 @@ int unpack_2bit_samples::work(int noutput_items,
}
else
{
for (unsigned int i = 0; i < ninput_bytes; ++i)
for (size_t i = 0; i < ninput_bytes; ++i)
{
// Read packed input sample (1 byte = 4 samples)
raw_byte.byte = in[i];

View File

@@ -98,14 +98,14 @@ int Gnss_Sdr_Valve::work(int noutput_items,
return 0;
}
// multichannel support
for (unsigned int ch = 0; ch < output_items.size(); ch++)
for (size_t ch = 0; ch < output_items.size(); ch++)
{
memcpy(output_items[ch], input_items[ch], n * input_signature()->sizeof_stream_item(ch));
}
d_ncopied_items += n;
return n;
}
for (unsigned int ch = 0; ch < output_items.size(); ch++)
for (size_t ch = 0; ch < output_items.size(); ch++)
{
memcpy(output_items[ch], input_items[ch], noutput_items * input_signature()->sizeof_stream_item(ch));
}