From 3cddb3c692acd3536a7cc8542a29f0cc3c0ac3d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 30 Mar 2012 11:27:02 -0400 Subject: [PATCH] Fix remaining signedness errors We can change the data type for 'size' but we have to cast len to size_t for the comparisons with sizeof results. --- src/wayland-client.c | 6 +++--- src/wayland-server.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland-client.c b/src/wayland-client.c index 498a429..9057b4f 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -499,8 +499,8 @@ handle_event(struct wl_display *display, WL_EXPORT void wl_display_iterate(struct wl_display *display, uint32_t mask) { - uint32_t p[2], object, opcode, size; - int len; + uint32_t p[2], object; + int len, opcode, size; mask &= display->mask; if (mask == 0) { @@ -512,7 +512,7 @@ wl_display_iterate(struct wl_display *display, uint32_t mask) len = wl_connection_data(display->connection, mask); while (len > 0) { - if (len < sizeof p) + if ((size_t) len < sizeof p) break; wl_connection_copy(display->connection, p, sizeof p); diff --git a/src/wayland-server.c b/src/wayland-server.c index 8c7323d..a649d66 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -202,7 +202,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data) return 1; } - while (len >= sizeof p) { + while ((size_t) len >= sizeof p) { wl_connection_copy(connection, p, sizeof p); opcode = p[1] & 0xffff; size = p[1] >> 16; -- 2.7.4