Reviewers: Yang, machenbach,
Description:
Use static_cast<> for NULL (clang 3.7)
The following errors come up when compiling v8
with clang 3.7 on FreeBSD/amd64:
src/runtime/runtime-i18n.cc:629:37: error: reinterpret_cast from
'nullptr_t' to 'v8::internal::Smi *' is not allowed
local_object->SetInternalField(1, reinterpret_cast<Smi*>(NULL));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/cctest/test-heap.cc:131:20: error: reinterpret_cast from
'nullptr_t' to 'v8::internal::Object *' is not allowed
Handle<Object> n(reinterpret_cast<Object*>(NULL), isolate);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/cctest/test-heap.cc:1989:18: error: reinterpret_cast from
'nullptr_t' to 'Address' (aka 'unsigned char *') is not
allowed
Address base = reinterpret_cast<Address>(NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+add myself to the AUTHORS file.
BUG=
Please review this at https://codereview.chromium.org/1277353002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+4, -3 lines):
M AUTHORS
M src/runtime/runtime-i18n.cc
M test/cctest/test-heap.cc
Index: AUTHORS
diff --git a/AUTHORS b/AUTHORS
index
c04aa16b047fff5e35a27ba1beccb2ff27267d6c..72c23bcc83e0b73fac67a2d554ab1b5b2cccabc7
100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -70,6 +70,7 @@ Kang-Hao (Kenny) Lu <[email protected]>
Luis Reis <[email protected]>
Luke Zarko <[email protected]>
Maciej Małecki <[email protected]>
+Marcin Cieślak <[email protected]>
Mathias Bynens <[email protected]>
Matt Hanselman <[email protected]>
Matthew Sporleder <[email protected]>
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index
18e9aee126b47329cfd847d08ff88dde0aa101e4..3da71a98ef309d23b7d31f0349a751536602a728
100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -626,7 +626,7 @@ RUNTIME_FUNCTION(Runtime_CreateBreakIterator) {
local_object->SetInternalField(0,
reinterpret_cast<Smi*>(break_iterator));
// Make sure that the pointer to adopted text is NULL.
- local_object->SetInternalField(1, reinterpret_cast<Smi*>(NULL));
+ local_object->SetInternalField(1, static_cast<Smi*>(nullptr));
Factory* factory = isolate->factory();
Handle<String> key = factory->NewStringFromStaticChars("breakIterator");
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index
0bc3c1e13f6f4b47e124fbc38d5bf24a069ac76a..b34dbe631f37c1c2877f34ac02de73815f913b98
100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -128,7 +128,7 @@ TEST(HandleNull) {
Isolate* isolate = CcTest::i_isolate();
HandleScope outer_scope(isolate);
LocalContext context;
- Handle<Object> n(reinterpret_cast<Object*>(NULL), isolate);
+ Handle<Object> n(static_cast<Object*>(NULL), isolate);
CHECK(!n.is_null());
}
@@ -1986,7 +1986,7 @@ TEST(TestAlignmentCalculations) {
Heap::GetMaximumFillToAlign(kSimd128Unaligned);
CHECK_EQ(maximum_simd128_misalignment, max_simd128_unaligned_fill);
- Address base = reinterpret_cast<Address>(NULL);
+ Address base = static_cast<Address>(NULL);
int fill = 0;
// Word alignment never requires fill.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.