summaryrefslogtreecommitdiff
path: root/src/x11
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-02-08 00:27:54 +0200
committerRan Benita <ran234@gmail.com>2014-02-08 00:54:53 +0200
commit623b10f8c5c35529141393944114ea93668bebb3 (patch)
treef8529fd110f4bf43484e07f953035f47152c6f28 /src/x11
parent893f01301b23b59a79c729f2dcd6e6bf31baecdf (diff)
downloadxorg-lib-libxkbcommon-623b10f8c5c35529141393944114ea93668bebb3.tar.gz
Fix sign-compare warnings
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/keymap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 0eedb30..9d680b1 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -354,7 +354,7 @@ get_types(struct xkb_keymap *keymap, xcb_connection_t *conn,
xcb_xkb_mod_def_iterator_t preserves_iter =
xcb_xkb_key_type_preserve_iterator(wire_type);
- FAIL_UNLESS(preserves_length <= type->num_entries);
+ FAIL_UNLESS((unsigned) preserves_length <= type->num_entries);
for (int j = 0; j < preserves_length; j++) {
xcb_xkb_mod_def_t *wire_preserve = preserves_iter.data;
@@ -405,7 +405,7 @@ get_sym_maps(struct xkb_keymap *keymap, xcb_connection_t *conn,
FAIL_UNLESS(key->num_groups <= ARRAY_SIZE(wire_sym_map->kt_index));
ALLOC_OR_FAIL(key->groups, key->num_groups);
- for (int j = 0; j < key->num_groups; j++) {
+ for (unsigned j = 0; j < key->num_groups; j++) {
FAIL_UNLESS(wire_sym_map->kt_index[j] < keymap->num_types);
key->groups[j].type = &keymap->types[wire_sym_map->kt_index[j]];
@@ -427,7 +427,7 @@ get_sym_maps(struct xkb_keymap *keymap, xcb_connection_t *conn,
int syms_length = xcb_xkb_key_sym_map_syms_length(wire_sym_map);
xcb_keysym_t *syms_iter = xcb_xkb_key_sym_map_syms(wire_sym_map);
- FAIL_UNLESS(syms_length == wire_sym_map->width * key->num_groups);
+ FAIL_UNLESS((unsigned) syms_length == wire_sym_map->width * key->num_groups);
for (int j = 0; j < syms_length; j++) {
xcb_keysym_t wire_keysym = *syms_iter;
@@ -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) <= darray_size(keymap->leds));
+ FAIL_UNLESS(msb_pos(reply->indicators) <= (int) darray_size(keymap->leds));
for (int i = 0; i < NUM_INDICATORS; i++) {
if (reply->indicators & (1 << i)) {
@@ -965,7 +965,7 @@ get_key_names(struct xkb_keymap *keymap, xcb_connection_t *conn,
FAIL_UNLESS(reply->minKeyCode == keymap->min_key_code);
FAIL_UNLESS(reply->maxKeyCode == keymap->max_key_code);
FAIL_UNLESS(reply->firstKey == keymap->min_key_code);
- FAIL_UNLESS(reply->firstKey + reply->nKeys - 1 == keymap->max_key_code);
+ FAIL_UNLESS(reply->firstKey + reply->nKeys - 1U == keymap->max_key_code);
for (int i = 0; i < length; i++) {
xcb_xkb_key_name_t *wire = iter.data;
@@ -1105,7 +1105,7 @@ get_controls(struct xkb_keymap *keymap, xcb_connection_t *conn,
FAIL_UNLESS(keymap->max_key_code < XCB_XKB_CONST_PER_KEY_BIT_ARRAY_SIZE * 8);
- for (int i = keymap->min_key_code; i <= keymap->max_key_code; i++)
+ for (xkb_keycode_t i = keymap->min_key_code; i <= keymap->max_key_code; i++)
keymap->keys[i].repeats = !!(reply->perKeyRepeat[i / 8] & (1 << (i % 8)));
free(reply);