Bug 785321 - Replace PRUptrdiff with uintptr_t, prtdiff_t or etc; r=ehsan,jrmuizel

This commit is contained in:
Makoto Kato 2012-09-14 16:09:52 -04:00
parent c7a6a4a9a1
commit 909aba1eb8
17 changed files with 25 additions and 25 deletions

View File

@ -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

View File

@ -20,7 +20,7 @@
#include "nsCOMPtr.h"
#include "SVGAttrValueWrapper.h"
typedef PRUptrdiff PtrBits;
typedef uintptr_t PtrBits;
class nsAString;
class nsIAtom;
class nsIDocument;

View File

@ -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,

View File

@ -27,7 +27,7 @@
#include "prtypes.h"
class nsIAtom;
typedef PRUptrdiff PtrBits;
typedef uintptr_t PtrBits;
typedef void
(*NSPropertyFunc)(void *aObject,

View File

@ -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<nsXBLUncompiledMethod*>(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)
};

View File

@ -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

View File

@ -12,7 +12,7 @@ struct JSObject;
struct JSContext;
class XPCWrappedNativeScope;
typedef PRUptrdiff PtrBits;
typedef uintptr_t PtrBits;
namespace mozilla {
namespace dom {

View File

@ -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 <stdlib.h>
#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
typedef PRUptrdiff uintptr_t;
typedef unsigned long uintptr_t;
#endif
#endif

View File

@ -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 {

View File

@ -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<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
+ reinterpret_cast<uint8*>(reinterpret_cast<PRUptrdiff>(yuvbuf + 15) & ~15);
+ reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
uint8* ubuf = ybuf + kFilterBufferSize;
uint8* vbuf = ubuf + kFilterBufferSize;
// TODO(fbarchard): Fixed point math is off by 1 on negatives.

View File

@ -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<uint8*>(reinterpret_cast<PRUptrdiff>(yuvbuf + 15) & ~15);
reinterpret_cast<uint8*>(reinterpret_cast<uintptr_t>(yuvbuf + 15) & ~15);
uint8* ubuf = ybuf + kFilterBufferSize;
uint8* vbuf = ubuf + kFilterBufferSize;
// TODO(fbarchard): Fixed point math is off by 1 on negatives.

View File

@ -5632,13 +5632,13 @@ NS_IMETHODIMP
nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent)
{
IndentBy(out, aIndent);
fprintf(out, "<frame va=\"%ld\" type=\"", PRUptrdiff(this));
fprintf(out, "<frame va=\"%p\" type=\"", (void*)this);
nsAutoString name;
GetFrameName(name);
XMLQuote(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), out);
fprintf(out, "\" state=\"%016llx\" parent=\"%ld\">\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, "<next-sibling va=\"%ld\"/>\n", PRUptrdiff(GetNextSibling()));
fprintf(out, "<next-sibling va=\"%p\"/>\n", (void*)GetNextSibling());
}
if (HasView()) {
IndentBy(out, aIndent);
fprintf(out, "<view va=\"%ld\">\n", PRUptrdiff(GetView()));
fprintf(out, "<view va=\"%p\">\n", (void*)GetView());
aIndent++;
// XXX add in code to dump out view state too...
aIndent--;

View File

@ -212,11 +212,11 @@ nsSplittableFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out
nsFrame::DumpBaseRegressionData(aPresContext, out, aIndent);
if (nullptr != mNextContinuation) {
IndentBy(out, aIndent);
fprintf(out, "<next-continuation va=\"%ld\"/>\n", PRUptrdiff(mNextContinuation));
fprintf(out, "<next-continuation va=\"%p\"/>\n", (void*)mNextContinuation);
}
if (nullptr != mPrevContinuation) {
IndentBy(out, aIndent);
fprintf(out, "<prev-continuation va=\"%ld\"/>\n", PRUptrdiff(mPrevContinuation));
fprintf(out, "<prev-continuation va=\"%p\"/>\n", (void*)mPrevContinuation);
}
}

View File

@ -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<PRUptrdiff>(data) & 3)) {
while (len && (reinterpret_cast<uintptr_t>(data) & 3)) {
*data ^= mask >> 24;
mask = PR_ROTATE_LEFT32(mask, 8);
data++;

View File

@ -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 {

View File

@ -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;
/**

View File

@ -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<const char*>(copy), byteCount);