summaryrefslogtreecommitdiff
path: root/libutils/Unicode.cpp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-09-13 11:08:41 -0700
committerChih-hung Hsieh <chh@google.com>2018-09-17 16:50:11 +0000
commit4d1d0f9be6b76c4e94462f532c1cebaad9ac1526 (patch)
treeb34cb377a8a6543fb0baf68e566b120209b3aaf9 /libutils/Unicode.cpp
parent4848961f1bdd2c4d2809e45a44a40045d086c361 (diff)
Suppress implicit-fallthrough warnings.
Add FALLTHROUGH_INTENDED for clang compiler. Bug: 112564944 Test: build with global -Wimplicit-fallthrough. Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
Diffstat (limited to 'libutils/Unicode.cpp')
-rw-r--r--libutils/Unicode.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp
index 82f650dcec..5f0a51f1c5 100644
--- a/libutils/Unicode.cpp
+++ b/libutils/Unicode.cpp
@@ -16,8 +16,9 @@
#define LOG_TAG "unicode"
-#include <utils/Unicode.h>
+#include <android-base/macros.h>
#include <limits.h>
+#include <utils/Unicode.h>
#include <log/log.h>
@@ -105,8 +106,11 @@ static inline void utf32_codepoint_to_utf8(uint8_t* dstP, char32_t srcChar, size
switch (bytes)
{ /* note: everything falls through. */
case 4: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
+ FALLTHROUGH_INTENDED;
case 3: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
+ FALLTHROUGH_INTENDED;
case 2: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
+ FALLTHROUGH_INTENDED;
case 1: *--dstP = (uint8_t)(srcChar | kFirstByteMark[bytes]);
}
}