summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-04-22 13:15:21 +0300
committerRan Benita <ran234@gmail.com>2014-04-22 14:58:42 +0300
commit9014cf8cd850b8685571590fe060a8a4239c03e8 (patch)
tree367907ffaa5397df3c4c2e9b1483eaf2d50a7f86 /src/state.c
parent787faf36654ed75672613c560286caddadce3ec5 (diff)
downloadxorg-lib-libxkbcommon-9014cf8cd850b8685571590fe060a8a4239c03e8.tar.gz
keymap, keycodes, compat: don't use darray for LEDs
Use a static array of size XKB_MAX_LEDS instead, as in xkb_mod_set. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index 4b5f3cb..94545bc 100644
--- a/src/state.c
+++ b/src/state.c
@@ -619,7 +619,7 @@ xkb_state_led_update_all(struct xkb_state *state)
state->components.leds = 0;
- darray_enumerate(idx, led, state->keymap->leds) {
+ xkb_leds_enumerate(idx, led, state->keymap) {
xkb_mod_mask_t mod_mask = 0;
xkb_layout_mask_t group_mask = 0;
@@ -1252,8 +1252,8 @@ xkb_state_layout_name_is_active(struct xkb_state *state, const char *name,
XKB_EXPORT int
xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx)
{
- if (idx >= darray_size(state->keymap->leds) ||
- darray_item(state->keymap->leds, idx).name == XKB_ATOM_NONE)
+ if (idx >= state->keymap->num_leds ||
+ state->keymap->leds[idx].name == XKB_ATOM_NONE)
return -1;
return !!(state->components.leds & (1u << idx));