src: fix build on freebsd
authorfedor.indutny <fedor.indutny@gmail.com>
Wed, 14 Jan 2015 14:35:24 +0000 (06:35 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 14 Jan 2015 14:35:39 +0000 (14:35 +0000)
BUG=
R=danno

Review URL: https://codereview.chromium.org/839053004

Cr-Commit-Position: refs/heads/master@{#26057}

src/base/platform/platform-freebsd.cc
src/base/platform/platform-posix.cc
src/debug.cc
src/preparser.h
src/unique.h

index 507b946..58316f8 100644 (file)
@@ -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)
index c2fa26a..64aed2b 100644 (file)
@@ -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
 }
 
index e3cadda..dd3ec6e 100644 (file)
@@ -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;
 }
 
index 2ffd358..8dffa41 100644 (file)
@@ -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);
   }
 
index 9232f85..321eb36 100644 (file)
@@ -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) {