summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utils.h6
-rw-r--r--src/x11/keymap.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/utils.h b/src/utils.h
index 6affee1..878c2ac 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -163,13 +163,13 @@ is_graph(char ch)
* Note: this is 1-based! It's more useful this way, and returns 0 when
* mask is all 0s.
*/
-static inline int
+static inline unsigned
msb_pos(uint32_t mask)
{
- int pos = 0;
+ unsigned pos = 0;
while (mask) {
pos++;
- mask >>= 1;
+ mask >>= 1u;
}
return pos;
}
diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 8581a79..51b0219 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -883,7 +883,7 @@ get_indicator_names(struct xkb_keymap *keymap, xcb_connection_t *conn,
{
xcb_atom_t *iter = xcb_xkb_get_names_value_list_indicator_names(list);
- FAIL_UNLESS(msb_pos(reply->indicators) <= (int) darray_size(keymap->leds));
+ FAIL_UNLESS(msb_pos(reply->indicators) <= darray_size(keymap->leds));
for (int i = 0; i < NUM_INDICATORS; i++) {
if (reply->indicators & (1u << i)) {