mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 714057 - Remove uintn users from XPConnect; r=bholley+khuey
This commit is contained in:
parent
766a34f6ff
commit
609cf3bed0
@ -53,4 +53,8 @@ EXTRA_JS_MODULES = XPCOMUtils.jsm ISO8601DateUtils.jsm
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -DJSFILE -DJS_THREADSAFE
|
||||
DEFINES += \
|
||||
-DJSFILE \
|
||||
-DJS_THREADSAFE \
|
||||
-DNO_NSPR_10_SUPPORT \
|
||||
$(NULL)
|
||||
|
@ -441,7 +441,7 @@ mozJSComponentLoader::ReallyInit()
|
||||
if (!mContext)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
uint32 options = JS_GetOptions(mContext);
|
||||
uint32_t options = JS_GetOptions(mContext);
|
||||
JS_SetOptions(mContext, options | JSOPTION_XML);
|
||||
|
||||
// Always use the latest js version
|
||||
@ -791,7 +791,7 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
||||
// If |exception| is non-null, then our caller wants us to propagate
|
||||
// any exceptions out to our caller. Ensure that the engine doesn't
|
||||
// eagerly report the exception.
|
||||
uint32 oldopts = JS_GetOptions(cx);
|
||||
uint32_t oldopts = JS_GetOptions(cx);
|
||||
JS_SetOptions(cx, oldopts | JSOPTION_NO_SCRIPT_RVAL |
|
||||
(exception ? JSOPTION_DONT_REPORT_UNCAUGHT : 0));
|
||||
|
||||
@ -965,7 +965,7 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
||||
// See bug 384168.
|
||||
*aGlobal = global;
|
||||
|
||||
uint32 oldopts = JS_GetOptions(cx);
|
||||
uint32_t oldopts = JS_GetOptions(cx);
|
||||
JS_SetOptions(cx, oldopts |
|
||||
(exception ? JSOPTION_DONT_REPORT_UNCAUGHT : 0));
|
||||
bool ok = JS_ExecuteScriptVersion(cx, global, script, NULL, JSVERSION_LATEST);
|
||||
|
@ -65,6 +65,10 @@ endif
|
||||
|
||||
LIBS += $(NSPR_LIBS)
|
||||
|
||||
DEFINES += \
|
||||
-DNO_NSPR_10_SUPPORT \
|
||||
$(NULL)
|
||||
|
||||
NSDISTMODE = copy
|
||||
|
||||
ifdef _MSC_VER
|
||||
|
@ -723,7 +723,7 @@ GetChildGlobalObject(JSContext* cx,
|
||||
*/
|
||||
static const struct JSOption {
|
||||
const char *name;
|
||||
uint32 flag;
|
||||
uint32_t flag;
|
||||
} js_options[] = {
|
||||
{"atline", JSOPTION_ATLINE},
|
||||
{"relimit", JSOPTION_RELIMIT},
|
||||
@ -732,7 +732,7 @@ static const struct JSOption {
|
||||
{"xml", JSOPTION_XML},
|
||||
};
|
||||
|
||||
static uint32
|
||||
static uint32_t
|
||||
MapContextOptionNameToFlag(JSContext* cx, const char* name)
|
||||
{
|
||||
for (size_t i = 0; i < ArrayLength(js_options); ++i) {
|
||||
|
@ -116,6 +116,7 @@ DEFINES += \
|
||||
-DJSFILE \
|
||||
-DJS_THREADSAFE \
|
||||
-DEXPORT_XPC_API \
|
||||
-DNO_NSPR_10_SUPPORT \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
@ -3812,16 +3812,16 @@ nsXPCComponents_Utils::CanSetProperty(const nsIID * iid, const PRUnichar *proper
|
||||
}
|
||||
|
||||
nsresult
|
||||
GetBoolOption(JSContext* cx, uint32 aOption, bool* aValue)
|
||||
GetBoolOption(JSContext* cx, uint32_t aOption, bool* aValue)
|
||||
{
|
||||
*aValue = !!(JS_GetOptions(cx) & aOption);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
SetBoolOption(JSContext* cx, uint32 aOption, bool aValue)
|
||||
SetBoolOption(JSContext* cx, uint32_t aOption, bool aValue)
|
||||
{
|
||||
uint32 options = JS_GetOptions(cx);
|
||||
uint32_t options = JS_GetOptions(cx);
|
||||
if (aValue) {
|
||||
options |= aOption;
|
||||
} else {
|
||||
|
@ -78,7 +78,7 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp,
|
||||
const char* filename = nsnull;
|
||||
PRInt32 lineno = 0;
|
||||
JSFunction* fun = nsnull;
|
||||
uint32 namedArgCount = 0;
|
||||
uint32_t namedArgCount = 0;
|
||||
jsval val;
|
||||
JSBool isString;
|
||||
|
||||
@ -129,7 +129,7 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp,
|
||||
// print the function arguments
|
||||
|
||||
if (showArgs && callObj) {
|
||||
for (uint32 i = 0; i < callProps.length; i++) {
|
||||
for (uint32_t i = 0; i < callProps.length; i++) {
|
||||
JSPropertyDesc* desc = &callProps.array[i];
|
||||
if (desc->flags & JSPD_ARGUMENT) {
|
||||
JSAutoByteString nameBytes;
|
||||
@ -160,7 +160,7 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp,
|
||||
if (JS_GetProperty(cx, argsObj, "length", &val) &&
|
||||
JS_ValueToECMAUint32(cx, val, &argCount) &&
|
||||
argCount > namedArgCount) {
|
||||
for (uint32 k = namedArgCount; k < argCount; k++) {
|
||||
for (uint32_t k = namedArgCount; k < argCount; k++) {
|
||||
char number[8];
|
||||
JS_snprintf(number, 8, "%d", (int) k);
|
||||
|
||||
@ -190,7 +190,7 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp,
|
||||
// print local variables
|
||||
|
||||
if (showLocals && callProps.array) {
|
||||
for (uint32 i = 0; i < callProps.length; i++) {
|
||||
for (uint32_t i = 0; i < callProps.length; i++) {
|
||||
JSPropertyDesc* desc = &callProps.array[i];
|
||||
if (desc->flags & JSPD_VARIABLE) {
|
||||
JSAutoByteString nameBytes;
|
||||
@ -230,7 +230,7 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp,
|
||||
|
||||
if (showThisProps && thisProps.array) {
|
||||
|
||||
for (uint32 i = 0; i < thisProps.length; i++) {
|
||||
for (uint32_t i = 0; i < thisProps.length; i++) {
|
||||
JSPropertyDesc* desc = &thisProps.array[i];
|
||||
if (desc->flags & JSPD_ENUMERATE) {
|
||||
JSAutoByteString nameBytes;
|
||||
|
@ -1110,7 +1110,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
// clean up and destroy maps...
|
||||
if (mWrappedJSMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mWrappedJSMap->Count();
|
||||
uint32_t count = mWrappedJSMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live wrapped JSObject\n", (int)count);
|
||||
#endif
|
||||
@ -1120,7 +1120,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mWrappedJSClassMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mWrappedJSClassMap->Count();
|
||||
uint32_t count = mWrappedJSClassMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live nsXPCWrappedJSClass\n", (int)count);
|
||||
#endif
|
||||
@ -1129,7 +1129,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mIID2NativeInterfaceMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mIID2NativeInterfaceMap->Count();
|
||||
uint32_t count = mIID2NativeInterfaceMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live XPCNativeInterfaces\n", (int)count);
|
||||
#endif
|
||||
@ -1138,7 +1138,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mClassInfo2NativeSetMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mClassInfo2NativeSetMap->Count();
|
||||
uint32_t count = mClassInfo2NativeSetMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live XPCNativeSets\n", (int)count);
|
||||
#endif
|
||||
@ -1147,7 +1147,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mNativeSetMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mNativeSetMap->Count();
|
||||
uint32_t count = mNativeSetMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live XPCNativeSets\n", (int)count);
|
||||
#endif
|
||||
@ -1159,7 +1159,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mThisTranslatorMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mThisTranslatorMap->Count();
|
||||
uint32_t count = mThisTranslatorMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live ThisTranslator\n", (int)count);
|
||||
#endif
|
||||
@ -1179,7 +1179,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mNativeScriptableSharedMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mNativeScriptableSharedMap->Count();
|
||||
uint32_t count = mNativeScriptableSharedMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live XPCNativeScriptableShared\n", (int)count);
|
||||
#endif
|
||||
@ -1188,7 +1188,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mDyingWrappedNativeProtoMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mDyingWrappedNativeProtoMap->Count();
|
||||
uint32_t count = mDyingWrappedNativeProtoMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live but dying XPCWrappedNativeProto\n", (int)count);
|
||||
#endif
|
||||
@ -1197,7 +1197,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mDetachedWrappedNativeProtoMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mDetachedWrappedNativeProtoMap->Count();
|
||||
uint32_t count = mDetachedWrappedNativeProtoMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live detached XPCWrappedNativeProto\n", (int)count);
|
||||
#endif
|
||||
@ -1206,7 +1206,7 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
|
||||
if (mExplicitNativeWrapperMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32 count = mExplicitNativeWrapperMap->Count();
|
||||
uint32_t count = mExplicitNativeWrapperMap->Count();
|
||||
if (count)
|
||||
printf("deleting XPCJSRuntime with %d live explicit XPCNativeWrapper\n", (int)count);
|
||||
#endif
|
||||
@ -1274,7 +1274,7 @@ ChunkCallback(JSContext *cx, void *vdata, js::gc::Chunk *chunk)
|
||||
// Nb: This function is only called for dirty chunks, which is why we
|
||||
// increment gcHeapChunkDirtyDecommitted.
|
||||
IterateData *data = static_cast<IterateData *>(vdata);
|
||||
for (uint32 i = 0; i < js::gc::ArenasPerChunk; i++)
|
||||
for (uint32_t i = 0; i < js::gc::ArenasPerChunk; i++)
|
||||
if (chunk->decommittedArenas.get(i))
|
||||
data->gcHeapChunkDirtyDecommitted += js::gc::ArenaSize;
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ public:
|
||||
JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
|
||||
@ -166,8 +166,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, wrapper->GetIdentityObject(), JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
|
||||
@ -228,8 +228,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, &clazz->GetIID(), JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~IID2WrappedJSClassMap();
|
||||
@ -285,8 +285,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, iface->GetIID(), JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
|
||||
@ -344,8 +344,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, info, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
// ClassInfo2NativeSetMap holds pointers to *some* XPCNativeSets.
|
||||
@ -404,8 +404,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, info, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
|
||||
@ -477,8 +477,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, &key, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
|
||||
@ -546,8 +546,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, &iid, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~IID2ThisTranslatorMap();
|
||||
@ -583,8 +583,8 @@ public:
|
||||
JSBool GetNewOrUsed(uint32_t flags, char* name, bool isGlobal,
|
||||
PRUint32 interfacesBitmap, XPCNativeScriptableInfo* si);
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~XPCNativeScriptableSharedMap();
|
||||
@ -621,8 +621,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, proto, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~XPCWrappedNativeProtoMap();
|
||||
@ -657,8 +657,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, nw, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~XPCNativeWrapperMap();
|
||||
@ -728,8 +728,8 @@ public:
|
||||
JS_DHashTableOperate(mTable, wrapper, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{return JS_DHashTableEnumerate(mTable, f, arg);}
|
||||
|
||||
~WrappedNative2WrapperMap();
|
||||
@ -793,9 +793,9 @@ public:
|
||||
JS_DHashTableOperate(mTable, key, JS_DHASH_REMOVE);
|
||||
}
|
||||
|
||||
inline uint32 Count() {return mTable->entryCount;}
|
||||
inline uint32_t Count() {return mTable->entryCount;}
|
||||
|
||||
inline uint32 Enumerate(JSDHashEnumerator f, void *arg)
|
||||
inline uint32_t Enumerate(JSDHashEnumerator f, void *arg)
|
||||
{
|
||||
return JS_DHashTableEnumerate(mTable, f, arg);
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ xpc_qsDefineQuickStubs(JSContext *cx, JSObject *proto, uintN flags,
|
||||
* front of 'interfaces' overwrite those toward the back.
|
||||
*/
|
||||
bool definedProperty = false;
|
||||
for (uint32 i = ifacec; i-- != 0;) {
|
||||
for (uint32_t i = ifacec; i-- != 0;) {
|
||||
const nsID &iid = *interfaces[i];
|
||||
const xpc_qsHashEntry *entry =
|
||||
LookupInterfaceOrAncestor(tableSize, table, iid);
|
||||
|
@ -262,28 +262,28 @@ XPCArrayHomogenizer::GetTypeForArray(XPCCallContext& ccx, JSObject* array,
|
||||
|
||||
switch (state) {
|
||||
case tInt :
|
||||
*resultType = nsXPTType((uint8)TD_INT32);
|
||||
*resultType = nsXPTType((uint8_t)TD_INT32);
|
||||
break;
|
||||
case tDbl :
|
||||
*resultType = nsXPTType((uint8)TD_DOUBLE);
|
||||
*resultType = nsXPTType((uint8_t)TD_DOUBLE);
|
||||
break;
|
||||
case tBool:
|
||||
*resultType = nsXPTType((uint8)TD_BOOL);
|
||||
*resultType = nsXPTType((uint8_t)TD_BOOL);
|
||||
break;
|
||||
case tStr :
|
||||
*resultType = nsXPTType((uint8)TD_PWSTRING);
|
||||
*resultType = nsXPTType((uint8_t)TD_PWSTRING);
|
||||
break;
|
||||
case tID :
|
||||
*resultType = nsXPTType((uint8)TD_PNSIID);
|
||||
*resultType = nsXPTType((uint8_t)TD_PNSIID);
|
||||
break;
|
||||
case tISup:
|
||||
*resultType = nsXPTType((uint8)TD_INTERFACE_IS_TYPE);
|
||||
*resultType = nsXPTType((uint8_t)TD_INTERFACE_IS_TYPE);
|
||||
*resultID = NS_GET_IID(nsISupports);
|
||||
break;
|
||||
case tNull:
|
||||
// FALL THROUGH
|
||||
case tVar :
|
||||
*resultType = nsXPTType((uint8)TD_INTERFACE_IS_TYPE);
|
||||
*resultType = nsXPTType((uint8_t)TD_INTERFACE_IS_TYPE);
|
||||
*resultID = NS_GET_IID(nsIVariant);
|
||||
break;
|
||||
case tArr :
|
||||
@ -497,67 +497,67 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
|
||||
case nsIDataType::VTYPE_CHAR:
|
||||
if (NS_FAILED(variant->GetAsChar(&xpctvar.val.c)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_CHAR;
|
||||
xpctvar.type = (uint8_t)TD_CHAR;
|
||||
break;
|
||||
case nsIDataType::VTYPE_WCHAR:
|
||||
if (NS_FAILED(variant->GetAsWChar(&xpctvar.val.wc)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_WCHAR;
|
||||
xpctvar.type = (uint8_t)TD_WCHAR;
|
||||
break;
|
||||
case nsIDataType::VTYPE_ID:
|
||||
if (NS_FAILED(variant->GetAsID(&iid)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_PNSIID;
|
||||
xpctvar.type = (uint8_t)TD_PNSIID;
|
||||
xpctvar.val.p = &iid;
|
||||
break;
|
||||
case nsIDataType::VTYPE_ASTRING:
|
||||
if (NS_FAILED(variant->GetAsAString(astring)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_ASTRING;
|
||||
xpctvar.type = (uint8_t)TD_ASTRING;
|
||||
xpctvar.val.p = &astring;
|
||||
break;
|
||||
case nsIDataType::VTYPE_DOMSTRING:
|
||||
if (NS_FAILED(variant->GetAsAString(astring)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_DOMSTRING;
|
||||
xpctvar.type = (uint8_t)TD_DOMSTRING;
|
||||
xpctvar.val.p = &astring;
|
||||
break;
|
||||
case nsIDataType::VTYPE_CSTRING:
|
||||
if (NS_FAILED(variant->GetAsACString(cString)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_CSTRING;
|
||||
xpctvar.type = (uint8_t)TD_CSTRING;
|
||||
xpctvar.val.p = &cString;
|
||||
break;
|
||||
case nsIDataType::VTYPE_UTF8STRING:
|
||||
if (NS_FAILED(variant->GetAsAUTF8String(utf8String)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_UTF8STRING;
|
||||
xpctvar.type = (uint8_t)TD_UTF8STRING;
|
||||
xpctvar.val.p = &utf8String;
|
||||
break;
|
||||
case nsIDataType::VTYPE_CHAR_STR:
|
||||
if (NS_FAILED(variant->GetAsString((char**)&xpctvar.val.p)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_PSTRING;
|
||||
xpctvar.type = (uint8_t)TD_PSTRING;
|
||||
xpctvar.SetValNeedsCleanup();
|
||||
break;
|
||||
case nsIDataType::VTYPE_STRING_SIZE_IS:
|
||||
if (NS_FAILED(variant->GetAsStringWithSize(&size,
|
||||
(char**)&xpctvar.val.p)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_PSTRING_SIZE_IS;
|
||||
xpctvar.type = (uint8_t)TD_PSTRING_SIZE_IS;
|
||||
xpctvar.SetValNeedsCleanup();
|
||||
break;
|
||||
case nsIDataType::VTYPE_WCHAR_STR:
|
||||
if (NS_FAILED(variant->GetAsWString((PRUnichar**)&xpctvar.val.p)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_PWSTRING;
|
||||
xpctvar.type = (uint8_t)TD_PWSTRING;
|
||||
xpctvar.SetValNeedsCleanup();
|
||||
break;
|
||||
case nsIDataType::VTYPE_WSTRING_SIZE_IS:
|
||||
if (NS_FAILED(variant->GetAsWStringWithSize(&size,
|
||||
(PRUnichar**)&xpctvar.val.p)))
|
||||
return false;
|
||||
xpctvar.type = (uint8)TD_PWSTRING_SIZE_IS;
|
||||
xpctvar.type = (uint8_t)TD_PWSTRING_SIZE_IS;
|
||||
xpctvar.SetValNeedsCleanup();
|
||||
break;
|
||||
case nsIDataType::VTYPE_INTERFACE:
|
||||
@ -570,7 +570,7 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
|
||||
iid = *piid;
|
||||
nsMemory::Free((char*)piid);
|
||||
|
||||
xpctvar.type = (uint8)TD_INTERFACE_IS_TYPE;
|
||||
xpctvar.type = (uint8_t)TD_INTERFACE_IS_TYPE;
|
||||
if (xpctvar.val.p)
|
||||
xpctvar.SetValNeedsCleanup();
|
||||
break;
|
||||
@ -610,23 +610,23 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
|
||||
case nsIDataType::VTYPE_BOOL:
|
||||
case nsIDataType::VTYPE_CHAR:
|
||||
case nsIDataType::VTYPE_WCHAR:
|
||||
conversionType = nsXPTType((uint8)elementType);
|
||||
conversionType = nsXPTType((uint8_t)elementType);
|
||||
break;
|
||||
|
||||
case nsIDataType::VTYPE_ID:
|
||||
case nsIDataType::VTYPE_CHAR_STR:
|
||||
case nsIDataType::VTYPE_WCHAR_STR:
|
||||
conversionType = nsXPTType((uint8)elementType);
|
||||
conversionType = nsXPTType((uint8_t)elementType);
|
||||
break;
|
||||
|
||||
case nsIDataType::VTYPE_INTERFACE:
|
||||
pid = &NS_GET_IID(nsISupports);
|
||||
conversionType = nsXPTType((uint8)elementType);
|
||||
conversionType = nsXPTType((uint8_t)elementType);
|
||||
break;
|
||||
|
||||
case nsIDataType::VTYPE_INTERFACE_IS:
|
||||
pid = &du.u.array.mArrayInterfaceID;
|
||||
conversionType = nsXPTType((uint8)elementType);
|
||||
conversionType = nsXPTType((uint8_t)elementType);
|
||||
break;
|
||||
|
||||
// The rest are illegal.
|
||||
|
@ -52,7 +52,7 @@
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsXPCWrappedJSClass, nsIXPCWrappedJSClass)
|
||||
|
||||
// the value of this variable is never used - we use its address as a sentinel
|
||||
static uint32 zero_methods_descriptor;
|
||||
static uint32_t zero_methods_descriptor;
|
||||
|
||||
bool AutoScriptEvaluate::StartEvaluating(JSObject *scope, JSErrorReporter errorReporter)
|
||||
{
|
||||
@ -190,11 +190,11 @@ nsXPCWrappedJSClass::nsXPCWrappedJSClass(XPCCallContext& ccx, REFNSIID aIID,
|
||||
mRuntime->GetWrappedJSClassMap()->Add(this);
|
||||
}
|
||||
|
||||
uint16 methodCount;
|
||||
uint16_t methodCount;
|
||||
if (NS_SUCCEEDED(mInfo->GetMethodCount(&methodCount))) {
|
||||
if (methodCount) {
|
||||
int wordCount = (methodCount/32)+1;
|
||||
if (nsnull != (mDescriptors = new uint32[wordCount])) {
|
||||
if (nsnull != (mDescriptors = new uint32_t[wordCount])) {
|
||||
int i;
|
||||
// init flags to 0;
|
||||
for (i = wordCount-1; i >= 0; i--)
|
||||
@ -292,7 +292,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(XPCCallContext& ccx,
|
||||
// is not an exception that is ever worth reporting, but we don't want
|
||||
// to eat all exceptions either.
|
||||
|
||||
uint32 oldOpts =
|
||||
uint32_t oldOpts =
|
||||
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_DONT_REPORT_UNCAUGHT);
|
||||
|
||||
jsval args[1] = {OBJECT_TO_JSVAL(id)};
|
||||
@ -361,7 +361,7 @@ GetNamedPropertyAsVariantRaw(XPCCallContext& ccx,
|
||||
nsIVariant** aResult,
|
||||
nsresult* pErr)
|
||||
{
|
||||
nsXPTType type = nsXPTType((uint8)TD_INTERFACE_TYPE);
|
||||
nsXPTType type = nsXPTType((uint8_t)TD_INTERFACE_TYPE);
|
||||
jsval val;
|
||||
|
||||
return JS_GetPropertyById(ccx, aJSObj, aName, &val) &&
|
||||
@ -868,12 +868,12 @@ JSBool
|
||||
nsXPCWrappedJSClass::GetArraySizeFromParam(JSContext* cx,
|
||||
const XPTMethodDescriptor* method,
|
||||
const nsXPTParamInfo& param,
|
||||
uint16 methodIndex,
|
||||
uint8 paramIndex,
|
||||
uint16_t methodIndex,
|
||||
uint8_t paramIndex,
|
||||
nsXPTCMiniVariant* nativeParams,
|
||||
uint32_t* result)
|
||||
{
|
||||
uint8 argnum;
|
||||
uint8_t argnum;
|
||||
nsresult rv;
|
||||
|
||||
rv = mInfo->GetSizeIsArgNumberForParam(methodIndex, ¶m, 0, &argnum);
|
||||
@ -900,12 +900,12 @@ JSBool
|
||||
nsXPCWrappedJSClass::GetInterfaceTypeFromParam(JSContext* cx,
|
||||
const XPTMethodDescriptor* method,
|
||||
const nsXPTParamInfo& param,
|
||||
uint16 methodIndex,
|
||||
uint16_t methodIndex,
|
||||
const nsXPTType& type,
|
||||
nsXPTCMiniVariant* nativeParams,
|
||||
nsID* result)
|
||||
{
|
||||
uint8 type_tag = type.TagPart();
|
||||
uint8_t type_tag = type.TagPart();
|
||||
|
||||
if (type_tag == nsXPTType::T_INTERFACE) {
|
||||
if (NS_SUCCEEDED(GetInterfaceInfo()->
|
||||
@ -913,7 +913,7 @@ nsXPCWrappedJSClass::GetInterfaceTypeFromParam(JSContext* cx,
|
||||
return true;
|
||||
}
|
||||
} else if (type_tag == nsXPTType::T_INTERFACE_IS) {
|
||||
uint8 argnum;
|
||||
uint8_t argnum;
|
||||
nsresult rv;
|
||||
rv = mInfo->GetInterfaceIsArgNumberForParam(methodIndex,
|
||||
¶m, &argnum);
|
||||
@ -1176,15 +1176,15 @@ class ContextPrincipalGuard
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
|
||||
nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
|
||||
const XPTMethodDescriptor* info,
|
||||
nsXPTCMiniVariant* nativeParams)
|
||||
{
|
||||
jsval* sp = nsnull;
|
||||
jsval* argv = nsnull;
|
||||
uint8 i;
|
||||
uint8 argc=0;
|
||||
uint8 paramCount=0;
|
||||
uint8_t i;
|
||||
uint8_t argc=0;
|
||||
uint8_t paramCount=0;
|
||||
nsresult retval = NS_ERROR_FAILURE;
|
||||
nsresult pending_result = NS_OK;
|
||||
JSBool success;
|
||||
@ -1522,7 +1522,7 @@ pre_call_clean_up:
|
||||
rval = *argv;
|
||||
} else {
|
||||
if (!JSVAL_IS_PRIMITIVE(fval)) {
|
||||
uint32 oldOpts = JS_GetOptions(cx);
|
||||
uint32_t oldOpts = JS_GetOptions(cx);
|
||||
JS_SetOptions(cx, oldOpts | JSOPTION_DONT_REPORT_UNCAUGHT);
|
||||
|
||||
success = JS_CallFunctionValue(cx, thisObj, fval, argc, argv, &rval);
|
||||
@ -1586,7 +1586,7 @@ pre_call_clean_up:
|
||||
}
|
||||
|
||||
jsval val;
|
||||
uint8 type_tag = type.TagPart();
|
||||
uint8_t type_tag = type.TagPart();
|
||||
nsXPTCMiniVariant* pv;
|
||||
|
||||
if (param.IsDipper())
|
||||
@ -1693,7 +1693,7 @@ pre_call_clean_up:
|
||||
// We didn't manage all the result conversions!
|
||||
// We have to cleanup any junk that *did* get converted.
|
||||
|
||||
for (uint8 k = 0; k < i; k++) {
|
||||
for (uint8_t k = 0; k < i; k++) {
|
||||
const nsXPTParamInfo& param = info->params[k];
|
||||
if (!param.IsOut())
|
||||
continue;
|
||||
@ -1766,9 +1766,9 @@ nsXPCWrappedJSClass::DebugDump(PRInt16 depth)
|
||||
if (iid)
|
||||
NS_Free(iid);
|
||||
XPC_LOG_ALWAYS(("InterfaceInfo @ %x", mInfo));
|
||||
uint16 methodCount = 0;
|
||||
uint16_t methodCount = 0;
|
||||
if (depth) {
|
||||
uint16 i;
|
||||
uint16_t i;
|
||||
nsCOMPtr<nsIInterfaceInfo> parent;
|
||||
XPC_LOG_INDENT();
|
||||
mInfo->GetParent(getter_AddRefs(parent));
|
||||
@ -1784,7 +1784,7 @@ nsXPCWrappedJSClass::DebugDump(PRInt16 depth)
|
||||
if (depth && mDescriptors && methodCount) {
|
||||
depth--;
|
||||
XPC_LOG_INDENT();
|
||||
for (uint16 i = 0; i < methodCount; i++) {
|
||||
for (uint16_t i = 0; i < methodCount; i++) {
|
||||
XPC_LOG_ALWAYS(("Method %d is %s%s", \
|
||||
i, IsReflectable(i) ? "":" NOT ","reflectable"));
|
||||
}
|
||||
|
@ -2076,26 +2076,26 @@ class CallMethodHelper
|
||||
nsIInterfaceInfo* const mIFaceInfo;
|
||||
const nsXPTMethodInfo* mMethodInfo;
|
||||
nsISupports* const mCallee;
|
||||
const uint16 mVTableIndex;
|
||||
const uint16_t mVTableIndex;
|
||||
const jsid mIdxValueId;
|
||||
|
||||
nsAutoTArray<nsXPTCVariant, 8> mDispatchParams;
|
||||
uint8 mJSContextIndex; // TODO make const
|
||||
uint8 mOptArgcIndex; // TODO make const
|
||||
uint8_t mJSContextIndex; // TODO make const
|
||||
uint8_t mOptArgcIndex; // TODO make const
|
||||
|
||||
jsval* const mArgv;
|
||||
const PRUint32 mArgc;
|
||||
|
||||
JS_ALWAYS_INLINE JSBool
|
||||
GetArraySizeFromParam(uint8 paramIndex, uint32_t* result) const;
|
||||
GetArraySizeFromParam(uint8_t paramIndex, uint32_t* result) const;
|
||||
|
||||
JS_ALWAYS_INLINE JSBool
|
||||
GetInterfaceTypeFromParam(uint8 paramIndex,
|
||||
GetInterfaceTypeFromParam(uint8_t paramIndex,
|
||||
const nsXPTType& datum_type,
|
||||
nsID* result) const;
|
||||
|
||||
JS_ALWAYS_INLINE JSBool
|
||||
GetOutParamSource(uint8 paramIndex, jsval* srcp) const;
|
||||
GetOutParamSource(uint8_t paramIndex, jsval* srcp) const;
|
||||
|
||||
JS_ALWAYS_INLINE JSBool
|
||||
GatherAndConvertResults();
|
||||
@ -2104,7 +2104,7 @@ class CallMethodHelper
|
||||
QueryInterfaceFastPath() const;
|
||||
|
||||
nsXPTCVariant*
|
||||
GetDispatchParam(uint8 paramIndex)
|
||||
GetDispatchParam(uint8_t paramIndex)
|
||||
{
|
||||
if (paramIndex >= mJSContextIndex)
|
||||
paramIndex += 1;
|
||||
@ -2113,7 +2113,7 @@ class CallMethodHelper
|
||||
return &mDispatchParams[paramIndex];
|
||||
}
|
||||
const nsXPTCVariant*
|
||||
GetDispatchParam(uint8 paramIndex) const
|
||||
GetDispatchParam(uint8_t paramIndex) const
|
||||
{
|
||||
return const_cast<CallMethodHelper*>(this)->GetDispatchParam(paramIndex);
|
||||
}
|
||||
@ -2121,9 +2121,9 @@ class CallMethodHelper
|
||||
JS_ALWAYS_INLINE JSBool InitializeDispatchParams();
|
||||
|
||||
JS_ALWAYS_INLINE JSBool ConvertIndependentParams(JSBool* foundDependentParam);
|
||||
JS_ALWAYS_INLINE JSBool ConvertIndependentParam(uint8 i);
|
||||
JS_ALWAYS_INLINE JSBool ConvertIndependentParam(uint8_t i);
|
||||
JS_ALWAYS_INLINE JSBool ConvertDependentParams();
|
||||
JS_ALWAYS_INLINE JSBool ConvertDependentParam(uint8 i);
|
||||
JS_ALWAYS_INLINE JSBool ConvertDependentParam(uint8_t i);
|
||||
|
||||
JS_ALWAYS_INLINE void CleanupParam(nsXPTCMiniVariant& param, nsXPTType& type);
|
||||
|
||||
@ -2265,9 +2265,9 @@ CallMethodHelper::Call()
|
||||
|
||||
CallMethodHelper::~CallMethodHelper()
|
||||
{
|
||||
uint8 paramCount = mMethodInfo->GetParamCount();
|
||||
uint8_t paramCount = mMethodInfo->GetParamCount();
|
||||
if (mDispatchParams.Length()) {
|
||||
for (uint8 i = 0; i < paramCount; i++) {
|
||||
for (uint8_t i = 0; i < paramCount; i++) {
|
||||
nsXPTCVariant* dp = GetDispatchParam(i);
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
|
||||
@ -2313,7 +2313,7 @@ CallMethodHelper::~CallMethodHelper()
|
||||
}
|
||||
|
||||
JSBool
|
||||
CallMethodHelper::GetArraySizeFromParam(uint8 paramIndex,
|
||||
CallMethodHelper::GetArraySizeFromParam(uint8_t paramIndex,
|
||||
uint32_t* result) const
|
||||
{
|
||||
nsresult rv;
|
||||
@ -2331,13 +2331,13 @@ CallMethodHelper::GetArraySizeFromParam(uint8 paramIndex,
|
||||
}
|
||||
|
||||
JSBool
|
||||
CallMethodHelper::GetInterfaceTypeFromParam(uint8 paramIndex,
|
||||
CallMethodHelper::GetInterfaceTypeFromParam(uint8_t paramIndex,
|
||||
const nsXPTType& datum_type,
|
||||
nsID* result) const
|
||||
{
|
||||
nsresult rv;
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex);
|
||||
uint8 tag = datum_type.TagPart();
|
||||
uint8_t tag = datum_type.TagPart();
|
||||
|
||||
// TODO fixup the various exceptions that are thrown
|
||||
|
||||
@ -2362,7 +2362,7 @@ CallMethodHelper::GetInterfaceTypeFromParam(uint8 paramIndex,
|
||||
}
|
||||
|
||||
JSBool
|
||||
CallMethodHelper::GetOutParamSource(uint8 paramIndex, jsval* srcp) const
|
||||
CallMethodHelper::GetOutParamSource(uint8_t paramIndex, jsval* srcp) const
|
||||
{
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex);
|
||||
|
||||
@ -2393,8 +2393,8 @@ JSBool
|
||||
CallMethodHelper::GatherAndConvertResults()
|
||||
{
|
||||
// now we iterate through the native params to gather and convert results
|
||||
uint8 paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8 i = 0; i < paramCount; i++) {
|
||||
uint8_t paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8_t i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
if (!paramInfo.IsOut() && !paramInfo.IsDipper())
|
||||
continue;
|
||||
@ -2531,11 +2531,11 @@ CallMethodHelper::QueryInterfaceFastPath() const
|
||||
JSBool
|
||||
CallMethodHelper::InitializeDispatchParams()
|
||||
{
|
||||
const uint8 wantsOptArgc = mMethodInfo->WantsOptArgc() ? 1 : 0;
|
||||
const uint8 wantsJSContext = mMethodInfo->WantsContext() ? 1 : 0;
|
||||
const uint8 paramCount = mMethodInfo->GetParamCount();
|
||||
uint8 requiredArgs = paramCount;
|
||||
uint8 hasRetval = 0;
|
||||
const uint8_t wantsOptArgc = mMethodInfo->WantsOptArgc() ? 1 : 0;
|
||||
const uint8_t wantsJSContext = mMethodInfo->WantsContext() ? 1 : 0;
|
||||
const uint8_t paramCount = mMethodInfo->GetParamCount();
|
||||
uint8_t requiredArgs = paramCount;
|
||||
uint8_t hasRetval = 0;
|
||||
|
||||
// XXX ASSUMES that retval is last arg. The xpidl compiler ensures this.
|
||||
if (paramCount && mMethodInfo->GetParam(paramCount-1).IsRetval()) {
|
||||
@ -2569,7 +2569,7 @@ CallMethodHelper::InitializeDispatchParams()
|
||||
}
|
||||
|
||||
// iterate through the params to clear flags (for safe cleanup later)
|
||||
for (uint8 i = 0; i < paramCount + wantsJSContext + wantsOptArgc; i++) {
|
||||
for (uint8_t i = 0; i < paramCount + wantsJSContext + wantsOptArgc; i++) {
|
||||
nsXPTCVariant* dp = mDispatchParams.AppendElement();
|
||||
dp->ClearFlags();
|
||||
dp->val.p = nsnull;
|
||||
@ -2595,8 +2595,8 @@ CallMethodHelper::InitializeDispatchParams()
|
||||
JSBool
|
||||
CallMethodHelper::ConvertIndependentParams(JSBool* foundDependentParam)
|
||||
{
|
||||
const uint8 paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8 i = 0; i < paramCount; i++) {
|
||||
const uint8_t paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8_t i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
|
||||
if (paramInfo.GetType().IsDependent())
|
||||
@ -2610,11 +2610,11 @@ CallMethodHelper::ConvertIndependentParams(JSBool* foundDependentParam)
|
||||
}
|
||||
|
||||
JSBool
|
||||
CallMethodHelper::ConvertIndependentParam(uint8 i)
|
||||
CallMethodHelper::ConvertIndependentParam(uint8_t i)
|
||||
{
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
const nsXPTType& type = paramInfo.GetType();
|
||||
uint8 type_tag = type.TagPart();
|
||||
uint8_t type_tag = type.TagPart();
|
||||
nsXPTCVariant* dp = GetDispatchParam(i);
|
||||
dp->type = type;
|
||||
NS_ABORT_IF_FALSE(!paramInfo.IsShared(), "[shared] implies [noscript]!");
|
||||
@ -2691,8 +2691,8 @@ CallMethodHelper::ConvertIndependentParam(uint8 i)
|
||||
JSBool
|
||||
CallMethodHelper::ConvertDependentParams()
|
||||
{
|
||||
const uint8 paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8 i = 0; i < paramCount; i++) {
|
||||
const uint8_t paramCount = mMethodInfo->GetParamCount();
|
||||
for (uint8_t i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
|
||||
if (!paramInfo.GetType().IsDependent())
|
||||
@ -2705,7 +2705,7 @@ CallMethodHelper::ConvertDependentParams()
|
||||
}
|
||||
|
||||
JSBool
|
||||
CallMethodHelper::ConvertDependentParam(uint8 i)
|
||||
CallMethodHelper::ConvertDependentParam(uint8_t i)
|
||||
{
|
||||
const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
|
||||
const nsXPTType& type = paramInfo.GetType();
|
||||
@ -2877,7 +2877,7 @@ CallMethodHelper::HandleDipperParam(nsXPTCVariant* dp,
|
||||
const nsXPTParamInfo& paramInfo)
|
||||
{
|
||||
// Get something we can make comparisons with.
|
||||
uint8 type_tag = paramInfo.GetType().TagPart();
|
||||
uint8_t type_tag = paramInfo.GetType().TagPart();
|
||||
|
||||
// Dippers always have the 'in' and 'dipper' flags set. Never 'out'.
|
||||
NS_ABORT_IF_FALSE(!paramInfo.IsOut(), "Dipper has unexpected flags.");
|
||||
|
@ -116,7 +116,7 @@ XPCNativeMember::Resolve(XPCCallContext& ccx, XPCNativeInterface* iface,
|
||||
|
||||
// Note: ASSUMES that retval is last arg.
|
||||
argc = (intN) info->GetParamCount();
|
||||
if (argc && info->GetParam((uint8)(argc-1)).IsRetval())
|
||||
if (argc && info->GetParam((uint8_t)(argc-1)).IsRetval())
|
||||
argc-- ;
|
||||
|
||||
callback = XPC_WN_CallMethod;
|
||||
|
@ -303,14 +303,14 @@ ListBase<LC>::length_getter(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
||||
return false;
|
||||
PRUint32 length;
|
||||
getListObject(obj)->GetLength(&length);
|
||||
JS_ASSERT(int32(length) >= 0);
|
||||
JS_ASSERT(int32_t(length) >= 0);
|
||||
*vp = UINT_TO_JSVAL(length);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class LC>
|
||||
bool
|
||||
ListBase<LC>::getItemAt(ListType *list, uint32 i, IndexGetterType &item)
|
||||
ListBase<LC>::getItemAt(ListType *list, uint32_t i, IndexGetterType &item)
|
||||
{
|
||||
JS_STATIC_ASSERT(!hasIndexGetter);
|
||||
return false;
|
||||
@ -318,7 +318,7 @@ ListBase<LC>::getItemAt(ListType *list, uint32 i, IndexGetterType &item)
|
||||
|
||||
template<class LC>
|
||||
bool
|
||||
ListBase<LC>::setItemAt(JSContext *cx, ListType *list, uint32 i, IndexSetterType item)
|
||||
ListBase<LC>::setItemAt(JSContext *cx, ListType *list, uint32_t i, IndexSetterType item)
|
||||
{
|
||||
JS_STATIC_ASSERT(!hasIndexSetter);
|
||||
return false;
|
||||
@ -734,8 +734,8 @@ ListBase<LC>::getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &
|
||||
{
|
||||
PRUint32 length;
|
||||
getListObject(proxy)->GetLength(&length);
|
||||
JS_ASSERT(int32(length) >= 0);
|
||||
for (int32 i = 0; i < int32(length); ++i) {
|
||||
JS_ASSERT(int32_t(length) >= 0);
|
||||
for (int32_t i = 0; i < int32_t(length); ++i) {
|
||||
if (!props.append(INT_TO_JSID(i)))
|
||||
return false;
|
||||
}
|
||||
@ -976,7 +976,7 @@ ListBase<LC>::getPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id, bo
|
||||
if (vp) {
|
||||
PRUint32 length;
|
||||
getListObject(proxy)->GetLength(&length);
|
||||
JS_ASSERT(int32(length) >= 0);
|
||||
JS_ASSERT(int32_t(length) >= 0);
|
||||
vp->setInt32(length);
|
||||
}
|
||||
*found = true;
|
||||
@ -1074,7 +1074,7 @@ ListBase<LC>::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, V
|
||||
template<class LC>
|
||||
bool
|
||||
ListBase<LC>::getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver,
|
||||
uint32 index, Value *vp, bool *present)
|
||||
uint32_t index, Value *vp, bool *present)
|
||||
{
|
||||
NS_ASSERTION(!xpc::WrapperFactory::IsXrayWrapper(proxy),
|
||||
"Should not have a XrayWrapper here");
|
||||
|
@ -192,8 +192,8 @@ private:
|
||||
|
||||
static JSBool length_getter(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
|
||||
|
||||
static inline bool getItemAt(ListType *list, uint32 i, IndexGetterType &item);
|
||||
static inline bool setItemAt(JSContext *cx, ListType *list, uint32 i, IndexSetterType item);
|
||||
static inline bool getItemAt(ListType *list, uint32_t i, IndexGetterType &item);
|
||||
static inline bool setItemAt(JSContext *cx, ListType *list, uint32_t i, IndexSetterType item);
|
||||
|
||||
static inline bool namedItem(JSContext *cx, JSObject *obj, jsval *name, NameGetterType &result,
|
||||
bool *hasResult);
|
||||
@ -227,7 +227,7 @@ public:
|
||||
bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
|
||||
bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, JS::Value *vp);
|
||||
bool getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver,
|
||||
uint32 index, JS::Value *vp, bool *present);
|
||||
uint32_t index, JS::Value *vp, bool *present);
|
||||
bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
|
||||
JS::Value *vp);
|
||||
bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
|
||||
|
@ -494,7 +494,7 @@ toStringTemplate = (
|
||||
indexGetterTemplate = (
|
||||
"template<>\n"
|
||||
"bool\n"
|
||||
"${name}Wrapper::getItemAt(${nativeClass} *list, uint32 index, ${indexGetterType} &item)\n"
|
||||
"${name}Wrapper::getItemAt(${nativeClass} *list, uint32_t index, ${indexGetterType} &item)\n"
|
||||
"{\n"
|
||||
"${indexGet}"
|
||||
"}\n"
|
||||
@ -503,7 +503,7 @@ indexGetterTemplate = (
|
||||
indexSetterTemplate = (
|
||||
"template<>\n"
|
||||
"bool\n"
|
||||
"${name}Wrapper::setItemAt(JSContext *cx, ${nativeClass} *list, uint32 index, ${indexSetterType} item)\n"
|
||||
"${name}Wrapper::setItemAt(JSContext *cx, ${nativeClass} *list, uint32_t index, ${indexSetterType} item)\n"
|
||||
"{\n"
|
||||
"${indexSet}"
|
||||
"}\n"
|
||||
|
@ -401,19 +401,19 @@ argumentUnboxingTemplates = {
|
||||
" uint32_t ${name}_u32;\n"
|
||||
" if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
|
||||
" return JS_FALSE;\n"
|
||||
" uint8 ${name} = (uint8) ${name}_u32;\n",
|
||||
" uint8_t ${name} = (uint8_t) ${name}_u32;\n",
|
||||
|
||||
'short':
|
||||
" int32_t ${name}_i32;\n"
|
||||
" if (!JS_ValueToECMAInt32(cx, ${argVal}, &${name}_i32))\n"
|
||||
" return JS_FALSE;\n"
|
||||
" int16 ${name} = (int16) ${name}_i32;\n",
|
||||
" int16_t ${name} = (int16_t) ${name}_i32;\n",
|
||||
|
||||
'unsigned short':
|
||||
" uint32_t ${name}_u32;\n"
|
||||
" if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
|
||||
" return JS_FALSE;\n"
|
||||
" uint16 ${name} = (uint16) ${name}_u32;\n",
|
||||
" uint16_t ${name} = (uint16_t) ${name}_u32;\n",
|
||||
|
||||
'long':
|
||||
" int32_t ${name};\n"
|
||||
@ -633,11 +633,11 @@ resultConvTemplates = {
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'octet':
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32) result);\n"
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32_t) result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'short':
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32) result);\n"
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32_t) result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'long':
|
||||
@ -648,7 +648,7 @@ resultConvTemplates = {
|
||||
" return xpc_qsInt64ToJsval(cx, result, ${jsvalPtr});\n",
|
||||
|
||||
'unsigned short':
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32) result);\n"
|
||||
" ${jsvalRef} = INT_TO_JSVAL((int32_t) result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'unsigned long':
|
||||
|
@ -2885,7 +2885,7 @@ public:
|
||||
|
||||
JSObject* GetRootJSObject(XPCCallContext& ccx, JSObject* aJSObj);
|
||||
|
||||
NS_IMETHOD CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
|
||||
NS_IMETHOD CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
|
||||
const XPTMethodDescriptor* info,
|
||||
nsXPTCMiniVariant* params);
|
||||
|
||||
@ -2914,24 +2914,24 @@ private:
|
||||
|
||||
JSObject* NewOutObject(JSContext* cx, JSObject* scope);
|
||||
|
||||
JSBool IsReflectable(uint16 i) const
|
||||
JSBool IsReflectable(uint16_t i) const
|
||||
{return (JSBool)(mDescriptors[i/32] & (1 << (i%32)));}
|
||||
void SetReflectable(uint16 i, JSBool b)
|
||||
void SetReflectable(uint16_t i, JSBool b)
|
||||
{if (b) mDescriptors[i/32] |= (1 << (i%32));
|
||||
else mDescriptors[i/32] &= ~(1 << (i%32));}
|
||||
|
||||
JSBool GetArraySizeFromParam(JSContext* cx,
|
||||
const XPTMethodDescriptor* method,
|
||||
const nsXPTParamInfo& param,
|
||||
uint16 methodIndex,
|
||||
uint8 paramIndex,
|
||||
uint16_t methodIndex,
|
||||
uint8_t paramIndex,
|
||||
nsXPTCMiniVariant* params,
|
||||
uint32_t* result);
|
||||
|
||||
JSBool GetInterfaceTypeFromParam(JSContext* cx,
|
||||
const XPTMethodDescriptor* method,
|
||||
const nsXPTParamInfo& param,
|
||||
uint16 methodIndex,
|
||||
uint16_t methodIndex,
|
||||
const nsXPTType& type,
|
||||
nsXPTCMiniVariant* params,
|
||||
nsID* result);
|
||||
@ -2948,7 +2948,7 @@ private:
|
||||
nsIInterfaceInfo* mInfo;
|
||||
char* mName;
|
||||
nsIID mIID;
|
||||
uint32* mDescriptors;
|
||||
uint32_t* mDescriptors;
|
||||
};
|
||||
|
||||
/*************************/
|
||||
|
@ -56,4 +56,8 @@ CPPSRCS = AccessCheck.cpp \
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../src \
|
||||
|
||||
DEFINES += \
|
||||
-DNO_NSPR_10_SUPPORT \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -55,9 +55,9 @@ namespace xpc {
|
||||
|
||||
using namespace js;
|
||||
|
||||
static const uint32 JSSLOT_WN = 0;
|
||||
static const uint32 JSSLOT_RESOLVING = 1;
|
||||
static const uint32 JSSLOT_EXPANDO = 2;
|
||||
static const uint32_t JSSLOT_WN = 0;
|
||||
static const uint32_t JSSLOT_RESOLVING = 1;
|
||||
static const uint32_t JSSLOT_EXPANDO = 2;
|
||||
|
||||
class ResolvingId
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user