Commit ac42103b0d21e7f9bdaf252090e7bec5938b6c5f

Ran Benita 2014-02-08T16:25:22

x11: make some #defines unsigned Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 6143e6e..fd05fab 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -43,13 +43,13 @@
 
 /* Constants from /usr/include/X11/extensions/XKB.h */
 /* XkbNumModifiers. */
-#define NUM_REAL_MODS 8
+#define NUM_REAL_MODS 8u
 /* XkbNumVirtualMods. */
-#define NUM_VMODS 16
+#define NUM_VMODS 16u
 /* XkbNoModifier. */
 #define NO_MODIFIER 0xff
 /* XkbNumIndicators. */
-#define NUM_INDICATORS 32
+#define NUM_INDICATORS 32u
 /* XkbAllIndicatorsMask. */
 #define ALL_INDICATORS_MASK 0xffffffff
 
@@ -511,8 +511,8 @@ get_vmods(struct xkb_keymap *keymap, xcb_connection_t *conn,
     darray_resize0(keymap->mods,
                    NUM_REAL_MODS + msb_pos(reply->virtualMods));
 
-    for (int i = 0; i < NUM_VMODS; i++) {
-        if (reply->virtualMods & (1 << i)) {
+    for (unsigned i = 0; i < NUM_VMODS; i++) {
+        if (reply->virtualMods & (1u << i)) {
             uint8_t wire = *iter;
             struct xkb_mod *mod = &darray_item(keymap->mods, NUM_REAL_MODS + i);
 
@@ -683,7 +683,7 @@ get_indicators(struct xkb_keymap *keymap, xcb_connection_t *conn,
 
     darray_resize0(keymap->leds, msb_pos(reply->which));
 
-    for (int i = 0; i < NUM_INDICATORS; i++) {
+    for (unsigned i = 0; i < NUM_INDICATORS; i++) {
         if (reply->which & (1u << i)) {
             xcb_xkb_indicator_map_t *wire = iter.data;
             struct xkb_led *led = &darray_item(keymap->leds, i);
@@ -885,7 +885,7 @@ get_indicator_names(struct xkb_keymap *keymap, xcb_connection_t *conn,
 
     FAIL_UNLESS(msb_pos(reply->indicators) <= darray_size(keymap->leds));
 
-    for (int i = 0; i < NUM_INDICATORS; i++) {
+    for (unsigned i = 0; i < NUM_INDICATORS; i++) {
         if (reply->indicators & (1u << i)) {
             xcb_atom_t wire = *iter;
             struct xkb_led *led = &darray_item(keymap->leds, i);
@@ -917,8 +917,8 @@ get_vmod_names(struct xkb_keymap *keymap, xcb_connection_t *conn,
      */
     darray_resize0(keymap->mods, NUM_REAL_MODS + msb_pos(reply->virtualMods));
 
-    for (int i = 0; i < NUM_VMODS; i++) {
-        if (reply->virtualMods & (1 << i)) {
+    for (unsigned i = 0; i < NUM_VMODS; i++) {
+        if (reply->virtualMods & (1u << i)) {
             xcb_atom_t wire = *iter;
             struct xkb_mod *mod = &darray_item(keymap->mods, NUM_REAL_MODS + i);