projects
/
platform
/
upstream
/
libinput.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b34139c
)
util: add min/max macros
author
Peter Hutterer
<peter.hutterer@who-t.net>
Thu, 6 Feb 2014 05:26:02 +0000
(15:26 +1000)
committer
Peter Hutterer
<peter.hutterer@who-t.net>
Mon, 17 Feb 2014 04:35:06 +0000
(14:35 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput-util.h
patch
|
blob
|
history
diff --git
a/src/libinput-util.h
b/src/libinput-util.h
index 381a0d4423da7b1ed17e362e65d733c2245e4bb7..2fbce72f2902061cc301d237eb454761d9ba9159 100644
(file)
--- a/
src/libinput-util.h
+++ b/
src/libinput-util.h
@@
-73,6
+73,9
@@
int list_empty(const struct list *list);
#define ARRAY_FOR_EACH(_arr, _elem) \
for (int i = 0; (_elem = &_arr[i]) && i < ARRAY_LENGTH(_arr); i++)
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+
/*
* This fixed point implementation is a verbatim copy from wayland-util.h from
* the Wayland project, with the wl_ prefix renamed li_.