Use static_cast instead of reinterpret_cast for casting void*.
authorDan Gohman <gohman@apple.com>
Sat, 21 Jun 2008 20:17:03 +0000 (20:17 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 21 Jun 2008 20:17:03 +0000 (20:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52592 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITMemoryManager.cpp
lib/System/Mutex.cpp

index b07af2e11ddd0f35c60bd0c5d3ab25b461683ab2..4cbfcf9e5184806e63653b957e18059f08348048 100644 (file)
@@ -369,7 +369,7 @@ DefaultJITMemoryManager::DefaultJITMemoryManager() {
   // Allocate a 16M block of memory for functions.
   sys::MemoryBlock MemBlock = getNewMemoryBlock(16 << 20);
 
-  unsigned char *MemBase = reinterpret_cast<unsigned char*>(MemBlock.base());
+  unsigned char *MemBase = static_cast<unsigned char*>(MemBlock.base());
 
   // Allocate stubs backwards from the base, allocate functions forward
   // from the base.
index 3bef7ce0b02e4fd7656614b7549f13ec2af6e9fd..81dcd3b418b8b6962704ff68f055bbf7ff7dfb5a 100644 (file)
@@ -98,7 +98,7 @@ Mutex::~Mutex()
 {
   if (pthread_enabled)
   {
-    pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
+    pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
     assert(mutex != 0);
     pthread_mutex_destroy(mutex);
     assert(mutex != 0);
@@ -110,7 +110,7 @@ Mutex::acquire()
 {
   if (pthread_enabled)
   {
-    pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
+    pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
     assert(mutex != 0);
 
     int errorcode = pthread_mutex_lock(mutex);
@@ -124,7 +124,7 @@ Mutex::release()
 {
   if (pthread_enabled)
   {
-    pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
+    pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
     assert(mutex != 0);
 
     int errorcode = pthread_mutex_unlock(mutex);
@@ -138,7 +138,7 @@ Mutex::tryacquire()
 {
   if (pthread_enabled)
   {
-    pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(data_);
+    pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
     assert(mutex != 0);
 
     int errorcode = pthread_mutex_trylock(mutex);