mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 15:00:05 +01:00
util: make the newtype comparision functions return bool
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1373>
This commit is contained in:
parent
b3f7b4b1ea
commit
e8dfc3bfd6
1 changed files with 8 additions and 6 deletions
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "util-macros.h"
|
#include "util-macros.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -102,10 +104,10 @@
|
||||||
static inline int name_##_cmp(name_##_t a, name_##_t b) { \
|
static inline int name_##_cmp(name_##_t a, name_##_t b) { \
|
||||||
return a.v < b.v ? -1 : (a.v > b.v ? 1 : 0); \
|
return a.v < b.v ? -1 : (a.v > b.v ? 1 : 0); \
|
||||||
}; \
|
}; \
|
||||||
static inline int name_##_eq(name_##_t a, type_ b) { return a.v == b; }\
|
static inline bool name_##_eq(name_##_t a, type_ b) { return a.v == b; }\
|
||||||
static inline int name_##_ne(name_##_t a, type_ b) { return a.v != b; }\
|
static inline bool name_##_ne(name_##_t a, type_ b) { return a.v != b; }\
|
||||||
static inline int name_##_le(name_##_t a, type_ b) { return a.v <= b; }\
|
static inline bool name_##_le(name_##_t a, type_ b) { return a.v <= b; }\
|
||||||
static inline int name_##_lt(name_##_t a, type_ b) { return a.v < b; }\
|
static inline bool name_##_lt(name_##_t a, type_ b) { return a.v < b; }\
|
||||||
static inline int name_##_ge(name_##_t a, type_ b) { return a.v >= b; }\
|
static inline bool name_##_ge(name_##_t a, type_ b) { return a.v >= b; }\
|
||||||
static inline int name_##_gt(name_##_t a, type_ b) { return a.v > b; }\
|
static inline bool name_##_gt(name_##_t a, type_ b) { return a.v > b; }\
|
||||||
struct __useless_struct_to_allow_trailing_semicolon__
|
struct __useless_struct_to_allow_trailing_semicolon__
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue