Browse Source

devices/limesdr: Use correct format specifier for channel index

Use %zu to print size_t channel indices in error messages.
The previous %lu specifier expects unsigned long, which is not
guaranteed to match size_t on all platforms.

Identified by cppcheck format warnings.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
e8cdeeda92
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 6
      devices/limesdr/devicelimesdr.cpp

6
devices/limesdr/devicelimesdr.cpp

@ -167,7 +167,7 @@ bool DeviceLimeSDR::SetRFELNA_dB(lms_device_t *device, std::size_t chan, int val @@ -167,7 +167,7 @@ bool DeviceLimeSDR::SetRFELNA_dB(lms_device_t *device, std::size_t chan, int val
{
if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0)
{
fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%lu\n", chan);
fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%zu\n", chan);
return false;
}
@ -207,7 +207,7 @@ bool DeviceLimeSDR::SetRFETIA_dB(lms_device_t *device, std::size_t chan, int val @@ -207,7 +207,7 @@ bool DeviceLimeSDR::SetRFETIA_dB(lms_device_t *device, std::size_t chan, int val
{
if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0)
{
fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%lu\n", chan);
fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%zu\n", chan);
return false;
}
@ -232,7 +232,7 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v @@ -232,7 +232,7 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v
{
if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0)
{
fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%lu\n", chan);
fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%zu\n", chan);
return false;
}

Loading…
Cancel
Save