Bug 714057 - Remove uintn users from XPConnect; r=bholley+khuey
authorMs2ger <ms2ger@gmail.com>
Mon, 02 Jan 2012 19:05:19 +0100
changeset 84870 69fe2af4da71132bc31b8866e1bb9e96a1f97a21
parent 84869 92ac3413d15f9ed3fe7cb0a71897348fd4149d83
child 84871 9c3ab8c81d28d426c692d3d46cb1f42eaf611b9b
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs714057
milestone12.0a1
Bug 714057 - Remove uintn users from XPConnect; r=bholley+khuey
js/xpconnect/loader/Makefile.in
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/shell/Makefile.in
js/xpconnect/shell/xpcshell.cpp
js/xpconnect/src/Makefile.in
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCDebug.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCMaps.h
js/xpconnect/src/XPCQuickStubs.cpp
js/xpconnect/src/XPCVariant.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeInfo.cpp
js/xpconnect/src/dombindings.cpp
js/xpconnect/src/dombindings.h
js/xpconnect/src/dombindingsgen.py
js/xpconnect/src/qsgen.py
js/xpconnect/src/xpcprivate.h
js/xpconnect/wrappers/Makefile.in
js/xpconnect/wrappers/XrayWrapper.cpp
--- a/js/xpconnect/loader/Makefile.in
+++ b/js/xpconnect/loader/Makefile.in
@@ -48,9 +48,13 @@ LIBXUL_LIBRARY = 1
 LOCAL_INCLUDES += -I$(srcdir)/../src
 
 CPPSRCS		= mozJSComponentLoader.cpp mozJSSubScriptLoader.cpp mozJSLoaderUtils.cpp
 
 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)
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -436,17 +436,17 @@ mozJSComponentLoader::ReallyInit()
     if (NS_FAILED(rv))
         return rv;
 
     // Create our compilation context.
     mContext = JS_NewContext(mRuntime, 256);
     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
     JS_SetVersion(mContext, JSVERSION_LATEST);
 
     // Limit C stack consumption to a reasonable 512K
     JS_SetNativeStackQuota(mContext, 512 * 1024);
 
