Skip to content

Commit 0fd3ed0

Browse files
committed
input/protocoldata: silence build warnings, adjust printf formats
Properly use %zu for size_t, and %PRIu64 for uint64_t data types. This silences build warnings which previously went unnoticed because their occurance depends on the target platform.
1 parent da17513 commit 0fd3ed0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/input/protocoldata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ static int assign_bit_widths(struct context *inc)
607607
bit_times_total += bit_time_int;
608608
sr_spew("Bit %zu, width %" PRIu64 ".", idx, bit_time_int);
609609
}
610-
sr_dbg("Maximum waveform width: %zu slots, %.2f / %zu samples.",
610+
sr_dbg("Maximum waveform width: %zu slots, %.2f / %" PRIu64 " samples.",
611611
inc->max_frame_bits, bit_edge, bit_times_total);
612612

613613
return SR_OK;
@@ -879,7 +879,7 @@ static int uart_check_opts(struct context *inc)
879879
total_bits += fmt_opts->stopbit_count;
880880
total_bits += fmt_opts->half_stopbit ? 1 : 0;
881881
total_bits += UART_ADD_IDLEBITS;
882-
sr_dbg("UART frame: total bits %lu.", total_bits);
882+
sr_dbg("UART frame: total bits %zu.", total_bits);
883883
if (total_bits > UART_MAX_WAVELEN)
884884
return SR_ERR_DATA;
885885
inc->max_frame_bits = total_bits;
@@ -1550,7 +1550,7 @@ static int spi_check_opts(struct context *inc)
15501550
total_bits += 2 * fmt_opts->databit_count;
15511551
total_bits += 3;
15521552

1553-
sr_dbg("SPI frame: total bits %lu.", total_bits);
1553+
sr_dbg("SPI frame: total bits %zu.", total_bits);
15541554
if (total_bits > SPI_MAX_WAVELEN)
15551555
return SR_ERR_DATA;
15561556
inc->max_frame_bits = total_bits;
@@ -2170,7 +2170,7 @@ static int i2c_check_opts(struct context *inc)
21702170
total_bits *= I2C_BITTIME_QUANTA;
21712171
total_bits += I2C_ADD_IDLESLOTS;
21722172

2173-
sr_dbg("I2C frame: total bits %lu.", total_bits);
2173+
sr_dbg("I2C frame: total bits %zu.", total_bits);
21742174
if (total_bits > I2C_MAX_WAVELEN)
21752175
return SR_ERR_DATA;
21762176
inc->max_frame_bits = total_bits;

0 commit comments

Comments
 (0)