Add signedness warning flag and fix fallout

Kristian Høgsberg 13 years ago
parent ed92f79655
commit 875ab9e735
  1. 11
      clients/dnd.c
  2. 2
      clients/eventdemo.c
  3. 2
      clients/gears.c
  4. 2
      clients/glmatrix.c
  5. 2
      clients/simple-touch.c
  6. 6
      clients/terminal.c
  7. 2
      clients/window.c
  8. 4
      clients/wscreensaver.h
  9. 5
      configure.ac
  10. 8
      src/compositor-drm.c
  11. 4
      src/compositor-x11.c
  12. 10
      src/compositor.c
  13. 2
      src/hash.c
  14. 2
      src/shell.c
  15. 11
      src/xserver-launcher.c

@ -168,7 +168,7 @@ dnd_redraw_handler(struct widget *widget, void *data)
struct rectangle allocation; struct rectangle allocation;
cairo_t *cr; cairo_t *cr;
cairo_surface_t *surface; cairo_surface_t *surface;
int i; unsigned int i;
surface = window_get_surface(dnd->window); surface = window_get_surface(dnd->window);
cr = cairo_create(surface); cr = cairo_create(surface);
@ -206,7 +206,7 @@ keyboard_focus_handler(struct window *window,
static int static int
dnd_add_item(struct dnd *dnd, struct item *item) dnd_add_item(struct dnd *dnd, struct item *item)
{ {
int i; unsigned int i;
for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) {
if (dnd->items[i] == 0) { if (dnd->items[i] == 0) {
@ -222,7 +222,7 @@ dnd_get_item(struct dnd *dnd, int32_t x, int32_t y)
{ {
struct item *item; struct item *item;
struct rectangle allocation; struct rectangle allocation;
int i; unsigned int i;
widget_get_allocation(dnd->widget, &allocation); widget_get_allocation(dnd->widget, &allocation);
@ -369,7 +369,7 @@ dnd_button_handler(struct widget *widget,
struct display *display; struct display *display;
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_buffer *buffer; struct wl_buffer *buffer;
int i; unsigned int i;
widget_get_allocation(dnd->widget, &allocation); widget_get_allocation(dnd->widget, &allocation);
input_get_position(input, &x, &y); input_get_position(input, &x, &y);
@ -518,8 +518,9 @@ static struct dnd *
dnd_create(struct display *display) dnd_create(struct display *display)
{ {
struct dnd *dnd; struct dnd *dnd;
int i, x, y; int x, y;
int32_t width, height; int32_t width, height;
unsigned int i;
dnd = malloc(sizeof *dnd); dnd = malloc(sizeof *dnd);
if (dnd == NULL) if (dnd == NULL)

@ -86,7 +86,7 @@ struct eventdemo {
struct widget *widget; struct widget *widget;
struct display *display; struct display *display;
unsigned int x, y, w, h; int x, y, w, h;
}; };
/** /**

@ -63,7 +63,7 @@ struct gear_template {
GLfloat tooth_depth; GLfloat tooth_depth;
}; };
const static struct gear_template gear_templates[] = { static const struct gear_template gear_templates[] = {
{ { 0.8, 0.1, 0.0, 1.0 }, 1.0, 4.0, 1.0, 20, 0.7 }, { { 0.8, 0.1, 0.0, 1.0 }, 1.0, 4.0, 1.0, 20, 0.7 },
{ { 0.0, 0.8, 0.2, 1.0 }, 0.5, 2.0, 2.0, 10, 0.7 }, { { 0.0, 0.8, 0.2, 1.0 }, 0.5, 2.0, 2.0, 10, 0.7 },
{ { 0.2, 0.2, 1.0, 1.0 }, 1.3, 2.0, 0.5, 10, 0.7 }, { { 0.2, 0.2, 1.0, 1.0 }, 1.3, 2.0, 0.5, 10, 0.7 },

@ -257,7 +257,7 @@ reset_strip (ModeInfo *mi, strip *s)
(i < GRID_SIZE-5) && /* display approx. once per 5 strips */ (i < GRID_SIZE-5) && /* display approx. once per 5 strips */
!(random() % (GRID_SIZE-5)*5)) !(random() % (GRID_SIZE-5)*5))
{ {
int j; unsigned int j;
char text[80]; char text[80];
time_t now = time ((time_t *) 0); time_t now = time ((time_t *) 0);
struct tm *tm = localtime (&now); struct tm *tm = localtime (&now);

@ -166,7 +166,7 @@ touch_paint(struct touch *touch, int32_t x, int32_t y, int32_t id)
0xffff00ff, 0xffff00ff,
}; };
if (id < ARRAY_LENGTH(colors)) if (id < (int32_t) ARRAY_LENGTH(colors))
c = colors[id]; c = colors[id];
else else
c = 0xffffffff; c = 0xffffffff;

@ -95,7 +95,7 @@ init_state_machine(struct utf8_state_machine *machine)
} }
static enum utf8_state static enum utf8_state
utf8_next_char(struct utf8_state_machine *machine, char c) utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
{ {
switch(machine->state) { switch(machine->state) {
case utf8state_start: case utf8state_start:
@ -861,7 +861,7 @@ terminal_send_selection(struct terminal *terminal, int fd)
struct glyph_run { struct glyph_run {
struct terminal *terminal; struct terminal *terminal;
cairo_t *cr; cairo_t *cr;
int count; unsigned int count;
union decoded_attr attr; union decoded_attr attr;
cairo_glyph_t glyphs[256], *g; cairo_glyph_t glyphs[256], *g;
}; };
@ -1864,7 +1864,7 @@ escape_append_utf8(struct terminal *terminal, union utf8_char utf8)
static void static void
terminal_data(struct terminal *terminal, const char *data, size_t length) terminal_data(struct terminal *terminal, const char *data, size_t length)
{ {
int i; unsigned int i;
union utf8_char utf8; union utf8_char utf8;
enum utf8_state parser_state; enum utf8_state parser_state;

@ -166,7 +166,7 @@ struct input {
struct wl_input_device *input_device; struct wl_input_device *input_device;
struct window *pointer_focus; struct window *pointer_focus;
struct window *keyboard_focus; struct window *keyboard_focus;
uint32_t current_pointer_image; int current_pointer_image;
uint32_t modifiers; uint32_t modifiers;
int32_t sx, sy; int32_t sx, sy;
struct wl_list link; struct wl_list link;

@ -39,8 +39,8 @@ struct ModeInfo {
struct widget *widget; struct widget *widget;
int instance_number; int instance_number;
unsigned width; int width;
unsigned height; int height;
unsigned long polygon_count; unsigned long polygon_count;
int fps_p; int fps_p;

@ -170,7 +170,10 @@ AC_ARG_ENABLE(tests,
AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests = xyes) AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests = xyes)
if test "x$GCC" = "xyes"; then if test "x$GCC" = "xyes"; then
GCC_CFLAGS="-Wall -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden" GCC_CFLAGS="-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-Wno-unused-parameter -Wno-missing-field-initializers \
-g -fvisibility=hidden"
fi fi
AC_SUBST(GCC_CFLAGS) AC_SUBST(GCC_CFLAGS)

@ -382,7 +382,7 @@ page_flip_handler(int fd, unsigned int frame,
static int static int
drm_surface_format_supported(struct drm_sprite *s, uint32_t format) drm_surface_format_supported(struct drm_sprite *s, uint32_t format)
{ {
int i; uint32_t i;
for (i = 0; i < s->count_formats; i++) for (i = 0; i < s->count_formats; i++)
if (s->formats[i] == format) if (s->formats[i] == format)
@ -991,7 +991,7 @@ drm_set_backlight(struct weston_output *output_base, uint32_t value)
if (!output->backlight) if (!output->backlight)
return; return;
if (value < 0 || value > 255) if (value > 255)
return; return;
max_brightness = backlight_get_max_brightness(output->backlight); max_brightness = backlight_get_max_brightness(output->backlight);
@ -1182,7 +1182,7 @@ create_sprites(struct drm_compositor *ec)
struct drm_sprite *sprite; struct drm_sprite *sprite;
drmModePlaneRes *plane_res; drmModePlaneRes *plane_res;
drmModePlane *plane; drmModePlane *plane;
int i; uint32_t i;
plane_res = drmModeGetPlaneResources(ec->drm.fd); plane_res = drmModeGetPlaneResources(ec->drm.fd);
if (!plane_res) { if (!plane_res) {
@ -1249,7 +1249,7 @@ destroy_sprites(struct drm_compositor *compositor)
} }
static int 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) struct udev_device *drm_device)
{ {
drmModeConnector *connector; drmModeConnector *connector;

@ -554,7 +554,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
xcb_focus_in_event_t *focus_in; xcb_focus_in_event_t *focus_in;
xcb_atom_t atom; xcb_atom_t atom;
uint32_t *k; uint32_t *k;
int i, set; uint32_t i, set;
prev = NULL; prev = NULL;
while (x11_compositor_next_event(c, &event, mask)) { while (x11_compositor_next_event(c, &event, mask)) {
@ -740,7 +740,7 @@ x11_compositor_get_resources(struct x11_compositor *c)
xcb_intern_atom_reply_t *reply; xcb_intern_atom_reply_t *reply;
xcb_pixmap_t pixmap; xcb_pixmap_t pixmap;
xcb_gc_t gc; xcb_gc_t gc;
int i; unsigned int i;
uint8_t data[] = { 0, 0, 0, 0 }; uint8_t data[] = { 0, 0, 0, 0 };
for (i = 0; i < ARRAY_LENGTH(atoms); i++) for (i = 0; i < ARRAY_LENGTH(atoms); i++)

@ -1276,7 +1276,7 @@ surface_set_input_region(struct wl_client *client,
weston_compositor_schedule_repaint(surface->compositor); 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_destroy,
surface_attach, surface_attach,
surface_damage, surface_damage,
@ -1378,7 +1378,7 @@ compositor_create_region(struct wl_client *client,
wl_client_add_resource(client, &region->resource); wl_client_add_resource(client, &region->resource);
} }
const static struct wl_compositor_interface compositor_interface = { static const struct wl_compositor_interface compositor_interface = {
compositor_create_surface, compositor_create_surface,
compositor_create_region compositor_create_region
}; };
@ -1904,7 +1904,7 @@ input_device_attach(struct wl_client *client,
0, 0, buffer->width, buffer->height); 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, input_device_attach,
}; };
@ -2514,11 +2514,11 @@ int main(int argc, char *argv[])
char *socket_name = NULL; char *socket_name = NULL;
char *config_file; char *config_file;
const const struct config_key shell_config_keys[] = { const struct config_key shell_config_keys[] = {
{ "type", CONFIG_KEY_STRING, &shell }, { "type", CONFIG_KEY_STRING, &shell },
}; };
const const struct config_section cs[] = { const struct config_section cs[] = {
{ "shell", { "shell",
shell_config_keys, ARRAY_LENGTH(shell_config_keys) }, shell_config_keys, ARRAY_LENGTH(shell_config_keys) },
}; };

@ -212,7 +212,7 @@ hash_table_lookup(struct hash_table *ht, uint32_t hash)
} }
static void 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_table old_ht;
struct hash_entry *table, *entry; struct hash_entry *table, *entry;

@ -1181,7 +1181,7 @@ static void
surface_opacity_binding(struct wl_input_device *device, uint32_t time, 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) 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 shell_surface *shsurf;
struct weston_surface *surface = struct weston_surface *surface =
(struct weston_surface *) device->pointer_focus; (struct weston_surface *) device->pointer_focus;

@ -155,7 +155,8 @@ dump_property(struct weston_wm *wm, xcb_atom_t property,
int32_t *incr_value; int32_t *incr_value;
const char *text_value, *name; const char *text_value, *name;
xcb_atom_t *atom_value; 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)); width = fprintf(stderr, " %s: ", get_atom_name(wm->conn, property));
if (reply == NULL) { if (reply == NULL) {
@ -295,7 +296,7 @@ weston_wm_get_selection_targets(struct weston_wm *wm)
xcb_get_property_reply_t *reply; xcb_get_property_reply_t *reply;
xcb_atom_t *value; xcb_atom_t *value;
char **p; char **p;
int i; uint32_t i;
cookie = xcb_get_property(wm->conn, cookie = xcb_get_property(wm->conn,
1, /* delete */ 1, /* delete */
@ -609,7 +610,7 @@ weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event)
void *p; void *p;
uint32_t *xid; uint32_t *xid;
xcb_atom_t *atom; xcb_atom_t *atom;
int i; uint32_t i;
fprintf(stderr, "XCB_MAP_NOTIFY (window %d)\n", map_notify->window); fprintf(stderr, "XCB_MAP_NOTIFY (window %d)\n", map_notify->window);
@ -668,7 +669,7 @@ weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event)
weston_wm_activate(wm, window, XCB_TIME_CURRENT_TIME); 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 static void
weston_wm_send_selection_notify(struct weston_wm *wm, xcb_atom_t property) weston_wm_send_selection_notify(struct weston_wm *wm, xcb_atom_t property)
@ -1174,7 +1175,7 @@ wxs_wm_get_resources(struct weston_wm *wm)
xcb_xfixes_query_version_reply_t *xfixes_reply; xcb_xfixes_query_version_reply_t *xfixes_reply;
xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)]; xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)];
xcb_intern_atom_reply_t *reply; xcb_intern_atom_reply_t *reply;
int i; uint32_t i;
xcb_prefetch_extension_data (wm->conn, &xcb_xfixes_id); xcb_prefetch_extension_data (wm->conn, &xcb_xfixes_id);

Loading…
Cancel
Save