keysym: fix types in bin_search

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2014-02-08 16:03:06 +02:00
parent 04bacf87ba
commit a088c9ba77
1 changed files with 3 additions and 3 deletions

View 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)