@@ -786,17 +786,17 @@ mozJSComponentLoader::GlobalForLocation(
 
     if (!script) {
         // The script wasn't in the cache , so compile it now.
         LOG(("Slow loading %s\n", nativePath.get()));
 
         // 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));
 
         if (realFile) {
 #ifdef HAVE_PR_MEMMAP
             PRInt64 fileSize;
             rv = aComponentFile->GetFileSize(&fileSize);
             if (NS_FAILED(rv)) {
@@ -960,17 +960,17 @@ mozJSComponentLoader::GlobalForLocation(
             LOG(("Failed to write to cache\n"));
         }
     }
 
     // Assign aGlobal here so that it's available to recursive imports.
     // 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);
     JS_SetOptions(cx, oldopts);
 
     if (!ok) {
 #ifdef DEBUG_shaver_off
         fprintf(stderr, "mJCL: failed to execute %s\n", nativePath.get());
--- a/js/xpconnect/shell/Makefile.in
+++ b/js/xpconnect/shell/Makefile.in
@@ -60,16 +60,20 @@ LIBS		= \
 		$(NULL)
 
 ifdef JS_SHARED_LIBRARY
 LIBS +=	$(MOZ_JS_LIBS)
 endif
 
 LIBS +=	$(NSPR_LIBS)
 
+DEFINES += \
+  -DNO_NSPR_10_SUPPORT \
+  $(NULL)
+
 NSDISTMODE = copy
 
 ifdef _MSC_VER
 ifeq ($(OS_TEST),x86_64)
 # set stack to 2MB on x64 build.  See bug 582910
 WIN32_EXE_LDFLAGS += -STACK:2097152
 endif
 endif
--- a/js/xpconnect/shell/xpcshell.cpp
+++ b/js/xpconnect/shell/xpcshell.cpp
@@ -718,26 +718,26 @@ GetChildGlobalObject(JSContext* cx,
 }
 
 /*
  * JSContext option name to flag map. The option names are in alphabetical
  * order for better reporting.
  */
 static const struct JSOption {
     const char  *name;
-    uint32      flag;
+    uint32_t    flag;
 } js_options[] = {
     {"atline",          JSOPTION_ATLINE},
     {"relimit",         JSOPTION_RELIMIT},
     {"strict",          JSOPTION_STRICT},
     {"werror",          JSOPTION_WERROR},
     {"xml",             JSOPTION_XML},
 };
 
-static uint32
+static uint32_t
 MapContextOptionNameToFlag(JSContext* cx, const char* name)
 {
     for (size_t i = 0; i < ArrayLength(js_options); ++i) {
         if (strcmp(name, js_options[i].name) == 0)
             return js_options[i].flag;
     }
 
     char* msg = JS_sprintf_append(NULL,
--- a/js/xpconnect/src/Makefile.in
+++ b/js/xpconnect/src/Makefile.in
@@ -111,16 +111,17 @@ SHARED_LIBRARY_LIBS = \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += \
   -DJSFILE \
   -DJS_THREADSAFE \
   -DEXPORT_XPC_API \
+  -DNO_NSPR_10_SUPPORT \
   $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CXX
 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
 # whole program optimization and precompiled headers are incompatible
 ifeq (,$(findstring GL,$(CXXFLAGS)))
 # use pre-compiled headers
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -3807,26 +3807,26 @@ NS_IMETHODIMP
 nsXPCComponents_Utils::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
 {
     // If you have to ask, then the answer is NO
     *_retval = nsnull;
     return NS_OK;
 }
 
 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 {
         options &= ~aOption;
     }
     JS_SetOptions(cx, options & JSALLOPTION_MASK);
     return NS_OK;
 }
--- a/js/xpconnect/src/XPCDebug.cpp
+++ b/js/xpconnect/src/XPCDebug.cpp
@@ -73,17 +73,17 @@ static char* FormatJSFrame(JSContext* cx
     JSBool gotThisVal = false;
     jsval thisVal;
     JSObject* callObj = nsnull;
     JSString* funname = nsnull;
     JSAutoByteString funbytes;
     const char* filename = nsnull;
     PRInt32 lineno = 0;
     JSFunction* fun = nsnull;
-    uint32 namedArgCount = 0;
+    uint32_t namedArgCount = 0;
     jsval val;
     JSBool isString;
 
     // get the info for this stack frame
 
     JSScript* script = JS_GetFrameScript(cx, fp);
     jsbytecode* pc = JS_GetFramePC(cx, fp);
 
@@ -124,17 +124,17 @@ static char* FormatJSFrame(JSContext* cx
         buf = JS_sprintf_append(buf, "%d anonymous(", num);
     else
         buf = JS_sprintf_append(buf, "%d <TOP LEVEL>", num);
     if (!buf) goto out;
 
     // 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;
                 const char* name = JSVAL2String(cx, desc->id, &isString, &nameBytes);
                 if (!isString)
                     name = nsnull;
                 JSAutoByteString valueBytes;
                 const char* value = JSVAL2String(cx, desc->value, &isString, &valueBytes);
@@ -155,17 +155,17 @@ static char* FormatJSFrame(JSContext* cx
 
         if (JS_GetProperty(cx, callObj, "arguments", &val) &&
             JSVAL_IS_OBJECT(val)) {
             uint32_t argCount;
             JSObject* argsObj = JSVAL_TO_OBJECT(val);
             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);
 
                     if (JS_GetProperty(cx, argsObj, number, &val)) {
                         JSAutoByteString valueBytes;
                         const char *value = JSVAL2String(cx, val, &isString, &valueBytes);
                         buf = JS_sprintf_append(buf, "%s%s%s%s",
                                                 k ? ", " : "",
@@ -185,17 +185,17 @@ static char* FormatJSFrame(JSContext* cx
                             fun ? ")" : "",
                             filename ? filename : "<unknown>",
                             lineno);
     if (!buf) goto out;
 
     // 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;
                 JSAutoByteString valueBytes;
                 const char *name = JSVAL2String(cx, desc->id, nsnull, &nameBytes);
                 const char *value = JSVAL2String(cx, desc->value, &isString, &valueBytes);
 
                 if (name && value) {
@@ -225,17 +225,17 @@ static char* FormatJSFrame(JSContext* cx
         } else
             buf = JS_sprintf_append(buf, TAB "<failed to get 'this' value>\n");
     }
 
     // print the properties of 'this', if it is an object
 
     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;
                 JSAutoByteString valueBytes;
                 const char *name = JSVAL2String(cx, desc->id, nsnull, &nameBytes);
                 const char *value = JSVAL2String(cx, desc->value, &isString, &valueBytes);
                 if (name && value) {
                     buf = JS_sprintf_append(buf, TAB "this.%s = %s%s%s\n",
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1105,66 +1105,66 @@ XPCJSRuntime::~XPCJSRuntime()
     if (count)
         printf("deleting XPCJSRuntime with %d live JSContexts\n", count);
     }
 #endif
 
     // 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
         mWrappedJSMap->Enumerate(WrappedJSShutdownMarker, mJSRuntime);
         delete mWrappedJSMap;
     }
 
     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
         delete mWrappedJSClassMap;
     }
 
     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
         delete mIID2NativeInterfaceMap;
     }
 
     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
         delete mClassInfo2NativeSetMap;
     }
 
     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
         delete mNativeSetMap;
     }
 
     if (mMapLock)
         XPCAutoLock::DestroyLock(mMapLock);
 
     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
         delete mThisTranslatorMap;
     }
 
 #ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
     if (DEBUG_WrappedNativeHashtable) {
@@ -1174,44 +1174,44 @@ XPCJSRuntime::~XPCJSRuntime()
         if (LiveWrapperCount)
             printf("deleting XPCJSRuntime with %d live XPCWrappedNative (found in wrapper check)\n", (int)LiveWrapperCount);
         JS_DHashTableDestroy(DEBUG_WrappedNativeHashtable);
     }
 #endif
 
     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
         delete mNativeScriptableSharedMap;
     }
 
     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
         delete mDyingWrappedNativeProtoMap;
     }
 
     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
         delete mDetachedWrappedNativeProtoMap;
     }
 
     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
         delete mExplicitNativeWrapperMap;
     }
 
     // unwire the readable/JSString sharing magic
     XPCStringConvert::ShutdownDOMStringFinalizer();
@@ -1269,17 +1269,17 @@ ExplicitNonHeapCompartmentCallback(JSCon
 }
 
 void
 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;
 }
 
 void
 ArenaCallback(JSContext *cx, void *vdata, js::gc::Arena *arena,
               JSGCTraceKind traceKind, size_t thingSize)
 {
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -93,18 +93,18 @@ public:
 
     inline void Remove(nsXPCWrappedJS* wrapper)
     {
         NS_PRECONDITION(wrapper,"bad param");
         JS_DHashTableOperate(mTable, wrapper->GetJSObjectPreserveColor(),
                              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);
 
     ~JSObject2WrappedJSMap();
 private:
     JSObject2WrappedJSMap();    // no implementation
     JSObject2WrappedJSMap(int size);
@@ -161,18 +161,18 @@ public:
         NS_ASSERTION(!wrapperInMap || wrapperInMap == wrapper,
                      "About to remove a different wrapper with the same "
                      "nsISupports identity! This will most likely cause serious "
                      "problems!");
 #endif
         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);
 
     ~Native2WrappedNativeMap();
 private:
     Native2WrappedNativeMap();    // no implementation
     Native2WrappedNativeMap(int size);
@@ -223,18 +223,18 @@ public:
     }
 
     inline void Remove(nsXPCWrappedJSClass* clazz)
     {
         NS_PRECONDITION(clazz,"bad param");
         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();
 private:
     IID2WrappedJSClassMap();    // no implementation
     IID2WrappedJSClassMap(int size);
 private:
     JSDHashTable *mTable;
@@ -280,18 +280,18 @@ public:
     }
 
     inline void Remove(XPCNativeInterface* iface)
     {
         NS_PRECONDITION(iface,"bad param");
         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);
 
     ~IID2NativeInterfaceMap();
 private:
     IID2NativeInterfaceMap();    // no implementation
     IID2NativeInterfaceMap(int size);
