Fix windows compile warnings.
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
This commit is contained in:
parent
17a54b61fe
commit
a2a002be0d
@ -3312,15 +3312,16 @@ MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString(
|
|||||||
return symbol;
|
return symbol;
|
||||||
// Now we know the length is 2, we might as well make use of that fact
|
// Now we know the length is 2, we might as well make use of that fact
|
||||||
// when building the new string.
|
// 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.
|
ASSERT(IsPowerOf2(String::kMaxAsciiCharCodeU + 1)); // because of this.
|
||||||
Object* result;
|
Object* result;
|
||||||
{ MaybeObject* maybe_result = heap->AllocateRawOneByteString(2);
|
{ MaybeObject* maybe_result = heap->AllocateRawOneByteString(2);
|
||||||
if (!maybe_result->ToObject(&result)) return maybe_result;
|
if (!maybe_result->ToObject(&result)) return maybe_result;
|
||||||
}
|
}
|
||||||
char* dest = SeqOneByteString::cast(result)->GetChars();
|
char* dest = SeqOneByteString::cast(result)->GetChars();
|
||||||
dest[0] = c1;
|
dest[0] = static_cast<char>(c1);
|
||||||
dest[1] = c2;
|
dest[1] = static_cast<char>(c2);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
Object* result;
|
Object* result;
|
||||||
|
Loading…
Reference in New Issue
Block a user