diff options
author | Ben Smith <binjimin@gmail.com> | 2017-07-19 13:17:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 13:17:10 -0700 |
commit | 3142da34c5cafb41b1953556c9a312d5beab5780 (patch) | |
tree | ab72cad8ce45ec9c2e036b9090001c05720a2668 /src/utf8.cc | |
parent | 028701aa7a80320d5e5a6e1d69b52cd940d402ea (diff) | |
download | wabt-3142da34c5cafb41b1953556c9a312d5beab5780.tar.gz wabt-3142da34c5cafb41b1953556c9a312d5beab5780.tar.bz2 wabt-3142da34c5cafb41b1953556c9a312d5beab5780.zip |
Rename snake_case to MixedCase. (#579)
There are no functional changes.
Diffstat (limited to 'src/utf8.cc')
-rw-r--r-- | src/utf8.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utf8.cc b/src/utf8.cc index 23422983..3855fb71 100644 --- a/src/utf8.cc +++ b/src/utf8.cc @@ -43,13 +43,13 @@ const int s_utf8_length[256] = { }; // Returns true if this is a valid continuation byte. -bool is_cont(uint8_t c) { +bool IsCont(uint8_t c) { return (c & 0xc0) == 0x80; } } // end anonymous namespace -bool is_valid_utf8(const char* s, size_t s_length) { +bool IsValidUtf8(const char* s, size_t s_length) { const uint8_t* p = reinterpret_cast<const uint8_t*>(s); const uint8_t* end = p + s_length; while (p < end) { @@ -68,7 +68,7 @@ bool is_valid_utf8(const char* s, size_t s_length) { case 2: p++; - if (!is_cont(*p++)) + if (!IsCont(*p++)) return false; break; @@ -76,7 +76,7 @@ bool is_valid_utf8(const char* s, size_t s_length) { p++; uint8_t cu1 = *p++; uint8_t cu2 = *p++; - if (!(is_cont(cu1) && is_cont(cu2)) || + if (!(IsCont(cu1) && IsCont(cu2)) || (cu0 == 0xe0 && cu1 < 0xa0) || // Overlong encoding. (cu0 == 0xed && cu1 >= 0xa0)) // UTF-16 surrogate halves. return false; @@ -88,7 +88,7 @@ bool is_valid_utf8(const char* s, size_t s_length) { uint8_t cu1 = *p++; uint8_t cu2 = *p++; uint8_t cu3 = *p++; - if (!(is_cont(cu1) && is_cont(cu2) && is_cont(cu3)) || + if (!(IsCont(cu1) && IsCont(cu2) && IsCont(cu3)) || (cu0 == 0xf0 && cu1 < 0x90) || // Overlong encoding. (cu0 == 0xf4 && cu1 >= 0x90)) // Code point >= 0x11000. return false; |