@@ -339,18 +339,18 @@ public:
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
         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.
     // So we don't want to count those XPCNativeSets, because they are better
     // counted elsewhere (i.e. in XPCJSRuntime::mNativeSetMap, which holds
     // pointers to *all* XPCNativeSets).  Hence the "Shallow".
     size_t ShallowSizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
 
@@ -399,18 +399,18 @@ public:
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
         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);
 
     ~ClassInfo2WrappedNativeProtoMap();
 private:
     ClassInfo2WrappedNativeProtoMap();    // no implementation
     ClassInfo2WrappedNativeProtoMap(int size);
@@ -472,18 +472,18 @@ public:
     inline void Remove(XPCNativeSet* set)
     {
         NS_PRECONDITION(set,"bad param");
 
         XPCNativeSetKey key(set, nsnull, 0);
         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);
 
     ~NativeSetMap();
 private:
     NativeSetMap();    // no implementation
     NativeSetMap(int size);
@@ -541,18 +541,18 @@ public:
         return obj;
     }
 
     inline void Remove(REFNSIID iid)
     {
         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();
 private:
     IID2ThisTranslatorMap();    // no implementation
     IID2ThisTranslatorMap(int size);
 private:
     JSDHashTable *mTable;
@@ -578,18 +578,18 @@ public:
         static struct JSDHashTableOps sOps;
     };
 
     static XPCNativeScriptableSharedMap* newMap(int size);
 
     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();
 private:
     XPCNativeScriptableSharedMap();    // no implementation
     XPCNativeScriptableSharedMap(int size);
 private:
     JSDHashTable *mTable;
