Bug 780387 - Part a: Stop using PRPtrdiff; r=bsmedberg
authorMs2ger <ms2ger@gmail.com>
Thu, 09 Aug 2012 09:09:31 +0200
changeset 101927 62d94d3c6affb5181a13e7dc4029dd18ac176c4e
parent 101891 257777cf58fe7c3eee79e113c35b4faf63601b77
child 101928 4587cc2d01545d18cea6d650e725af5751f549ee
push id13237
push useremorley@mozilla.com
push dateThu, 09 Aug 2012 11:51:38 +0000
treeherdermozilla-inbound@f799dd180292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs780387
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 780387 - Part a: Stop using PRPtrdiff; r=bsmedberg
xpcom/glue/nsTArray-inl.h
xpcom/glue/pldhash.cpp
xpcom/tests/TestTArray.cpp
--- a/xpcom/glue/nsTArray-inl.h
+++ b/xpcom/glue/nsTArray-inl.h
@@ -82,17 +82,17 @@ bool nsTArray_base<Alloc>::UsesAutoArray
   // nsTArray, because GetAutoArrayBuffer(16) could lie outside the memory
   // owned by this nsAutoTArray.  We statically assert that elem_type's
   // alignment is 8 bytes or less in nsAutoArrayBase.
 
   MOZ_STATIC_ASSERT(sizeof(nsTArrayHeader) > 4,
                     "see comment above");
 
 #ifdef DEBUG
-  PRPtrdiff diff = reinterpret_cast<const char*>(GetAutoArrayBuffer(8)) -
+  ptrdiff_t diff = reinterpret_cast<const char*>(GetAutoArrayBuffer(8)) -
                    reinterpret_cast<const char*>(GetAutoArrayBuffer(4));
   NS_ABORT_IF_FALSE(diff >= 0 && diff <= 4, "GetAutoArrayBuffer doesn't do what we expect.");
 #endif
 
   return mHdr == GetAutoArrayBuffer(4) || mHdr == GetAutoArrayBuffer(8);
 }
 
 
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -92,17 +92,17 @@ PLDHashNumber
 PL_DHashStringKey(PLDHashTable *table, const void *key)
 {
     return HashString(static_cast<const char*>(key));
 }
 
 PLDHashNumber
 PL_DHashVoidPtrKeyStub(PLDHashTable *table, const void *key)
 {
-    return (PLDHashNumber)(PRPtrdiff)key >> 2;
+    return (PLDHashNumber)(ptrdiff_t)key >> 2;
 }
 
 bool
 PL_DHashMatchEntryStub(PLDHashTable *table,
                        const PLDHashEntryHdr *entry,
                        const void *key)
 {
     const PLDHashEntryStub *stub = (const PLDHashEntryStub *)entry;
--- a/xpcom/tests/TestTArray.cpp
+++ b/xpcom/tests/TestTArray.cpp
@@ -551,17 +551,17 @@ static bool test_heap() {
 
 //----
 
 // An array |arr| is using its auto buffer if |&arr < arr.Elements()| and
 // |arr.Elements() - &arr| is small.
 
 #define IS_USING_AUTO(arr) \
   ((uintptr_t) &(arr) < (uintptr_t) arr.Elements() && \
-   ((PRPtrdiff)arr.Elements() - (PRPtrdiff)&arr) <= 16)
+   ((ptrdiff_t)arr.Elements() - (ptrdiff_t)&arr) <= 16)
 
 #define CHECK_IS_USING_AUTO(arr) \
   do {                                                    \
     if (!(IS_USING_AUTO(arr))) {                          \
       printf("%s:%d CHECK_IS_USING_AUTO(%s) failed.\n",   \
              __FILE__, __LINE__, #arr);                   \
       return false;                                    \
     }                                                     \