From e9230aef5f68918b6e806bfb10faa4d0edb49746 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Aug 2015 11:22:11 +1000 Subject: [PATCH] Fix an unsigned vs signed compiler warning In file included from hidpp10.c:43:0: hidpp10.c: In function 'hidpp10_get_device_info': ./libratbag-util.h:76:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] #define min(a, b) (((a) < (b)) ? (a) : (b)) ^ hidpp10.c:251:12: note: in expansion of macro 'min' dev->name[min(name_size, sizeof(dev->name) - 1)] = '\0'; Signed-off-by: Peter Hutterer --- src/hidpp10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hidpp10.c b/src/hidpp10.c index 404a01c1..5f8eab0b 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -230,7 +230,7 @@ static int hidpp10_get_device_info(int fd, struct unifying_device *dev) { union hidpp10_message device_name = CMD_PAIRING_INFORMATION(idx, DEVICE_NAME); union hidpp10_message firmware_information = CMD_DEVICE_FIRMWARE_INFORMATION(idx, FIRMWARE_INFO_ITEM_FW_NAME_AND_VERSION(1)); union hidpp10_message build_information = CMD_DEVICE_FIRMWARE_INFORMATION(idx, FIRMWARE_INFO_ITEM_FW_BUILD_NUMBER(1)); - int name_size; + size_t name_size; int res; res = hidpp10_request_command(fd, &pairing_information);