@@ -616,18 +616,18 @@ public:
     }
 
     inline void Remove(XPCWrappedNativeProto* proto)
     {
         NS_PRECONDITION(proto,"bad param");
         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();
 private:
     XPCWrappedNativeProtoMap();    // no implementation
     XPCWrappedNativeProtoMap(int size);
 private:
     JSDHashTable *mTable;
@@ -652,18 +652,18 @@ public:
     }
 
     inline void Remove(JSObject* nw)
     {
         NS_PRECONDITION(nw,"bad param");
         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();
 private:
     XPCNativeWrapperMap();    // no implementation
     XPCNativeWrapperMap(int size);
 private:
     JSDHashTable *mTable;
@@ -723,18 +723,18 @@ public:
     bool AddLink(JSObject* wrappedObject, Link* oldLink);
 
     inline void Remove(JSObject* wrapper)
     {
         NS_PRECONDITION(wrapper,"bad param");
         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();
 
 private:
     WrappedNative2WrapperMap();    // no implementation
     WrappedNative2WrapperMap(int size);
 
@@ -788,19 +788,19 @@ public:
     }
 
     inline void Remove(JSObject* key)
     {
         NS_PRECONDITION(key,"bad param");
         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);
     }
 
     ~JSObject2JSObjectMap()
     {
         if (mTable)
             JS_DHashTableDestroy(mTable);
--- a/js/xpconnect/src/XPCQuickStubs.cpp
+++ b/js/xpconnect/src/XPCQuickStubs.cpp
@@ -394,17 +394,17 @@ xpc_qsDefineQuickStubs(JSContext *cx, JS
      * Walk interfaces in reverse order to behave like XPConnect when a
      * feature is defined in more than one of the interfaces.
      *
      * XPCNativeSet::FindMethod returns the first matching feature it finds,
      * searching the interfaces forward.  Here, definitions toward the
      * 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);
 
         if (entry) {
             for (;;) {
                 // Define quick stubs for attributes.
                 const xpc_qsPropertySpec *ps = entry->properties;
--- a/js/xpconnect/src/XPCVariant.cpp
+++ b/js/xpconnect/src/XPCVariant.cpp
@@ -257,38 +257,38 @@ XPCArrayHomogenizer::GetTypeForArray(XPC
         NS_ASSERTION(state != tUnk, "bad state table!");
 
         if (state == tVar)
             break;
     }
 
     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 :
             // FALL THROUGH
         case tUnk :
             // FALL THROUGH
         case tErr :
             // FALL THROUGH
@@ -492,90 +492,90 @@ XPCVariant::VariantDataToJS(XPCLazyCallC
             if (NS_FAILED(variant->GetAsBool(&xpctvar.val.b)))
                 return false;
             *pJSVal = BOOLEAN_TO_JSVAL(xpctvar.val.b);
             return true;
         }
         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:
         case nsIDataType::VTYPE_INTERFACE_IS:
         {
             nsID* piid;
             if (NS_FAILED(variant->GetAsInterface(&piid, &xpctvar.val.p)))
                 return false;
 
             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;
         }
         case nsIDataType::VTYPE_ARRAY:
         {
             nsDiscriminatedUnion du;
             nsVariant::Initialize(&du);
@@ -605,33 +605,33 @@ XPCVariant::VariantDataToJS(XPCLazyCallC
                 case nsIDataType::VTYPE_UINT16:
                 case nsIDataType::VTYPE_UINT32:
                 case nsIDataType::VTYPE_UINT64:
                 case nsIDataType::VTYPE_FLOAT:
                 case nsIDataType::VTYPE_DOUBLE:
                 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.
                 case nsIDataType::VTYPE_VOID:
                 case nsIDataType::VTYPE_ASTRING:
                 case nsIDataType::VTYPE_DOMSTRING:
                 case nsIDataType::VTYPE_CSTRING:
                 case nsIDataType::VTYPE_UTF8STRING:
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -47,17 +47,17 @@
 #include "nsWrapperCache.h"
 #include "XPCWrapper.h"
 #include "AccessCheck.h"
 #include "nsJSUtils.h"
 
 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)
 {
     NS_PRECONDITION(!mEvaluated, "AutoScriptEvaluate::Evaluate should only be called once");
 
     if (!mJSContext)
         return true;
 
@@ -185,21 +185,21 @@ nsXPCWrappedJSClass::nsXPCWrappedJSClass
     NS_ADDREF(mInfo);
     NS_ADDREF_THIS();
 
     {   // scoped lock
         XPCAutoLock lock(mRuntime->GetMapLock());
         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--)
                     mDescriptors[i] = 0;
 
                 for (i = 0; i < methodCount; i++) {
                     const nsXPTMethodInfo* info;
                     if (NS_SUCCEEDED(mInfo->GetMethodInfo(i, &info)))
@@ -287,17 +287,17 @@ nsXPCWrappedJSClass::CallQueryInterfaceO
     }
 
     id = xpc_NewIDObject(cx, jsobj, aIID);
     if (id) {
         // Throwing NS_NOINTERFACE is the prescribed way to fail QI from JS. It
         // 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)};
         success = JS_CallFunctionValue(cx, jsobj, fun, 1, args, &retval);
 
         JS_SetOptions(cx, oldOpts);
 
         if (!success) {
@@ -356,17 +356,17 @@ nsXPCWrappedJSClass::CallQueryInterfaceO
 
 static JSBool
 GetNamedPropertyAsVariantRaw(XPCCallContext& ccx,
                              JSObject* aJSObj,
                              jsid aName,
                              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) &&
            // Note that this always takes the T_INTERFACE path through
            // JSData2Native, so the value passed for useAllocator
            // doesn't really matter. We pass true for consistency.
            XPCConvert::JSData2Native(ccx, aResult, val, type, true,
                                      &NS_GET_IID(nsIVariant), pErr);
@@ -863,22 +863,22 @@ xpcWrappedJSErrorReporter(JSContext *cx,
     if (e)
         ccx.GetXPCContext()->SetException(e);
 }
 
 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, &param, 0, &argnum);
     if (NS_FAILED(rv))
         return false;
 
     const nsXPTParamInfo& arg_param = method->params[argnum];
     const nsXPTType& arg_type = arg_param.GetType();
@@ -895,30 +895,30 @@ nsXPCWrappedJSClass::GetArraySizeFromPar
 
     return true;
 }
 
 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()->
                          GetIIDForParamNoAlloc(methodIndex, &param, result))) {
             return true;
         }
     } else if (type_tag == nsXPTType::T_INTERFACE_IS) {
-        uint8 argnum;
+        uint8_t argnum;
         nsresult rv;
         rv = mInfo->GetInterfaceIsArgNumberForParam(methodIndex,
                                                     &param, &argnum);
         if (NS_FAILED(rv))
             return false;
 
         const nsXPTParamInfo& arg_param = method->params[argnum];
         const nsXPTType& arg_type = arg_param.GetType();
@@ -1171,25 +1171,25 @@ class ContextPrincipalGuard
   public:
     ContextPrincipalGuard(XPCCallContext &ccx)
       : ssm(nsnull), ccx(ccx) {}
     void principalPushed(nsIScriptSecurityManager *ssm) { this->ssm = ssm; }
     ~ContextPrincipalGuard() { if (ssm) ssm->PopContextPrincipal(ccx); }
 };
 
 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;
     JSBool readyToDoTheCall = false;
     nsID  param_iid;
     JSObject* obj;
     const char* name = info->name;
     jsval fval;
@@ -1517,17 +1517,17 @@ pre_call_clean_up:
     if (XPT_MD_IS_GETTER(info->flags)) {
         success = JS_GetProperty(cx, obj, name, argv);
         rval = *argv;
     } else if (XPT_MD_IS_SETTER(info->flags)) {
         success = JS_SetProperty(cx, obj, name, argv);
         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);
 
             JS_SetOptions(cx, oldOpts);
         } else {
             // The property was not an object so can't be a function.
             // Let's build and 'throw' an exception.
@@ -1581,17 +1581,17 @@ pre_call_clean_up:
 
         const nsXPTType& type = param.GetType();
         if (type.IsDependent()) {
             foundDependentParam = true;
             continue;
         }
 
         jsval val;
-        uint8 type_tag = type.TagPart();
+        uint8_t type_tag = type.TagPart();
         nsXPTCMiniVariant* pv;
 
         if (param.IsDipper())
             pv = (nsXPTCMiniVariant*) &nativeParams[i].val.p;
         else
             pv = (nsXPTCMiniVariant*) nativeParams[i].val.p;
 
         if (param.IsRetval())
@@ -1688,17 +1688,17 @@ pre_call_clean_up:
             }
         }
     }
 
     if (i != paramCount) {
         // 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;
             const nsXPTType& type = param.GetType();
             if (!type.deprecated_IsPointer())
                 continue;
             void* p;
             if (!(p = nativeParams[k].val.p))
@@ -1761,35 +1761,35 @@ nsXPCWrappedJSClass::DebugDump(PRInt16 d
         XPC_LOG_ALWAYS(("interface name is %s", name));
         if (name)
             nsMemory::Free(name);
         char * iid = mIID.ToString();
         XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
         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));
             XPC_LOG_ALWAYS(("parent @ %x", parent.get()));
             mInfo->GetMethodCount(&methodCount);
             XPC_LOG_ALWAYS(("MethodCount = %d", methodCount));
             mInfo->GetConstantCount(&i);
             XPC_LOG_ALWAYS(("ConstantCount = %d", i));
             XPC_LOG_OUTDENT();
         }
         XPC_LOG_ALWAYS(("mRuntime @ %x", mRuntime));
         XPC_LOG_ALWAYS(("mDescriptors @ %x count = %d", mDescriptors, methodCount));
         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"));
             }
             XPC_LOG_OUTDENT();
             depth++;
         }
     XPC_LOG_OUTDENT();
 #endif
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -2071,64 +2071,64 @@ static JSBool Throw(uintN errNum, XPCCal
 /***************************************************************************/
 
 class CallMethodHelper
 {
     XPCCallContext& mCallContext;
     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();
 
     JS_ALWAYS_INLINE JSBool
     QueryInterfaceFastPath() const;
 
     nsXPTCVariant*
-    GetDispatchParam(uint8 paramIndex)
+    GetDispatchParam(uint8_t paramIndex)
     {
         if (paramIndex >= mJSContextIndex)
             paramIndex += 1;
         if (paramIndex >= mOptArgcIndex)
             paramIndex += 1;
         return &mDispatchParams[paramIndex];
     }
     const nsXPTCVariant*
-    GetDispatchParam(uint8 paramIndex) const
+    GetDispatchParam(uint8_t paramIndex) const
     {
         return const_cast<CallMethodHelper*>(this)->GetDispatchParam(paramIndex);
     }
 
     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);
 
     JS_ALWAYS_INLINE JSBool HandleDipperParam(nsXPTCVariant* dp,
                                               const nsXPTParamInfo& paramInfo);
 
     JS_ALWAYS_INLINE nsresult Invoke();
 
@@ -2260,19 +2260,19 @@ CallMethodHelper::Call()
         return false;
     }
 
     return GatherAndConvertResults();
 }
 
 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);
 
             if (paramInfo.GetType().IsArray()) {
                 void* p = dp->val.p;
                 if (!p)
                     continue;
 
@@ -2308,17 +2308,17 @@ CallMethodHelper::~CallMethodHelper()
                     CleanupParam(*dp, dp->type);
             }
         }
     }
 
 }
 
 JSBool
