diff --git a/content/base/src/nsAttrName.h b/content/base/src/nsAttrName.h index bfbb3073e45..10ad5a95c28 100644 --- a/content/base/src/nsAttrName.h +++ b/content/base/src/nsAttrName.h @@ -16,7 +16,7 @@ #include "nsIAtom.h" #include "nsDOMString.h" -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; #define NS_ATTRNAME_NODEINFO_BIT 1 class nsAttrName diff --git a/content/base/src/nsAttrValue.h b/content/base/src/nsAttrValue.h index b992d32a024..b4e0003171e 100644 --- a/content/base/src/nsAttrValue.h +++ b/content/base/src/nsAttrValue.h @@ -20,7 +20,7 @@ #include "nsCOMPtr.h" #include "SVGAttrValueWrapper.h" -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; class nsAString; class nsIAtom; class nsIDocument; diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 8373f9e0ec2..cb92da4a1ee 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -57,7 +57,7 @@ class nsDOMTokenList; class ContentUnbinder; struct nsRect; -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; /** * A generic base class for DOM elements, implementing many nsIContent, diff --git a/content/base/src/nsPropertyTable.h b/content/base/src/nsPropertyTable.h index 013b35223ef..29982d43676 100644 --- a/content/base/src/nsPropertyTable.h +++ b/content/base/src/nsPropertyTable.h @@ -27,7 +27,7 @@ #include "prtypes.h" class nsIAtom; -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; typedef void (*NSPropertyFunc)(void *aObject, diff --git a/content/xbl/src/nsXBLProtoImplMethod.h b/content/xbl/src/nsXBLProtoImplMethod.h index 6edfdead475..40285b07532 100644 --- a/content/xbl/src/nsXBLProtoImplMethod.h +++ b/content/xbl/src/nsXBLProtoImplMethod.h @@ -107,11 +107,11 @@ public: } void SetUncompiledMethod(nsXBLUncompiledMethod* aUncompiledMethod) { - mUncompiledMethod = PRUptrdiff(aUncompiledMethod) | BIT_UNCOMPILED; + mUncompiledMethod = uintptr_t(aUncompiledMethod) | BIT_UNCOMPILED; } nsXBLUncompiledMethod* GetUncompiledMethod() const { - PRUptrdiff unmasked = mUncompiledMethod & ~BIT_UNCOMPILED; + uintptr_t unmasked = mUncompiledMethod & ~BIT_UNCOMPILED; return reinterpret_cast(unmasked); } @@ -119,7 +119,7 @@ protected: enum { BIT_UNCOMPILED = 1 << 0 }; union { - PRUptrdiff mUncompiledMethod; // An object that represents the method before being compiled. + uintptr_t mUncompiledMethod; // An object that represents the method before being compiled. JSObject* mJSMethodObject; // The JS object for the method (after compilation) }; diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index a87c7255426..cc5dff0366a 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -82,7 +82,7 @@ struct nsExternalDOMClassInfoData : public nsDOMClassInfoData }; -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; // To be used with the nsDOMClassInfoData::mCachedClassInfo pointer. // The low bit is set when we created a generic helper for an external diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index de5c65ac2a3..c6eb58002d1 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -12,7 +12,7 @@ struct JSObject; struct JSContext; class XPCWrappedNativeScope; -typedef PRUptrdiff PtrBits; +typedef uintptr_t PtrBits; namespace mozilla { namespace dom { diff --git a/gfx/qcms/qcmstypes.h b/gfx/qcms/qcmstypes.h index 9bacf8799ac..4653ae2646a 100644 --- a/gfx/qcms/qcmstypes.h +++ b/gfx/qcms/qcmstypes.h @@ -29,7 +29,7 @@ typedef uint64_t uint64_t; /* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */ #include #elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED) -typedef PRUptrdiff uintptr_t; +typedef unsigned long uintptr_t; #endif #endif diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 95ef2d2726e..0dc866bcce3 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -1064,7 +1064,7 @@ private: float x, y, width, height; }; - typedef PRUptrdiff PtrBits; + typedef uintptr_t PtrBits; enum { BLOCK_SIZE_BITS = 7, BLOCK_SIZE = 1 << BLOCK_SIZE_BITS }; // 128-glyph blocks class GlyphWidths { diff --git a/gfx/ycbcr/convert.patch b/gfx/ycbcr/convert.patch index 86f28a5ce7a..2881ce72d37 100644 --- a/gfx/ycbcr/convert.patch +++ b/gfx/ycbcr/convert.patch @@ -322,7 +322,7 @@ diff --git a/gfx/ycbcr/yuv_convert.cpp b/gfx/ycbcr/yuv_convert.cpp uint8 yuvbuf[16 + kFilterBufferSize * 3 + 16]; uint8* ybuf = - reinterpret_cast(reinterpret_cast(yuvbuf + 15) & ~15); -+ reinterpret_cast(reinterpret_cast(yuvbuf + 15) & ~15); ++ reinterpret_cast(reinterpret_cast(yuvbuf + 15) & ~15); uint8* ubuf = ybuf + kFilterBufferSize; uint8* vbuf = ubuf + kFilterBufferSize; // TODO(fbarchard): Fixed point math is off by 1 on negatives. diff --git a/gfx/ycbcr/yuv_convert.cpp b/gfx/ycbcr/yuv_convert.cpp index a46783e3e43..8b35e989082 100644 --- a/gfx/ycbcr/yuv_convert.cpp +++ b/gfx/ycbcr/yuv_convert.cpp @@ -252,7 +252,7 @@ NS_GFX_(void) ScaleYCbCrToRGB32(const uint8* y_buf, // after the end for SSE2 version. uint8 yuvbuf[16 + kFilterBufferSize * 3 + 16]; uint8* ybuf = - reinterpret_cast(reinterpret_cast(yuvbuf + 15) & ~15); + reinterpret_cast(reinterpret_cast(yuvbuf + 15) & ~15); uint8* ubuf = ybuf + kFilterBufferSize; uint8* vbuf = ubuf + kFilterBufferSize; // TODO(fbarchard): Fixed point math is off by 1 on negatives. diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index ea068d1bf4b..81439468532 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5632,13 +5632,13 @@ NS_IMETHODIMP nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent) { IndentBy(out, aIndent); - fprintf(out, "\n", - (unsigned long long)GetDebugStateBits(), PRUptrdiff(mParent)); + fprintf(out, "\" state=\"%016llx\" parent=\"%p\">\n", + (unsigned long long)GetDebugStateBits(), (void*)mParent); aIndent++; DumpBaseRegressionData(aPresContext, out, aIndent); @@ -5655,12 +5655,12 @@ nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t { if (GetNextSibling()) { IndentBy(out, aIndent); - fprintf(out, "\n", PRUptrdiff(GetNextSibling())); + fprintf(out, "\n", (void*)GetNextSibling()); } if (HasView()) { IndentBy(out, aIndent); - fprintf(out, "\n", PRUptrdiff(GetView())); + fprintf(out, "\n", (void*)GetView()); aIndent++; // XXX add in code to dump out view state too... aIndent--; diff --git a/layout/generic/nsSplittableFrame.cpp b/layout/generic/nsSplittableFrame.cpp index 68236ac8fbe..fecf0d972a2 100644 --- a/layout/generic/nsSplittableFrame.cpp +++ b/layout/generic/nsSplittableFrame.cpp @@ -212,11 +212,11 @@ nsSplittableFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out nsFrame::DumpBaseRegressionData(aPresContext, out, aIndent); if (nullptr != mNextContinuation) { IndentBy(out, aIndent); - fprintf(out, "\n", PRUptrdiff(mNextContinuation)); + fprintf(out, "\n", (void*)mNextContinuation); } if (nullptr != mPrevContinuation) { IndentBy(out, aIndent); - fprintf(out, "\n", PRUptrdiff(mPrevContinuation)); + fprintf(out, "\n", (void*)mPrevContinuation); } } diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 233c9594c34..48c78351641 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -1456,7 +1456,7 @@ WebSocketChannel::ApplyMask(uint32_t mask, uint8_t *data, uint64_t len) // but the buffer might not be alligned. So we first deal with // 0 to 3 bytes of preamble individually - while (len && (reinterpret_cast(data) & 3)) { + while (len && (reinterpret_cast(data) & 3)) { *data ^= mask >> 24; mask = PR_ROTATE_LEFT32(mask, 8); data++; diff --git a/tools/trace-malloc/lib/nsTraceMalloc.c b/tools/trace-malloc/lib/nsTraceMalloc.c index 19e19a8eb60..310299c0a2c 100644 --- a/tools/trace-malloc/lib/nsTraceMalloc.c +++ b/tools/trace-malloc/lib/nsTraceMalloc.c @@ -1053,7 +1053,7 @@ static void alloc_freeentry(void *pool, PLHashEntry *he, unsigned flag) if (flag != HT_FREE_ENTRY) return; alloc = (allocation*) he; - if ((PRUptrdiff)(alloc - alloc_heap) < (PRUptrdiff)ALLOC_HEAP_SIZE) { + if ((ptrdiff_t)(alloc - alloc_heap) < (ptrdiff_t)ALLOC_HEAP_SIZE) { alloc->entry.next = &alloc_freelist->entry; alloc_freelist = alloc; } else { diff --git a/xpcom/base/nsStackWalk.h b/xpcom/base/nsStackWalk.h index a77e9cbd636..78ba02ace18 100644 --- a/xpcom/base/nsStackWalk.h +++ b/xpcom/base/nsStackWalk.h @@ -56,7 +56,7 @@ typedef struct { * string and zero if unknown. */ char library[256]; - PRUptrdiff loffset; + ptrdiff_t loffset; /* * The name of the file name and line number of the code * corresponding to the address, or empty string and zero if @@ -69,7 +69,7 @@ typedef struct { * offset within that function, or empty string and zero if unknown. */ char function[256]; - PRUptrdiff foffset; + ptrdiff_t foffset; } nsCodeAddressDetails; /** diff --git a/xpcom/io/nsBinaryStream.cpp b/xpcom/io/nsBinaryStream.cpp index 3c56f1312a5..e671c7fc405 100644 --- a/xpcom/io/nsBinaryStream.cpp +++ b/xpcom/io/nsBinaryStream.cpp @@ -190,7 +190,7 @@ nsBinaryOutputStream::WriteWStringZ(const PRUnichar* aString) if (!copy) return NS_ERROR_OUT_OF_MEMORY; } - NS_ASSERTION((PRUptrdiff(aString) & 0x1) == 0, "aString not properly aligned"); + NS_ASSERTION((uintptr_t(aString) & 0x1) == 0, "aString not properly aligned"); for (uint32_t i = 0; i < length; i++) copy[i] = NS_SWAP16(aString[i]); rv = WriteBytes(reinterpret_cast(copy), byteCount);