diff options
author | 2012-08-16 21:18:58 -0700 | |
---|---|---|
committer | 2012-08-16 21:18:58 -0700 | |
commit | aca6bef515dcbc6720884760b48c24c83ab25916 (patch) | |
tree | 611669fcde3c5524761692306b1d16eb404f070d /native/jni/src/char_utils.h | |
parent | 667108d71d42d599a06a2075c75bc514ee8e682c (diff) | |
parent | 99927f865faff5a9f31de315620447fd963f3dff (diff) | |
download | latinime-aca6bef515dcbc6720884760b48c24c83ab25916.tar.gz latinime-aca6bef515dcbc6720884760b48c24c83ab25916.tar.xz latinime-aca6bef515dcbc6720884760b48c24c83ab25916.zip |
am 99927f86: am de8a9a82: Small cleanups
* commit '99927f865faff5a9f31de315620447fd963f3dff':
Small cleanups
Diffstat (limited to 'native/jni/src/char_utils.h')
-rw-r--r-- | native/jni/src/char_utils.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/native/jni/src/char_utils.h b/native/jni/src/char_utils.h index edd96bbb0..b30677fa7 100644 --- a/native/jni/src/char_utils.h +++ b/native/jni/src/char_utils.h @@ -17,21 +17,23 @@ #ifndef LATINIME_CHAR_UTILS_H #define LATINIME_CHAR_UTILS_H +#include <cctype> + namespace latinime { -inline static int isAsciiUpper(unsigned short c) { - return c >= 'A' && c <= 'Z'; +inline static bool isAsciiUpper(unsigned short c) { + return isupper(static_cast<int>(c)) != 0; } inline static unsigned short toAsciiLower(unsigned short c) { return c - 'A' + 'a'; } -inline static int isAscii(unsigned short c) { - return c <= 127; +inline static bool isAscii(unsigned short c) { + return isascii(static_cast<int>(c)) != 0; } -unsigned short latin_tolower(unsigned short c); +unsigned short latin_tolower(const unsigned short c); /** * Table mapping most combined Latin, Greek, and Cyrillic characters |