-CallMethodHelper::GetArraySizeFromParam(uint8 paramIndex,
+CallMethodHelper::GetArraySizeFromParam(uint8_t paramIndex,
                                         uint32_t* result) const
 {
     nsresult rv;
     const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex);
 
     // TODO fixup the various exceptions that are thrown
 
     rv = mIFaceInfo->GetSizeIsArgNumberForParam(mVTableIndex, &paramInfo, 0, &paramIndex);
@@ -2326,23 +2326,23 @@ CallMethodHelper::GetArraySizeFromParam(
         return Throw(NS_ERROR_XPC_CANT_GET_ARRAY_INFO, mCallContext);
 
     *result = GetDispatchParam(paramIndex)->val.u32;
 
     return true;
 }
 
 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
 
     if (tag == nsXPTType::T_INTERFACE) {
         rv = mIFaceInfo->GetIIDForParamNoAlloc(mVTableIndex, &paramInfo, result);
         if (NS_FAILED(rv))
             return ThrowBadParam(NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO,
                                  paramIndex, mCallContext);
@@ -2357,17 +2357,17 @@ CallMethodHelper::GetInterfaceTypeFromPa
             return ThrowBadParam(NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO,
                                  paramIndex, mCallContext);
         *result = *p;
     }
     return true;
 }
 
 JSBool
