Commit c8e6996ff9285be27831d963438ff9fb5ef78999

Ran Benita 2016-06-09T15:30:21

src/state: match_mod_masks can return bool instead of int Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/state.c b/src/state.c
index a45315d..8845a4e 100644
--- a/src/state.c
+++ b/src/state.c
@@ -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;
 }
 
 /**