summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2013-05-09 14:47:09 +0100
committerDaniel Stone <daniel@fooishbar.org>2013-05-09 14:47:09 +0100
commit17a956d80781846903c90b7bd4beaf8ac7aac40c (patch)
tree549912d7d8644616cf24ede7a7c20353f2e0d7e6 /src/utils.h
parenta392d2682bfbf5ce6c3ee153c6a08bb456da0660 (diff)
downloadlibxkbcommon-17a956d80781846903c90b7bd4beaf8ac7aac40c.tar.gz
libxkbcommon-17a956d80781846903c90b7bd4beaf8ac7aac40c.tar.bz2
libxkbcommon-17a956d80781846903c90b7bd4beaf8ac7aac40c.zip
Widen keycode range to 8/255 if possible (bug #63390)
If the keycode range is smaller than 8 → 255, artifically widen it when dumping the keymap as not to displease X. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 160bc42..eca6368 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -93,6 +93,18 @@ memdup(const void *mem, size_t nmemb, size_t size)
return p;
}
+static inline int
+min(int misc, int other)
+{
+ return (misc < other) ? misc : other;
+}
+
+static inline int
+max(int misc, int other)
+{
+ return (misc > other) ? misc : other;
+}
+
bool
map_file(FILE *file, const char **string_out, size_t *size_out);