Add signedness warning flag and fix fallout
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 39b7a1b..d428c82 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -382,7 +382,7 @@
static int
drm_surface_format_supported(struct drm_sprite *s, uint32_t format)
{
- int i;
+ uint32_t i;
for (i = 0; i < s->count_formats; i++)
if (s->formats[i] == format)
@@ -991,7 +991,7 @@
if (!output->backlight)
return;
- if (value < 0 || value > 255)
+ if (value > 255)
return;
max_brightness = backlight_get_max_brightness(output->backlight);
@@ -1182,7 +1182,7 @@
struct drm_sprite *sprite;
drmModePlaneRes *plane_res;
drmModePlane *plane;
- int i;
+ uint32_t i;
plane_res = drmModeGetPlaneResources(ec->drm.fd);
if (!plane_res) {
@@ -1249,7 +1249,7 @@
}
static int
-create_outputs(struct drm_compositor *ec, int option_connector,
+create_outputs(struct drm_compositor *ec, uint32_t option_connector,
struct udev_device *drm_device)
{
drmModeConnector *connector;
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index e28fc94..d0203ca 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -554,7 +554,7 @@
xcb_focus_in_event_t *focus_in;
xcb_atom_t atom;
uint32_t *k;
- int i, set;
+ uint32_t i, set;
prev = NULL;
while (x11_compositor_next_event(c, &event, mask)) {
@@ -740,7 +740,7 @@
xcb_intern_atom_reply_t *reply;
xcb_pixmap_t pixmap;
xcb_gc_t gc;
- int i;
+ unsigned int i;
uint8_t data[] = { 0, 0, 0, 0 };
for (i = 0; i < ARRAY_LENGTH(atoms); i++)
diff --git a/src/compositor.c b/src/compositor.c
index 60142d1..1fce69a 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1276,7 +1276,7 @@
weston_compositor_schedule_repaint(surface->compositor);
}
-const static struct wl_surface_interface surface_interface = {
+static const struct wl_surface_interface surface_interface = {
surface_destroy,
surface_attach,
surface_damage,
@@ -1378,7 +1378,7 @@
wl_client_add_resource(client, ®ion->resource);
}
-const static struct wl_compositor_interface compositor_interface = {
+static const struct wl_compositor_interface compositor_interface = {
compositor_create_surface,
compositor_create_region
};
@@ -1904,7 +1904,7 @@
0, 0, buffer->width, buffer->height);
}
-const static struct wl_input_device_interface input_device_interface = {
+static const struct wl_input_device_interface input_device_interface = {
input_device_attach,
};
@@ -2514,11 +2514,11 @@
char *socket_name = NULL;
char *config_file;
- const const struct config_key shell_config_keys[] = {
+ const struct config_key shell_config_keys[] = {
{ "type", CONFIG_KEY_STRING, &shell },
};
- const const struct config_section cs[] = {
+ const struct config_section cs[] = {
{ "shell",
shell_config_keys, ARRAY_LENGTH(shell_config_keys) },
};
diff --git a/src/hash.c b/src/hash.c
index 1dbee82..d841883 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -212,7 +212,7 @@
}
static void
-hash_table_rehash(struct hash_table *ht, int new_size_index)
+hash_table_rehash(struct hash_table *ht, unsigned int new_size_index)
{
struct hash_table old_ht;
struct hash_entry *table, *entry;
diff --git a/src/shell.c b/src/shell.c
index 02f203a..46fa370 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1181,7 +1181,7 @@
surface_opacity_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button, uint32_t axis, int32_t value, void *data)
{
- int step = 15;
+ uint32_t step = 15;
struct shell_surface *shsurf;
struct weston_surface *surface =
(struct weston_surface *) device->pointer_focus;
diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c
index 33bd773..502b9d4 100644
--- a/src/xserver-launcher.c
+++ b/src/xserver-launcher.c
@@ -155,7 +155,8 @@
int32_t *incr_value;
const char *text_value, *name;
xcb_atom_t *atom_value;
- int i, width, len;
+ int width, len;
+ uint32_t i;
width = fprintf(stderr, " %s: ", get_atom_name(wm->conn, property));
if (reply == NULL) {
@@ -295,7 +296,7 @@
xcb_get_property_reply_t *reply;
xcb_atom_t *value;
char **p;
- int i;
+ uint32_t i;
cookie = xcb_get_property(wm->conn,
1, /* delete */
@@ -609,7 +610,7 @@
void *p;
uint32_t *xid;
xcb_atom_t *atom;
- int i;
+ uint32_t i;
fprintf(stderr, "XCB_MAP_NOTIFY (window %d)\n", map_notify->window);
@@ -668,7 +669,7 @@
weston_wm_activate(wm, window, XCB_TIME_CURRENT_TIME);
}
-static const int incr_chunk_size = 64 * 1024;
+static const size_t incr_chunk_size = 64 * 1024;
static void
weston_wm_send_selection_notify(struct weston_wm *wm, xcb_atom_t property)
@@ -1174,7 +1175,7 @@
xcb_xfixes_query_version_reply_t *xfixes_reply;
xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)];
xcb_intern_atom_reply_t *reply;
- int i;
+ uint32_t i;
xcb_prefetch_extension_data (wm->conn, &xcb_xfixes_id);