Skip to content

Commit 334020e

Browse files
indutnybnoordhuis
authored andcommitted
deps: fix v8 build on FreeBSD
clang++ on FreeBSD was blaming v8 for using invalid casts from nullptr: reinterpret_cast from 'nullptr_t' to '...' is not allowed Replace casts with NULL, or NULL with 0 where applicable. Fixes: nodejs#324 PR-URL: nodejs#332 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 5e7ebc7 commit 334020e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

deps/v8/src/base/platform/platform-freebsd.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
141141
if (bytes_read < 8) break;
142142
unsigned end = StringToLong(addr_buffer);
143143
char buffer[MAP_LENGTH];
144-
int bytes_read = -1;
144+
bytes_read = -1;
145145
do {
146146
bytes_read++;
147147
if (bytes_read >= MAP_LENGTH - 1)

deps/v8/src/base/platform/platform-posix.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int OS::GetCurrentThreadId() {
261261
#elif V8_OS_ANDROID
262262
return static_cast<int>(gettid());
263263
#else
264-
return static_cast<int>(pthread_self());
264+
return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self()));
265265
#endif
266266
}
267267

deps/v8/src/debug.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ void Debug::ThreadInit() {
573573
thread_local_.step_out_fp_ = 0;
574574
// TODO(isolates): frames_are_dropped_?
575575
base::NoBarrier_Store(&thread_local_.current_debug_scope_,
576-
static_cast<base::AtomicWord>(NULL));
576+
static_cast<base::AtomicWord>(0));
577577
thread_local_.restarter_frame_function_pointer_ = NULL;
578578
}
579579

deps/v8/src/preparser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class ParserBase : public Traits {
467467
void ReportMessageAt(Scanner::Location location, const char* message,
468468
bool is_reference_error = false) {
469469
Traits::ReportMessageAt(location, message,
470-
reinterpret_cast<const char*>(NULL),
470+
reinterpret_cast<const char*>(0),
471471
is_reference_error);
472472
}
473473

deps/v8/src/unique.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Unique {
117117

118118
// TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
119119
static Unique<T> CreateUninitialized(Handle<T> handle) {
120-
return Unique<T>(reinterpret_cast<Address>(NULL), handle);
120+
return Unique<T>(NULL, handle);
121121
}
122122

123123
static Unique<T> CreateImmovable(Handle<T> handle) {

0 commit comments

Comments
 (0)