src/state: match_mod_masks can return bool instead of int

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2016-06-09 15:30:21 +03:00
parent 81ee012af0
commit c8e6996ff9
1 changed files with 4 additions and 6 deletions

View File

@ -1140,7 +1140,7 @@ xkb_state_mod_index_is_active(struct xkb_state *state,
* Helper function for xkb_state_mod_indices_are_active and
* xkb_state_mod_names_are_active.
*/
static int
static bool
match_mod_masks(struct xkb_state *state,
enum xkb_state_component type,
enum xkb_state_match match,
@ -1149,14 +1149,12 @@ match_mod_masks(struct xkb_state *state,
xkb_mod_mask_t active = xkb_state_serialize_mods(state, type);
if (!(match & XKB_STATE_MATCH_NON_EXCLUSIVE) && (active & ~wanted))
return 0;
return false;
if (match & XKB_STATE_MATCH_ANY)
return !!(active & wanted);
else
return (active & wanted) == wanted;
return active & wanted;
return 0;
return (active & wanted) == wanted;
}
/**