Revision: 3925
Author: [email protected]
Date: Mon Feb 22 03:42:46 2010
Log: Add integer casts to make v8 compile without warnings on 64-bit Visual
Studio
Review URL: http://codereview.chromium.org/650140
http://code.google.com/p/v8/source/detail?r=3925
Modified:
/branches/bleeding_edge/src/heap.cc
/branches/bleeding_edge/src/heap.h
/branches/bleeding_edge/src/scopeinfo.cc
/branches/bleeding_edge/src/serialize.cc
/branches/bleeding_edge/src/spaces-inl.h
=======================================
--- /branches/bleeding_edge/src/heap.cc Thu Feb 18 01:07:03 2010
+++ /branches/bleeding_edge/src/heap.cc Mon Feb 22 03:42:46 2010
@@ -4111,7 +4111,7 @@
// Uses only lower 32 bits if pointers are larger.
uintptr_t addr_hash =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)) >>
kMapHashShift;
- return (addr_hash ^ name->Hash()) & kCapacityMask;
+ return static_cast<uint32_t>((addr_hash ^ name->Hash()) & kCapacityMask);
}
=======================================
--- /branches/bleeding_edge/src/heap.h Mon Feb 8 05:44:49 2010
+++ /branches/bleeding_edge/src/heap.h Mon Feb 22 03:42:46 2010
@@ -1383,9 +1383,9 @@
private:
static int Hash(DescriptorArray* array, String* name) {
// Uses only lower 32 bits if pointers are larger.
- uintptr_t array_hash =
+ uint32_t array_hash =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array)) >> 2;
- uintptr_t name_hash =
+ uint32_t name_hash =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >> 2;
return (array_hash ^ name_hash) % kLength;
}
=======================================
--- /branches/bleeding_edge/src/scopeinfo.cc Wed Nov 11 01:50:06 2009
+++ /branches/bleeding_edge/src/scopeinfo.cc Mon Feb 22 03:42:46 2010
@@ -536,7 +536,7 @@
// Uses only lower 32 bits if pointers are larger.
uintptr_t addr_hash =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(code)) >> 2;
- return (addr_hash ^ name->Hash()) % kLength;
+ return static_cast<int>((addr_hash ^ name->Hash()) % kLength);
}
=======================================
--- /branches/bleeding_edge/src/serialize.cc Thu Jan 28 05:05:29 2010
+++ /branches/bleeding_edge/src/serialize.cc Mon Feb 22 03:42:46 2010
@@ -852,10 +852,10 @@
const int max_shift = ((kPointerSize * kBitsPerByte) / 7) * 7;
for (int shift = max_shift; shift > 0; shift -= 7) {
if (integer >= static_cast<uintptr_t>(1u) << shift) {
- Put(((integer >> shift) & 0x7f) | 0x80, "IntPart");
+ Put((static_cast<int>((integer >> shift)) & 0x7f) | 0x80, "IntPart");
}
}
- PutSection(integer & 0x7f, "IntLastPart");
+ PutSection(static_cast<int>(integer & 0x7f), "IntLastPart");
}
#ifdef DEBUG
=======================================
--- /branches/bleeding_edge/src/spaces-inl.h Mon Jan 25 14:53:18 2010
+++ /branches/bleeding_edge/src/spaces-inl.h Mon Feb 22 03:42:46 2010
@@ -183,7 +183,7 @@
int MemoryAllocator::GetChunkId(Page* p) {
ASSERT(p->is_valid());
- return p->opaque_header & Page::kPageAlignmentMask;
+ return static_cast<int>(p->opaque_header & Page::kPageAlignmentMask);
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev