diff options
author | 2012-10-08 11:46:14 +0900 | |
---|---|---|
committer | 2012-10-09 11:17:50 +0900 | |
commit | b02ee3d67a1884b6ff59cc16c29a476845c0694f (patch) | |
tree | 3a820911ae43c94d74d2ddbdf98979a8a3e3ef87 /native/jni/src/char_utils.cpp | |
parent | 60f6120e2bbe9f6b6f53f7dfcd8421cda2cedc4c (diff) | |
download | latinime-b02ee3d67a1884b6ff59cc16c29a476845c0694f.tar.gz latinime-b02ee3d67a1884b6ff59cc16c29a476845c0694f.tar.xz latinime-b02ee3d67a1884b6ff59cc16c29a476845c0694f.zip |
Make use of the NELEMS and KEYCODE_SPACE macro. Also, remove an unused parameter.
Change-Id: I3c7e6c59990c92b0d5e2fb80493e8673cdd37b09
Diffstat (limited to 'native/jni/src/char_utils.cpp')
-rw-r--r-- | native/jni/src/char_utils.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/native/jni/src/char_utils.cpp b/native/jni/src/char_utils.cpp index d0547a982..9d27cadad 100644 --- a/native/jni/src/char_utils.cpp +++ b/native/jni/src/char_utils.cpp @@ -17,6 +17,7 @@ #include <cstdlib> #include "char_utils.h" +#include "defines.h" namespace latinime { @@ -33,7 +34,7 @@ struct LatinCapitalSmallPair { // // unsigned short c, cc, ccc, ccc2; // for (c = 0; c < 0xFFFF ; c++) { -// if (c < sizeof(BASE_CHARS) / sizeof(BASE_CHARS[0])) { +// if (c < NELEMS(BASE_CHARS)) { // cc = BASE_CHARS[c]; // } else { // cc = c; @@ -894,9 +895,7 @@ static int compare_pair_capital(const void *a, const void *b) { unsigned short latin_tolower(const unsigned short c) { struct LatinCapitalSmallPair *p = static_cast<struct LatinCapitalSmallPair *>(bsearch(&c, SORTED_CHAR_MAP, - sizeof(SORTED_CHAR_MAP) / sizeof(SORTED_CHAR_MAP[0]), - sizeof(SORTED_CHAR_MAP[0]), - compare_pair_capital)); + NELEMS(SORTED_CHAR_MAP), sizeof(SORTED_CHAR_MAP[0]), compare_pair_capital)); return p ? p->small : c; } } // namespace latinime |