summaryrefslogtreecommitdiff
path: root/src/keysym.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-10-16 21:09:33 +0200
committerRan Benita <ran234@gmail.com>2012-10-16 21:31:25 +0200
commit179855116d15b9da939f8fa397cd6e4399d96b39 (patch)
tree66a5646d04b12f47c23324878e854f93637b6fee /src/keysym.c
parent7b3bd11f92f0bed76f25eab8c79c0eca21e037bc (diff)
downloadlibxkbcommon-179855116d15b9da939f8fa397cd6e4399d96b39.tar.gz
libxkbcommon-179855116d15b9da939f8fa397cd6e4399d96b39.tar.bz2
libxkbcommon-179855116d15b9da939f8fa397cd6e4399d96b39.zip
utils: add and use ARRAY_SIZE macro
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/keysym.c')
-rw-r--r--src/keysym.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/keysym.c b/src/keysym.c
index 4f6285b..f80a1ed 100644
--- a/src/keysym.c
+++ b/src/keysym.c
@@ -79,7 +79,7 @@ xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size)
}
entry = bsearch(&search, keysym_to_name,
- sizeof(keysym_to_name) / sizeof(*keysym_to_name),
+ ARRAY_SIZE(keysym_to_name),
sizeof(*keysym_to_name),
compare_by_keysym);
if (entry)
@@ -112,7 +112,7 @@ static const struct name_keysym *
find_sym(const struct name_keysym *entry, const char *name, bool icase)
{
const struct name_keysym *iter, *last;
- size_t len = sizeof(name_to_keysym) / sizeof(*name_to_keysym);
+ size_t len = ARRAY_SIZE(name_to_keysym);
if (!entry)
return NULL;
@@ -159,7 +159,7 @@ xkb_keysym_from_name(const char *s, enum xkb_keysym_flags flags)
return XKB_KEY_NoSymbol;
entry = bsearch(&search, name_to_keysym,
- sizeof(name_to_keysym) / sizeof(*name_to_keysym),
+ ARRAY_SIZE(name_to_keysym),
sizeof(*name_to_keysym),
compare_by_name);
entry = find_sym(entry, s, icase);