Fix windows compile warnings.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 19 Dec 2012 13:57:51 +0000 (13:57 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 19 Dec 2012 13:57:51 +0000 (13:57 +0000)
R=dcarney@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11636016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap.cc

index 8f96f4b..b7f606a 100644 (file)
@@ -3312,15 +3312,16 @@ MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString(
     return symbol;
   // Now we know the length is 2, we might as well make use of that fact
   // when building the new string.
-  } else if ((c1 | c2) <= String::kMaxAsciiCharCodeU) {  // We can do this
+  } else if (static_cast<unsigned>(c1 | c2) <= String::kMaxAsciiCharCodeU) {
+    // We can do this.
     ASSERT(IsPowerOf2(String::kMaxAsciiCharCodeU + 1));  // because of this.
     Object* result;
     { MaybeObject* maybe_result = heap->AllocateRawOneByteString(2);
       if (!maybe_result->ToObject(&result)) return maybe_result;
     }
     char* dest = SeqOneByteString::cast(result)->GetChars();
-    dest[0] = c1;
-    dest[1] = c2;
+    dest[0] = static_cast<char>(c1);
+    dest[1] = static_cast<char>(c2);
     return result;
   } else {
     Object* result;