swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 974114cbf2d79ae8f2d9c34ccb29b7cb3dadf979
parent 58f286d6fc3f886660a9b0eb5f1b8e5839e79694
Author: Michael Forney <mforney@mforney.org>
Date:   Mon, 25 Nov 2013 14:11:20 -0800

Fix warnings/errors uncovered by previous commit

Diffstat:
Mlaunch/launch.c | 2--
Mlibswc/compositor.c | 8+-------
Mlibswc/drm.c | 4++--
Mlibswc/evdev_device.c | 1-
Mlibswc/input_focus.c | 2--
Mlibswc/plane.c | 1-
Mlibswc/pointer.c | 4----
Mlibswc/renderer.c | 1-
Mlibswc/seat.c | 3+--
Mlibswc/util.c | 8--------
Mlibswc/util.h | 4++--
Mlibswc/xkb.c | 6++++++
12 files changed, 12 insertions(+), 32 deletions(-)

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