keysym: fix types in bin_search
authorRan Benita <ran234@gmail.com>
Sat, 8 Feb 2014 14:03:06 +0000 (16:03 +0200)
committerRan Benita <ran234@gmail.com>
Sat, 8 Feb 2014 14:03:06 +0000 (16:03 +0200)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/keysym-utf.c

index 129da15..9b6fbd7 100644 (file)
@@ -838,15 +838,15 @@ static const struct codepair keysymtab[] = {
 static uint32_t
 bin_search(const struct codepair *table, size_t length, xkb_keysym_t keysym)
 {
-    int first = 0;
-    int last = length;
+    size_t first = 0;
+    size_t last = length;
 
     if (keysym < table[0].keysym  || keysym > table[length].keysym)
         return 0;
 
     /* binary search in table */
     while (last >= first) {
-        int mid = (first + last) / 2;
+        size_t mid = (first + last) / 2;
         if (table[mid].keysym < keysym)
             first = mid + 1;
         else if (table[mid].keysym > keysym)