diff options
Diffstat (limited to 'app/xterm/unicode/precompose.c.tail')
-rw-r--r-- | app/xterm/unicode/precompose.c.tail | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/xterm/unicode/precompose.c.tail b/app/xterm/unicode/precompose.c.tail index 0ceca9b6c..1f530f1bf 100644 --- a/app/xterm/unicode/precompose.c.tail +++ b/app/xterm/unicode/precompose.c.tail @@ -1,15 +1,18 @@ }; +#define UNICODE_SHIFT 21 + int do_precomposition(int base, int comb) { int min = 0; int max = sizeof(precompositions) / sizeof(precompositions[0]) - 1; int mid; - unsigned int sought = ((unsigned)base << 16) | (unsigned)comb, that; + unsigned long sought = ((unsigned) base << UNICODE_SHIFT) | (unsigned) comb; + unsigned long that; /* binary search */ while (max >= min) { mid = (min + max) / 2; - that = ((unsigned)precompositions[mid].base << 16) | ((unsigned)precompositions[mid].comb); + that = ((unsigned) precompositions[mid].base << UNICODE_SHIFT) | ((unsigned) precompositions[mid].comb); if (that < sought) { min = mid + 1; } else if (that > sought) { |