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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-08-20 11:22:11 +10:00
parent 724d59ba57
commit e9230aef5f

View File

@@ -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);