-CallMethodHelper::GetOutParamSource(uint8 paramIndex, jsval* srcp) const
+CallMethodHelper::GetOutParamSource(uint8_t paramIndex, jsval* srcp) const
 {
     const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(paramIndex);
 
     if ((paramInfo.IsOut() || paramInfo.IsDipper()) &&
         !paramInfo.IsRetval()) {
         NS_ASSERTION(paramIndex < mArgc || paramInfo.IsOptional(),
                      "Expected either enough arguments or an optional argument");
         jsval arg = paramIndex < mArgc ? mArgv[paramIndex] : JSVAL_NULL;
@@ -2388,18 +2388,18 @@ CallMethodHelper::GetOutParamSource(uint
 
     return true;
 }
 
 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;
 
         const nsXPTType& type = paramInfo.GetType();
         nsXPTCVariant* dp = GetDispatchParam(i);
         jsval v = JSVAL_NULL;
         AUTO_MARK_JSVAL(mCallContext, &v);
@@ -2526,21 +2526,21 @@ CallMethodHelper::QueryInterfaceFastPath
 
     mCallContext.SetRetVal(v);
     return true;
 }
 
 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()) {
         hasRetval = 1;
         requiredArgs--;
     }
 
     if (mArgc < requiredArgs || wantsOptArgc) {
@@ -2564,17 +2564,17 @@ CallMethodHelper::InitializeDispatchPara
         else if (mMethodInfo->IsSetter() || mMethodInfo->IsGetter())
             // For attributes, we always put the JSContext* first.
             mJSContextIndex = 0;
         else
             mJSContextIndex = paramCount - hasRetval;
     }
 
     // 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;
     }
 
     // Fill in the JSContext argument
     if (wantsJSContext) {
         nsXPTCVariant* dp = &mDispatchParams[mJSContextIndex];
@@ -2590,36 +2590,36 @@ CallMethodHelper::InitializeDispatchPara
     }
 
     return true;
 }
 
 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())
             *foundDependentParam = true;
         else if (!ConvertIndependentParam(i))
             return false;
 
     }
 
     return true;
 }
 
 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]!");
 
     // Handle dipper types separately.
     if (paramInfo.IsDipper())
         return HandleDipperParam(dp, paramInfo);
 
