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

Unified Diff: src/objects.h

Issue 11200004: Static cast char* diff to int. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f6fb8d23d12d811aad2ce0d4d79d4a945950f3e4..3213b6032414ffd95430d4531f99e8982171852f 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7424,18 +7424,18 @@ class String: public HeapObject {
const uintptr_t non_ascii_mask = kUintptrAllBitsSet / 0xFF * 0x80;
while (chars + sizeof(uintptr_t) <= limit) {
if (*reinterpret_cast<const uintptr_t*>(chars) & non_ascii_mask) {
- return chars - start;
+ return static_cast<int>(chars - start);
}
chars += sizeof(uintptr_t);
}
#endif
while (chars < limit) {
if (static_cast<uint8_t>(*chars) > kMaxAsciiCharCodeU) {
- return chars - start;
+ return static_cast<int>(chars - start);
}
++chars;
}
- return chars - start;
+ return static_cast<int>(chars - start);
}
static inline bool IsAscii(const char* chars, int length) {
@@ -7446,10 +7446,10 @@ class String: public HeapObject {
const uc16* limit = chars + length;
const uc16* start = chars;
while (chars < limit) {
- if (*chars > kMaxAsciiCharCodeU) return chars - start;
+ if (*chars > kMaxAsciiCharCodeU) return static_cast<int>(chars - start);
++chars;
}
- return chars - start;
+ return static_cast<int>(chars - start);
}
static inline bool IsAscii(const uc16* chars, int length) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698