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:
@@ -409,7 +409,7 @@ PluginScriptableObjectParent::ScriptableEnumerate(NPObject* aObject,
|
||||
return false;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < *aCount; index++) {
|
||||
for (uint32_t index = 0; index < *aCount; index++) {
|
||||
PluginIdentifierParent* id =
|
||||
static_cast<PluginIdentifierParent*>(identifiers[index]);
|
||||
(*aIdentifiers)[index] = id->ToNPIdentifier();
|
||||
@@ -708,7 +708,7 @@ PluginScriptableObjectParent::AnswerInvoke(PPluginIdentifierParent* aId,
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
PRUint32 argCount = aArgs.Length();
|
||||
uint32_t argCount = aArgs.Length();
|
||||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aResult = void_t();
|
||||
@@ -716,7 +716,7 @@ PluginScriptableObjectParent::AnswerInvoke(PPluginIdentifierParent* aId,
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index], instance)) {
|
||||
// Don't leak things we've already converted!
|
||||
while (index-- > 0) {
|
||||
@@ -733,7 +733,7 @@ PluginScriptableObjectParent::AnswerInvoke(PPluginIdentifierParent* aId,
|
||||
bool success = npn->invoke(instance->GetNPP(), mObject, id->ToNPIdentifier(),
|
||||
convertedArgs.Elements(), argCount, &result);
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
ReleaseVariant(convertedArgs[index], instance);
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ PluginScriptableObjectParent::AnswerInvokeDefault(const InfallibleTArray<Variant
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
PRUint32 argCount = aArgs.Length();
|
||||
uint32_t argCount = aArgs.Length();
|
||||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aResult = void_t();
|
||||
@@ -799,7 +799,7 @@ PluginScriptableObjectParent::AnswerInvokeDefault(const InfallibleTArray<Variant
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index], instance)) {
|
||||
// Don't leak things we've already converted!
|
||||
while (index-- > 0) {
|
||||
@@ -816,7 +816,7 @@ PluginScriptableObjectParent::AnswerInvokeDefault(const InfallibleTArray<Variant
|
||||
convertedArgs.Elements(), argCount,
|
||||
&result);
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
ReleaseVariant(convertedArgs[index], instance);
|
||||
}
|
||||
|
||||
@@ -1099,7 +1099,7 @@ PluginScriptableObjectParent::AnswerConstruct(const InfallibleTArray<Variant>& a
|
||||
}
|
||||
|
||||
nsAutoTArray<NPVariant, 10> convertedArgs;
|
||||
PRUint32 argCount = aArgs.Length();
|
||||
uint32_t argCount = aArgs.Length();
|
||||
|
||||
if (!convertedArgs.SetLength(argCount)) {
|
||||
*aResult = void_t();
|
||||
@@ -1107,7 +1107,7 @@ PluginScriptableObjectParent::AnswerConstruct(const InfallibleTArray<Variant>& a
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
if (!ConvertToVariant(aArgs[index], convertedArgs[index], instance)) {
|
||||
// Don't leak things we've already converted!
|
||||
while (index-- > 0) {
|
||||
@@ -1123,7 +1123,7 @@ PluginScriptableObjectParent::AnswerConstruct(const InfallibleTArray<Variant>& a
|
||||
bool success = npn->construct(instance->GetNPP(), mObject,
|
||||
convertedArgs.Elements(), argCount, &result);
|
||||
|
||||
for (PRUint32 index = 0; index < argCount; index++) {
|
||||
for (uint32_t index = 0; index < argCount; index++) {
|
||||
ReleaseVariant(convertedArgs[index], instance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user