server: fix button signedness in wl_grab_interface
authorPekka Paalanen <ppaalanen@gmail.com>
Fri, 30 Mar 2012 13:38:39 +0000 (16:38 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 30 Mar 2012 14:14:51 +0000 (10:14 -0400)
wl_input_device::grab_button is unsigned but the button parameter to
wl_grab_interface::button is signed. This lead to a warning in
data-device.c.

The button number is unsigned in the protocol, so make it unsigned in
the wl_grab_interface API, too. Fixes the compiler warning "comparison
between signed and unsigned integer expressions".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/data-device.c
src/wayland-server.c
src/wayland-server.h

index 797fdd7..03997f1 100644 (file)
@@ -248,7 +248,7 @@ data_device_end_drag_grab(struct wl_input_device *device, uint32_t time)
 
 static void
 drag_grab_button(struct wl_pointer_grab *grab,
-                uint32_t time, int32_t button, int32_t state)
+                uint32_t time, uint32_t button, int32_t state)
 {
        struct wl_input_device *device =
                container_of(grab, struct wl_input_device, drag_grab);
index 0c0d028..8c7323d 100644 (file)
@@ -474,7 +474,7 @@ default_grab_motion(struct wl_pointer_grab *grab,
 
 static void
 default_grab_button(struct wl_pointer_grab *grab,
-                   uint32_t time, int32_t button, int32_t state)
+                   uint32_t time, uint32_t button, int32_t state)
 {
        struct wl_input_device *device = grab->input_device;
        struct wl_resource *resource;
index 1a0878b..2e52244 100644 (file)
@@ -143,7 +143,7 @@ struct wl_pointer_grab_interface {
        void (*motion)(struct wl_pointer_grab *grab,
                       uint32_t time, int32_t x, int32_t y);
        void (*button)(struct wl_pointer_grab *grab,
-                      uint32_t time, int32_t button, int32_t state);
+                      uint32_t time, uint32_t button, int32_t state);
 };
 
 struct wl_pointer_grab {