diff options
author | Dmitry Mikhirev | 2014-10-28 22:52:38 +0300 |
---|---|---|
committer | Dmitry Mikhirev | 2014-10-28 22:52:38 +0300 |
commit | 610cd93c2df0bc40298957681784431a739d3335 (patch) | |
tree | 0cebf6ca1e3342cc65795f72dacaf80912c6d124 | |
parent | ad266491abf6b04775e3d279d0eadb5a92d0bd57 (diff) | |
download | brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.gz brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.bz2 brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.xz brainuino-610cd93c2df0bc40298957681784431a739d3335.zip |
fix warning
-rw-r--r-- | utf8.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -88,11 +88,13 @@ wchar_t utf8::get() wchar_t(_string[_index+1] & 0x3f) << 6 | wchar_t(_string[_index+2] & 0x3f); _index += 3; - } else if (((_string[_index] & 0x8) == 0) && (sizeof(code) >= 3)) { +#if WCHAR_MAX - WCHAR_MIN >= 16777215 + } else if ((_string[_index] & 0x8) == 0) { code = wchar_t(_string[_index] & 0x07) << 18 | wchar_t(_string[_index+1] & 0x3f) << 12 | wchar_t(_string[_index+2] & 0x3f) << 6 | wchar_t(_string[_index+3] & 0x3f); +#endif } else { code = '?'; _index++; @@ -111,11 +113,13 @@ wchar_t utf8::get() wchar_t(pgm_read_byte(_string_p + _index + 1) & 0x3f) << 6 | wchar_t(pgm_read_byte(_string_p + _index + 2) & 0x3f); _index += 3; - } else if (((first & 0x8) == 0) && (sizeof(code) >= 3)) { +#if WCHAR_MAX - WCHAR_MIN >= 16777215 + } else if ((first & 0x8) == 0) { code = wchar_t(first & 0x07) << 18 | wchar_t(pgm_read_byte(_string_p + _index + 1) & 0x3f) << 12 | wchar_t(pgm_read_byte(_string_p + _index + 2) & 0x3f) << 6 | wchar_t(pgm_read_byte(_string_p + _index + 3) & 0x3f); +#endif } else { code = '?'; _index++; |