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

Unified Diff: src/runtime/runtime-i18n.cc

Issue 2493553002: Fix -Wsign-compare warnings in parser, scanner, regexp, runtime. (Closed)
Patch Set: Created 4 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 | « src/regexp/regexp-parser.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index 684699edf1837773e382ecc830db65e2e9c0f967..14ebebb00bf518eaa13a5ccc8fddc33e245aa8f8 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -1138,7 +1138,7 @@ RUNTIME_FUNCTION(Runtime_StringToLowerCaseI18N) {
s = String::Flatten(s);
// First scan the string for uppercase and non-ASCII characters:
if (s->HasOnlyOneByteChars()) {
- unsigned first_index_to_lower = length;
+ int first_index_to_lower = length;
for (int index = 0; index < length; ++index) {
// Blink specializes this path for one-byte strings, so it
// does not need to do a generic get, but can do the equivalent
@@ -1165,14 +1165,16 @@ RUNTIME_FUNCTION(Runtime_StringToLowerCaseI18N) {
String::FlatContent flat = s->GetFlatContent();
if (flat.IsOneByte()) {
const uint8_t* src = flat.ToOneByteVector().start();
- CopyChars(result->GetChars(), src, first_index_to_lower);
+ CopyChars(result->GetChars(), src,
+ static_cast<size_t>(first_index_to_lower));
for (int index = first_index_to_lower; index < length; ++index) {
uint16_t ch = static_cast<uint16_t>(src[index]);
result->SeqOneByteStringSet(index, ToLatin1Lower(ch));
}
} else {
const uint16_t* src = flat.ToUC16Vector().start();
- CopyChars(result->GetChars(), src, first_index_to_lower);
+ CopyChars(result->GetChars(), src,
+ static_cast<size_t>(first_index_to_lower));
for (int index = first_index_to_lower; index < length; ++index) {
uint16_t ch = src[index];
result->SeqOneByteStringSet(index, ToLatin1Lower(ch));
« no previous file with comments | « src/regexp/regexp-parser.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698