diff --git a/src/connection.c b/src/connection.c index 4ac5bf83..9bb2ca43 100644 --- a/src/connection.c +++ b/src/connection.c @@ -546,7 +546,7 @@ wl_connection_demarshal(struct wl_connection *connection, struct wl_closure *closure = &connection->receive_closure; count = strlen(message->signature) + 2; - if (count > ARRAY_LENGTH(closure->types)) { + if (count > (int)ARRAY_LENGTH(closure->types)) { printf("too many args (%d)\n", count); errno = EINVAL; wl_connection_consume(connection, size); diff --git a/src/wayland-client.c b/src/wayland-client.c index 7814379a..0be3a1a2 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -507,14 +507,14 @@ 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 ((uint32_t)len < sizeof p) break; wl_connection_copy(display->connection, p, sizeof p); object = p[0]; opcode = p[1] & 0xffff; size = p[1] >> 16; - if (len < size) + if ((uint32_t)len < size) break; handle_event(display, object, opcode, size); diff --git a/src/wayland-server.c b/src/wayland-server.c index 3b166c98..e62ba808 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -189,7 +189,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data) return 1; } - while (len >= sizeof p) { + while (len >= (int)sizeof p) { wl_connection_copy(connection, p, sizeof p); opcode = p[1] & 0xffff; size = p[1] >> 16; diff --git a/src/wayland-shm.c b/src/wayland-shm.c index 0c75cc94..24bf7a90 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -134,7 +134,7 @@ shm_create_buffer(struct wl_client *client, struct wl_resource *resource, return; } - if (width < 0 || height < 0 || stride < width) { + if (width < 0 || height < 0 || stride < (uint32_t)width) { wl_resource_post_error(resource, WL_SHM_ERROR_INVALID_STRIDE, "invalid width, height or stride (%dx%d, %u)", diff --git a/src/wayland-util.c b/src/wayland-util.c index 06bd245a..12391e2b 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -99,7 +99,7 @@ wl_array_release(struct wl_array *array) WL_EXPORT void * wl_array_add(struct wl_array *array, int size) { - int alloc; + uint32_t alloc; void *data, *p; if (array->alloc > 0)