From 32456faaf9e0a7c73e2b75d1a7f7ad7f66ccadbc Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Wed, 25 Oct 2017 17:02:39 +0900 Subject: [PATCH] fix build warnings --- src/evdev.c | 2 +- src/libinput.c | 4 ++++ src/udev-seat.c | 32 -------------------------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 86b663c6..b6e5ab48 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -3179,6 +3179,7 @@ evdev_device_destroy(struct evdev_device *device) struct evdev_dispatch *dispatch; dispatch = device->dispatch; + evdev_device_free_aux_data(device); if (dispatch) dispatch->interface->destroy(dispatch); @@ -3194,7 +3195,6 @@ evdev_device_destroy(struct evdev_device *device) libinput_seat_unref(device->base.seat); libevdev_free(device->evdev); udev_device_unref(device->udev_device); - evdev_device_free_aux_data(device); free(device); } diff --git a/src/libinput.c b/src/libinput.c index fca0eda2..7606c99e 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -119,6 +119,8 @@ event_type_to_str(enum libinput_event_type type) CASE_RETURN_STRING(LIBINPUT_EVENT_SWITCH_TOGGLE); case LIBINPUT_EVENT_NONE: abort(); + default: + break; } return NULL; @@ -1989,6 +1991,8 @@ libinput_event_get_touch_aux_data(struct libinput_event *event) break; case LIBINPUT_EVENT_TOUCH_AUX_DATA: return (struct libinput_event_touch_aux_data *) event; + default: + break; } return NULL; diff --git a/src/udev-seat.c b/src/udev-seat.c index 856c0692..a276601f 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -92,38 +92,6 @@ libinput_path_has_device(struct libinput *libinput, const char *devnode) return false; } -/** - * Return the next word in a string pointed to by state before the first - * separator character. Call repeatedly to tokenize a whole string. - * - * @param state Current state - * @param len String length of the word returned - * @param separators List of separator characters - * - * @return The first word in *state, NOT null-terminated - */ -static const char * -next_word(const char **state, size_t *len, const char *separators) -{ - const char *next = *state; - size_t l; - - if (!*next) - return NULL; - - next += strspn(next, separators); - if (!*next) { - *state = next; - return NULL; - } - - l = strcspn(next, separators); - *state = next + l; - *len = l; - - return next; -} - static int device_added(struct udev_device *udev_device, struct udev_input *input, -- 2.34.1