From: JengHyun Kang Date: Wed, 25 Oct 2017 08:02:39 +0000 (+0900) Subject: fix build warnings X-Git-Tag: submit/tizen/20171107.103302^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fsandbox%2Fupgrade%2Fefl120;p=platform%2Fupstream%2Flibinput.git fix build warnings --- diff --git a/src/evdev-lid.c b/src/evdev-lid.c index fe98e6e1..150ca422 100644 --- a/src/evdev-lid.c +++ b/src/evdev-lid.c @@ -70,6 +70,7 @@ lid_switch_keyboard_event(uint64_t time, void *data) { struct lid_switch_dispatch *dispatch = lid_dispatch(data); + unsigned int temp; if (!dispatch->lid_is_closed) return; @@ -84,7 +85,8 @@ lid_switch_keyboard_event(uint64_t time, {{ 0, 0 }, EV_SYN, SYN_REPORT, 0 }, }; - (void)write(fd, ev, sizeof(ev)); + temp = write(fd, ev, sizeof(ev)); + (void)temp; /* In case write() fails, we sync the lid state manually * regardless. */ } diff --git a/src/evdev-tablet-pad.c b/src/evdev-tablet-pad.c index 2b8c1422..0131dfc1 100644 --- a/src/evdev-tablet-pad.c +++ b/src/evdev-tablet-pad.c @@ -374,7 +374,7 @@ pad_notify_button_mask(struct pad_dispatch *pad, continue; map = pad->button_map[code - 1]; - if (map != -1) { + if (map != (char)-1) { group = pad_button_get_mode_group(pad, map); pad_button_update_mode(group, map, state); tablet_pad_notify_button(base, time, map, state, group); diff --git a/src/evdev.c b/src/evdev.c index 018fba1e..3fc85f09 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2820,14 +2820,14 @@ evdev_configure_device(struct evdev_device *device) env = getenv("LIBINPUT_IGNORE_JOYSTICK"); if (env && atoi(env) == 1) { evdev_log_info(device, - "input device '%s', have joystick, ignoring\n", + "input device '%s' have joystick, ignoring\n", device->devname); return NULL; } else { if ((udev_tags & EVDEV_UDEV_TAG_JOYSTICK) == udev_tags) { evdev_log_info(device, - "input device '%s', %s is a joystick, ignoring\n", + "input device '%s' is a joystick, ignoring\n", device->devname); return NULL; } @@ -3728,6 +3728,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); @@ -3739,7 +3740,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); } @@ -3841,6 +3841,8 @@ evdev_device_free_aux_data(struct evdev_device *device) struct fallback_dispatch *dispatch; struct mt_aux_data *aux_data, *aux_data_tmp; + if (!device || !device->dispatch) return; + dispatch = fallback_dispatch(device->dispatch); for (i = 0; i < (int)dispatch->mt.slots_len; i++) { diff --git a/src/libinput.c b/src/libinput.c index 5013615a..565c96ab 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -141,6 +141,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; @@ -1895,6 +1897,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 c4bb2417..4878c3cf 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -63,38 +63,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, diff --git a/tools/Makefile.am b/tools/Makefile.am index 07cd614a..ff396708 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -74,7 +74,7 @@ uninstall-local: rm -f $(DESTDIR)$(bindir)/libinput-debug-events SUFFIXES = .man -.man.1: +.man.1: $(AM_V_GEN)$(SED) -e 's|\@LIBINPUT_VERSION\@|$(PACKAGE_VERSION)|' < $< > $@ CLEANFILES = *.1 EXTRA_DIST += $(dist_man1_MANS:.1=.man)