aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Mikhirev2014-10-28 22:52:38 +0300
committerDmitry Mikhirev2014-10-28 22:52:38 +0300
commit610cd93c2df0bc40298957681784431a739d3335 (patch)
tree0cebf6ca1e3342cc65795f72dacaf80912c6d124
parentad266491abf6b04775e3d279d0eadb5a92d0bd57 (diff)
downloadbrainuino-610cd93c2df0bc40298957681784431a739d3335.zip
brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.gz
brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.bz2
brainuino-610cd93c2df0bc40298957681784431a739d3335.tar.xz
fix warning
-rw-r--r--utf8.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/utf8.cpp b/utf8.cpp
index e4a295e..ecadb99 100644
--- a/utf8.cpp
+++ b/utf8.cpp
@@ -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++;