Bug 794510 - Part 8: Use void* parameters to mmap and friends as opposed to caddr_t; r=bsmith
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 18 Oct 2012 15:00:31 -0400
changeset 110826 6a016c00dcc3640d4bd921bcbeaf22c7c7f80ef3
parent 110825 f86c9ae8f544e9ac7f22bd5279a1e73d2c35f0ae
child 110827 602330b6745c07cad8cbff140b338b314c05fef6
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbsmith
bugs794510
milestone19.0a1
Bug 794510 - Part 8: Use void* parameters to mmap and friends as opposed to caddr_t; r=bsmith caddr_t is an obsolete BSD type which we don't need to use any more.
layout/base/tests/cpp-tests/TestPoisonArea.cpp
--- a/layout/base/tests/cpp-tests/TestPoisonArea.cpp
+++ b/layout/base/tests/cpp-tests/TestPoisonArea.cpp
@@ -321,31 +321,31 @@ ExceptionHandler(PEXCEPTIONREPORTRECORD 
 #define LastErrMsg() (strerror(errno))
 
 static unsigned long _pagesize;
 #define PAGESIZE _pagesize
 
 static void *
 ReserveRegion(uintptr_t request, bool accessible)
 {
-  return mmap((caddr_t)request, PAGESIZE,
+  return mmap(reinterpret_cast<void*>(request), PAGESIZE,
               accessible ? PROT_READ|PROT_WRITE : PROT_NONE,
               MAP_PRIVATE|MAP_ANON, -1, 0);
 }
 
 static void
 ReleaseRegion(void *page)
 {
-  munmap((caddr_t)page, PAGESIZE);
+  munmap(page, PAGESIZE);
 }
 
 static bool
 ProbeRegion(uintptr_t page)
 {
-  if (madvise((caddr_t)page, PAGESIZE, MADV_NORMAL)) {
+  if (madvise(reinterpret_cast<void*>(page), PAGESIZE, MADV_NORMAL)) {
     return true;
   } else {
     return false;
   }
 }
 
 static int
 MakeRegionExecutable(void *page)