Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script. Here's the source of the script for
future reference:
function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
! -wholename "*security/nss*" \
! -wholename "*/.hg*" \
! -wholename "obj-ff-dbg*" \
! -name nsXPCOMCID.h \
! -name prtypes.h \
-type f \
\( -iname "*.cpp" \
-o -iname "*.h" \
-o -iname "*.c" \
-o -iname "*.cc" \
-o -iname "*.idl" \
-o -iname "*.ipdl" \
-o -iname "*.ipdlh" \
-o -iname "*.mm" \) | \
xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}
convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t
convert PRIntn int
convert PRUintn unsigned
convert PRSize size_t
convert PROffset32 int32_t
convert PROffset64 int64_t
convert PRPtrdiff ptrdiff_t
convert PRFloat64 double
This commit is contained in:
@@ -244,9 +244,9 @@ nsNPAPIPlugin::PluginCrashed(const nsAString& pluginDumpID,
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX) && defined(__i386__)
|
||||
static PRInt32 OSXVersion()
|
||||
static int32_t OSXVersion()
|
||||
{
|
||||
static PRInt32 gOSXVersion = 0x0;
|
||||
static int32_t gOSXVersion = 0x0;
|
||||
if (gOSXVersion == 0x0) {
|
||||
OSErr err = ::Gestalt(gestaltSystemVersion, (SInt32*)&gOSXVersion);
|
||||
if (err != noErr) {
|
||||
@@ -341,7 +341,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
|
||||
// The "filename.dll" part can contain shell wildcard pattern
|
||||
|
||||
nsCAutoString prefFile(aPluginTag->mFullPath.get());
|
||||
PRInt32 slashPos = prefFile.RFindCharInSet("/\\");
|
||||
int32_t slashPos = prefFile.RFindCharInSet("/\\");
|
||||
if (kNotFound == slashPos)
|
||||
return false;
|
||||
prefFile.Cut(0, slashPos + 1);
|
||||
@@ -366,7 +366,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
|
||||
return false;
|
||||
}
|
||||
|
||||
PRUint32 prefCount;
|
||||
uint32_t prefCount;
|
||||
char** prefNames;
|
||||
nsresult rv = prefs->GetChildList(prefGroupKey.get(),
|
||||
&prefCount, &prefNames);
|
||||
@@ -375,8 +375,8 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
|
||||
bool prefSet = false;
|
||||
|
||||
if (NS_SUCCEEDED(rv) && prefCount > 0) {
|
||||
PRUint32 prefixLength = prefGroupKey.Length();
|
||||
for (PRUint32 currentPref = 0; currentPref < prefCount; currentPref++) {
|
||||
uint32_t prefixLength = prefGroupKey.Length();
|
||||
for (uint32_t currentPref = 0; currentPref < prefCount; currentPref++) {
|
||||
// Get the mask
|
||||
const char* maskStart = prefNames[currentPref] + prefixLength;
|
||||
bool match = false;
|
||||
@@ -1044,7 +1044,7 @@ _write(NPP npp, NPStream *pstream, int32_t len, void *buffer)
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRUint32 count = 0;
|
||||
uint32_t count = 0;
|
||||
nsresult rv = stream->Write((char *)buffer, len, &count);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
@@ -1432,7 +1432,7 @@ _retainobject(NPObject* npobj)
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
int32_t refCnt =
|
||||
#endif
|
||||
PR_ATOMIC_INCREMENT((PRInt32*)&npobj->referenceCount);
|
||||
PR_ATOMIC_INCREMENT((int32_t*)&npobj->referenceCount);
|
||||
NS_LOG_ADDREF(npobj, refCnt, "BrowserNPObject", sizeof(NPObject));
|
||||
}
|
||||
|
||||
@@ -1448,7 +1448,7 @@ _releaseobject(NPObject* npobj)
|
||||
if (!npobj)
|
||||
return;
|
||||
|
||||
int32_t refCnt = PR_ATOMIC_DECREMENT((PRInt32*)&npobj->referenceCount);
|
||||
int32_t refCnt = PR_ATOMIC_DECREMENT((int32_t*)&npobj->referenceCount);
|
||||
NS_LOG_RELEASE(npobj, refCnt, "BrowserNPObject");
|
||||
|
||||
if (refCnt == 0) {
|
||||
@@ -2133,7 +2133,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
||||
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance*)npp->ndata;
|
||||
if (inst) {
|
||||
NPDrawingModel drawingModel;
|
||||
inst->GetDrawingModel((PRInt32*)&drawingModel);
|
||||
inst->GetDrawingModel((int32_t*)&drawingModel);
|
||||
*(NPDrawingModel*)result = drawingModel;
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
@@ -2517,7 +2517,7 @@ _requestread(NPStream *pstream, NPByteRange *rangeList)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
PRInt32 streamtype = NP_NORMAL;
|
||||
int32_t streamtype = NP_NORMAL;
|
||||
|
||||
streamlistener->GetStreamType(&streamtype);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user