@@ -2686,31 +2686,31 @@ CallMethodHelper::ConvertIndependentPara
     }
 
     return true;
 }
 
 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())
             continue;
         if (!ConvertDependentParam(i))
             return false;
     }
 
     return true;
 }
 
 JSBool
-CallMethodHelper::ConvertDependentParam(uint8 i)
+CallMethodHelper::ConvertDependentParam(uint8_t i)
 {
     const nsXPTParamInfo& paramInfo = mMethodInfo->GetParam(i);
     const nsXPTType& type = paramInfo.GetType();
     nsXPTType datum_type;
     uint32_t array_count = 0;
     bool isArray = type.IsArray();
 
     bool isSizedString = isArray ?
@@ -2872,17 +2872,17 @@ CallMethodHelper::CleanupParam(nsXPTCMin
 // after the call.
 //
 // This method creates these empty containers.
 JSBool
 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.");
 
     // xpidl.h specifies that dipper types will be used in exactly four
     // cases, all strings. Verify that here.
     NS_ABORT_IF_FALSE(type_tag == nsXPTType::T_ASTRING ||
                       type_tag == nsXPTType::T_DOMSTRING ||
--- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp
@@ -111,17 +111,17 @@ XPCNativeMember::Resolve(XPCCallContext&
 
     if (IsMethod()) {
         const nsXPTMethodInfo* info;
         if (NS_FAILED(iface->GetInterfaceInfo()->GetMethodInfo(mIndex, &info)))
             return false;
 
         // 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;
     } else {
         argc = 0;
         callback = XPC_WN_GetterSetter;
     }
 
--- a/js/xpconnect/src/dombindings.cpp
+++ b/js/xpconnect/src/dombindings.cpp
@@ -298,32 +298,32 @@ ListBase<LC>::instanceIsListObject(JSCon
 template<class LC>
 JSBool
 ListBase<LC>::length_getter(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
     if (!instanceIsListObject(cx, obj, NULL))
         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;
 }
 
 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;
 }
 
 template<class LC>
 bool
 ListBase<LC>::getNamedItem(ListType *list, const nsAString& aName, NameGetterType &item)
@@ -729,18 +729,18 @@ ListBase<LC>::defineProperty(JSContext *
 }
 
 template<class LC>
 bool
 ListBase<LC>::getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props)
 {
     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;
     }
 
     JSObject *expando;
     if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = getExpandoObject(proxy)) &&
         !GetPropertyNames(cx, expando, JSITER_OWNONLY | JSITER_HIDDEN, &props))
         return false;
@@ -971,17 +971,17 @@ ListBase<LC>::getPropertyOnPrototype(JSC
         hit = true;
     }
 
     if (hit) {
         if (id == s_length_id) {
             if (vp) {
                 PRUint32 length;
                 getListObject(proxy)->GetLength(&length);
-                JS_ASSERT(int32(length) >= 0);
+                JS_ASSERT(int32_t(length) >= 0);
                 vp->setInt32(length);
             }
             *found = true;
             return true;
         }
         if (!nativeGet(cx, proxy, proto, id, found, vp))
             return false;
         if (*found)
@@ -1069,17 +1069,17 @@ ListBase<LC>::get(JSContext *cx, JSObjec
 
     vp->setUndefined();
     return true;
 }
 
 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");
 
     if (hasIndexGetter) {
         IndexGetterType result;
         *present = getItemAt(getListObject(proxy), index, result);
         if (*present)
--- a/js/xpconnect/src/dombindings.h
+++ b/js/xpconnect/src/dombindings.h
@@ -187,18 +187,18 @@ private:
 
     static JSObject *ensureExpandoObject(JSContext *cx, JSObject *obj);
 
     static js::Shape *getProtoShape(JSObject *obj);
     static void setProtoShape(JSObject *obj, js::Shape *shape);
 
     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);
 
     static inline bool getNamedItem(ListType *list, const nsAString& aName, NameGetterType &item);
     static inline bool setNamedItem(JSContext *cx, ListType *list, const nsAString& aName,
                                     NameSetterType item);
 
@@ -222,17 +222,17 @@ public:
     bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
     bool enumerate(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
     bool fix(JSContext *cx, JSObject *proxy, JS::Value *vp);
 
     bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
     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);
     bool iterate(JSContext *cx, JSObject *proxy, uintN flags, JS::Value *vp);
 
     /* Spidermonkey extensions. */
     bool hasInstance(JSContext *cx, JSObject *proxy, const JS::Value *vp, bool *bp);
     JSString *obj_toString(JSContext *cx, JSObject *proxy);
--- a/js/xpconnect/src/dombindingsgen.py
+++ b/js/xpconnect/src/dombindingsgen.py
@@ -489,26 +489,26 @@ toStringTemplate = (
 "    JSString *jsresult;\n"
 "    return NS_SUCCEEDED(rv) && xpc_qsStringToJsstring(cx, result, &jsresult) ? jsresult : NULL;\n"
 "}\n"
 "\n")
 
 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"
 "\n")
 
 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"
 "\n")
 
 nameGetterTemplate = (
 "template<>\n"
 "bool\n"
--- a/js/xpconnect/src/qsgen.py
+++ b/js/xpconnect/src/qsgen.py
@@ -396,29 +396,29 @@ def substitute(template, vals):
     return re.sub(r'\${(\w+)}', replacement, template)
 
 # From JSData2Native.
 argumentUnboxingTemplates = {
     'octet':
         "    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"
         "    if (!JS_ValueToECMAInt32(cx, ${argVal}, &${name}))\n"
         "        return JS_FALSE;\n",
 
     'unsigned long':
         "    uint32_t ${name};\n"
@@ -628,32 +628,32 @@ def outParamForm(name, type):
 
 # From NativeData2JS.
 resultConvTemplates = {
     'void':
             "    ${jsvalRef} = JSVAL_VOID;\n"
             "    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':
         "    ${jsvalRef} = INT_TO_JSVAL(result);\n"
         "    return JS_TRUE;\n",
 
     'long long':
         "    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':
         "    ${jsvalRef} = UINT_TO_JSVAL(result);\n"
         "    return JS_TRUE;\n",
 
     'unsigned long long':
         "    return xpc_qsUint64ToJsval(cx, result, ${jsvalPtr});\n",
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2880,17 +2880,17 @@ public:
 
     static JSBool IsWrappedJS(nsISupports* aPtr);
 
     NS_IMETHOD DelegatedQueryInterface(nsXPCWrappedJS* self, REFNSIID aIID,
                                        void** aInstancePtr);
 
     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);
 
     JSObject*  CallQueryInterfaceOnJSObject(XPCCallContext& ccx,
                                             JSObject* jsobj, REFNSIID aIID);
 
     static nsresult BuildPropertyEnumerator(XPCCallContext& ccx,
                                             JSObject* aJSObj,
@@ -2909,51 +2909,51 @@ public:
                                       bool aForceReport);
 private:
     nsXPCWrappedJSClass();   // not implemented
     nsXPCWrappedJSClass(XPCCallContext& ccx, REFNSIID aIID,
                         nsIInterfaceInfo* aInfo);
 
     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);
 
     void CleanupPointerArray(const nsXPTType& datum_type,
                              uint32_t array_count,
                              void** arrayp);
 
     void CleanupPointerTypeObject(const nsXPTType& type,
                                   void** pp);
 
 private:
     XPCJSRuntime* mRuntime;
     nsIInterfaceInfo* mInfo;
     char* mName;
     nsIID mIID;
-    uint32* mDescriptors;
+    uint32_t* mDescriptors;
 };
 
 /*************************/
 // nsXPCWrappedJS is a wrapper for a single JSObject for use from native code.
 // nsXPCWrappedJS objects are chained together to represent the various
 // interface on the single underlying (possibly aggregate) JSObject.
 
 class nsXPCWrappedJS : protected nsAutoXPTCStub,
--- a/js/xpconnect/wrappers/Makefile.in
+++ b/js/xpconnect/wrappers/Makefile.in
@@ -51,9 +51,13 @@ CPPSRCS		= AccessCheck.cpp \
 	          CrossOriginWrapper.cpp \
 		  FilteringWrapper.cpp \
 		  XrayWrapper.cpp \
 		  WrapperFactory.cpp
 
 LOCAL_INCLUDES = \
                 -I$(srcdir)/../src \
 
+DEFINES += \
+  -DNO_NSPR_10_SUPPORT \
+  $(NULL)
+
 include $(topsrcdir)/config/rules.mk
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -50,19 +50,19 @@
 
 #include "XPCWrapper.h"
 #include "xpcprivate.h"
 
 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
 {
   public:
     ResolvingId(JSObject *holder, jsid id)
       : mId(id),
         mPrev(getResolvingId(holder)),
         mHolder(holder)