Skip to content

Commit

Permalink
deps: fix v8 build on FreeBSD
Browse files Browse the repository at this point in the history
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: #324
PR-URL: #332
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
indutny authored and bnoordhuis committed Jan 18, 2015
1 parent 5e7ebc7 commit 334020e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deps/v8/src/base/platform/platform-freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
if (bytes_read < 8) break;
unsigned end = StringToLong(addr_buffer);
char buffer[MAP_LENGTH];
int bytes_read = -1;
bytes_read = -1;
do {
bytes_read++;
if (bytes_read >= MAP_LENGTH - 1)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int OS::GetCurrentThreadId() {
#elif V8_OS_ANDROID
return static_cast<int>(gettid());
#else
return static_cast<int>(pthread_self());
return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self()));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void Debug::ThreadInit() {
thread_local_.step_out_fp_ = 0;
// TODO(isolates): frames_are_dropped_?
base::NoBarrier_Store(&thread_local_.current_debug_scope_,
static_cast<base::AtomicWord>(NULL));
static_cast<base::AtomicWord>(0));
thread_local_.restarter_frame_function_pointer_ = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/preparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class ParserBase : public Traits {
void ReportMessageAt(Scanner::Location location, const char* message,
bool is_reference_error = false) {
Traits::ReportMessageAt(location, message,
reinterpret_cast<const char*>(NULL),
reinterpret_cast<const char*>(0),
is_reference_error);
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/unique.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Unique {

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

static Unique<T> CreateImmovable(Handle<T> handle) {
Expand Down

0 comments on commit 334020e

Please sign in to comment.