Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: runtime/vm/unicode.cc

Issue 11299084: Correct a misnomer regarding supplementary code points. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: missed a few uses of smp Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/unicode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unicode.cc
diff --git a/runtime/vm/unicode.cc b/runtime/vm/unicode.cc
index d870c1377ab406870c7c53438061aae30f636376..f854eecb17990092dc165c68b8740a48aa2d8916 100644
--- a/runtime/vm/unicode.cc
+++ b/runtime/vm/unicode.cc
@@ -64,7 +64,7 @@ static bool IsLatin1SequenceStart(uint8_t code_unit) {
}
-static bool IsSmpSequenceStart(uint8_t code_unit) {
+static bool IsSupplementarySequenceStart(uint8_t code_unit) {
// Check is codepoint is >= U+10000.
return (code_unit >= 0xF0);
}
@@ -94,8 +94,8 @@ intptr_t Utf8::CodePointCount(const uint8_t* utf8_array,
++len;
}
if (!IsLatin1SequenceStart(code_unit)) { // > U+00FF
- if (IsSmpSequenceStart(code_unit)) { // >= U+10000
- char_type = kSMP;
+ if (IsSupplementarySequenceStart(code_unit)) { // >= U+10000
+ char_type = kSupplementary;
++len;
} else if (char_type == kLatin1) {
char_type = kBMP;
@@ -272,12 +272,12 @@ bool Utf8::DecodeToUTF16(const uint8_t* utf8_array,
intptr_t num_bytes;
for (; (i < array_len) && (j < len); i += num_bytes, ++j) {
int32_t ch;
- bool is_smp = IsSmpSequenceStart(utf8_array[i]);
+ bool is_supplementary = IsSupplementarySequenceStart(utf8_array[i]);
num_bytes = Utf8::Decode(&utf8_array[i], (array_len - i), &ch);
if (ch == -1) {
return false; // invalid input
}
- if (is_smp) {
+ if (is_supplementary) {
Utf16::Encode(ch, &dst[j]);
j = j + 1;
} else {
« no previous file with comments | « runtime/vm/unicode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698