commit 974114c

Michael Forney  ·  2013-11-25 22:11:20 +0000 UTC
parent 58f286d
Fix warnings/errors uncovered by previous commit
12 files changed,  +12, -32
+0, -2
1@@ -466,8 +466,6 @@ int main(int argc, char * argv[])
2     if (child_pid == 0)
3     {
4         char string[64];
5-        uid_t uid;
6-        gid_t gid;
7 
8         /* Reset signal handlers to defaults */
9         action.sa_handler = SIG_DFL;
+1, -7
 1@@ -17,7 +17,7 @@ static void calculate_damage(struct swc_compositor * compositor)
 2 {
 3     struct swc_surface * surface;
 4     struct swc_compositor_surface_state * state;
 5-    pixman_region32_t opaque, surface_opaque;
 6+    pixman_region32_t surface_opaque;
 7 
 8     pixman_region32_clear(&compositor->opaque);
 9     pixman_region32_init(&surface_opaque);
10@@ -178,12 +178,6 @@ static void handle_focus(struct swc_pointer * pointer)
11 
12 static bool handle_motion(struct swc_pointer * pointer, uint32_t time)
13 {
14-    struct swc_seat * seat;
15-    struct swc_compositor * compositor;
16-
17-    seat = CONTAINER_OF(pointer, typeof(*seat), pointer);
18-    compositor = CONTAINER_OF(seat, typeof(*compositor), seat);
19-
20     return false;
21 }
22 
+2, -2
 1@@ -379,7 +379,7 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm)
 2     drmModeConnector * connector;
 3     drmModeCrtc * crtc;
 4     uint32_t index;
 5-    uint32_t x = 0, y = 0;
 6+    uint32_t x = 0;
 7     struct swc_output * output;
 8     struct wl_list * outputs;
 9     uint32_t taken_crtcs = 0;
10@@ -400,7 +400,7 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm)
11     for (index = 0; index < resources->count_crtcs; ++index)
12     {
13         printf("crtc[%u]: %u\n", index, resources->crtcs[index]);
14-        drmModeCrtc * crtc = drmModeGetCrtc(drm->fd, resources->crtcs[index]);
15+        crtc = drmModeGetCrtc(drm->fd, resources->crtcs[index]);
16         printf("crtc, id: %u, x: %u, y: %u, width: %u, height: %u\n",
17             crtc->crtc_id, crtc->x, crtc->y, crtc->width, crtc->height);
18         drmModeFreeCrtc(crtc);
+0, -1
1@@ -144,7 +144,6 @@ struct swc_evdev_device * swc_evdev_device_new
2     (const char * path, const struct swc_evdev_device_handler * handler)
3 {
4     struct swc_evdev_device * device;
5-    uint32_t index;
6 
7     if (!(device = malloc(sizeof *device)))
8         goto error0;
+0, -2
 1@@ -120,9 +120,7 @@ void swc_input_focus_set(struct swc_input_focus * input_focus,
 2                          struct swc_surface * surface)
 3 {
 4     struct wl_client * client;
 5-    struct wl_display * display;
 6     struct wl_resource * resource;
 7-    uint32_t serial;
 8     struct swc_input_focus_event_data data;
 9 
10     if (surface == input_focus->surface)
+0, -1
1@@ -147,7 +147,6 @@ static struct wld_drawable * cursor_get_buffer(void * data)
2 
3 static bool cursor_flip(struct swc_plane * plane)
4 {
5-    struct swc_output * output = plane->output;
6     struct wld_drawable * drawable
7         = swc_double_buffer_back(&plane->double_buffer);
8     int handle = wld_drm_get_handle(drawable);
+0, -4
 1@@ -200,10 +200,6 @@ void swc_pointer_handle_axis(struct swc_pointer * pointer, uint32_t time,
 2          || !pointer->handler->axis(pointer, time, axis, amount))
 3         && pointer->focus.resource)
 4     {
 5-        struct wl_client * client
 6-            = wl_resource_get_client(pointer->focus.resource);
 7-        struct wl_display * display = wl_client_get_display(client);
 8-
 9         wl_pointer_send_axis(pointer->focus.resource, time, axis, amount);
10     }
11 }
+0, -1
1@@ -236,7 +236,6 @@ void swc_renderer_attach(struct swc_renderer * renderer,
2 void swc_renderer_flush(struct swc_renderer * renderer,
3                         struct swc_surface * surface)
4 {
5-    struct wl_shm_buffer * buffer;
6     struct buffer_state * state;
7 
8     state = buffer_state(surface->state.buffer);
+1, -2
 1@@ -101,11 +101,10 @@ static void get_pointer(struct wl_client * client, struct wl_resource * resource
 2 static void get_keyboard(struct wl_client * client, struct wl_resource * resource,
 3                          uint32_t id)
 4 {
 5-    struct wl_resource * client_resource;
 6     struct swc_seat * seat = wl_resource_get_user_data(resource);
 7     struct swc_keyboard * keyboard = &seat->keyboard;
 8 
 9-    client_resource = swc_keyboard_bind(keyboard, client, id);
10+    swc_keyboard_bind(keyboard, client, id);
11 }
12 
13 static void get_touch(struct wl_client * client, struct wl_resource * resource,
+0, -8
 1@@ -39,7 +39,6 @@ static bool send_request(const struct swc_launch_request * request, size_t size,
 2                          int out_fd, int * in_fd)
 3 {
 4     int socket;
 5-    ssize_t ret;
 6 
 7     socket = get_launcher_socket();
 8 
 9@@ -59,9 +58,6 @@ int swc_launch_open_device(const char * path, int flags)
10     struct swc_launch_request * request = (void *) buffer;
11     struct swc_launch_response response;
12     int fd;
13-    int socket;
14-
15-    socket = get_launcher_socket();
16 
17     request->type = SWC_LAUNCH_REQUEST_OPEN_DEVICE;
18     request->flags = flags;
19@@ -77,10 +73,6 @@ bool swc_launch_activate_vt(unsigned vt)
20 {
21     struct swc_launch_request request;
22     struct swc_launch_response response;
23-    ssize_t size;
24-    int socket;
25-
26-    socket = get_launcher_socket();
27 
28     request.type = SWC_LAUNCH_REQUEST_ACTIVATE_VT;
29     request.vt = vt;
+2, -2
 1@@ -53,9 +53,9 @@ static inline bool swc_rectangle_overlap
 2 static inline void swc_array_remove(struct wl_array * array,
 3                                     void * item, size_t size)
 4 {
 5-    size_t bytes = array->size - (item + size - array->data);
 6+    size_t bytes = array->size - ((intptr_t) item + size - (intptr_t) array->data);
 7     if (bytes > 0)
 8-        memmove(item, item + size, bytes);
 9+        memmove(item, (void *)((intptr_t) item + size), bytes);
10     array->size -= size;
11 }
12 
+6, -0
 1@@ -34,6 +34,12 @@ bool swc_xkb_initialize(struct swc_xkb * xkb)
 2 
 3     xkb->state = xkb_state_new(xkb->keymap.map);
 4 
 5+    if (!xkb->state)
 6+    {
 7+        printf("could not create XKB state\n");
 8+        goto error_keymap;
 9+    }
10+
11     if (!swc_xkb_update_keymap(xkb))
12     {
13         printf("could not update XKB keymap\n");