From 9da69dfc3699bd71c5153ed6315d573a2cc891f4 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 23 Oct 2018 12:53:29 +0200 Subject: [PATCH] elan: Fix format mismatch warnings in debug output libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat] dbg_buf(elandev->last_read, transfer->actual_length); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:46:21: note: expanded from macro 'dbg_buf' fp_dbg("%02hx", buf[0]); \ ~~~~~~~~~~~~~~~~^~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] dbg_buf(elandev->last_read, transfer->actual_length); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:48:21: note: expanded from macro 'dbg_buf' fp_dbg("%04hx", buf[0] << 8 | buf[1]); \ ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] dbg_buf(elandev->last_read, transfer->actual_length); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:50:35: note: expanded from macro 'dbg_buf' fp_dbg("%04hx... (%d bytes)", buf[0] << 8 | buf[1], len) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat] dbg_buf(cmd->cmd, 2); ~~~~~~~~^~~~~~~~~~~~ libfprint/drivers/elan.c:46:21: note: expanded from macro 'dbg_buf' fp_dbg("%02hx", buf[0]); \ ~~~~~~~~~~~~~~~~^~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] dbg_buf(cmd->cmd, 2); ~~~~~~~~^~~~~~~~~~~~ libfprint/drivers/elan.c:48:21: note: expanded from macro 'dbg_buf' fp_dbg("%04hx", buf[0] << 8 | buf[1]); \ ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] dbg_buf(cmd->cmd, 2); ~~~~~~~~^~~~~~~~~~~~ libfprint/drivers/elan.c:50:35: note: expanded from macro 'dbg_buf' fp_dbg("%04hx... (%d bytes)", buf[0] << 8 | buf[1], len) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug' __VA_ARGS__) ^~~~~~~~~~~ --- libfprint/drivers/elan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index a2c1105..32d7534 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -43,11 +43,11 @@ #define dbg_buf(buf, len) \ if (len == 1) \ - fp_dbg("%02hx", buf[0]); \ + fp_dbg("%02x", buf[0]); \ else if (len == 2) \ - fp_dbg("%04hx", buf[0] << 8 | buf[1]); \ + fp_dbg("%04x", buf[0] << 8 | buf[1]); \ else if (len > 2) \ - fp_dbg("%04hx... (%d bytes)", buf[0] << 8 | buf[1], len) + fp_dbg("%04x... (%d bytes)", buf[0] << 8 | buf[1], len) unsigned char elan_get_pixel(struct fpi_frame_asmbl_ctx *ctx, struct fpi_frame *frame, unsigned int x,