fix build warnings
authorJengHyun Kang <jhyuni.kang@samsung.com>
Wed, 25 Oct 2017 08:02:39 +0000 (17:02 +0900)
committerjeon <jhyuni.kang@samsung.com>
Tue, 5 Jan 2021 10:39:43 +0000 (19:39 +0900)
src/evdev.c
src/libinput.c
src/udev-seat.c

index 04427d1f1e740e4c5f430e2725f30000f1186690..258cc2495d766978d8c75f8eb0a5a97ba5483b14 100644 (file)
@@ -1867,14 +1867,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;
                        }
@@ -2928,6 +2928,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);
 
@@ -2941,7 +2942,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);
 }
 
index 5168b51ca13c96d7a0d011c351a255cb42e2cef1..7c460755dc773620b738a2c9b9103b266bcebb6a 100644 (file)
@@ -144,6 +144,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;
@@ -1903,6 +1905,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;
index e0f11bae282a811932c5e8ce258b126fa12cf98c..914897c00ac3957e2c11cf88f428304546f24fd4 100644 (file)
@@ -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,