x11: make some #defines unsigned Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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);