util: add an _unused_ macro and replace LIBINPUT_UNUSED

For annotating intentionally used variables it needs to be a bit
shorter, so let's replace the current one which was aimed at functions.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184>
This commit is contained in:
Peter Hutterer 2025-04-07 15:18:55 +10:00
parent 6cbe4568de
commit cefab21e42
6 changed files with 5 additions and 5 deletions

View file

@ -1912,7 +1912,7 @@ tp_handle_state(struct tp_dispatch *tp,
tp_3fg_drag_apply_config(tp->device);
}
LIBINPUT_UNUSED
_unused_
static inline void
tp_debug_touch_state(struct tp_dispatch *tp,
struct evdev_device *device)

View file

@ -1022,7 +1022,7 @@ evdev_read_switch_reliability_prop(struct evdev_device *device)
return r;
}
LIBINPUT_UNUSED
_unused_
static inline void
evdev_print_event(struct evdev_device *device,
const struct input_event *e)

View file

@ -70,7 +70,6 @@
#define etrace(...) _trace(stderr, __VA_ARGS__)
#define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
#define LIBINPUT_UNUSED __attribute__ ((unused))
/* Commonly-used cleanup */
#ifdef udev_list_entry_foreach

View file

@ -3173,7 +3173,7 @@ switch_notify_toggle(struct libinput_device *device,
#endif
}
LIBINPUT_UNUSED
_unused_
static inline void
libinput_print_queued_event(struct libinput_event *event)
{

View file

@ -75,4 +75,5 @@
#define CONCAT2(X,Y) X##Y
#define CONCAT(X,Y) CONCAT2(X,Y)
#define _unused_ __attribute__((unused))
#define _fallthrough_ __attribute__((fallthrough))

View file

@ -42,7 +42,7 @@
#define START_TEST(func_) \
static enum litest_runner_result func_(const struct litest_runner_test_env *test_env) { \
int _i __attribute__((unused)) = test_env->rangeval;
int _i _unused_ = test_env->rangeval;
#define END_TEST \
return LITEST_PASS; \