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.
parent 0ca75a4f
...@@ -499,8 +499,8 @@ handle_event(struct wl_display *display, ...@@ -499,8 +499,8 @@ handle_event(struct wl_display *display,
WL_EXPORT void WL_EXPORT void
wl_display_iterate(struct wl_display *display, uint32_t mask) wl_display_iterate(struct wl_display *display, uint32_t mask)
{ {
uint32_t p[2], object, opcode, size; uint32_t p[2], object;
int len; int len, opcode, size;
mask &= display->mask; mask &= display->mask;
if (mask == 0) { if (mask == 0) {
...@@ -512,7 +512,7 @@ wl_display_iterate(struct wl_display *display, uint32_t mask) ...@@ -512,7 +512,7 @@ wl_display_iterate(struct wl_display *display, uint32_t mask)
len = wl_connection_data(display->connection, mask); len = wl_connection_data(display->connection, mask);
while (len > 0) { while (len > 0) {
if (len < sizeof p) if ((size_t) len < sizeof p)
break; break;
wl_connection_copy(display->connection, p, sizeof p); wl_connection_copy(display->connection, p, sizeof p);
......
...@@ -202,7 +202,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data) ...@@ -202,7 +202,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
return 1; return 1;
} }
while (len >= sizeof p) { while ((size_t) len >= sizeof p) {
wl_connection_copy(connection, p, sizeof p); wl_connection_copy(connection, p, sizeof p);
opcode = p[1] & 0xffff; opcode = p[1] & 0xffff;
size = p[1] >> 16; size = p[1] >> 16;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment