ni845x_spi: Add cast to `unsigned long' to meet format string
We don't know the actual definition of `uInt32` used for `read_size`
here. Assuming it's unsigned and fits into 32 bits, an unsigned long
should serve us well and ensure that we can always match the format
string. Fixes the last GCC and Clang warning.
Change-Id: Ice3eb81c79915d60abb0a3bef00ad58397f2706e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/410
diff --git a/ni845x_spi.c b/ni845x_spi.c
index 98ac153..f65cabd 100644
--- a/ni845x_spi.c
+++ b/ni845x_spi.c
@@ -589,8 +589,8 @@
if (read_cnt != 0 && read_arr != NULL) {
if ((read_cnt + write_cnt) != read_size) {
- msg_perr("%s: expected and returned read count mismatch: %u expected, %ld received\n",
- __func__, read_cnt, read_size);
+ msg_perr("%s: expected and returned read count mismatch: %u expected, %lu received\n",
+ __func__, read_cnt, (unsigned long)read_size);
free(transfer_buffer);
return -1;
}