[llvm-commits] [llvm] r160142 - in /llvm/trunk/lib/Support: Memory.cpp Unix/Path.inc raw_ostream.cpp
Galina Kistanova
gkistanova at gmail.com
Thu Jul 12 13:45:37 PDT 2012
Author: gkistanova
Date: Thu Jul 12 15:45:36 2012
New Revision: 160142
URL: http://llvm.org/viewvc/llvm-project?rev=160142&view=rev
Log:
Fixed few warnings.
Modified:
llvm/trunk/lib/Support/Memory.cpp
llvm/trunk/lib/Support/Unix/Path.inc
llvm/trunk/lib/Support/raw_ostream.cpp
Modified: llvm/trunk/lib/Support/Memory.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Memory.cpp?rev=160142&r1=160141&r2=160142&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Memory.cpp (original)
+++ llvm/trunk/lib/Support/Memory.cpp Thu Jul 12 15:45:36 2012
@@ -45,7 +45,7 @@
# if (defined(__POWERPC__) || defined (__ppc__) || \
defined(_POWER) || defined(_ARCH_PPC)) || defined(__arm__)
- sys_icache_invalidate(Addr, Len);
+ sys_icache_invalidate(const_cast<void *>(Addr), Len);
# endif
#else
@@ -67,11 +67,12 @@
asm volatile("isync");
# elif defined(__arm__) && defined(__GNUC__)
// FIXME: Can we safely always call this for __GNUC__ everywhere?
- char *Start = (char*) Addr;
- char *End = Start + Len;
- __clear_cache(Start, End);
+ const char *Start = static_cast<const char *>(Addr);
+ const char *End = Start + Len;
+ __clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
# elif defined(__mips__)
- cacheflush((char*)Addr, Len, BCACHE);
+ const char *Start = static_cast<const char *>(Addr);
+ cacheflush(const_cast<char *>(Start), Len, BCACHE);
# endif
#endif // end apple
Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=160142&r1=160141&r2=160142&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Thu Jul 12 15:45:36 2012
@@ -884,7 +884,8 @@
}
void Path::UnMapFilePages(const char *BasePtr, size_t FileSize) {
- ::munmap((void*)BasePtr, FileSize);
+ const void *Addr = static_cast<const void *>(BasePtr);
+ ::munmap(const_cast<void *>(Addr), FileSize);
}
} // end llvm namespace
Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=160142&r1=160141&r2=160142&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Thu Jul 12 15:45:36 2012
@@ -528,7 +528,8 @@
} else {
// Use ::writev() where available.
#if defined(HAVE_WRITEV)
- struct iovec IOV = { (void*) Ptr, Size };
+ const void *Addr = static_cast<const void *>(Ptr);
+ struct iovec IOV = {const_cast<void *>(Addr), Size };
ret = ::writev(FD, &IOV, 1);
#else
ret = ::write(FD, Ptr, Size);
More information about the llvm-commits
mailing list