Bug 794510: Part 2: Use more stdint types instead of protypes.h types; r=ehsan
authorIsaac Aggrey <isaac.aggrey@gmail.com>
Thu, 11 Oct 2012 18:38:04 -0500
changeset 110847 52b59d7cff7c7fe85e4664a163ee3cd6df17e374
parent 110846 1adde03021f9b5842a8d702f24d5be2f7747c2fd
child 110848 62627192e1563789da8b97907ffd342f4348f31d
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs794510
milestone19.0a1
Bug 794510: Part 2: Use more stdint types instead of protypes.h types; r=ehsan
content/xtf/src/nsXTFWeakTearoff.cpp
docshell/shistory/src/nsSHistory.cpp
dom/base/nsStructuredCloneContainer.cpp
dom/camera/GonkRecorder.cpp
dom/plugins/base/android/android_npapi.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginsDirDarwin.cpp
dom/src/json/nsJSON.cpp
dom/workers/Events.cpp
dom/workers/Events.h
dom/workers/Exceptions.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/WorkerScope.cpp
gfx/src/nsScriptableRegion.cpp
gfx/thebes/gfxColor.h
gfx/thebes/gfxFontUtils.cpp
image/decoders/nsGIFDecoder2.cpp
intl/uconv/public/uconvutil.h
intl/uconv/tools/umaptable.c
js/src/builtin/MapObject.cpp
js/src/builtin/ParallelArray.cpp
js/src/gc/Heap.h
js/src/jsanalyze.cpp
js/src/jsarray.cpp
js/src/jsobjinlines.h
js/src/jstypedarray.h
js/src/methodjit/Compiler.cpp
js/src/methodjit/FastArithmetic.cpp
js/src/methodjit/FastOps.cpp
js/src/methodjit/FrameEntry.h
js/src/methodjit/FrameState.h
netwerk/cache/nsCacheService.cpp
netwerk/socket/nsSOCKSIOLayer.cpp
parser/expat/expat_config.h
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/url-classifier/ChunkSet.cpp
toolkit/components/url-classifier/ChunkSet.h
toolkit/components/url-classifier/Classifier.cpp
toolkit/components/url-classifier/Entries.h
toolkit/components/url-classifier/HashStore.cpp
toolkit/components/url-classifier/HashStore.h
toolkit/components/url-classifier/LookupCache.cpp
toolkit/components/url-classifier/LookupCache.h
toolkit/components/url-classifier/ProtocolParser.cpp
toolkit/components/url-classifier/ProtocolParser.h
toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
tools/profiler/libunwind/src/include/unwind.h
tools/trace-malloc/bloatblame.cpp
tools/trace-malloc/leakstats.c
tools/trace-malloc/lib/nsDebugHelpWin32.cpp
tools/trace-malloc/lib/nsTraceMalloc.c
tools/trace-malloc/lib/nsTraceMallocCallbacks.h
tools/trace-malloc/tmreader.c
tools/trace-malloc/tmreader.h
xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_shle.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
xpcom/reflect/xptinfo/tests/TestInterfaceInfo.cpp
xpcom/string/src/nsUTF8UtilsSSE2.cpp
xpcom/typelib/xpt/public/xpt_struct.h
xpcom/typelib/xpt/tests/PrimitiveTest.c
xpcom/typelib/xpt/tests/SimpleTypeLib.c
--- a/content/xtf/src/nsXTFWeakTearoff.cpp
+++ b/content/xtf/src/nsXTFWeakTearoff.cpp
@@ -118,17 +118,17 @@ nsXTFWeakTearoff::CallMethod(uint16_t me
   else {
     fullPars = new nsXPTCVariant[paramCount];
     if (!fullPars)
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   for (int i=0; i<paramCount; ++i) {
     const nsXPTParamInfo& paramInfo = info->params[i];
-    uint8 flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
+    uint8_t flags = paramInfo.IsOut() ? nsXPTCVariant::PTR_IS_DATA : 0;
     fullPars[i].Init(params[i], paramInfo.GetType(), flags);
   }
   
   // make the call:
   nsresult rv = NS_InvokeByIndex(mObj, methodIndex, paramCount, fullPars);
   if (fullPars)
     delete []fullPars;
   return rv;
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -282,17 +282,17 @@ nsSHistory::CalcMaxTotalViewers()
   // 1024 Mb       8
   // 2048 Mb       8
   // 4096 Mb       8
   uint64_t bytes = PR_GetPhysicalMemorySize();
 
   if (bytes == 0)
     return 0;
 
-  // Conversion from unsigned int64 to double doesn't work on all platforms.
+  // Conversion from unsigned int64_t to double doesn't work on all platforms.
   // We need to truncate the value at INT64_MAX to make sure we don't
   // overflow.
   if (bytes > INT64_MAX)
     bytes = INT64_MAX;
 
   uint64_t kbytes;
   LL_SHR(kbytes, bytes, 10);
 
--- a/dom/base/nsStructuredCloneContainer.cpp
+++ b/dom/base/nsStructuredCloneContainer.cpp
@@ -153,17 +153,17 @@ nsStructuredCloneContainer::GetDataAsBas
 
 nsresult
 nsStructuredCloneContainer::GetSerializedNBytes(uint64_t *aSize)
 {
   NS_ENSURE_STATE(mData);
   NS_ENSURE_ARG_POINTER(aSize);
 
   // mSize is a size_t, while aSize is a uint64_t.  We rely on an implicit cast
-  // here so that we'll get a compile error if a size_t-to-uint64 cast is
+  // here so that we'll get a compile error if a size_t-to-uint64_t cast is
   // narrowing.
   *aSize = mSize;
 
   return NS_OK;
 }
 
 nsresult
 nsStructuredCloneContainer::GetFormatVersion(uint32_t *aFormatVersion)
--- a/dom/camera/GonkRecorder.cpp
+++ b/dom/camera/GonkRecorder.cpp
@@ -221,17 +221,17 @@ status_t GonkRecorder::setOutputFile(int
     if (mOutputFd >= 0) {
         ::close(mOutputFd);
     }
     mOutputFd = dup(fd);
 
     return OK;
 }
 
-// Attempt to parse an int64 literal optionally surrounded by whitespace,
+// Attempt to parse an int64_t literal optionally surrounded by whitespace,
 // returns true on success, false otherwise.
 static bool safe_strtoi64(const char *s, int64_t *val) {
     char *end;
 
     // It is lame, but according to man page, we have to set errno to 0
     // before calling strtoll().
     errno = 0;
     *val = strtoll(s, &end, 10);
@@ -241,17 +241,17 @@ static bool safe_strtoi64(const char *s,
     }
 
     // Skip trailing whitespace
     while (isspace(*end)) {
         ++end;
     }
 
     // For a successful return, the string must contain nothing but a valid
-    // int64 literal optionally surrounded by whitespace.
+    // int64_t literal optionally surrounded by whitespace.
 
     return *end == '\0';
 }
 
 // Return true if the value is in [0, 0x007FFFFFFF]
 static bool safe_strtoi32(const char *s, int32_t *val) {
     int64_t temp;
     if (safe_strtoi64(s, &temp)) {
--- a/dom/plugins/base/android/android_npapi.h
+++ b/dom/plugins/base/android/android_npapi.h
@@ -1029,21 +1029,16 @@ struct ANPSurfaceInterfaceV0 : ANPInterf
   bool (*lock)(JNIEnv* env, jobject surface, ANPBitmap* bitmap, ANPRectI* dirtyRect);
   /** Given a locked surface handle (i.e. result of a successful call to lock)
         the surface is unlocked and the contents of the bitmap, specifically
         those inside the dirtyRect are written to the screen.
   */
   void (*unlock)(JNIEnv* env, jobject surface);
 };
 
-typedef int32_t   int32;
-typedef uint32_t uint32;
-typedef int16_t   int16;
-typedef uint16_t uint16;
-
 /**
  * TODO should we not use EGL and GL data types for ABI safety?
  */
 struct ANPTextureInfo {
     GLuint      textureId;
     uint32_t    width;
     uint32_t    height;
     GLenum      internalFormat;
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2707,18 +2707,18 @@ void nsPluginInstanceOwner::Paint(const 
   RECTL rectl;
   rectl.xLeft   = relDirtyRect.x + window->x;
   rectl.yBottom = relDirtyRect.y + window->y;
   rectl.xRight  = rectl.xLeft + relDirtyRect.width;
   rectl.yTop    = rectl.yBottom + relDirtyRect.height;
 
   NPEvent pluginEvent;
   pluginEvent.event = WM_PAINT;
-  pluginEvent.wParam = (uint32)aHPS;
-  pluginEvent.lParam = (uint32)&rectl;
+  pluginEvent.wParam = (uint32_t)aHPS;
+  pluginEvent.lParam = (uint32_t)&rectl;
   mInstance->HandleEvent(&pluginEvent, nullptr);
 }
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 
 void nsPluginInstanceOwner::Paint(gfxContext* aContext,
                                   const gfxRect& aFrameRect,
--- a/dom/plugins/base/nsPluginsDirDarwin.cpp
+++ b/dom/plugins/base/nsPluginsDirDarwin.cpp
@@ -369,23 +369,23 @@ static bool IsCompatibleArch(nsIFile *fi
     if (packageType == 'BRPL' || packageType == 'IEPL' || packageType == 'NSPL') {
       // Get path to plugin as a C string.
       char executablePath[PATH_MAX];
       executablePath[0] = '\0';
       if (!::CFURLGetFileSystemRepresentation(pluginURL, true, (UInt8*)&executablePath, PATH_MAX)) {
         executablePath[0] = '\0';
       }
 
-      uint32 pluginLibArchitectures;
+      uint32_t pluginLibArchitectures;
       nsresult rv = mozilla::ipc::GeckoChildProcessHost::GetArchitecturesForBinary(executablePath, &pluginLibArchitectures);
       if (NS_FAILED(rv)) {
         return false;
       }
 
-      uint32 containerArchitectures = mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
+      uint32_t containerArchitectures = mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
 
       // Consider the plugin architecture valid if there is any overlap in the masks.
       isPluginFile = !!(containerArchitectures & pluginLibArchitectures);
     }
     ::CFRelease(pluginBundle);
   }
 
   ::CFRelease(pluginURL);
--- a/dom/src/json/nsJSON.cpp
+++ b/dom/src/json/nsJSON.cpp
@@ -571,17 +571,17 @@ nsJSONListener::OnStopRequest(nsIRequest
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   js::RootedValue reviver(mCx, JS::NullValue()), value(mCx);
 
   JS::StableCharPtr chars(reinterpret_cast<const jschar*>(mBufferedChars.Elements()),
                           mBufferedChars.Length());
   JSBool ok = js::ParseJSONWithReviver(mCx, chars,
-                                       (uint32) mBufferedChars.Length(),
+                                       (uint32_t) mBufferedChars.Length(),
                                        reviver, &value,
                                        mDecodingMode);
 
   *mRootVal = value;
   mBufferedChars.TruncateLength(0);
   return ok ? NS_OK : NS_ERROR_FAILURE;
 }
 
--- a/dom/workers/Events.cpp
+++ b/dom/workers/Events.cpp
@@ -219,17 +219,17 @@ private:
     delete GetJSPrivateSafeish<Event>(aObj);
   }
 
   static JSBool
   GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSMutableHandleValue aVp)
   {
     JS_ASSERT(JSID_IS_INT(aIdval));
 
-    int32 slot = JSID_TO_INT(aIdval);
+    int32_t slot = JSID_TO_INT(aIdval);
 
     const char*& name = sProperties[slot - SLOT_FIRST].name;
     if (!GetInstancePrivate(aCx, aObj, name)) {
       return false;
     }
 
     aVp.set(JS_GetReservedSlot(aObj, slot));
     return true;
@@ -512,17 +512,17 @@ private:
     }
   }
 
   static JSBool
   GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSMutableHandleValue aVp)
   {
     JS_ASSERT(JSID_IS_INT(aIdval));
 
-    int32 slot = JSID_TO_INT(aIdval);
+    int32_t slot = JSID_TO_INT(aIdval);
 
     JS_ASSERT(slot >= SLOT_data && slot < SLOT_COUNT);
 
     const char*& name = sProperties[slot - SLOT_FIRST].name;
     MessageEvent* event = GetInstancePrivate(aCx, aObj, name);
     if (!event) {
       return false;
     }
@@ -632,17 +632,17 @@ public:
     JSClass* clasp = aMainRuntime ? &sMainRuntimeClass : &sClass;
 
     return JS_InitClass(aCx, aObj, aParentProto, clasp, Construct, 0,
                         sProperties, sFunctions, NULL, NULL);
   }
 
   static JSObject*
   Create(JSContext* aCx, JSObject* aParent, JSString* aMessage,
-         JSString* aFilename, uint32 aLineNumber, bool aMainRuntime)
+         JSString* aFilename, uint32_t aLineNumber, bool aMainRuntime)
   {
     JSString* type = JS_InternString(aCx, "error");
     if (!type) {
       return NULL;
     }
 
     JSClass* clasp = aMainRuntime ? &sMainRuntimeClass : &sClass;
 
@@ -692,17 +692,17 @@ private:
                          classPtr->name);
     return NULL;
   }
 
   static void
   InitErrorEventCommon(JSObject* aObj, Event* aEvent, JSString* aType,
                        JSBool aBubbles, JSBool aCancelable,
                        JSString* aMessage, JSString* aFilename,
-                       uint32 aLineNumber, bool aIsTrusted)
+                       uint32_t aLineNumber, bool aIsTrusted)
   {
     Event::InitEventCommon(aObj, aEvent, aType, aBubbles, aCancelable,
                            aIsTrusted);
     JS_SetReservedSlot(aObj, SLOT_message, STRING_TO_JSVAL(aMessage));
     JS_SetReservedSlot(aObj, SLOT_filename, STRING_TO_JSVAL(aFilename));
     JS_SetReservedSlot(aObj, SLOT_lineno, INT_TO_JSVAL(aLineNumber));
   }
 
@@ -721,17 +721,17 @@ private:
     delete GetJSPrivateSafeish<ErrorEvent>(aObj);
   }
 
   static JSBool
   GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSMutableHandleValue aVp)
   {
     JS_ASSERT(JSID_IS_INT(aIdval));
 
-    int32 slot = JSID_TO_INT(aIdval);
+    int32_t slot = JSID_TO_INT(aIdval);
 
     JS_ASSERT(slot >= SLOT_message && slot < SLOT_COUNT);
 
     const char*& name = sProperties[slot - SLOT_FIRST].name;
     ErrorEvent* event = GetInstancePrivate(aCx, aObj, name);
     if (!event) {
       return false;
     }
@@ -901,17 +901,17 @@ private:
     delete GetJSPrivateSafeish<ProgressEvent>(aObj);
   }
 
   static JSBool
   GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSMutableHandleValue aVp)
   {
     JS_ASSERT(JSID_IS_INT(aIdval));
 
-    int32 slot = JSID_TO_INT(aIdval);
+    int32_t slot = JSID_TO_INT(aIdval);
 
     JS_ASSERT(slot >= SLOT_lengthComputable && slot < SLOT_COUNT);
 
     const char*& name = sProperties[slot - SLOT_FIRST].name;
     ProgressEvent* event = GetInstancePrivate(aCx, aObj, name);
     if (!event) {
       return false;
     }
@@ -1018,17 +1018,17 @@ CreateMessageEvent(JSContext* aCx, JSAut
                    bool aMainRuntime)
 {
   JSObject* global = JS_GetGlobalForScopeChain(aCx);
   return MessageEvent::Create(aCx, global, aData, aClonedObjects, aMainRuntime);
 }
 
 JSObject*
 CreateErrorEvent(JSContext* aCx, JSString* aMessage, JSString* aFilename,
-                 uint32 aLineNumber, bool aMainRuntime)
+                 uint32_t aLineNumber, bool aMainRuntime)
 {
   JSObject* global = JS_GetGlobalForScopeChain(aCx);
   return ErrorEvent::Create(aCx, global, aMessage, aFilename, aLineNumber,
                             aMainRuntime);
 }
 
 JSObject*
 CreateProgressEvent(JSContext* aCx, JSString* aType, bool aLengthComputable,
--- a/dom/workers/Events.h
+++ b/dom/workers/Events.h
@@ -23,17 +23,17 @@ CreateGenericEvent(JSContext* aCx, JSStr
 
 JSObject*
 CreateMessageEvent(JSContext* aCx, JSAutoStructuredCloneBuffer& aData,
                    nsTArray<nsCOMPtr<nsISupports> >& aClonedObjects,
                    bool aMainRuntime);
 
 JSObject*
 CreateErrorEvent(JSContext* aCx, JSString* aMessage, JSString* aFilename,
-                 uint32 aLineNumber, bool aMainRuntime);
+                 uint32_t aLineNumber, bool aMainRuntime);
 
 JSObject*
 CreateProgressEvent(JSContext* aCx, JSString* aType, bool aLengthComputable,
                     double aLoaded, double aTotal);
 
 bool
 IsSupportedEventClass(JSObject* aEvent);
 
--- a/dom/workers/Exceptions.cpp
+++ b/dom/workers/Exceptions.cpp
@@ -125,17 +125,17 @@ private:
     return true;
   }
 
   static JSBool
   GetProperty(JSContext* aCx, JSHandleObject aObj, JSHandleId aIdval, JSMutableHandleValue aVp)
   {
     JS_ASSERT(JSID_IS_INT(aIdval));
 
-    int32 slot = JSID_TO_INT(aIdval);
+    int32_t slot = JSID_TO_INT(aIdval);
 
     JSClass* classPtr = JS_GetClass(aObj);
 
     if (classPtr != &sClass || !GetJSPrivateSafeish<DOMException>(aObj)) {
       JS_ReportErrorNumber(aCx, js_GetErrorMessage, NULL,
                            JSMSG_INCOMPATIBLE_PROTO, sClass.name,
                            sProperties[slot].name, classPtr->name);
       return false;
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3781,17 +3781,17 @@ WorkerPrivate::SetTimeout(JSContext* aCx
 
   JS_SET_RVAL(aCx, aVp, INT_TO_JSVAL(timerId));
 
   newInfo.forget();
   return true;
 }
 
 bool
-WorkerPrivate::ClearTimeout(JSContext* aCx, uint32 aId)
+WorkerPrivate::ClearTimeout(JSContext* aCx, uint32_t aId)
 {
   AssertIsOnWorkerThread();
 
   if (!mTimeouts.IsEmpty()) {
     NS_ASSERTION(mTimerRunning, "Huh?!");
 
     for (uint32_t index = 0; index < mTimeouts.Length(); index++) {
       nsAutoPtr<TimeoutInfo>& info = mTimeouts[index];
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -670,17 +670,17 @@ public:
 
   void
   ReportError(JSContext* aCx, const char* aMessage, JSErrorReport* aReport);
 
   bool
   SetTimeout(JSContext* aCx, unsigned aArgc, jsval* aVp, bool aIsInterval);
 
   bool
-  ClearTimeout(JSContext* aCx, uint32 aId);
+  ClearTimeout(JSContext* aCx, uint32_t aId);
 
   bool
   RunExpiredTimeouts(JSContext* aCx);
 
   bool
   RescheduleTimeoutTimer(JSContext* aCx);
 
   void
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -105,30 +105,30 @@ public:
   using EventTarget::GetEventListener;
   using EventTarget::SetEventListener;
 
 protected:
   WorkerGlobalScope(JSContext* aCx, WorkerPrivate* aWorker)
   : EventTarget(aCx), mWorker(aWorker)
   {
     MOZ_COUNT_CTOR(mozilla::dom::workers::WorkerGlobalScope);
-    for (int32 i = 0; i < SLOT_COUNT; i++) {
+    for (int32_t i = 0; i < SLOT_COUNT; i++) {
       mSlots[i] = JSVAL_VOID;
     }
   }
 
   ~WorkerGlobalScope()
   {
     MOZ_COUNT_DTOR(mozilla::dom::workers::WorkerGlobalScope);
   }
 
   virtual void
   _trace(JSTracer* aTrc) MOZ_OVERRIDE
   {
-    for (int32 i = 0; i < SLOT_COUNT; i++) {
+    for (int32_t i = 0; i < SLOT_COUNT; i++) {
       JS_CALL_VALUE_TRACER(aTrc, mSlots[i], "WorkerGlobalScope instance slot");
     }
     mWorker->TraceInternal(aTrc);
     EventTarget::_trace(aTrc);
   }
 
   virtual void
   _finalize(JSFreeOp* aFop) MOZ_OVERRIDE
--- a/gfx/src/nsScriptableRegion.cpp
+++ b/gfx/src/nsScriptableRegion.cpp
@@ -129,17 +129,17 @@ NS_IMETHODIMP nsScriptableRegion::GetRec
 
   JSObject* destArray = JS_NewArrayObject(aCx, numRects * 4, NULL);
   if (!destArray) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   *aRects = OBJECT_TO_JSVAL(destArray);
 
-  uint32 n = 0;
+  uint32_t n = 0;
   nsIntRegionRectIterator iter(mRegion);
   const nsIntRect *rect;
 
   while ((rect = iter.Next())) {
     if (!JS_DefineElement(aCx, destArray, n, INT_TO_JSVAL(rect->x), NULL, NULL, JSPROP_ENUMERATE) ||
         !JS_DefineElement(aCx, destArray, n + 1, INT_TO_JSVAL(rect->y), NULL, NULL, JSPROP_ENUMERATE) ||
         !JS_DefineElement(aCx, destArray, n + 2, INT_TO_JSVAL(rect->width), NULL, NULL, JSPROP_ENUMERATE) ||
         !JS_DefineElement(aCx, destArray, n + 3, INT_TO_JSVAL(rect->height), NULL, NULL, JSPROP_ENUMERATE)) {
--- a/gfx/thebes/gfxColor.h
+++ b/gfx/thebes/gfxColor.h
@@ -201,17 +201,17 @@ struct THEBES_API gfxRGBA {
     }
     bool operator!=(const gfxRGBA& other) const
     {
         return !(*this == other);
     }
 
     /**
      * Returns this color value as a packed 32-bit integer. This reconstructs
-     * the int32 based on the given colorType, always in the native byte order.
+     * the int32_t based on the given colorType, always in the native byte order.
      *
      * Note: gcc 4.2.3 on at least Ubuntu (x86) does something strange with
      * (uint8_t)(c * 255.0) << x, where the result is different than
      * double d = c * 255.0; v = ((uint8_t) d) << x. 
      */
     uint32_t Packed(PackedColorType colorType = PACKED_ABGR) const {
         gfxFloat rb = (r * 255.0);
         gfxFloat gb = (g * 255.0);
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -356,17 +356,17 @@ gfxFontUtils::ReadCMAPTableFormat4(const
 
     uint16_t segCountX2 = ReadShortAt(aBuf, OffsetSegCountX2);
     NS_ENSURE_TRUE(tablelen >= 16 + (segCountX2 * 4), 
                    NS_ERROR_GFX_CMAP_MALFORMED);
 
     const uint16_t segCount = segCountX2 / 2;
 
     const uint16_t *endCounts = reinterpret_cast<const uint16_t*>(aBuf + 14);
-    const uint16_t *startCounts = endCounts + 1 /* skip one uint16 for reservedPad */ + segCount;
+    const uint16_t *startCounts = endCounts + 1 /* skip one uint16_t for reservedPad */ + segCount;
     const uint16_t *idDeltas = startCounts + segCount;
     const uint16_t *idRangeOffsets = idDeltas + segCount;
     uint16_t prevEndCount = 0;
     for (uint16_t i = 0; i < segCount; i++) {
         const uint16_t endCount = ReadShortAt16(endCounts, i);
         const uint16_t startCount = ReadShortAt16(startCounts, i);
         const uint16_t idRangeOffset = ReadShortAt16(idRangeOffsets, i);
 
--- a/image/decoders/nsGIFDecoder2.cpp
+++ b/image/decoders/nsGIFDecoder2.cpp
@@ -433,17 +433,17 @@ nsGIFDecoder2::DoLzw(const uint8_t *q)
       goto END;                                             \
     rowp = mImageData + mGIFStruct.irow * bpr;              \
     rowend = rowp + mGIFStruct.width;                       \
   PR_END_MACRO
 
   for (const uint8_t* ch = q; count-- > 0; ch++)
   {
     /* Feed the next byte into the decoder's 32-bit input buffer. */
-    datum += ((int32) *ch) << bits;
+    datum += ((int32_t) *ch) << bits;
     bits += 8;
 
     /* Check for underflow of decoder's 32-bit input buffer. */
     while (bits >= codesize)
     {
       /* Get the leading variable-length symbol from the data stream */
       int code = datum & codemask;
       datum >>= codesize;
--- a/intl/uconv/public/uconvutil.h
+++ b/intl/uconv/public/uconvutil.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef __UCONV_TIL_H__
 #define __UCONV_TIL_H__
 
 #include "prcpucfg.h"
 
 
 /*=====================================*/
-#define PACK(h,l)   (int16)(( (h) << 8) | (l))
+#define PACK(h,l)   (int16_t)(( (h) << 8) | (l))
 
 #if defined(IS_LITTLE_ENDIAN)
 #define ShiftInCell(sub,len,min,max)  \
     PACK(len,sub), PACK(max,min)
 #define ShiftOutCell(sub,len,minh,minl,maxh,maxl)  \
     PACK(len,sub), PACK(minl,minh), PACK(maxl,maxh)
 #else
 #define ShiftInCell(sub,len,min,max)  \
--- a/intl/uconv/tools/umaptable.c
+++ b/intl/uconv/tools/umaptable.c
@@ -1,67 +1,66 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdio.h>
-typedef short int16;
-typedef unsigned short uint16;
+#include "mozilla/StandardInteger.h"
 
 #define NOMAPPING 0xfffd
 
 typedef struct {
-		uint16 srcBegin;		/* 2 byte	*/
-		uint16 srcEnd;			/* 2 byte	*/
-		uint16 destBegin;		/* 2 byte	*/
+		uint16_t srcBegin;		/* 2 byte	*/
+		uint16_t srcEnd;		/* 2 byte	*/
+		uint16_t destBegin;		/* 2 byte	*/
 } uFormat0;
 
 typedef struct {
-		uint16 srcBegin;		/* 2 byte	*/
-		uint16 srcEnd;			/* 2 byte	*/
-		uint16	mappingOffset;	/* 2 byte	*/
+		uint16_t srcBegin;		/* 2 byte	*/
+		uint16_t srcEnd;		/* 2 byte	*/
+		uint16_t	mappingOffset;	/* 2 byte	*/
 } uFormat1;
 
 typedef struct {
-		uint16 srcBegin;		/* 2 byte	*/
-		uint16 srcEnd;			/* 2 byte	-waste	*/
-		uint16 destBegin;		/* 2 byte	*/
+		uint16_t srcBegin;		/* 2 byte	*/
+		uint16_t srcEnd;		/* 2 byte	-waste	*/
+		uint16_t destBegin;		/* 2 byte	*/
 } uFormat2;
 
 typedef struct  {
 	union {
 		uFormat0	format0;
 		uFormat1	format1;
 		uFormat2	format2;
 	} fmt;
 } uMapCell;
 
 /* =================================================
 					uTable 
 ================================================= */
 typedef struct  {
-	uint16 		itemOfList;
-	uint16		offsetToFormatArray;
-	uint16		offsetToMapCellArray;
-	uint16		offsetToMappingTable;
-	uint16		data[1];
+	uint16_t 		itemOfList;
+	uint16_t		offsetToFormatArray;
+	uint16_t		offsetToMapCellArray;
+	uint16_t		offsetToMappingTable;
+	uint16_t		data[1];
 } uTable;
 
-uint16 umap[256][256];
+uint16_t umap[256][256];
 int bInitFromOrTo = 0;
 int bGenerateFromUnicodeTable = 0;
 
 #define MAXCELLNUM 1000
 
 static int numOfItem = 0;
 uMapCell cell[MAXCELLNUM];
-uint16    format[MAXCELLNUM / 4];
-uint16   mapping[256*256];
+uint16_t    format[MAXCELLNUM / 4];
+uint16_t   mapping[256*256];
 static int mappinglen  = 0;
 static int formatcount[4] = {0,0,0,0}; 
 
 #define SetFormat(n,f)		{ format[(n >> 2)] |= ((f) << ((n & 0x0003)	<< 2)); formatcount[f]++; }
 #define GetFormat(n)		( format[(n >> 2)] >> ((n & 0x0003)	<< 2)) &0x00FF)
 #define MAPVALUE(i)	(umap[(i >> 8) & 0xFF][(i) & 0xFF])
 
 int  FORMAT1CNST = 10 ;
@@ -80,35 +79,35 @@ void initmaps()
 void SetMapValue(short u,short c)
 {
         if(NOMAPPING == MAPVALUE(u))
 	   MAPVALUE(u) = c & 0x0000FFFF;
         else {
            fprintf(stderr, "warning- duplicate mapping %x map to both %x and %x\n", u, MAPVALUE(u), c);
         }
 }
-void AddFormat2(uint16 srcBegin)
+void AddFormat2(uint16_t srcBegin)
 {
-	uint16 destBegin = MAPVALUE(srcBegin);
+	uint16_t destBegin = MAPVALUE(srcBegin);
 	printf("Begin of Item %04X\n",numOfItem);
 	printf(" Format 2\n");
 	printf("  srcBegin = %04X\n", srcBegin);
 	printf("  destBegin = %04X\n", destBegin );
 	SetFormat(numOfItem,2);
 	cell[numOfItem].fmt.format2.srcBegin = srcBegin;
 	cell[numOfItem].fmt.format2.srcEnd = 0;
 	cell[numOfItem].fmt.format2.destBegin = destBegin;
 	printf("End of Item %04X \n\n",numOfItem);
 	numOfItem++;
 	/*	Unmark the umap */
 	MAPVALUE(srcBegin) = NOMAPPING;
 }
-void AddFormat1(uint16 srcBegin, uint16 srcEnd)
+void AddFormat1(uint16_t srcBegin, uint16_t srcEnd)
 {
-	uint16 i;
+	uint16_t i;
 	printf("Begin of Item %04X\n",numOfItem);
 	printf(" Format 1\n");
 	printf("  srcBegin = %04X\n", srcBegin);
 	printf("  srcEnd = %04X\n", srcEnd );
 	printf("  mappingOffset = %04X\n", mappinglen);
 	printf(" Mapping  = " );  
 	SetFormat(numOfItem,1);
 	cell[numOfItem].fmt.format1.srcBegin = srcBegin;
@@ -122,20 +121,20 @@ void AddFormat1(uint16 srcBegin, uint16 
 		printf("%04X ",(mapping[mappinglen]  ));
 		/*	Unmark the umap */
 		MAPVALUE(i) = NOMAPPING;
 	}
 	printf("\n");
 	printf("End of Item %04X \n\n",numOfItem);
 	numOfItem++;
 }
-void AddFormat0(uint16 srcBegin, uint16 srcEnd)
+void AddFormat0(uint16_t srcBegin, uint16_t srcEnd)
 {
-	uint16 i;
-	uint16 destBegin = MAPVALUE(srcBegin);
+	uint16_t i;
+	uint16_t destBegin = MAPVALUE(srcBegin);
 	printf("Begin of Item %04X\n",numOfItem);
 	printf(" Format 0\n");
 	printf("  srcBegin = %04X\n", srcBegin);
 	printf("  srcEnd = %04X\n", srcEnd );
 	printf("  destBegin = %04X\n", destBegin );
 	SetFormat(numOfItem,0);
 	cell[numOfItem].fmt.format0.srcBegin = srcBegin;
 	cell[numOfItem].fmt.format0.srcEnd = srcEnd;
@@ -155,19 +154,19 @@ printf(
 "/* This Source Code Form is subject to the terms of the Mozilla Public\n"
 " * License, v. 2.0. If a copy of the MPL was not distributed with this\n"
 " * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n");
 }
 void gentable()
 {
 	/*	OK! For now, we just use format 1 for each row */
 	/*	We need to chage this to use other format to save the space */
-	uint16 begin,end;
-	uint16 ss,gs,gp,state,gc;	
-	uint16 diff, lastdiff;
+	uint16_t begin,end;
+	uint16_t ss,gs,gp,state,gc;	
+	uint16_t diff, lastdiff;
 
         printnpl();
 	printf("/*========================================================\n");
 	printf("  This is a Generated file. Please don't edit it.\n");
 	printf("\n");
 	printf("  The tool which used to generate this file is called umaptable.\n");
 	printf("  You can find this tool under mozilla/intl/uconv/tools/umaptable.c.\n");
 
@@ -278,23 +277,23 @@ void gentable()
 					AddFormat2(ss );	
 				else
 					AddFormat1(ss ,end );	
 	}
 	printf("========================================================*/\n");
 }
 void writetable()
 {
-	uint16 i;
-	uint16 off1,off2,off3;
-	uint16 cur = 0; 
-	uint16 formatitem = (((numOfItem)>>2) + 1);
+	uint16_t i;
+	uint16_t off1,off2,off3;
+	uint16_t cur = 0; 
+	uint16_t formatitem = (((numOfItem)>>2) + 1);
 	off1 = 4;
 	off2 = off1 + formatitem ;
-	off3 = off2 + numOfItem * sizeof(uMapCell) / sizeof(uint16);
+	off3 = off2 + numOfItem * sizeof(uMapCell) / sizeof(uint16_t);
 	/*	write itemOfList		*/
 	printf("/* Offset=0x%04X  ItemOfList */\n  0x%04X,\n", cur++, numOfItem);
 
 	/*	write offsetToFormatArray	*/
 	printf("/*-------------------------------------------------------*/\n");
 	printf("/* Offset=0x%04X  offsetToFormatArray */\n  0x%04X,\n",  cur++,off1);
 
 	/*	write offsetToMapCellArray	*/
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -683,17 +683,17 @@ HashableValue::setValue(JSContext *cx, c
         JSString *str = AtomizeString(cx, v.toString(), DoNotInternAtom);
         if (!str)
             return false;
         value = StringValue(str);
     } else if (v.isDouble()) {
         double d = v.toDouble();
         int32_t i;
         if (MOZ_DOUBLE_IS_INT32(d, &i)) {
-            // Normalize int32-valued doubles to int32 for faster hashing and testing.
+            // Normalize int32_t-valued doubles to int32_t for faster hashing and testing.
             value = Int32Value(i);
         } else if (MOZ_DOUBLE_IS_NaN(d)) {
             // NaNs with different bits must hash and test identically.
             value = DoubleValue(js_NaN);
         } else {
             value = v;
         }
     } else {
--- a/js/src/builtin/ParallelArray.cpp
+++ b/js/src/builtin/ParallelArray.cpp
@@ -152,17 +152,17 @@ ToUint32(JSContext *cx, const Value &v, 
 
 static bool
 GetLength(JSContext *cx, HandleObject obj, uint32_t *length)
 {
     // If obj's length cannot overflow, just use GetLengthProperty.
     if (obj->isArray() || obj->isArguments())
         return GetLengthProperty(cx, obj, length);
 
-    // Otherwise check that we don't overflow uint32.
+    // Otherwise check that we don't overflow uint32_t.
     RootedValue value(cx);
     if (!JSObject::getProperty(cx, obj, obj, cx->names().length, &value))
         return false;
 
     bool malformed;
     if (!ToUint32(cx, value, length, &malformed))
         return false;
     if (malformed)
--- a/js/src/gc/Heap.h
+++ b/js/src/gc/Heap.h
@@ -186,17 +186,17 @@ struct FreeSpan
         checkSpan();
     }
 
     /*
      * To minimize the size of the arena header the first span is encoded
      * there as offsets from the arena start.
      */
     static size_t encodeOffsets(size_t firstOffset, size_t lastOffset) {
-        /* Check that we can pack the offsets into uint16. */
+        /* Check that we can pack the offsets into uint16_t. */
         JS_STATIC_ASSERT(ArenaShift < 16);
         JS_ASSERT(firstOffset <= ArenaSize);
         JS_ASSERT(lastOffset < ArenaSize);
         JS_ASSERT(firstOffset <= ((lastOffset + 1) & ~size_t(1)));
         return firstOffset | (lastOffset << 16);
     }
 
     /*
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -274,17 +274,17 @@ ScriptAnalysis::analyzeBytecode(JSContex
             stackDepth -= nuses;
             stackDepth += ndefs;
         }
 
         /*
          * Assign an observed type set to each reachable JOF_TYPESET opcode.
          * This may be less than the number of type sets in the script if some
          * are unreachable, and may be greater in case the number of type sets
-         * overflows a uint16. In the latter case a single type set will be
+         * overflows a uint16_t. In the latter case a single type set will be
          * used for the observed types of all ops after the overflow.
          */
         if ((js_CodeSpec[op].format & JOF_TYPESET) && cx->typeInferenceEnabled()) {
             if (nTypeSets < script_->nTypeSets) {
                 code->observedTypes = typeArray[nTypeSets++].toStackTypeSet();
             } else {
                 JS_ASSERT(nTypeSets == UINT16_MAX);
                 code->observedTypes = typeArray[nTypeSets - 1].toStackTypeSet();
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -9,17 +9,17 @@
  * JS array class.
  *
  * Array objects begin as "dense" arrays, optimized for index-only property
  * access over a vector of slots with high load factor.  Array methods
  * optimize for denseness by testing that the object's class is
  * &ArrayClass, and can then directly manipulate the slots for efficiency.
  *
  * We track these pieces of metadata for arrays in dense mode:
- *  - The array's length property as a uint32, accessible with
+ *  - The array's length property as a uint32_t, accessible with
  *    getArrayLength(), setArrayLength().
  *  - The number of element slots (capacity), gettable with
  *    getDenseArrayCapacity().
  *  - The array's initialized length, accessible with
  *    getDenseArrayInitializedLength().
  *
  * In dense mode, holes in the array are represented by
  * MagicValue(JS_ARRAY_HOLE) invalid values.
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -379,17 +379,17 @@ JSObject::setArrayLength(JSContext *cx, 
     }
 
     obj->getElementsHeader()->length = length;
 }
 
 inline void
 JSObject::setDenseArrayLength(uint32_t length)
 {
-    /* Variant of setArrayLength for use on dense arrays where the length cannot overflow int32. */
+    /* Variant of setArrayLength for use on dense arrays where the length cannot overflow int32_t. */
     JS_ASSERT(isDenseArray());
     JS_ASSERT(length <= INT32_MAX);
     getElementsHeader()->length = length;
 }
 
 inline void
 JSObject::setDenseArrayInitializedLength(uint32_t length)
 {
--- a/js/src/jstypedarray.h
+++ b/js/src/jstypedarray.h
@@ -203,18 +203,18 @@ struct TypedArray : public BufferView {
         TYPE_INT16,
         TYPE_UINT16,
         TYPE_INT32,
         TYPE_UINT32,
         TYPE_FLOAT32,
         TYPE_FLOAT64,
 
         /*
-         * Special type that's a uint8, but assignments are clamped to 0 .. 255.
-         * Treat the raw data type as a uint8.
+         * Special type that's a uint8_t, but assignments are clamped to 0 .. 255.
+         * Treat the raw data type as a uint8_t.
          */
         TYPE_UINT8_CLAMPED,
 
         TYPE_MAX
     };
 
     /*
      * Typed array properties stored in slots, beyond those shared by all
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -5086,17 +5086,17 @@ mjit::Compiler::jsop_getprop(PropertyNam
             }
         }
 
         types::StackTypeSet *types = analysis->poppedTypes(PC, 0);
 
         /*
          * Check if we are accessing the 'length' property of a known dense array.
          * Note that if the types are known to indicate dense arrays, their lengths
-         * must fit in an int32.
+         * must fit in an int32_t.
          */
         if (!types->hasObjectFlags(cx, types::OBJECT_FLAG_NON_DENSE_ARRAY)) {
             bool isObject = top->isTypeKnown();
             if (!isObject) {
                 Jump notObject = frame.testObject(Assembler::NotEqual, top);
                 stubcc.linkExit(notObject, Uses(1));
                 stubcc.leave();
                 stubcc.masm.move(ImmPtr(name), Registers::ArgReg1);
@@ -5114,17 +5114,17 @@ mjit::Compiler::jsop_getprop(PropertyNam
                 bumpPropCount(PC, PCCounts::PROP_DEFINITE);
             if (!isObject)
                 stubcc.rejoin(Changes(1));
             return true;
         }
 
         /*
          * Check if we're accessing the 'length' property of a typed array.
-         * The typed array length always fits in an int32.
+         * The typed array length always fits in an int32_t.
          */
         if (!types->hasObjectFlags(cx, types::OBJECT_FLAG_NON_TYPED_ARRAY)) {
             if (top->isConstant()) {
                 JSObject *obj = &top->getValue().toObject();
                 uint32_t length = TypedArray::length(obj);
                 frame.pop();
                 frame.push(Int32Value(length));
                 return true;
--- a/js/src/methodjit/FastArithmetic.cpp
+++ b/js/src/methodjit/FastArithmetic.cpp
@@ -348,17 +348,17 @@ mjit::Compiler::jsop_binary_double(Frame
      * double result. Unless the pushed type set already contains the double
      * type, we need to call a stub rather than push. Note that looking at
      * the pushed type tag is not sufficient, as it will be UNKNOWN if
      * we do not yet know the possible types of the division's operands.
      */
     types::TypeSet *resultTypes = pushedTypeSet(0);
     if (resultTypes && !resultTypes->hasType(types::Type::DoubleType())) {
         /*
-         * Call a stub and try harder to convert to int32, failing that trigger
+         * Call a stub and try harder to convert to int32_t, failing that trigger
          * recompilation of this script.
          */
         stubcc.linkExit(masm.jump(), Uses(2));
     } else {
         JS_ASSERT(type != JSVAL_TYPE_INT32);
         if (type != JSVAL_TYPE_DOUBLE)
             masm.storeDouble(fpLeft, frame.addressOf(lhs));
     }
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -51,17 +51,17 @@ mjit::Compiler::ensureInteger(FrameEntry
         Jump truncateGuard = masm.branchTruncateDoubleToInt32(fpreg, data);
 
         Label syncPath = stubcc.syncExitAndJump(uses);
         stubcc.linkExitDirect(truncateGuard, stubcc.masm.label());
 
         /*
          * Try an OOL path to convert doubles representing integers within 2^32
          * of a signed integer, by adding/subtracting 2^32 and then trying to
-         * convert to int32. This has to be an exact conversion, as otherwise
+         * convert to int32_t. This has to be an exact conversion, as otherwise
          * the truncation works incorrectly on the modified value.
          */
 
         stubcc.masm.zeroDouble(fptemp);
         Jump positive = stubcc.masm.branchDouble(Assembler::DoubleGreaterThan, fpreg, fptemp);
         stubcc.masm.slowLoadConstantDouble(double(4294967296.0), fptemp);
         Jump skip = stubcc.masm.jump();
         positive.linkTo(stubcc.masm.label(), &stubcc.masm);
@@ -1611,17 +1611,17 @@ mjit::Compiler::jsop_setelem(bool popGua
     //  2) tempRegForData() will work fine on a pinned register.
 
     // Guard that the object is an object.
     if (!obj->isTypeKnown()) {
         Jump j = frame.testObject(Assembler::NotEqual, obj);
         stubcc.linkExit(j, Uses(3));
     }
 
-    // Guard that the id is int32.
+    // Guard that the id is int32_t.
     if (!id->isTypeKnown()) {
         Jump j = frame.testInt32(Assembler::NotEqual, id);
         stubcc.linkExit(j, Uses(3));
     }
 
     // Grab a register for the object. It's safe to unpin |obj| because it
     // won't have been pinned if it shares a backing with |value|. However,
     // it would not be safe to copyDataIntoReg() if the value was pinned,
--- a/js/src/methodjit/FrameEntry.h
+++ b/js/src/methodjit/FrameEntry.h
@@ -50,17 +50,17 @@ class FrameEntry
     }
 #elif defined JS_PUNBOX64
     uint64_t getPayload() const {
         JS_ASSERT(isConstant());
         return v_.asBits & JSVAL_PAYLOAD_MASK;
     }
 #endif
 
-    /* For a constant double FrameEntry, truncate to an int32. */
+    /* For a constant double FrameEntry, truncate to an int32_t. */
     void convertConstantDoubleOrBooleanToInt32(JSContext *cx) {
         JS_ASSERT(isConstant());
         JS_ASSERT(isType(JSVAL_TYPE_DOUBLE) || isType(JSVAL_TYPE_BOOLEAN));
 
         int32_t value;
         ToInt32(cx, getValue(), &value);
 
         Value newValue = Int32Value(value);
--- a/js/src/methodjit/FrameState.h
+++ b/js/src/methodjit/FrameState.h
@@ -313,17 +313,17 @@ class FrameState
      * known to be correct at a slow-path merge point.
      */
     inline void pushUntypedValue(const Value &value);
 
     /*
      * Pushes a number onto the operation stack.
      *
      * If asInt32 is set to true, then the FS will attempt to optimize
-     * syncing the type as int32. Only use this parameter when the fast-path
+     * syncing the type as int32_t. Only use this parameter when the fast-path
      * guaranteed that the stack slot was guarded to be an int32_t originally.
      *
      * For example, checking LHS and RHS as ints guarantees that if the LHS
      * was synced, then popping both and pushing a maybe-int32_t does not need
      * to be synced.
      */
     inline void pushNumber(RegisterID payload, bool asInt32 = false);
 
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -935,17 +935,17 @@ nsCacheProfilePrefObserver::MemoryCacheC
     CACHE_LOG_DEBUG(("Physical Memory size is %llu\n", bytes));
 
     // If getting the physical memory failed, arbitrarily assume
     // 32 MB of RAM. We use a low default to have a reasonable
     // size on all the devices we support.
     if (bytes == 0)
         bytes = 32 * 1024 * 1024;
 
-    // Conversion from unsigned int64 to double doesn't work on all platforms.
+    // Conversion from unsigned int64_t to double doesn't work on all platforms.
     // We need to truncate the value at INT64_MAX to make sure we don't
     // overflow.
     if (bytes > INT64_MAX)
         bytes = INT64_MAX;
 
     uint64_t kbytes = bytes >> 10;
 
     double kBytesD = double(kbytes);
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -898,39 +898,39 @@ nsSOCKSSocketInfo::WriteString(const nsA
     mDataLength += str.Length();
 }
 
 inline uint8_t
 nsSOCKSSocketInfo::ReadUint8()
 {
     uint8_t rv;
     NS_ABORT_IF_FALSE(mReadOffset + sizeof(rv) <= mDataLength,
-                      "Not enough space to pop a uint8!");
+                      "Not enough space to pop a uint8_t!");
     rv = mData[mReadOffset];
     mReadOffset += sizeof(rv);
     return rv;
 }
 
 inline uint16_t
 nsSOCKSSocketInfo::ReadUint16()
 {
     uint16_t rv;
     NS_ABORT_IF_FALSE(mReadOffset + sizeof(rv) <= mDataLength,
-                      "Not enough space to pop a uint16!");
+                      "Not enough space to pop a uint16_t!");
     memcpy(&rv, mData + mReadOffset, sizeof(rv));
     mReadOffset += sizeof(rv);
     return rv;
 }
 
 inline uint32_t
 nsSOCKSSocketInfo::ReadUint32()
 {
     uint32_t rv;
     NS_ABORT_IF_FALSE(mReadOffset + sizeof(rv) <= mDataLength,
-                      "Not enough space to pop a uint32!");
+                      "Not enough space to pop a uint32_t!");
     memcpy(&rv, mData + mReadOffset, sizeof(rv));
     mReadOffset += sizeof(rv);
     return rv;
 }
 
 void
 nsSOCKSSocketInfo::ReadNetAddr(PRNetAddr *addr, uint16_t fam)
 {
--- a/parser/expat/expat_config.h
+++ b/parser/expat/expat_config.h
@@ -11,17 +11,17 @@
 
 #ifdef IS_LITTLE_ENDIAN
 #define BYTEORDER 1234
 #else 
 #define BYTEORDER 4321
 #endif /* IS_LITTLE_ENDIAN */
 
 #if PR_BYTES_PER_INT != 4
-#define int int32
+#define int int32_t
 #endif /* PR_BYTES_PER_INT != 4 */
 
 /* Other Mozilla code relies on memmove already, so we assume it's available */
 #define HAVE_MEMMOVE 1
 
 #define XMLCALL
 #define XML_STATIC
 #define XMLIMPORT
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -1158,17 +1158,17 @@ int32_t nsNavHistoryContainerResultNode:
         NS_ENSURE_SUCCESS(annosvc->GetItemAnnotationType(b->mItemId,
                                                          annoName,
                                                          &b_type), 0);
       } else {
         NS_ENSURE_SUCCESS(annosvc->GetPageAnnotationType(b_uri, annoName,
                                                          &b_type), 0);
       }
       // We better make the API not support this state, really
-      // XXXmano: this is actually wrong for double<->int and int64<->int32
+      // XXXmano: this is actually wrong for double<->int and int64_t<->int32_t
       if (a_hasAnno && b_type != annoType)
         return 0;
       annoType = b_type;
     }
 
 #define GET_ANNOTATIONS_VALUES(METHOD_ITEM, METHOD_PAGE, A_VAL, B_VAL)        \
         if (a_hasAnno) {                                                      \
           if (a_itemAnno) {                                                   \
--- a/toolkit/components/url-classifier/ChunkSet.cpp
+++ b/toolkit/components/url-classifier/ChunkSet.cpp
@@ -35,57 +35,57 @@ ChunkSet::Serialize(nsACString& aChunkSt
 
   return NS_OK;
 }
 
 nsresult
 ChunkSet::Set(uint32_t aChunk)
 {
   uint32_t idx = mChunks.BinaryIndexOf(aChunk);
-  if (idx == nsTArray<uint32>::NoIndex) {
+  if (idx == nsTArray<uint32_t>::NoIndex) {
     mChunks.InsertElementSorted(aChunk);
   }
   return NS_OK;
 }
 
 nsresult
 ChunkSet::Unset(uint32_t aChunk)
 {
   mChunks.RemoveElementSorted(aChunk);
 
   return NS_OK;
 }
 
 bool
 ChunkSet::Has(uint32_t aChunk) const
 {
-  return mChunks.BinaryIndexOf(aChunk) != nsTArray<uint32>::NoIndex;
+  return mChunks.BinaryIndexOf(aChunk) != nsTArray<uint32_t>::NoIndex;
 }
 
 nsresult
 ChunkSet::Merge(const ChunkSet& aOther)
 {
-  const uint32 *dupIter = aOther.mChunks.Elements();
-  const uint32 *end = aOther.mChunks.Elements() + aOther.mChunks.Length();
+  const uint32_t *dupIter = aOther.mChunks.Elements();
+  const uint32_t *end = aOther.mChunks.Elements() + aOther.mChunks.Length();
 
-  for (const uint32 *iter = dupIter; iter != end; iter++) {
+  for (const uint32_t *iter = dupIter; iter != end; iter++) {
     nsresult rv = Set(*iter);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 nsresult
 ChunkSet::Remove(const ChunkSet& aOther)
 {
-  uint32 *addIter = mChunks.Elements();
-  uint32 *end = mChunks.Elements() + mChunks.Length();
+  uint32_t *addIter = mChunks.Elements();
+  uint32_t *end = mChunks.Elements() + mChunks.Length();
 
-  for (uint32 *iter = addIter; iter != end; iter++) {
+  for (uint32_t *iter = addIter; iter != end; iter++) {
     if (!aOther.Has(*iter)) {
       *addIter = *iter;
       addIter++;
     }
   }
 
   mChunks.SetLength(addIter - mChunks.Elements());
 
--- a/toolkit/components/url-classifier/ChunkSet.h
+++ b/toolkit/components/url-classifier/ChunkSet.h
@@ -10,17 +10,17 @@
 #include "Entries.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace safebrowsing {
 
 /**
- * Store the chunks as an array of uint32.
+ * Store the chunks as an array of uint32_t.
  * XXX: We should optimize this further to compress the
  * many consecutive numbers.
  */
 class ChunkSet {
 public:
   ChunkSet() {}
   ~ChunkSet() {}
 
@@ -28,29 +28,29 @@ public:
   nsresult Set(uint32_t aChunk);
   nsresult Unset(uint32_t aChunk);
   void Clear();
   nsresult Merge(const ChunkSet& aOther);
   nsresult Remove(const ChunkSet& aOther);
 
   bool Has(uint32_t chunk) const;
 
-  uint32 Length() const { return mChunks.Length(); }
+  uint32_t Length() const { return mChunks.Length(); }
 
   nsresult Write(nsIOutputStream* aOut) {
     return WriteTArray(aOut, mChunks);
   }
 
   nsresult Read(nsIInputStream* aIn, uint32_t aNumElements) {
     return ReadTArray(aIn, &mChunks, aNumElements);
   }
 
-  uint32 *Begin() { return mChunks.Elements(); }
-  uint32 *End() { return mChunks.Elements() + mChunks.Length(); }
+  uint32_t *Begin() { return mChunks.Elements(); }
+  uint32_t *End() { return mChunks.Elements() + mChunks.Length(); }
 
 private:
-  nsTArray<uint32> mChunks;
+  nsTArray<uint32_t> mChunks;
 };
 
 }
 }
 
 #endif
--- a/toolkit/components/url-classifier/Classifier.cpp
+++ b/toolkit/components/url-classifier/Classifier.cpp
@@ -122,17 +122,17 @@ Classifier::SetupPathNames()
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mStoreDirectory->AppendNative(STORE_DIRECTORY);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Make sure LookupCaches (which are persistent and survive updates)
   // are reading/writing in the right place. We will be moving their
   // files "underneath" them during backup/restore.
-  for (uint32 i = 0; i < mLookupCaches.Length(); i++) {
+  for (uint32_t i = 0; i < mLookupCaches.Length(); i++) {
     mLookupCaches[i]->UpdateDirHandle(mStoreDirectory);
   }
 
   // Directory where to move a backup before an update.
   rv = mCacheDirectory->Clone(getter_AddRefs(mBackupDirectory));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mBackupDirectory->AppendNative(STORE_DIRECTORY + BACKUP_DIR_SUFFIX);
@@ -235,17 +235,17 @@ Classifier::Reset()
   RegenActiveTables();
 }
 
 void
 Classifier::TableRequest(nsACString& aResult)
 {
   nsTArray<nsCString> tables;
   ActiveTables(tables);
-  for (uint32 i = 0; i < tables.Length(); i++) {
+  for (uint32_t i = 0; i < tables.Length(); i++) {
     nsAutoPtr<HashStore> store(new HashStore(tables[i], mStoreDirectory));
     if (!store)
       continue;
 
     nsresult rv = store->Open();
     if (NS_FAILED(rv))
       continue;
 
@@ -371,17 +371,17 @@ Classifier::ApplyUpdates(nsTArray<TableU
 
   LOG(("Backup before update."));
 
   nsresult rv = BackupTables();
   NS_ENSURE_SUCCESS(rv, rv);
 
   LOG(("Applying table updates."));
 
-  for (uint32 i = 0; i < aUpdates->Length(); i++) {
+  for (uint32_t i = 0; i < aUpdates->Length(); i++) {
     // Previous ApplyTableUpdates() may have consumed this update..
     if ((*aUpdates)[i]) {
       // Run all updates for one table
       nsCString updateTable(aUpdates->ElementAt(i)->TableName());
       rv = ApplyTableUpdates(aUpdates, updateTable);
       if (NS_FAILED(rv)) {
         Reset();
         return rv;
@@ -415,46 +415,46 @@ Classifier::ApplyUpdates(nsTArray<TableU
 #endif
 
   return NS_OK;
 }
 
 nsresult
 Classifier::MarkSpoiled(nsTArray<nsCString>& aTables)
 {
-  for (uint32 i = 0; i < aTables.Length(); i++) {
+  for (uint32_t i = 0; i < aTables.Length(); i++) {
     LOG(("Spoiling table: %s", aTables[i].get()));
     // Spoil this table by marking it as no known freshness
     mTableFreshness.Remove(aTables[i]);
   }
   return NS_OK;
 }
 
 void
 Classifier::DropStores()
 {
-  for (uint32 i = 0; i < mHashStores.Length(); i++) {
+  for (uint32_t i = 0; i < mHashStores.Length(); i++) {
     delete mHashStores[i];
   }
   mHashStores.Clear();
-  for (uint32 i = 0; i < mLookupCaches.Length(); i++) {
+  for (uint32_t i = 0; i < mLookupCaches.Length(); i++) {
     delete mLookupCaches[i];
   }
   mLookupCaches.Clear();
 }
 
 nsresult
 Classifier::RegenActiveTables()
 {
   mActiveTablesCache.Clear();
 
   nsTArray<nsCString> foundTables;
   ScanStoreDir(foundTables);
 
-  for (uint32 i = 0; i < foundTables.Length(); i++) {
+  for (uint32_t i = 0; i < foundTables.Length(); i++) {
     nsAutoPtr<HashStore> store(new HashStore(nsCString(foundTables[i]), mStoreDirectory));
     if (!store)
       return NS_ERROR_OUT_OF_MEMORY;
 
     nsresult rv = store->Open();
     if (NS_FAILED(rv))
       continue;
 
@@ -624,19 +624,19 @@ Classifier::ApplyTableUpdates(nsTArray<T
 
   nsAutoPtr<HashStore> store(new HashStore(aTable, mStoreDirectory));
 
   if (!store)
     return NS_ERROR_FAILURE;
 
   // take the quick exit if there is no valid update for us
   // (common case)
-  uint32 validupdates = 0;
+  uint32_t validupdates = 0;
 
-  for (uint32 i = 0; i < aUpdates->Length(); i++) {
+  for (uint32_t i = 0; i < aUpdates->Length(); i++) {
     TableUpdate *update = aUpdates->ElementAt(i);
     if (!update || !update->TableName().Equals(store->TableName()))
       continue;
     if (update->Empty()) {
       aUpdates->ElementAt(i) = nullptr;
       delete update;
       continue;
     }
@@ -659,20 +659,20 @@ Classifier::ApplyTableUpdates(nsTArray<T
   }
   nsTArray<uint32_t> AddPrefixHashes;
   rv = prefixSet->GetPrefixes(&AddPrefixHashes);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = store->AugmentAdds(AddPrefixHashes);
   NS_ENSURE_SUCCESS(rv, rv);
   AddPrefixHashes.Clear();
 
-  uint32 applied = 0;
+  uint32_t applied = 0;
   bool updateFreshness = false;
 
-  for (uint32 i = 0; i < aUpdates->Length(); i++) {
+  for (uint32_t i = 0; i < aUpdates->Length(); i++) {
     TableUpdate *update = aUpdates->ElementAt(i);
     if (!update || !update->TableName().Equals(store->TableName()))
       continue;
 
     rv = store->ApplyUpdate(*update);
     NS_ENSURE_SUCCESS(rv, rv);
 
     applied++;
@@ -729,17 +729,17 @@ Classifier::ApplyTableUpdates(nsTArray<T
   }
 
   return NS_OK;
 }
 
 LookupCache *
 Classifier::GetLookupCache(const nsACString& aTable)
 {
-  for (uint32 i = 0; i < mLookupCaches.Length(); i++) {
+  for (uint32_t i = 0; i < mLookupCaches.Length(); i++) {
     if (mLookupCaches[i]->TableName().Equals(aTable)) {
       return mLookupCaches[i];
     }
   }
 
   LookupCache *cache = new LookupCache(aTable, mStoreDirectory,
                                        mPerClientRandomize);
   nsresult rv = cache->Init();
--- a/toolkit/components/url-classifier/Entries.h
+++ b/toolkit/components/url-classifier/Entries.h
@@ -26,33 +26,33 @@ extern PRLogModuleInfo *gUrlClassifierDb
 #endif
 
 namespace mozilla {
 namespace safebrowsing {
 
 #define PREFIX_SIZE   4
 #define COMPLETE_SIZE 32
 
-template <uint32 S, class Comparator>
+template <uint32_t S, class Comparator>
 struct SafebrowsingHash
 {
-  static const uint32 sHashSize = S;
+  static const uint32_t sHashSize = S;
   typedef SafebrowsingHash<S, Comparator> self_type;
-  uint8 buf[S];
+  uint8_t buf[S];
 
   nsresult FromPlaintext(const nsACString& aPlainText, nsICryptoHash* aHash) {
     // From the protocol doc:
     // Each entry in the chunk is composed
     // of the SHA 256 hash of a suffix/prefix expression.
 
     nsresult rv = aHash->Init(nsICryptoHash::SHA256);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = aHash->Update
-      (reinterpret_cast<const uint8*>(aPlainText.BeginReading()),
+      (reinterpret_cast<const uint8_t*>(aPlainText.BeginReading()),
        aPlainText.Length());
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoCString hashed;
     rv = aHash->Finish(false, hashed);
     NS_ENSURE_SUCCESS(rv, rv);
 
     NS_ASSERTION(hashed.Length() >= sHashSize,
@@ -82,35 +82,35 @@ struct SafebrowsingHash
   }
 
   bool operator<(const self_type& aOther) const {
     return Comparator::Compare(buf, aOther.buf) < 0;
   }
 
 #ifdef DEBUG
   void ToString(nsACString& aStr) const {
-    uint32 len = ((sHashSize + 2) / 3) * 4;
+    uint32_t len = ((sHashSize + 2) / 3) * 4;
     aStr.SetCapacity(len + 1);
     PL_Base64Encode((char*)buf, sHashSize, aStr.BeginWriting());
     aStr.BeginWriting()[len] = '\0';
   }
 #endif
   uint32_t ToUint32() const {
-      return *((uint32*)buf);
+      return *((uint32_t*)buf);
   }
   void FromUint32(uint32_t aHash) {
-      *((uint32*)buf) = aHash;
+      *((uint32_t*)buf) = aHash;
   }
 };
 
 class PrefixComparator {
 public:
   static int Compare(const uint8_t* a, const uint8_t* b) {
-      uint32 first = *((uint32*)a);
-      uint32 second = *((uint32*)b);
+      uint32_t first = *((uint32_t*)a);
+      uint32_t second = *((uint32_t*)b);
       if (first > second) {
           return 1;
       } else if (first == second) {
           return 0;
       } else {
           return -1;
       }
   }
@@ -124,21 +124,21 @@ public:
     return memcmp(a, b, COMPLETE_SIZE);
   }
 };
 typedef SafebrowsingHash<COMPLETE_SIZE, CompletionComparator> Completion;
 typedef nsTArray<Completion> CompletionArray;
 
 struct AddPrefix {
   Prefix prefix;
-  uint32 addChunk;
+  uint32_t addChunk;
 
   AddPrefix() : addChunk(0) {}
 
-  uint32 Chunk() const { return addChunk; }
+  uint32_t Chunk() const { return addChunk; }
   const Prefix &PrefixHash() const { return prefix; }
 
   template<class T>
   int Compare(const T& other) const {
     int cmp = prefix.Compare(other.PrefixHash());
     if (cmp != 0) {
       return cmp;
     }
@@ -146,43 +146,43 @@ struct AddPrefix {
   }
 };
 
 struct AddComplete {
   union {
     Prefix prefix;
     Completion complete;
   } hash;
-  uint32 addChunk;
+  uint32_t addChunk;
 
   AddComplete() : addChunk(0) {}
 
-  uint32 Chunk() const { return addChunk; }
+  uint32_t Chunk() const { return addChunk; }
   const Prefix &PrefixHash() const { return hash.prefix; }
   const Completion &CompleteHash() const { return hash.complete; }
 
   template<class T>
   int Compare(const T& other) const {
     int cmp = hash.complete.Compare(other.CompleteHash());
     if (cmp != 0) {
       return cmp;
     }
     return addChunk - other.addChunk;
   }
 };
 
 struct SubPrefix {
   Prefix prefix;
-  uint32 addChunk;
-  uint32 subChunk;
+  uint32_t addChunk;
+  uint32_t subChunk;
 
   SubPrefix(): addChunk(0), subChunk(0) {}
 
-  uint32 Chunk() const { return subChunk; }
-  uint32 AddChunk() const { return addChunk; }
+  uint32_t Chunk() const { return subChunk; }
+  uint32_t AddChunk() const { return addChunk; }
   const Prefix &PrefixHash() const { return prefix; }
 
   template<class T>
   int Compare(const T& aOther) const {
     int cmp = prefix.Compare(aOther.PrefixHash());
     if (cmp != 0)
       return cmp;
     if (addChunk != aOther.addChunk)
@@ -199,23 +199,23 @@ struct SubPrefix {
   }
 };
 
 struct SubComplete {
   union {
     Prefix prefix;
     Completion complete;
   } hash;
-  uint32 addChunk;
-  uint32 subChunk;
+  uint32_t addChunk;
+  uint32_t subChunk;
 
   SubComplete() : addChunk(0), subChunk(0) {}
 
-  uint32 Chunk() const { return subChunk; }
-  uint32 AddChunk() const { return addChunk; }
+  uint32_t Chunk() const { return subChunk; }
+  uint32_t AddChunk() const { return addChunk; }
   const Prefix &PrefixHash() const { return hash.prefix; }
   const Completion &CompleteHash() const { return hash.complete; }
 
   int Compare(const SubComplete& aOther) const {
     int cmp = hash.complete.Compare(aOther.hash.complete);
     if (cmp != 0)
       return cmp;
     if (addChunk != aOther.addChunk)
--- a/toolkit/components/url-classifier/HashStore.cpp
+++ b/toolkit/components/url-classifier/HashStore.cpp
@@ -53,45 +53,45 @@
 // the upper 16-bits are correlated, it is worthwhile to slice 32-bit
 // values into 4 1-byte slices and compress the slices individually.
 // The slices corresponding to MSBs will compress very well, and the
 // slice corresponding to LSB almost nothing. Because of this, we
 // only apply DEFLATE to the 3 most significant bytes, and store the
 // LSB uncompressed.
 //
 // byte sliced (numValues) data format:
-//    uint32 compressed-size
+//    uint32_t compressed-size
 //    compressed-size bytes    zlib DEFLATE data
 //        0...numValues        byte MSB of 4-byte numValues data
-//    uint32 compressed-size
+//    uint32_t compressed-size
 //    compressed-size bytes    zlib DEFLATE data
 //        0...numValues        byte 2nd byte of 4-byte numValues data
-//    uint32 compressed-size
+//    uint32_t compressed-size
 //    compressed-size bytes    zlib DEFLATE data
 //        0...numValues        byte 3rd byte of 4-byte numValues data
 //    0...numValues            byte LSB of 4-byte numValues data
 //
 // Store data format:
-//    uint32 magic
-//    uint32 version
-//    uint32 numAddChunks
-//    uint32 numSubChunks
-//    uint32 numAddPrefixes
-//    uint32 numSubPrefixes
-//    uint32 numAddCompletes
-//    uint32 numSubCompletes
-//    0...numAddChunks               uint32 addChunk
-//    0...numSubChunks               uint32 subChunk
-//    byte sliced (numAddPrefixes)   uint32 add chunk of AddPrefixes
-//    byte sliced (numSubPrefixes)   uint32 add chunk of SubPrefixes
-//    byte sliced (numSubPrefixes)   uint32 sub chunk of SubPrefixes
-//    byte sliced (numSubPrefixes)   uint32 SubPrefixes
-//    0...numAddCompletes            32-byte Completions + uint32 addChunk
-//    0...numSubCompletes            32-byte Completions + uint32 addChunk
-//                                                       + uint32 subChunk
+//    uint32_t magic
+//    uint32_t version
+//    uint32_t numAddChunks
+//    uint32_t numSubChunks
+//    uint32_t numAddPrefixes
+//    uint32_t numSubPrefixes
+//    uint32_t numAddCompletes
+//    uint32_t numSubCompletes
+//    0...numAddChunks               uint32_t addChunk
+//    0...numSubChunks               uint32_t subChunk
+//    byte sliced (numAddPrefixes)   uint32_t add chunk of AddPrefixes
+//    byte sliced (numSubPrefixes)   uint32_t add chunk of SubPrefixes
+//    byte sliced (numSubPrefixes)   uint32_t sub chunk of SubPrefixes
+//    byte sliced (numSubPrefixes)   uint32_t SubPrefixes
+//    0...numAddCompletes            32-byte Completions + uint32_t addChunk
+//    0...numSubCompletes            32-byte Completions + uint32_t addChunk
+//                                                       + uint32_t subChunk
 //    16-byte MD5 of all preceding data
 
 // Name of the SafeBrowsing store
 #define STORE_SUFFIX ".sbstore"
 
 // NSPR_LOG_MODULES=UrlClassifierDbService:5
 extern PRLogModuleInfo *gUrlClassifierDbServiceLog;
 #if defined(PR_LOGGING)
@@ -112,18 +112,18 @@ extern PRLogModuleInfo *gUrlClassifierDb
       Reset();                                                            \
       return __rv;                                                        \
     }                                                                     \
   } while(0)
 
 namespace mozilla {
 namespace safebrowsing {
 
-const uint32 STORE_MAGIC = 0x1231af3b;
-const uint32 CURRENT_VERSION = 2;
+const uint32_t STORE_MAGIC = 0x1231af3b;
+const uint32_t CURRENT_VERSION = 2;
 
 void
 TableUpdate::NewAddPrefix(uint32_t aAddChunk, const Prefix& aHash)
 {
   AddPrefix *add = mAddPrefixes.AppendElement();
   add->addChunk = aAddChunk;
   add->prefix = aHash;
 }
@@ -309,17 +309,17 @@ HashStore::CalculateChecksum(nsAutoCStri
   // Reset mInputStream to start
   nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mInputStream);
   nsresult rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
 
   nsCOMPtr<nsICryptoHash> hash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Size of MD5 hash in bytes
-  const uint32 CHECKSUM_SIZE = 16;
+  const uint32_t CHECKSUM_SIZE = 16;
 
   rv = hash->Init(nsICryptoHash::MD5);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!aChecksumPresent) {
     // Hash entire file
     rv = hash->UpdateFromStream(mInputStream, UINT32_MAX);
   } else {
@@ -374,18 +374,18 @@ nsresult
 HashStore::ReadHashes()
 {
   if (!mInputStream) {
     return NS_OK;
   }
 
   nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mInputStream);
 
-  uint32 offset = sizeof(Header);
-  offset += (mHeader.numAddChunks + mHeader.numSubChunks) * sizeof(uint32);
+  uint32_t offset = sizeof(Header);
+  offset += (mHeader.numAddChunks + mHeader.numSubChunks) * sizeof(uint32_t);
   nsresult rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, offset);
 
   rv = ReadAddPrefixes();
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ReadSubPrefixes();
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -668,17 +668,17 @@ ByteSliceRead(nsIInputStream* aInStream,
   rv = InflateReadTArray(aInStream, &slice3, count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ReadTArray(aInStream, &slice4, count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   aData->SetCapacity(count);
 
-  for (uint32 i = 0; i < count; i++) {
+  for (uint32_t i = 0; i < count; i++) {
     aData->AppendElement((slice1[i] << 24) | (slice2[i] << 16)
                          | (slice3[i] << 8) | (slice4[i]));
   }
 
   return NS_OK;
 }
 
 nsresult
@@ -713,17 +713,17 @@ HashStore::ReadSubPrefixes()
 
   rv = ByteSliceRead(mInputStream, &subchunks, count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ByteSliceRead(mInputStream, &prefixes, count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mSubPrefixes.SetCapacity(count);
-  for (uint32 i = 0; i < count; i++) {
+  for (uint32_t i = 0; i < count; i++) {
     SubPrefix *sub = mSubPrefixes.AppendElement();
     sub->addChunk = addchunks[i];
     sub->prefix.FromUint32(prefixes[i]);
     sub->subChunk = subchunks[i];
   }
 
   return NS_OK;
 }
@@ -731,17 +731,17 @@ HashStore::ReadSubPrefixes()
 // Split up PrefixArray back into the constituents
 nsresult
 HashStore::WriteAddPrefixes(nsIOutputStream* aOut)
 {
   nsTArray<uint32_t> chunks;
   uint32_t count = mAddPrefixes.Length();
   chunks.SetCapacity(count);
 
-  for (uint32 i = 0; i < count; i++) {
+  for (uint32_t i = 0; i < count; i++) {
     chunks.AppendElement(mAddPrefixes[i].Chunk());
   }
 
   nsresult rv = ByteSliceWrite(aOut, chunks);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
@@ -752,17 +752,17 @@ HashStore::WriteSubPrefixes(nsIOutputStr
   nsTArray<uint32_t> addchunks;
   nsTArray<uint32_t> subchunks;
   nsTArray<uint32_t> prefixes;
   uint32_t count = mSubPrefixes.Length();
   addchunks.SetCapacity(count);
   subchunks.SetCapacity(count);
   prefixes.SetCapacity(count);
 
-  for (uint32 i = 0; i < count; i++) {
+  for (uint32_t i = 0; i < count; i++) {
     addchunks.AppendElement(mSubPrefixes[i].AddChunk());
     prefixes.AppendElement(mSubPrefixes[i].PrefixHash().ToUint32());
     subchunks.AppendElement(mSubPrefixes[i].Chunk());
   }
 
   nsresult rv = ByteSliceWrite(aOut, addchunks);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -823,18 +823,18 @@ HashStore::WriteFile()
 
   return NS_OK;
 }
 
 template <class T>
 static void
 Erase(nsTArray<T>* array, T* iterStart, T* iterEnd)
 {
-  uint32 start = iterStart - array->Elements();
-  uint32 count = iterEnd - iterStart;
+  uint32_t start = iterStart - array->Elements();
+  uint32_t count = iterEnd - iterStart;
 
   if (count > 0) {
     array->RemoveElementsAt(start, count);
   }
 }
 
 // Find items matching between |subs| and |adds|, and remove them,
 // recording the item from |adds| in |adds_removed|.  To minimize
@@ -858,17 +858,17 @@ KnockoutSubs(nsTArray<TSub>* aSubs, nsTA
   TSub* subOut = aSubs->Elements();
   TSub* subIter = aSubs->Elements();
 
   TAdd* addEnd = addIter + aAdds->Length();
   TSub* subEnd = subIter + aSubs->Length();
 
   while (addIter != addEnd && subIter != subEnd) {
     // additer compare, so it compares on add chunk
-    int32 cmp = addIter->Compare(*subIter);
+    int32_t cmp = addIter->Compare(*subIter);
     if (cmp > 0) {
       // If |*sub_iter| < |*add_iter|, retain the sub.
       *subOut = *subIter;
       ++subOut;
       ++subIter;
     } else if (cmp < 0) {
       // If |*add_iter| < |*sub_iter|, retain the add.
       *addOut = *addIter;
@@ -895,17 +895,17 @@ RemoveMatchingPrefixes(const SubPrefixAr
   T* out = aFullHashes->Elements();
   T* hashIter = out;
   T* hashEnd = aFullHashes->Elements() + aFullHashes->Length();
 
   SubPrefix const * removeIter = aSubs.Elements();
   SubPrefix const * removeEnd = aSubs.Elements() + aSubs.Length();
 
   while (hashIter != hashEnd && removeIter != removeEnd) {
-    int32 cmp = removeIter->CompareAlt(*hashIter);
+    int32_t cmp = removeIter->CompareAlt(*hashIter);
     if (cmp > 0) {
       // Keep items less than |*removeIter|.
       *out = *hashIter;
       ++out;
       ++hashIter;
     } else if (cmp < 0) {
       // No hit for |*removeIter|, bump it forward.
       ++removeIter;
@@ -1001,22 +1001,22 @@ HashStore::ProcessSubs()
 #endif
 
   return NS_OK;
 }
 
 nsresult
 HashStore::AugmentAdds(const nsTArray<uint32_t>& aPrefixes)
 {
-  uint32 cnt = aPrefixes.Length();
+  uint32_t cnt = aPrefixes.Length();
   if (cnt != mAddPrefixes.Length()) {
     LOG(("Amount of prefixes in cache not consistent with store (%d vs %d)",
          aPrefixes.Length(), mAddPrefixes.Length()));
     return NS_ERROR_FAILURE;
   }
-  for (uint32 i = 0; i < cnt; i++) {
+  for (uint32_t i = 0; i < cnt; i++) {
     mAddPrefixes[i].prefix.FromUint32(aPrefixes[i]);
   }
   return NS_OK;
 }
 
 }
 }
--- a/toolkit/components/url-classifier/HashStore.h
+++ b/toolkit/components/url-classifier/HashStore.h
@@ -126,24 +126,24 @@ private:
   nsresult ReadSubPrefixes();
 
   nsresult WriteAddPrefixes(nsIOutputStream* aOut);
   nsresult WriteSubPrefixes(nsIOutputStream* aOut);
 
   nsresult ProcessSubs();
 
   struct Header {
-    uint32 magic;
-    uint32 version;
-    uint32 numAddChunks;
-    uint32 numSubChunks;
-    uint32 numAddPrefixes;
-    uint32 numSubPrefixes;
-    uint32 numAddCompletes;
-    uint32 numSubCompletes;
+    uint32_t magic;
+    uint32_t version;
+    uint32_t numAddChunks;
+    uint32_t numSubChunks;
+    uint32_t numAddPrefixes;
+    uint32_t numSubPrefixes;
+    uint32_t numAddCompletes;
+    uint32_t numSubCompletes;
   };
 
   Header mHeader;
 
   nsCString mTableName;
   nsCOMPtr<nsIFile> mStoreDirectory;
 
   bool mInUpdate;
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -16,19 +16,19 @@
 // the updates from the protocol.
 
 // This module has its own store, which stores the Completions,
 // mostly caching lookups that have happened over the net.
 // The prefixes are cached/checked by looking them up in the
 // PrefixSet.
 
 // Data format for the ".cache" files:
-//    uint32 magic           Identify the file type
-//    uint32 version         Version identifier for file format
-//    uint32 numCompletions  Amount of completions stored
+//    uint32_t magic           Identify the file type
+//    uint32_t version         Version identifier for file format
+//    uint32_t numCompletions  Amount of completions stored
 //    0...numCompletions     256-bit Completions
 
 // Name of the lookupcomplete cache
 #define CACHE_SUFFIX ".cache"
 
 // Name of the persistent PrefixSet storage
 #define PREFIXSET_SUFFIX  ".pset"
 
@@ -40,18 +40,18 @@ extern PRLogModuleInfo *gUrlClassifierDb
 #else
 #define LOG(args)
 #define LOG_ENABLED() (false)
 #endif
 
 namespace mozilla {
 namespace safebrowsing {
 
-const uint32 LOOKUPCACHE_MAGIC = 0x1231af3e;
-const uint32 CURRENT_VERSION = 1;
+const uint32_t LOOKUPCACHE_MAGIC = 0x1231af3e;
+const uint32_t CURRENT_VERSION = 1;
 
 LookupCache::LookupCache(const nsACString& aTableName, nsIFile* aStoreDir,
                          bool aPerClientRandomize)
   : mPrimed(false)
   , mPerClientRandomize(aPerClientRandomize)
   , mTableName(aTableName)
   , mStoreDirectory(aStoreDir)
 {
@@ -154,17 +154,17 @@ nsresult
 LookupCache::Build(AddPrefixArray& aAddPrefixes,
                    AddCompleteArray& aAddCompletes)
 {
   Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS,
                         static_cast<uint32_t>(aAddCompletes.Length()));
 
   mCompletions.Clear();
   mCompletions.SetCapacity(aAddCompletes.Length());
-  for (uint32 i = 0; i < aAddCompletes.Length(); i++) {
+  for (uint32_t i = 0; i < aAddCompletes.Length(); i++) {
     mCompletions.AppendElement(aAddCompletes[i].CompleteHash());
   }
   aAddCompletes.Clear();
   mCompletions.Sort();
 
   Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES,
                         static_cast<uint32_t>(aAddPrefixes.Length()));
 
@@ -177,17 +177,17 @@ LookupCache::Build(AddPrefixArray& aAddP
 
 #if defined(DEBUG) && defined(PR_LOGGING)
 void
 LookupCache::Dump()
 {
   if (!LOG_ENABLED())
     return;
 
-  for (uint32 i = 0; i < mCompletions.Length(); i++) {
+  for (uint32_t i = 0; i < mCompletions.Length(); i++) {
     nsAutoCString str;
     mCompletions[i].ToString(str);
     LOG(("Completion: %s", str.get()));
   }
 }
 #endif
 
 nsresult
@@ -676,17 +676,17 @@ static void EnsureSorted(T* aArray)
 nsresult
 LookupCache::ConstructPrefixSet(AddPrefixArray& aAddPrefixes)
 {
   Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_CONSTRUCT_TIME> timer;
 
   nsTArray<uint32_t> array;
   array.SetCapacity(aAddPrefixes.Length());
 
-  for (uint32 i = 0; i < aAddPrefixes.Length(); i++) {
+  for (uint32_t i = 0; i < aAddPrefixes.Length(); i++) {
     array.AppendElement(aAddPrefixes[i].PrefixHash().ToUint32());
   }
   aAddPrefixes.Clear();
 
 #ifdef DEBUG
   // PrefixSet requires sorted order
   EnsureSorted(&array);
 #endif
--- a/toolkit/components/url-classifier/LookupCache.h
+++ b/toolkit/components/url-classifier/LookupCache.h
@@ -134,19 +134,19 @@ private:
   nsresult ReadCompletions(nsIInputStream* aInputStream);
   nsresult EnsureSizeConsistent();
   nsresult LoadPrefixSet();
   // Construct a Prefix Set with known prefixes.
   // This will Clear() aAddPrefixes when done.
   nsresult ConstructPrefixSet(AddPrefixArray& aAddPrefixes);
 
   struct Header {
-    uint32 magic;
-    uint32 version;
-    uint32 numCompletions;
+    uint32_t magic;
+    uint32_t version;
+    uint32_t numCompletions;
   };
   Header mHeader;
 
   bool mPrimed;
   bool mPerClientRandomize;
   nsCString mTableName;
   nsCOMPtr<nsIFile> mStoreDirectory;
   CompletionArray mCompletions;
--- a/toolkit/components/url-classifier/ProtocolParser.cpp
+++ b/toolkit/components/url-classifier/ProtocolParser.cpp
@@ -22,19 +22,19 @@ extern PRLogModuleInfo *gUrlClassifierDb
 #define LOG(args)
 #define LOG_ENABLED() (false)
 #endif
 
 namespace mozilla {
 namespace safebrowsing {
 
 // Updates will fail if fed chunks larger than this
-const uint32 MAX_CHUNK_SIZE = (1024 * 1024);
+const uint32_t MAX_CHUNK_SIZE = (1024 * 1024);
 
-const uint32 DOMAIN_SIZE = 4;
+const uint32_t DOMAIN_SIZE = 4;
 
 // Parse one stringified range of chunks of the form "n" or "n-m" from a
 // comma-separated list of chunks.  Upon return, 'begin' will point to the
 // next range of chunks in the list of chunks.
 static bool
 ParseChunkRange(nsACString::const_iterator& aBegin,
                 const nsACString::const_iterator& aEnd,
                 uint32_t* aFirst, uint32_t* aLast)
@@ -426,17 +426,17 @@ ProtocolParser::ProcessPlaintextChunk(co
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv;
   nsTArray<nsCString> lines;
   ParseString(PromiseFlatCString(aChunk), '\n', lines);
 
   // non-hashed tables need to be hashed
-  for (uint32 i = 0; i < lines.Length(); i++) {
+  for (uint32_t i = 0; i < lines.Length(); i++) {
     nsCString& line = lines[i];
 
     if (mChunkState.type == CHUNK_ADD) {
       if (mChunkState.hashSize == COMPLETE_SIZE) {
         Completion hash;
         hash.FromPlaintext(line, mCryptoHash);
         mTableUpdate->NewAddComplete(mChunkState.num, hash);
       } else {
@@ -454,17 +454,17 @@ ProtocolParser::ProcessPlaintextChunk(co
         newHash.FromUint32(codedHash);
         mTableUpdate->NewAddPrefix(mChunkState.num, newHash);
       }
     } else {
       nsCString::const_iterator begin, iter, end;
       line.BeginReading(begin);
       line.EndReading(end);
       iter = begin;
-      uint32 addChunk;
+      uint32_t addChunk;
       if (!FindCharInReadable(':', iter, end) ||
           PR_sscanf(lines[i].get(), "%d:", &addChunk) != 1) {
         NS_WARNING("Received sub chunk without associated add chunk.");
         return NS_ERROR_FAILURE;
       }
       iter++;
 
       if (mChunkState.hashSize == COMPLETE_SIZE) {
@@ -502,17 +502,17 @@ ProtocolParser::ProcessShaChunk(const ns
   uint32_t start = 0;
   while (start < aChunk.Length()) {
     // First four bytes are the domain key.
     Prefix domain;
     domain.Assign(Substring(aChunk, start, DOMAIN_SIZE));
     start += DOMAIN_SIZE;
 
     // Then a count of entries.
-    uint8 numEntries = static_cast<uint8>(aChunk[start]);
+    uint8_t numEntries = static_cast<uint8_t>(aChunk[start]);
     start++;
 
     nsresult rv;
     if (mChunkState.type == CHUNK_ADD && mChunkState.hashSize == PREFIX_SIZE) {
       rv = ProcessHostAdd(domain, numEntries, aChunk, &start);
     } else if (mChunkState.type == CHUNK_ADD && mChunkState.hashSize == COMPLETE_SIZE) {
       rv = ProcessHostAddComplete(numEntries, aChunk, &start);
     } else if (mChunkState.type == CHUNK_SUB && mChunkState.hashSize == PREFIX_SIZE) {
@@ -552,17 +552,17 @@ ProtocolParser::ProcessHostAdd(const Pre
     return NS_OK;
   }
 
   if (*aStart + (PREFIX_SIZE * aNumEntries) > aChunk.Length()) {
     NS_WARNING("Chunk is not long enough to contain the expected entries.");
     return NS_ERROR_FAILURE;
   }
 
-  for (uint8 i = 0; i < aNumEntries; i++) {
+  for (uint8_t i = 0; i < aNumEntries; i++) {
     Prefix hash;
     hash.Assign(Substring(aChunk, *aStart, PREFIX_SIZE));
     nsresult rv = LookupCache::KeyedHash(hash.ToUint32(), domHash, mHashKey, &codedHash,
                                          !mPerClientRandomize);
     NS_ENSURE_SUCCESS(rv, rv);
     Prefix newHash;
     newHash.FromUint32(codedHash);
     mTableUpdate->NewAddPrefix(mChunkState.num, newHash);
@@ -586,17 +586,17 @@ ProtocolParser::ProcessHostSub(const Pre
     if ((*aStart) + 4 > aChunk.Length()) {
       NS_WARNING("Received a zero-entry sub chunk without an associated add.");
       return NS_ERROR_FAILURE;
     }
 
     const nsCSubstring& addChunkStr = Substring(aChunk, *aStart, 4);
     *aStart += 4;
 
-    uint32 addChunk;
+    uint32_t addChunk;
     memcpy(&addChunk, addChunkStr.BeginReading(), 4);
     addChunk = PR_ntohl(addChunk);
 
     nsresult rv = LookupCache::KeyedHash(domHash, domHash, mHashKey, &codedHash,
                                          !mPerClientRandomize);
     NS_ENSURE_SUCCESS(rv, rv);
     Prefix newHash;
     newHash.FromUint32(codedHash);
@@ -609,21 +609,21 @@ ProtocolParser::ProcessHostSub(const Pre
     return NS_OK;
   }
 
   if (*aStart + ((PREFIX_SIZE + 4) * aNumEntries) > aChunk.Length()) {
     NS_WARNING("Chunk is not long enough to contain the expected entries.");
     return NS_ERROR_FAILURE;
   }
 
-  for (uint8 i = 0; i < aNumEntries; i++) {
+  for (uint8_t i = 0; i < aNumEntries; i++) {
     const nsCSubstring& addChunkStr = Substring(aChunk, *aStart, 4);
     *aStart += 4;
 
-    uint32 addChunk;
+    uint32_t addChunk;
     memcpy(&addChunk, addChunkStr.BeginReading(), 4);
     addChunk = PR_ntohl(addChunk);
 
     Prefix prefix;
     prefix.Assign(Substring(aChunk, *aStart, PREFIX_SIZE));
     *aStart += PREFIX_SIZE;
 
     nsresult rv = LookupCache::KeyedHash(prefix.ToUint32(), domHash, mHashKey,
@@ -655,17 +655,17 @@ ProtocolParser::ProcessHostAddComplete(u
     return NS_OK;
   }
 
   if (*aStart + (COMPLETE_SIZE * aNumEntries) > aChunk.Length()) {
     NS_WARNING("Chunk is not long enough to contain the expected entries.");
     return NS_ERROR_FAILURE;
   }
 
-  for (uint8 i = 0; i < aNumEntries; i++) {
+  for (uint8_t i = 0; i < aNumEntries; i++) {
     Completion hash;
     hash.Assign(Substring(aChunk, *aStart, COMPLETE_SIZE));
     mTableUpdate->NewAddComplete(mChunkState.num, hash);
     *aStart += COMPLETE_SIZE;
   }
 
   return NS_OK;
 }
@@ -691,51 +691,51 @@ ProtocolParser::ProcessHostSubComplete(u
   for (uint8_t i = 0; i < aNumEntries; i++) {
     Completion hash;
     hash.Assign(Substring(aChunk, *aStart, COMPLETE_SIZE));
     *aStart += COMPLETE_SIZE;
 
     const nsCSubstring& addChunkStr = Substring(aChunk, *aStart, 4);
     *aStart += 4;
 
-    uint32 addChunk;
+    uint32_t addChunk;
     memcpy(&addChunk, addChunkStr.BeginReading(), 4);
     addChunk = PR_ntohl(addChunk);
 
     mTableUpdate->NewSubComplete(addChunk, hash, mChunkState.num);
   }
 
   return NS_OK;
 }
 
 bool
 ProtocolParser::NextLine(nsACString& line)
 {
-  int32 newline = mPending.FindChar('\n');
+  int32_t newline = mPending.FindChar('\n');
   if (newline == kNotFound) {
     return false;
   }
   line.Assign(Substring(mPending, 0, newline));
   mPending = Substring(mPending, newline + 1);
   return true;
 }
 
 void
 ProtocolParser::CleanupUpdates()
 {
-  for (uint32 i = 0; i < mTableUpdates.Length(); i++) {
+  for (uint32_t i = 0; i < mTableUpdates.Length(); i++) {
     delete mTableUpdates[i];
   }
   mTableUpdates.Clear();
 }
 
 TableUpdate *
 ProtocolParser::GetTableUpdate(const nsACString& aTable)
 {
-  for (uint32 i = 0; i < mTableUpdates.Length(); i++) {
+  for (uint32_t i = 0; i < mTableUpdates.Length(); i++) {
     if (aTable.Equals(mTableUpdates[i]->TableName())) {
       return mTableUpdates[i];
     }
   }
 
   // We free automatically on destruction, ownership of these
   // updates can be transferred to DBServiceWorker, which passes
   // them back to Classifier when doing the updates, and that
--- a/toolkit/components/url-classifier/ProtocolParser.h
+++ b/toolkit/components/url-classifier/ProtocolParser.h
@@ -42,17 +42,17 @@ public:
   // Forget the table updates that were created by this pass.  It
   // becomes the caller's responsibility to free them.  This is shitty.
   TableUpdate *GetTableUpdate(const nsACString& aTable);
   void ForgetTableUpdates() { mTableUpdates.Clear(); }
   nsTArray<TableUpdate*> &GetTableUpdates() { return mTableUpdates; }
 
   // Update information.
   const nsTArray<ForwardedUpdate> &Forwards() const { return mForwards; }
-  int32 UpdateWait() { return mUpdateWait; }
+  int32_t UpdateWait() { return mUpdateWait; }
   bool ResetRequested() { return mResetRequested; }
   bool RekeyRequested() { return mRekeyRequested; }
 
 private:
   nsresult ProcessControl(bool* aDone);
   nsresult ProcessMAC(const nsCString& aLine);
   nsresult ProcessExpirations(const nsCString& aLine);
   nsresult ProcessChunkControl(const nsCString& aLine);
@@ -81,34 +81,34 @@ private:
 
   enum ChunkType {
     CHUNK_ADD,
     CHUNK_SUB
   };
 
   struct ChunkState {
     ChunkType type;
-    uint32 num;
-    uint32 hashSize;
-    uint32 length;
+    uint32_t num;
+    uint32_t hashSize;
+    uint32_t length;
     void Clear() { num = 0; hashSize = 0; length = 0; }
   };
   ChunkState mChunkState;
 
   uint32_t mHashKey;
   bool mPerClientRandomize;
   nsCOMPtr<nsICryptoHash> mCryptoHash;
 
   nsresult mUpdateStatus;
   nsCString mPending;
 
   nsCOMPtr<nsICryptoHMAC> mHMAC;
   nsCString mServerMAC;
 
-  uint32 mUpdateWait;
+  uint32_t mUpdateWait;
   bool mResetRequested;
   bool mRekeyRequested;
 
   nsTArray<ForwardedUpdate> mForwards;
   nsTArray<TableUpdate*> mTableUpdates;
   TableUpdate *mTableUpdate;
 };
 
--- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
+++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
@@ -45,15 +45,15 @@ nsCheckSummedOutputStream::Finish()
   NS_ENSURE_SUCCESS(rv, rv);
 
   return nsSafeFileOutputStream::Finish();
 }
 
 NS_IMETHODIMP
 nsCheckSummedOutputStream::Write(const char *buf, uint32_t count, uint32_t *result)
 {
-  nsresult rv = mHash->Update(reinterpret_cast<const uint8*>(buf), count);
+  nsresult rv = mHash->Update(reinterpret_cast<const uint8_t*>(buf), count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return nsSafeFileOutputStream::Write(buf, count, result);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -565,17 +565,17 @@ nsUrlClassifierDBServiceWorker::FinishSt
   mProtocolParser->FinishHMAC();
   if (NS_SUCCEEDED(mProtocolParser->Status())) {
     if (mProtocolParser->UpdateWait()) {
       mUpdateWait = mProtocolParser->UpdateWait();
     }
     // XXX: Only allow forwards from the initial update?
     const nsTArray<ProtocolParser::ForwardedUpdate> &forwards =
       mProtocolParser->Forwards();
-    for (uint32 i = 0; i < forwards.Length(); i++) {
+    for (uint32_t i = 0; i < forwards.Length(); i++) {
       const ProtocolParser::ForwardedUpdate &forward = forwards[i];
       mUpdateObserver->UpdateUrlRequested(forward.url, forward.table, forward.mac);
     }
     // Hold on to any TableUpdate objects that were created by the
     // parser.
     mTableUpdates.AppendElements(mProtocolParser->GetTableUpdates());
     mProtocolParser->ForgetTableUpdates();
   } else {
@@ -978,17 +978,17 @@ nsUrlClassifierLookupCallback::HandleRes
   }
 
   // Some parts of this gethash request generated no hits at all.
   // Prefixes must have been removed from the database since our last update.
   // Save the prefixes we checked to prevent repeated requests
   // until the next update.
   nsAutoPtr<PrefixArray> cacheMisses(new PrefixArray());
   if (cacheMisses) {
-    for (uint32 i = 0; i < mResults->Length(); i++) {
+    for (uint32_t i = 0; i < mResults->Length(); i++) {
       LookupResult &result = mResults->ElementAt(i);
       if (!result.Confirmed()) {
         cacheMisses->AppendElement(result.PrefixHash());
       }
     }
     // Hands ownership of the miss array back to the worker thread.
     mDBService->CacheMisses(cacheMisses.forget());
   }
--- a/tools/profiler/libunwind/src/include/unwind.h
+++ b/tools/profiler/libunwind/src/include/unwind.h
@@ -66,17 +66,17 @@ typedef void (*_Unwind_Exception_Cleanup
 
 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
 						uint64_t,
 						struct _Unwind_Exception *,
 						struct _Unwind_Context *,
 						void *);
 
 /* The C++ ABI requires exception_class, private_1, and private_2 to
-   be of type uint64 and the entire structure to be
+   be of type uint64_t and the entire structure to be
    double-word-aligned. Please note that exception_class stays 64-bit 
    even on 32-bit machines for gcc compatibility.  */
 struct _Unwind_Exception
   {
     uint64_t exception_class;
     _Unwind_Exception_Cleanup_Fn exception_cleanup;
     unsigned long private_1;
     unsigned long private_2;
--- a/tools/trace-malloc/bloatblame.cpp
+++ b/tools/trace-malloc/bloatblame.cpp
@@ -31,17 +31,17 @@ extern int  optind;
 #include "tmreader.h"
 
 static char   *program;
 static int    sort_by_direct = 0;
 static int    js_mode = 0;
 static int    do_tree_dump = 0;
 static int    unified_output = 0;
 static char   *function_dump = NULL;
-static uint32 min_subtotal = 0;
+static uint32_t min_subtotal = 0;
 
 static void compute_callsite_totals(tmcallsite *site)
 {
     tmcallsite *kid;
 
     site->allocs.bytes.total += site->allocs.bytes.direct;
     site->allocs.calls.total += site->allocs.calls.direct;
     for (kid = site->kids; kid; kid = kid->siblings) {
@@ -200,17 +200,17 @@ static int tabulate_node(PLHashEntry *he
         (curr->allocs.bytes.total < next->allocs.bytes.total));
     return HT_ENUMERATE_NEXT;
 }
 
 /* Sort in reverse size order, so biggest node comes first. */
 static int node_table_compare(const void *p1, const void *p2)
 {
     const tmgraphnode *node1, *node2;
-    uint32 key1, key2;
+    uint32_t key1, key2;
 
     node1 = *(const tmgraphnode**) p1;
     node2 = *(const tmgraphnode**) p2;
     if (sort_by_direct) {
         key1 = node1->allocs.bytes.direct;
         key2 = node2->allocs.bytes.direct;
     } else {
         key1 = node1->allocs.bytes.total;
@@ -234,30 +234,30 @@ static int mean_size_compare(const void 
     key2 = (double)node2->allocs.bytes.direct / div2;
     if (key1 < key2)
         return 1;
     if (key1 > key2)
         return -1;
     return 0;
 }
 
-static const char *prettybig(uint32 num, char *buf, size_t limit)
+static const char *prettybig(uint32_t num, char *buf, size_t limit)
 {
     if (num >= 1000000000)
         PR_snprintf(buf, limit, "%1.2fG", (double) num / 1e9);
     else if (num >= 1000000)
         PR_snprintf(buf, limit, "%1.2fM", (double) num / 1e6);
     else if (num >= 1000)
         PR_snprintf(buf, limit, "%1.2fK", (double) num / 1e3);
     else
         PR_snprintf(buf, limit, "%lu", (unsigned long) num);
     return buf;
 }
 
-static double percent(uint32 num, uint32 total)
+static double percent(uint32_t num, uint32_t total)
 {
     if (num == 0)
         return 0.0;
     return ((double) num * 100) / (double) total;
 }
 
 static void sort_graphlink_list(tmgraphlink **listp, int which)
 {
@@ -306,17 +306,17 @@ static void dump_graphlink_list(tmgraphl
         }
         fputs("</td>", fp);
     }
 }
 
 static void dump_graph(tmreader *tmr, PLHashTable *hashtbl, const char *varname,
                        const char *title, FILE *fp)
 {
-    uint32 i, count;
+    uint32_t i, count;
     tmgraphnode **table, *node;
     char *name;
     size_t namelen;
     char buf1[16], buf2[16], buf3[16], buf4[16];
 
     count = hashtbl->nentries;
     table = (tmgraphnode**) malloc(count * sizeof(tmgraphnode*));
     if (!table) {
@@ -456,18 +456,18 @@ static void dump_graph(tmreader *tmr, PL
                     "<tr>"
                       "<td valign=top>%.*s%s</td>"
                       "<td valign=top>%s</td>"
                       "<td valign=top>%s</td>"
                       "<td valign=top>%s</td>"
                     "</tr>\n",
                     (namelen > 65) ? 45 : (int)namelen, name,
                     (namelen > 65) ? "<i>...</i>" : "",
-                    prettybig((uint32)mean, buf1, sizeof buf1),
-                    prettybig((uint32)sigma, buf2, sizeof buf2),
+                    prettybig((uint32_t)mean, buf1, sizeof buf1),
+                    prettybig((uint32_t)sigma, buf2, sizeof buf2),
                     prettybig(node->allocs.calls.direct, buf3, sizeof buf3));
         }
         fputs("</table>\n", fp);
     }
 
     free((void*) table);
 }
 
--- a/tools/trace-malloc/leakstats.c
+++ b/tools/trace-malloc/leakstats.c
@@ -20,22 +20,22 @@ int optind=1;
 #include <time.h>
 #include "nsTraceMalloc.h"
 #include "tmreader.h"
 #include "prlog.h"
 
 static char *program;
 
 typedef struct handler_data {
-    uint32 current_heapsize;
-    uint32 max_heapsize;
-    uint32 bytes_allocated;
-    uint32 current_allocations;
-    uint32 total_allocations;
-    uint32 unmatched_frees;
+    uint32_t current_heapsize;
+    uint32_t max_heapsize;
+    uint32_t bytes_allocated;
+    uint32_t current_allocations;
+    uint32_t total_allocations;
+    uint32_t unmatched_frees;
     int finished;
 } handler_data;
 
 static void handler_data_init(handler_data *data)
 {
     data->current_heapsize = 0;
     data->max_heapsize = 0;
     data->bytes_allocated = 0;
--- a/tools/trace-malloc/lib/nsDebugHelpWin32.cpp
+++ b/tools/trace-malloc/lib/nsDebugHelpWin32.cpp
@@ -219,17 +219,17 @@ DHWImportHooker::PatchOneModule(HMODULE 
     if(aModule == mIgnoreModule)
     {
         return true;
     }
 
     // do the fun stuff...
 
     PIMAGE_IMPORT_DESCRIPTOR desc;
-    uint32 size;
+    uint32_t size;
 
     desc = (PIMAGE_IMPORT_DESCRIPTOR) 
         dhwImageDirectoryEntryToData(aModule, true, 
                                      IMAGE_DIRECTORY_ENTRY_IMPORT, &size);
 
     if(!desc)
     {
         return true;
--- a/tools/trace-malloc/lib/nsTraceMalloc.c
+++ b/tools/trace-malloc/lib/nsTraceMalloc.c
@@ -91,18 +91,18 @@ typedef struct logfile logfile;
 #define LOGFILE_TMBUFSIZE (16 * 1024)
 
 struct logfile {
     int         fd;
     int         lfd;            /* logical fd, dense among all logfiles */
     char        *buf;
     int         bufsize;
     int         pos;
-    uint32      size;
-    uint32      simsize;
+    uint32_t      size;
+    uint32_t      simsize;
     logfile     *next;
     logfile     **prevp;
 };
 
 static char      default_buf[STARTUP_TMBUFSIZE];
 static logfile   default_logfile =
                    {-1, 0, default_buf, STARTUP_TMBUFSIZE, 0, 0, 0, NULL, NULL};
 static logfile   *logfile_list = NULL;
@@ -120,22 +120,22 @@ static char      sdlogname[PATH_MAX] = "
  * It is separate from suppress_tracing so that we do not have to pay
  * the performance cost of repeated TM_TLS_GET_DATA calls when
  * trace-malloc is disabled (which is not as bad as the locking we used
  * to have).
  *
  * It must default to zero, since it can be tested by the Linux malloc
  * hooks before NS_TraceMallocStartup sets it.
  */
-static uint32 tracing_enabled = 0;
+static uint32_t tracing_enabled = 0;
 
 /*
  * Control whether we should log stacks
  */
-static uint32 stacks_enabled = 1;
+static uint32_t stacks_enabled = 1;
 
 /*
  * This lock must be held while manipulating the calltree, the
  * allocations table, the log, or the tmstats.
  *
  * Callers should not *enter* the lock without checking suppress_tracing
  * first; otherwise they risk trying to re-enter on the same thread.
  */
@@ -263,23 +263,23 @@ tm_get_thread(void)
 
         PR_ASSERT(stack_tm_thread.suppress_tracing == 1); /* balanced */
     }
 
     return t;
 }
 
 /* We don't want more than 32 logfiles open at once, ok? */
-typedef uint32          lfd_set;
+typedef uint32_t          lfd_set;
 
 #define LFD_SET_STATIC_INITIALIZER 0
 #define LFD_SET_SIZE    32
 
 #define LFD_ZERO(s)     (*(s) = 0)
-#define LFD_BIT(i)      ((uint32)1 << (i))
+#define LFD_BIT(i)      ((uint32_t)1 << (i))
 #define LFD_TEST(i,s)   (LFD_BIT(i) & *(s))
 #define LFD_SET(i,s)    (*(s) |= LFD_BIT(i))
 #define LFD_CLR(i,s)    (*(s) &= ~LFD_BIT(i))
 
 static logfile *get_logfile(int fd)
 {
     logfile *fp;
     int lfd;
@@ -377,17 +377,17 @@ static void log_filename(logfile* fp, co
                 *cp = '/';
         }
 
         filename = bp;
     }
     log_string(fp, filename);
 }
 
-static void log_uint32(logfile *fp, uint32 ival)
+static void log_uint32(logfile *fp, uint32_t ival)
 {
     if (ival < 0x80) {
         /* 0xxx xxxx */
         log_byte(fp, (char) ival);
     } else if (ival < 0x4000) {
         /* 10xx xxxx xxxx xxxx */
         log_byte(fp, (char) ((ival >> 8) | 0x80));
         log_byte(fp, (char) (ival & 0xff));
@@ -407,92 +407,92 @@ static void log_uint32(logfile *fp, uint
         log_byte(fp, (char) 0xf0);
         log_byte(fp, (char) ((ival >> 24) & 0xff));
         log_byte(fp, (char) ((ival >> 16) & 0xff));
         log_byte(fp, (char) ((ival >> 8) & 0xff));
         log_byte(fp, (char) (ival & 0xff));
     }
 }
 
-static void log_event1(logfile *fp, char event, uint32 serial)
+static void log_event1(logfile *fp, char event, uint32_t serial)
 {
     log_byte(fp, event);
-    log_uint32(fp, (uint32) serial);
+    log_uint32(fp, (uint32_t) serial);
 }
 
-static void log_event2(logfile *fp, char event, uint32 serial, size_t size)
+static void log_event2(logfile *fp, char event, uint32_t serial, size_t size)
 {
     log_event1(fp, event, serial);
-    log_uint32(fp, (uint32) size);
+    log_uint32(fp, (uint32_t) size);
 }
 
-static void log_event3(logfile *fp, char event, uint32 serial, size_t oldsize,
+static void log_event3(logfile *fp, char event, uint32_t serial, size_t oldsize,
                        size_t size)
 {
     log_event2(fp, event, serial, oldsize);
-    log_uint32(fp, (uint32) size);
+    log_uint32(fp, (uint32_t) size);
 }
 
-static void log_event4(logfile *fp, char event, uint32 serial, uint32 ui2,
-                       uint32 ui3, uint32 ui4)
+static void log_event4(logfile *fp, char event, uint32_t serial, uint32_t ui2,
+                       uint32_t ui3, uint32_t ui4)
 {
     log_event3(fp, event, serial, ui2, ui3);
     log_uint32(fp, ui4);
 }
 
-static void log_event5(logfile *fp, char event, uint32 serial, uint32 ui2,
-                       uint32 ui3, uint32 ui4, uint32 ui5)
+static void log_event5(logfile *fp, char event, uint32_t serial, uint32_t ui2,
+                       uint32_t ui3, uint32_t ui4, uint32_t ui5)
 {
     log_event4(fp, event, serial, ui2, ui3, ui4);
     log_uint32(fp, ui5);
 }
 
-static void log_event6(logfile *fp, char event, uint32 serial, uint32 ui2,
-                       uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6)
+static void log_event6(logfile *fp, char event, uint32_t serial, uint32_t ui2,
+                       uint32_t ui3, uint32_t ui4, uint32_t ui5, uint32_t ui6)
 {
     log_event5(fp, event, serial, ui2, ui3, ui4, ui5);
     log_uint32(fp, ui6);
 }
 
-static void log_event7(logfile *fp, char event, uint32 serial, uint32 ui2,
-                       uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6,
-                       uint32 ui7)
+static void log_event7(logfile *fp, char event, uint32_t serial, uint32_t ui2,
+                       uint32_t ui3, uint32_t ui4, uint32_t ui5, uint32_t ui6,
+                       uint32_t ui7)
 {
     log_event6(fp, event, serial, ui2, ui3, ui4, ui5, ui6);
     log_uint32(fp, ui7);
 }
 
-static void log_event8(logfile *fp, char event, uint32 serial, uint32 ui2,
-                       uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6,
-                       uint32 ui7, uint32 ui8)
+static void log_event8(logfile *fp, char event, uint32_t serial, uint32_t ui2,
+                       uint32_t ui3, uint32_t ui4, uint32_t ui5, uint32_t ui6,
+                       uint32_t ui7, uint32_t ui8)
 {
     log_event7(fp, event, serial, ui2, ui3, ui4, ui5, ui6, ui7);
     log_uint32(fp, ui8);
 }
 
 typedef struct callsite callsite;
 
 struct callsite {
     void*       pc;
-    uint32      serial;
+    uint32_t      serial;
     lfd_set     lfdset;
     const char  *name;    /* pointer to string owned by methods table */
     const char  *library; /* pointer to string owned by libraries table */
     int         offset;
     callsite    *parent;
     callsite    *siblings;
     callsite    *kids;
 };
 
 /* NB: these counters are incremented and decremented only within tmlock. */
-static uint32 library_serial_generator = 0;
-static uint32 method_serial_generator = 0;
-static uint32 callsite_serial_generator = 0;
-static uint32 tmstats_serial_generator = 0;
-static uint32 filename_serial_generator = 0;
+static uint32_t library_serial_generator = 0;
+static uint32_t method_serial_generator = 0;
+static uint32_t callsite_serial_generator = 0;
+static uint32_t tmstats_serial_generator = 0;
+static uint32_t filename_serial_generator = 0;
 
 /* Root of the tree of callsites, the sum of all (cycle-compressed) stacks. */
 static callsite calltree_root =
   {0, 0, LFD_SET_STATIC_INITIALIZER, NULL, NULL, 0, NULL, NULL, NULL};
 
 /* a fake pc for when stacks are disabled; must be different from the
    pc in calltree_root */
 #define STACK_DISABLED_PC ((void*)1)
@@ -588,20 +588,20 @@ static PLHashTable *methods = NULL;
  * Presumes that its caller is holding tmlock, but may temporarily exit
  * the lock.
  */
 static callsite *
 calltree(void **stack, size_t num_stack_entries, tm_thread *t)
 {
     logfile *fp = logfp;
     void *pc;
-    uint32 nkids;
+    uint32_t nkids;
     callsite *parent, *site, **csp, *tmp;
     int maxstack;
-    uint32 library_serial, method_serial, filename_serial;
+    uint32_t library_serial, method_serial, filename_serial;
     const char *library, *method, *filename;
     char *slash;
     PLHashNumber hash;
     PLHashEntry **hep, *he;
     lfdset_entry *le;
     size_t stack_index;
     nsCodeAddressDetails details;
     nsresult rv;
@@ -713,17 +713,17 @@ calltree(void **stack, size_t num_stack_
                     goto fail;
                 }
             }
             hash = PL_HashString(details.library);
             hep = PL_HashTableRawLookup(libraries, hash, details.library);
             he = *hep;
             if (he) {
                 library = (char*) he->key;
-                library_serial = (uint32) NS_PTR_TO_INT32(he->value);
+                library_serial = (uint32_t) NS_PTR_TO_INT32(he->value);
                 le = (lfdset_entry *) he;
                 if (LFD_TEST(fp->lfd, &le->lfdset)) {
                     /* We already logged an event on fp for this library. */
                     le = NULL;
                 }
             } else {
                 library = strdup(details.library);
                 if (library) {
@@ -760,17 +760,17 @@ calltree(void **stack, size_t num_stack_
                 return NULL;
             }
         }
         hash = PL_HashString(filename);
         hep = PL_HashTableRawLookup(filenames, hash, filename);
         he = *hep;
         if (he) {
             filename = (char*) he->key;
-            filename_serial = (uint32) NS_PTR_TO_INT32(he->value);
+            filename_serial = (uint32_t) NS_PTR_TO_INT32(he->value);
             le = (lfdset_entry *) he;
             if (LFD_TEST(fp->lfd, &le->lfdset)) {
                 /* We already logged an event on fp for this filename. */
                 le = NULL;
             }
         } else {
             filename = strdup(filename);
             if (filename) {
@@ -807,17 +807,17 @@ calltree(void **stack, size_t num_stack_
                 goto fail;
             }
         }
         hash = PL_HashString(details.function);
         hep = PL_HashTableRawLookup(methods, hash, details.function);
         he = *hep;
         if (he) {
             method = (char*) he->key;
-            method_serial = (uint32) NS_PTR_TO_INT32(he->value);
+            method_serial = (uint32_t) NS_PTR_TO_INT32(he->value);
             le = (lfdset_entry *) he;
             if (LFD_TEST(fp->lfd, &le->lfdset)) {
                 /* We already logged an event on fp for this method. */
                 le = NULL;
             }
         } else {
             method = strdup(details.function);
             if (method) {
@@ -1310,17 +1310,17 @@ cfree(void *ptr)
 
 #endif
 
 static const char magic[] = NS_TRACE_MALLOC_MAGIC;
 
 static void
 log_header(int logfd)
 {
-    uint32 ticksPerSec = PR_htonl(PR_TicksPerSecond());
+    uint32_t ticksPerSec = PR_htonl(PR_TicksPerSecond());
     (void) write(logfd, magic, NS_TRACE_MALLOC_MAGIC_SIZE);
     (void) write(logfd, &ticksPerSec, sizeof ticksPerSec);
 }
 
 PR_IMPLEMENT(void)
 NS_TraceMallocStartup(int logfd)
 {
     const char* stack_disable_env;
@@ -1552,17 +1552,17 @@ NS_TraceMallocShutdown(void)
     }
 }
 
 PR_IMPLEMENT(void)
 NS_TraceMallocDisable(void)
 {
     tm_thread *t = tm_get_thread();
     logfile *fp;
-    uint32 sample;
+    uint32_t sample;
 
     /* Robustify in case of duplicate call. */
     PR_ASSERT(tracing_enabled);
     if (tracing_enabled == 0)
         return;
 
     TM_SUPPRESS_TRACING_AND_ENTER_LOCK(t);
     for (fp = logfile_list; fp; fp = fp->next)
@@ -1572,17 +1572,17 @@ NS_TraceMallocDisable(void)
     if (sample == 0)
         ShutdownHooker();
 }
 
 PR_IMPLEMENT(void)
 NS_TraceMallocEnable(void)
 {
     tm_thread *t = tm_get_thread();
-    uint32 sample;
+    uint32_t sample;
 
     TM_SUPPRESS_TRACING_AND_ENTER_LOCK(t);
     sample = ++tracing_enabled;
     TM_EXIT_LOCK_AND_UNSUPPRESS_TRACING(t);
     if (sample == 1)
         StartupHooker();
 }
 
@@ -1686,23 +1686,23 @@ NS_TraceMallocLogTimestamp(const char *c
 
     TM_SUPPRESS_TRACING_AND_ENTER_LOCK(t);
 
     fp = logfp;
     log_byte(fp, TM_EVENT_TIMESTAMP);
 
 #ifdef XP_UNIX
     gettimeofday(&tv, NULL);
-    log_uint32(fp, (uint32) tv.tv_sec);
-    log_uint32(fp, (uint32) tv.tv_usec);
+    log_uint32(fp, (uint32_t) tv.tv_sec);
+    log_uint32(fp, (uint32_t) tv.tv_usec);
 #endif
 #ifdef XP_WIN32
     _ftime(&tb);
-    log_uint32(fp, (uint32) tb.time);
-    log_uint32(fp, (uint32) tb.millitm);
+    log_uint32(fp, (uint32_t) tb.time);
+    log_uint32(fp, (uint32_t) tb.millitm);
 #endif
     log_string(fp, caption);
 
     TM_EXIT_LOCK_AND_UNSUPPRESS_TRACING(t);
 }
 
 static void
 print_stack(FILE *ofp, callsite *site)
@@ -1843,17 +1843,17 @@ MallocCallback(void *ptr, size_t size, u
     TM_SUPPRESS_TRACING_AND_ENTER_LOCK(t);
     tmstats.malloc_calls++;
     if (!ptr) {
         tmstats.malloc_failures++;
     } else {
         if (site) {
             log_event5(logfp, TM_EVENT_MALLOC,
                        site->serial, start, end - start,
-                       (uint32)NS_PTR_TO_INT32(ptr), size);
+                       (uint32_t)NS_PTR_TO_INT32(ptr), size);
         }
         if (get_allocations()) {
             he = PL_HashTableAdd(allocations, ptr, site);
             if (he) {
                 alloc = (allocation*) he;
                 alloc->size = size;
                 alloc->trackfp = NULL;
             }
@@ -1881,17 +1881,17 @@ CallocCallback(void *ptr, size_t count, 
     tmstats.calloc_calls++;
     if (!ptr) {
         tmstats.calloc_failures++;
     } else {
         size *= count;
         if (site) {
             log_event5(logfp, TM_EVENT_CALLOC,
                        site->serial, start, end - start,
-                       (uint32)NS_PTR_TO_INT32(ptr), size);
+                       (uint32_t)NS_PTR_TO_INT32(ptr), size);
         }
         if (get_allocations()) {
             he = PL_HashTableAdd(allocations, ptr, site);
             if (he) {
                 alloc = (allocation*) he;
                 alloc->size = size;
                 alloc->trackfp = NULL;
             }
@@ -1948,19 +1948,19 @@ ReallocCallback(void * oldptr, void *ptr
          * When realloc() fails, the original block is not freed or moved, so
          * we'll leave the allocation entry untouched.
          */
         tmstats.realloc_failures++;
     } else {
         if (site) {
             log_event8(logfp, TM_EVENT_REALLOC,
                        site->serial, start, end - start,
-                       (uint32)NS_PTR_TO_INT32(ptr), size,
+                       (uint32_t)NS_PTR_TO_INT32(ptr), size,
                        oldsite ? oldsite->serial : 0,
-                       (uint32)NS_PTR_TO_INT32(oldptr), oldsize);
+                       (uint32_t)NS_PTR_TO_INT32(oldptr), oldsize);
         }
         if (ptr && allocations) {
             if (ptr != oldptr) {
                 /*
                  * If we're reallocating (not allocating new space by passing
                  * null to realloc) and realloc moved the block, free oldptr.
                  */
                 if (he)
@@ -2016,17 +2016,17 @@ FreeCallback(void * ptr, uint32_t start,
                     alloc = (allocation*) he;
                     if (alloc->trackfp) {
                         fprintf(alloc->trackfp, "\nfree(%p), alloc site %p\n",
                                 (void*) ptr, (void*) site);
                         NS_TraceStack(1, alloc->trackfp);
                     }
                     log_event5(logfp, TM_EVENT_FREE,
                                site->serial, start, end - start,
-                               (uint32)NS_PTR_TO_INT32(ptr), alloc->size);
+                               (uint32_t)NS_PTR_TO_INT32(ptr), alloc->size);
                 }
                 PL_HashTableRawRemove(allocations, hep, he);
             }
         }
     }
     TM_EXIT_LOCK_AND_UNSUPPRESS_TRACING(t);
 }
 
--- a/tools/trace-malloc/lib/nsTraceMallocCallbacks.h
+++ b/tools/trace-malloc/lib/nsTraceMallocCallbacks.h
@@ -23,17 +23,17 @@ typedef struct stack_buffer_info {
 } stack_buffer_info;
 
 typedef struct tm_thread tm_thread;
 struct tm_thread {
     /*
      * This counter suppresses tracing, in case any tracing code needs
      * to malloc.
      */
-    uint32 suppress_tracing;
+    uint32_t suppress_tracing;
 
     /* buffer for backtrace, below */
     stack_buffer_info backtrace_buf;
 };
 
 /* implemented in nsTraceMalloc.c */
 tm_thread * tm_get_thread(void);
 
--- a/tools/trace-malloc/tmreader.c
+++ b/tools/trace-malloc/tmreader.c
@@ -19,60 +19,60 @@
 #include "plarena.h"
 
 #include "prnetdb.h"
 #include "nsTraceMalloc.h"
 #include "tmreader.h"
 
 #undef  DEBUG_tmreader
 
-static int accum_byte(FILE *fp, uint32 *uip)
+static int accum_byte(FILE *fp, uint32_t *uip)
 {
     int c = getc(fp);
     if (c == EOF)
         return 0;
     *uip = (*uip << 8) | c;
     return 1;
 }
 
-static int get_uint32(FILE *fp, uint32 *uip)
+static int get_uint32(FILE *fp, uint32_t *uip)
 {
     int c;
-    uint32 ui;
+    uint32_t ui;
 
     c = getc(fp);
     if (c == EOF)
         return 0;
     ui = 0;
     if (c & 0x80) {
         c &= 0x7f;
         if (c & 0x40) {
             c &= 0x3f;
             if (c & 0x20) {
                 c &= 0x1f;
                 if (c & 0x10) {
                     if (!accum_byte(fp, &ui))
                         return 0;
                 } else {
-                    ui = (uint32) c;
+                    ui = (uint32_t) c;
                 }
                 if (!accum_byte(fp, &ui))
                     return 0;
             } else {
-                ui = (uint32) c;
+                ui = (uint32_t) c;
             }
             if (!accum_byte(fp, &ui))
                 return 0;
         } else {
-            ui = (uint32) c;
+            ui = (uint32_t) c;
         }
         if (!accum_byte(fp, &ui))
             return 0;
     } else {
-        ui = (uint32) c;
+        ui = (uint32_t) c;
     }
     *uip = ui;
     return 1;
 }
 
 static char *get_string(FILE *fp)
 {
     char *cp;
@@ -695,17 +695,17 @@ int tmreader_eventloop(tmreader *tmr, co
             site->frees.calls.direct = site->frees.calls.total = 0;
             break;
           }
 
           case TM_EVENT_MALLOC:
           case TM_EVENT_CALLOC:
           case TM_EVENT_REALLOC: {
             tmcallsite *site;
-            uint32 size, oldsize;
+            uint32_t size, oldsize;
             double delta, sqdelta, sqszdelta = 0;
             tmgraphnode *comp, *lib;
             tmmethodnode *meth;
 
             site = tmreader_callsite(tmr, event.serial);
             if (!site) {
                 fprintf(stderr, "%s: no callsite for '%c' (%lu)!\n",
                         tmr->program, event.type, (unsigned long) event.serial);
@@ -751,17 +751,17 @@ int tmreader_eventloop(tmreader *tmr, co
                     }
                 }
             }
             break;
           }
 
           case TM_EVENT_FREE: {
             tmcallsite *site;
-            uint32 size;
+            uint32_t size;
             tmgraphnode *comp, *lib;
             tmmethodnode *meth;
 
             site = tmreader_callsite(tmr, event.serial);
             if (!site) {
                 fprintf(stderr, "%s: no callsite for '%c' (%lu)!\n",
                         tmr->program, event.type, (unsigned long) event.serial);
                 continue;
@@ -792,27 +792,27 @@ int tmreader_eventloop(tmreader *tmr, co
         }
 
         eventhandler(tmr, &event);
     }
 
     return 1;
 }
 
-tmgraphnode *tmreader_library(tmreader *tmr, uint32 serial)
+tmgraphnode *tmreader_library(tmreader *tmr, uint32_t serial)
 {
     const void *key;
     PLHashNumber hash;
 
     key = (const void*) serial;
     hash = hash_serial(key);
     return (tmgraphnode*) *PL_HashTableRawLookup(tmr->libraries, hash, key);
 }
 
-tmgraphnode *tmreader_filename(tmreader *tmr, uint32 serial)
+tmgraphnode *tmreader_filename(tmreader *tmr, uint32_t serial)
 {
     const void *key;
     PLHashNumber hash;
 
     key = (const void*) serial;
     hash = hash_serial(key);
     return (tmgraphnode*) *PL_HashTableRawLookup(tmr->filenames, hash, key);
 }
@@ -820,27 +820,27 @@ tmgraphnode *tmreader_filename(tmreader 
 tmgraphnode *tmreader_component(tmreader *tmr, const char *name)
 {
     PLHashNumber hash;
 
     hash = PL_HashString(name);
     return (tmgraphnode*) *PL_HashTableRawLookup(tmr->components, hash, name);
 }
 
-tmmethodnode *tmreader_method(tmreader *tmr, uint32 serial)
+tmmethodnode *tmreader_method(tmreader *tmr, uint32_t serial)
 {
     const void *key;
     PLHashNumber hash;
 
     key = (const void*) serial;
     hash = hash_serial(key);
     return (tmmethodnode*) *PL_HashTableRawLookup(tmr->methods, hash, key);
 }
 
-tmcallsite *tmreader_callsite(tmreader *tmr, uint32 serial)
+tmcallsite *tmreader_callsite(tmreader *tmr, uint32_t serial)
 {
     const void *key;
     PLHashNumber hash;
 
     key = (const void*) serial;
     hash = hash_serial(key);
     return (tmcallsite*) *PL_HashTableRawLookup(tmr->callsites, hash, key);
 }
--- a/tools/trace-malloc/tmreader.h
+++ b/tools/trace-malloc/tmreader.h
@@ -22,51 +22,51 @@ typedef struct tmallcounts  tmallcounts;
 typedef struct tmgraphlink  tmgraphlink;
 typedef struct tmgraphedge  tmgraphedge;
 typedef struct tmgraphnode  tmgraphnode;
 typedef struct tmcallsite   tmcallsite;
 typedef struct tmmethodnode tmmethodnode;
 
 struct tmevent {
     char            type;
-    uint32          serial;
+    uint32_t          serial;
     union {
         char        *libname;
         char        *srcname;
         struct {
-            uint32  library;
-            uint32  filename;
-            uint32  linenumber;
+            uint32_t  library;
+            uint32_t  filename;
+            uint32_t  linenumber;
             char    *name;
         } method;
         struct {
-            uint32  parent;
-            uint32  method;
-            uint32  offset;
+            uint32_t  parent;
+            uint32_t  method;
+            uint32_t  offset;
         } site;
         struct {
-            uint32  interval; /* in ticks */
-            uint32  ptr;
-            uint32  size;
-            uint32  oldserial;
-            uint32  oldptr;
-            uint32  oldsize;
-            uint32  cost;     /* in ticks */
+            uint32_t  interval; /* in ticks */
+            uint32_t  ptr;
+            uint32_t  size;
+            uint32_t  oldserial;
+            uint32_t  oldptr;
+            uint32_t  oldsize;
+            uint32_t  cost;     /* in ticks */
         } alloc;
         struct {
             nsTMStats tmstats;
-            uint32  calltree_maxkids_parent;
-            uint32  calltree_maxstack_top;
+            uint32_t  calltree_maxkids_parent;
+            uint32_t  calltree_maxstack_top;
         } stats;
     } u;
 };
 
 struct tmcounts {
-    uint32          direct;     /* things allocated by this node's code */
-    uint32          total;      /* direct + things from all descendents */
+    uint32_t          direct;     /* things allocated by this node's code */
+    uint32_t          total;      /* direct + things from all descendents */
 };
 
 struct tmallcounts {
     tmcounts        bytes;
     tmcounts        calls;
 };
 
 struct tmgraphnode {
@@ -81,23 +81,23 @@ struct tmgraphnode {
     tmallcounts     frees;
     double          sqsum;      /* sum of squared bytes.direct */
     int             sort;       /* sorted index in node table, -1 if no table */
 };
 
 struct tmmethodnode {
     tmgraphnode   graphnode;
     char          *sourcefile;
-    uint32        linenumber;
+    uint32_t        linenumber;
 };
 
 #define tmgraphnode_name(node)  ((char*) (node)->entry.value)
 #define tmmethodnode_name(node)  ((char*) (node)->graphnode.entry.value)
 
-#define tmlibrary_serial(lib)   ((uint32) (lib)->entry.key)
+#define tmlibrary_serial(lib)   ((uint32_t) (lib)->entry.key)
 #define tmcomponent_name(comp)  ((const char*) (comp)->entry.key)
 #define filename_name(hashentry) ((char*)hashentry->value)
 
 /* Half a graphedge, not including per-edge allocation stats. */
 struct tmgraphlink {
     tmgraphlink     *next;      /* next fanning out from or into a node */
     tmgraphnode     *node;      /* the other node (to if OUT, from if IN) */
 };
@@ -121,17 +121,17 @@ struct tmgraphedge {
 #define TM_LINK_TO_EDGE(link,which) ((tmgraphedge*) &(link)[-(which)])
 
 struct tmcallsite {
     PLHashEntry     entry;      /* key is site serial number */
     tmcallsite      *parent;    /* calling site */
     tmcallsite      *siblings;  /* other sites reached from parent */
     tmcallsite      *kids;      /* sites reached from here */
     tmmethodnode    *method;    /* method node in tmr->methods graph */
-    uint32          offset;     /* pc offset from start of method */
+    uint32_t          offset;     /* pc offset from start of method */
     tmallcounts     allocs;
     tmallcounts     frees;
     void            *data;      /* tmreader clients can stick arbitrary
                                  *  data onto a callsite.
                                  */
 };
 
 struct tmreader {
@@ -139,38 +139,38 @@ struct tmreader {
     void            *data;
     PLHashTable     *libraries;
     PLHashTable     *filenames;
     PLHashTable     *components;
     PLHashTable     *methods;
     PLHashTable     *callsites;
     PLArenaPool     arena;
     tmcallsite      calltree_root;
-    uint32          ticksPerSec;
+    uint32_t          ticksPerSec;
 };
 
 typedef void (*tmeventhandler)(tmreader *tmr, tmevent *event);
 
 /* The tmreader constructor and destructor. */
 extern tmreader     *tmreader_new(const char *program, void *data);
 extern void         tmreader_destroy(tmreader *tmr);
 
 /*
  * Return -1 on permanent fatal error, 0 if filename can't be opened or is not
  * a trace-malloc logfile, and 1 on success.
  */
 extern int          tmreader_eventloop(tmreader *tmr, const char *filename,
                                        tmeventhandler eventhandler);
 
 /* Map serial number or name to graphnode or callsite. */
-extern tmgraphnode  *tmreader_library(tmreader *tmr, uint32 serial);
-extern tmgraphnode  *tmreader_filename(tmreader *tmr, uint32 serial);
+extern tmgraphnode  *tmreader_library(tmreader *tmr, uint32_t serial);
+extern tmgraphnode  *tmreader_filename(tmreader *tmr, uint32_t serial);
 extern tmgraphnode  *tmreader_component(tmreader *tmr, const char *name);
-extern tmmethodnode  *tmreader_method(tmreader *tmr, uint32 serial);
-extern tmcallsite   *tmreader_callsite(tmreader *tmr, uint32 serial);
+extern tmmethodnode  *tmreader_method(tmreader *tmr, uint32_t serial);
+extern tmcallsite   *tmreader_callsite(tmreader *tmr, uint32_t serial);
 
 /*
  * Connect node 'from' to node 'to' with an edge, if there isn't one already
  * connecting the nodes.  Add site's allocation stats to the edge only if we
  * create the edge, or if we find that it exists, but that to->low is zero or
  * less than from->low.
  *
  * If the callsite tree already totals allocation costs (tmcounts.total for
--- a/xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
+++ b/xpcom/reflect/xptcall/src/md/os2/xptcstubs_gcc_x86_os2.cpp
@@ -7,17 +7,17 @@
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 #include "xptc_gcc_x86_unix.h"
 
 extern "C" {
 static nsresult ATTRIBUTE_USED
 __attribute__ ((regparm (3)))
-PrepareAndDispatch(uint32 methodIndex, nsXPTCStubBase* self, uint32_t* args)
+PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
     uint8_t i;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_openbsd.cpp
@@ -19,17 +19,17 @@ static inline void
 invoke_count_words(uint32_t paramCount, nsXPTCVariant * s,
                    uint32_t & nr_gpr, uint32_t & nr_fpr, uint32_t & nr_stack)
 {
     nr_gpr = 1; // skip one GP register for 'that'
     nr_fpr = 0;
     nr_stack = 0;
 
     /* Compute number of eightbytes of class MEMORY.  */
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (!s->IsPtrData()
             && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
             if (nr_fpr < FPR_COUNT)
                 nr_fpr++;
             else
                 nr_stack++;
         }
         else {
@@ -44,17 +44,17 @@ invoke_count_words(uint32_t paramCount, 
 static void
 invoke_copy_to_stack(uint64_t * d, uint32_t paramCount, nsXPTCVariant * s,
                      uint64_t * gpregs, double * fpregs)
 {
     uint32_t nr_gpr = 1; // skip one GP register for 'that'
     uint32_t nr_fpr = 0;
     uint64_t value;
 
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (s->IsPtrData())
             value = (uint64_t) s->ptr;
         else {
             switch (s->type) {
             case nsXPTType::T_FLOAT:                                break;
             case nsXPTType::T_DOUBLE:                               break;
             case nsXPTType::T_I8:     value = s->val.i8;            break;
             case nsXPTType::T_I16:    value = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp
@@ -8,17 +8,17 @@
 /* This code is for MIPS using the O32 ABI. */
 
 /* Platform specific code to invoke XPCOM methods on native objects */
 
 #include "xptcprivate.h"
 
 #include "mozilla/StandardInteger.h"
 
-extern "C" uint32
+extern "C" uint32_t
 invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
 {
     // Count a word for a0 even though it's never stored or loaded
     // We do this only for alignment of register pairs.
     uint32_t result = 1;
     for (uint32_t i = 0; i < paramCount; i++, result++, s++)
     {
         if (s->IsPtrData())
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
@@ -6,17 +6,17 @@
 /* Platform specific code to invoke XPCOM methods on native objects */
 
 #include "xptcprivate.h"
 
 #if (_MIPS_SIM != _ABIN32)
 #error "This code is for MIPS N32 only"
 #endif
 
-extern "C" uint32
+extern "C" uint32_t
 invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
 {
     return paramCount;
 }
 
 extern "C" void
 invoke_copy_to_stack(uint64_t* d, uint32_t paramCount,
                      nsXPTCVariant* s, uint64_t *regs)
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_shle.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_shle.cpp
@@ -93,17 +93,17 @@ XPTC_InvokeByIndex(nsISupports* that, ui
 	   all the hard work will be done by copy_to_stack above.  We pass to it
 	   a chunk of memory, the top of which will be copied to registers r5 to r7
 	   and fr4 to fr11 before calling the target function.
 	*/
 
  __asm__ __volatile__(
     /* Make space for parameters to be passed to the method.  Assume worst case 
 	   8 bytes per parameter.  Also leave space for 3 longs and 8 floats that
-	   will be put into registers.  The worst case is all int64 parameters
+	   will be put into registers.  The worst case is all int64_t parameters
 	   and even in this case 8 bytes are passed in registers so we can
 	   deduct this from our allocation.
 	*/
 	"mov.l	@(8,r14), r4 \n\t"	// copy_to_stack paramCount parameter
 	"mov	r4, r6 \n\t"
 	"mov	#3, r1 \n\t"
 	"shld	r1, r6 \n\t"
 	"add	#36, r6 \n\t"		// Space for 3 longs, 8 floats - 8 bytes
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp
@@ -90,35 +90,35 @@ invoke_copy_to_stack(uint32_t* d,
     case nsXPTType::T_I64   :
     case nsXPTType::T_U64   :
       if (regwords & 1)
       {
         /* align on double word boundary */
         --dest;
         ++regwords;
       }
-      *((uint32*) dest) = ((DU *) source)->lo;
-      *((uint32*) --dest) = ((DU *) source)->hi;
+      *((uint32_t*) dest) = ((DU *) source)->lo;
+      *((uint32_t*) --dest) = ((DU *) source)->hi;
       /* big endian - hi word in low addr */
       regwords += 2;
       continue;
     case nsXPTType::T_DOUBLE :
       if (regwords & 1)
       {
         /* align on double word boundary */
         --dest;
         ++regwords;
       }
       switch (regwords) /* load double precision float register */
       {
       case 2:
         floatflags |= 1;
       }
-      *((uint32*) dest) = ((DU *) source)->lo;
-      *((uint32*) --dest) = ((DU *) source)->hi;
+      *((uint32_t*) dest) = ((DU *) source)->lo;
+      *((uint32_t*) --dest) = ((DU *) source)->hi;
       /* big endian - hi word in low addr */
       regwords += 2;
       continue;
     case nsXPTType::T_FLOAT :
       switch (regwords) /* load single precision float register */
       {
       case 1:
         floatflags |= 2;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
@@ -36,17 +36,17 @@ extern "C" void
 invoke_copy_to_stack(uint64_t* gpregs,
                      double* fpregs,
                      uint32_t paramCount,
                      nsXPTCVariant* s, 
                      uint64_t* d)
 {
     uint64_t tempu64;
 
-    for(uint32 i = 0; i < paramCount; i++, s++) {
+    for(uint32_t i = 0; i < paramCount; i++, s++) {
         if(s->IsPtrData())
             tempu64 = (uint64_t) s->ptr;
         else {
             switch(s->type) {
             case nsXPTType::T_FLOAT:                                  break;
             case nsXPTType::T_DOUBLE:                                 break;
             case nsXPTType::T_I8:     tempu64 = s->val.i8;            break;
             case nsXPTType::T_I16:    tempu64 = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp
@@ -20,55 +20,55 @@ invoke_copy_to_stack(uint32_t* d, uint32
     we're trying to populate.
 */
     uint32_t *l_d = d;
     nsXPTCVariant *l_s = s;
     uint32_t l_paramCount = paramCount, fpCount = 0;
     double *l_fprData = fprData;
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
-    for(uint32 i = 0; i < l_paramCount; i++, l_d++, l_s++)
+    for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
     {
         if(l_s->IsPtrData())
         {
             *((void**)l_d) = l_s->ptr;
             continue;
         }
         switch(l_s->type)
         {
-        case nsXPTType::T_I8     : *((int32*)  l_d) = l_s->val.i8;          break;
-        case nsXPTType::T_I16    : *((int32*)  l_d) = l_s->val.i16;         break;
-        case nsXPTType::T_I32    : *((int32*)  l_d) = l_s->val.i32;         break;
+        case nsXPTType::T_I8     : *((int32_t*)  l_d) = l_s->val.i8;          break;
+        case nsXPTType::T_I16    : *((int32_t*)  l_d) = l_s->val.i16;         break;
+        case nsXPTType::T_I32    : *((int32_t*)  l_d) = l_s->val.i32;         break;
         case nsXPTType::T_I64    : 
         case nsXPTType::T_U64    :
-            *((uint32*) l_d++) = ((DU *)l_s)->hi;
-            *((uint32*) l_d) = ((DU *)l_s)->lo;
+            *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
+            *((uint32_t*) l_d) = ((DU *)l_s)->lo;
             break;
         case nsXPTType::T_DOUBLE :
-            *((uint32*) l_d++) = ((DU *)l_s)->hi;
-            *((uint32*) l_d) = ((DU *)l_s)->lo;
+            *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
+            *((uint32_t*) l_d) = ((DU *)l_s)->lo;
             if(fpCount < 13)
                 l_fprData[fpCount++] = l_s->val.d;
             break;
-        case nsXPTType::T_U8     : *((uint32*) l_d) = l_s->val.u8;          break;
-        case nsXPTType::T_U16    : *((uint32*) l_d) = l_s->val.u16;         break;
-        case nsXPTType::T_U32    : *((uint32*) l_d) = l_s->val.u32;         break;
+        case nsXPTType::T_U8     : *((uint32_t*) l_d) = l_s->val.u8;          break;
+        case nsXPTType::T_U16    : *((uint32_t*) l_d) = l_s->val.u16;         break;
+        case nsXPTType::T_U32    : *((uint32_t*) l_d) = l_s->val.u32;         break;
         case nsXPTType::T_FLOAT  :
             *((float*)  l_d) = l_s->val.f;
             if(fpCount < 13)
                 l_fprData[fpCount++] = l_s->val.f;
             break;
-        case nsXPTType::T_BOOL   : *((uint32*) l_d) = l_s->val.b;           break;
-        case nsXPTType::T_CHAR   : *((uint32*) l_d) = l_s->val.c;           break;
-        case nsXPTType::T_WCHAR  : *((int32*)  l_d) = l_s->val.wc;          break;
+        case nsXPTType::T_BOOL   : *((uint32_t*) l_d) = l_s->val.b;           break;
+        case nsXPTType::T_CHAR   : *((uint32_t*) l_d) = l_s->val.c;           break;
+        case nsXPTType::T_WCHAR  : *((int32_t*)  l_d) = l_s->val.wc;          break;
         default:
             // all the others are plain pointer types
             *((void**)l_d) = l_s->val.p;
             break;
         }
     }
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_linux.cpp
@@ -39,17 +39,17 @@ invoke_copy_to_stack(uint32_t* d,
 {
     uint32_t gpr = 1; // skip one GP reg for 'that'
 #ifndef __NO_FPRS__
     uint32_t fpr = 0;
 #endif
     uint32_t tempu32;
     uint64_t tempu64;
     
-    for(uint32 i = 0; i < paramCount; i++, s++) {
+    for(uint32_t i = 0; i < paramCount; i++, s++) {
         if(s->IsPtrData())
             tempu32 = (uint32_t) s->ptr;
         else {
             switch(s->type) {
             case nsXPTType::T_FLOAT:                                  break;
             case nsXPTType::T_DOUBLE:                                 break;
             case nsXPTType::T_I8:     tempu32 = s->val.i8;            break;
             case nsXPTType::T_I16:    tempu32 = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp
@@ -35,17 +35,17 @@ invoke_copy_to_stack(uint32_t* d,
                      uint32_t* gpregs,
                      double* fpregs)
 {
     uint32_t gpr = 1; // skip one GP reg for 'that'
     uint32_t fpr = 0;
     uint32_t tempu32;
     uint64_t tempu64;
     
-    for(uint32 i = 0; i < paramCount; i++, s++) {
+    for(uint32_t i = 0; i < paramCount; i++, s++) {
         if(s->IsPtrData())
             tempu32 = (uint32_t) s->ptr;
         else {
             switch(s->type) {
             case nsXPTType::T_FLOAT:                                  break;
             case nsXPTType::T_DOUBLE:                                 break;
             case nsXPTType::T_I8:     tempu32 = s->val.i8;            break;
             case nsXPTType::T_I16:    tempu32 = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_openbsd.cpp
@@ -35,17 +35,17 @@ invoke_copy_to_stack(uint32_t* d,
                      uint32_t* gpregs,
                      double* fpregs)
 {
     uint32_t gpr = 1; // skip one GP reg for 'that'
     uint32_t fpr = 0;
     uint32_t tempu32;
     uint64_t tempu64;
     
-    for(uint32 i = 0; i < paramCount; i++, s++) {
+    for(uint32_t i = 0; i < paramCount; i++, s++) {
         if(s->IsPtrData())
             tempu32 = (uint32_t) s->ptr;
         else {
             switch(s->type) {
             case nsXPTType::T_FLOAT:                                  break;
             case nsXPTType::T_DOUBLE:                                 break;
             case nsXPTType::T_I8:     tempu32 = s->val.i8;            break;
             case nsXPTType::T_I16:    tempu32 = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Platform specific code to invoke XPCOM methods on native objects */
 
 #include "xptcprivate.h"
 
-extern "C" uint32
+extern "C" uint32_t
 invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
 {
     uint32_t result = 0;
     /*    fprintf(stderr,"invoke_count_words(%d,%p)\n",paramCount, s);*/
 
     for(uint32_t i = 0; i < paramCount; i++, s++)
     {
         if(s->IsPtrData())
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp
@@ -71,53 +71,53 @@ invoke_count_words(uint32_t paramCount, 
 extern "C" uint32_t
 invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s)
 {
 /*
     We need to copy the parameters for this function to locals and use them
     from there since the parameters occupy the same stack space as the stack
     we're trying to populate.
 */
-    uint32 *l_d = d;
+    uint32_t *l_d = d;
     nsXPTCVariant *l_s = s;
-    uint32 l_paramCount = paramCount;
-    uint32 regCount = 0;	// return the number of registers to load from the stack
+    uint32_t l_paramCount = paramCount;
+    uint32_t regCount = 0;	// return the number of registers to load from the stack
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
-    for(uint32 i = 0; i < l_paramCount; i++, l_d++, l_s++)
+    for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
     {
 	if (regCount < 5) regCount++;
         if(l_s->IsPtrData())
         {
             *((void**)l_d) = l_s->ptr;
             continue;
         }
         switch(l_s->type)
         {
-        case nsXPTType::T_I8     : *((int32*)   l_d) = l_s->val.i8;          break;
-        case nsXPTType::T_I16    : *((int32*)  l_d) = l_s->val.i16;         break;
-        case nsXPTType::T_I32    : *((int32*)  l_d) = l_s->val.i32;         break;
+        case nsXPTType::T_I8     : *((int32_t*)   l_d) = l_s->val.i8;          break;
+        case nsXPTType::T_I16    : *((int32_t*)  l_d) = l_s->val.i16;         break;
+        case nsXPTType::T_I32    : *((int32_t*)  l_d) = l_s->val.i32;         break;
         case nsXPTType::T_I64    : 
         case nsXPTType::T_U64    : 
-        case nsXPTType::T_DOUBLE : *((uint32*) l_d++) = ((DU *)l_s)->hi;
+        case nsXPTType::T_DOUBLE : *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
 				   if (regCount < 5) regCount++;
-                                   *((uint32*) l_d) = ((DU *)l_s)->lo;
+                                   *((uint32_t*) l_d) = ((DU *)l_s)->lo;
                                    break;
-        case nsXPTType::T_U8     : *((uint32*) l_d) = l_s->val.u8;          break;
-        case nsXPTType::T_U16    : *((uint32*) l_d) = l_s->val.u16;         break;
-        case nsXPTType::T_U32    : *((uint32*) l_d) = l_s->val.u32;         break;
+        case nsXPTType::T_U8     : *((uint32_t*) l_d) = l_s->val.u8;          break;
+        case nsXPTType::T_U16    : *((uint32_t*) l_d) = l_s->val.u16;         break;
+        case nsXPTType::T_U32    : *((uint32_t*) l_d) = l_s->val.u32;         break;
         case nsXPTType::T_FLOAT  : *((float*)  l_d) = l_s->val.f;           break;
-        case nsXPTType::T_BOOL   : *((uint32*) l_d) = l_s->val.b;           break;
-        case nsXPTType::T_CHAR   : *((uint32*) l_d) = l_s->val.c;           break;
-        case nsXPTType::T_WCHAR  : *((int32*)  l_d) = l_s->val.wc;          break;
+        case nsXPTType::T_BOOL   : *((uint32_t*) l_d) = l_s->val.b;           break;
+        case nsXPTType::T_CHAR   : *((uint32_t*) l_d) = l_s->val.c;           break;
+        case nsXPTType::T_WCHAR  : *((int32_t*)  l_d) = l_s->val.wc;          break;
         default:
             // all the others are plain pointer types
             *((void**)l_d) = l_s->val.p;
             break;
         }
     }
     return regCount;
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp
@@ -68,53 +68,53 @@ invoke_count_words(uint32_t paramCount, 
 extern "C" uint32_t
 invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s)
 {
 /*
     We need to copy the parameters for this function to locals and use them
     from there since the parameters occupy the same stack space as the stack
     we're trying to populate.
 */
-    uint32 *l_d = d;
+    uint32_t *l_d = d;
     nsXPTCVariant *l_s = s;
-    uint32 l_paramCount = paramCount;
-    uint32 regCount = 0;	// return the number of registers to load from the stack
+    uint32_t l_paramCount = paramCount;
+    uint32_t regCount = 0;	// return the number of registers to load from the stack
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
-    for(uint32 i = 0; i < l_paramCount; i++, l_d++, l_s++)
+    for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
     {
 	if (regCount < 5) regCount++;
         if(l_s->IsPtrData())
         {
             *((void**)l_d) = l_s->ptr;
             continue;
         }
         switch(l_s->type)
         {
-        case nsXPTType::T_I8     : *((int32*)  l_d) = l_s->val.i8;          break;
-        case nsXPTType::T_I16    : *((int32*)  l_d) = l_s->val.i16;         break;
-        case nsXPTType::T_I32    : *((int32*)  l_d) = l_s->val.i32;         break;
+        case nsXPTType::T_I8     : *((int32_t*)  l_d) = l_s->val.i8;          break;
+        case nsXPTType::T_I16    : *((int32_t*)  l_d) = l_s->val.i16;         break;
+        case nsXPTType::T_I32    : *((int32_t*)  l_d) = l_s->val.i32;         break;
         case nsXPTType::T_I64    : 
         case nsXPTType::T_U64    : 
-        case nsXPTType::T_DOUBLE : *((uint32*) l_d++) = ((DU *)l_s)->hi;
+        case nsXPTType::T_DOUBLE : *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
 				   if (regCount < 5) regCount++;
-                                   *((uint32*) l_d) = ((DU *)l_s)->lo;
+                                   *((uint32_t*) l_d) = ((DU *)l_s)->lo;
                                    break;
-        case nsXPTType::T_U8     : *((uint32*) l_d) = l_s->val.u8;          break;
-        case nsXPTType::T_U16    : *((uint32*) l_d) = l_s->val.u16;         break;
-        case nsXPTType::T_U32    : *((uint32*) l_d) = l_s->val.u32;         break;
+        case nsXPTType::T_U8     : *((uint32_t*) l_d) = l_s->val.u8;          break;
+        case nsXPTType::T_U16    : *((uint32_t*) l_d) = l_s->val.u16;         break;
+        case nsXPTType::T_U32    : *((uint32_t*) l_d) = l_s->val.u32;         break;
         case nsXPTType::T_FLOAT  : *((float*)  l_d) = l_s->val.f;           break;
-        case nsXPTType::T_BOOL   : *((uint32*) l_d) = l_s->val.b;           break;
-        case nsXPTType::T_CHAR   : *((uint32*) l_d) = l_s->val.c;           break;
-        case nsXPTType::T_WCHAR  : *((int32*)  l_d) = l_s->val.wc;          break;
+        case nsXPTType::T_BOOL   : *((uint32_t*) l_d) = l_s->val.b;           break;
+        case nsXPTType::T_CHAR   : *((uint32_t*) l_d) = l_s->val.c;           break;
+        case nsXPTType::T_WCHAR  : *((int32_t*)  l_d) = l_s->val.wc;          break;
         default:
             // all the others are plain pointer types
             *((void**)l_d) = l_s->val.p;
             break;
         }
     }
     return regCount;
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp
@@ -71,53 +71,53 @@ invoke_count_words(uint32_t paramCount, 
 extern "C" uint32_t
 invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s)
 {
 /*
     We need to copy the parameters for this function to locals and use them
     from there since the parameters occupy the same stack space as the stack
     we're trying to populate.
 */
-    uint32 *l_d = d;
+    uint32_t *l_d = d;
     nsXPTCVariant *l_s = s;
-    uint32 l_paramCount = paramCount;
-    uint32 regCount = 0;	// return the number of registers to load from the stack
+    uint32_t l_paramCount = paramCount;
+    uint32_t regCount = 0;	// return the number of registers to load from the stack
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
-    for(uint32 i = 0; i < l_paramCount; i++, l_d++, l_s++)
+    for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
     {
 	if (regCount < 5) regCount++;
         if(l_s->IsPtrData())
         {
             *((void**)l_d) = l_s->ptr;
             continue;
         }
         switch(l_s->type)
         {
-        case nsXPTType::T_I8     : *((int32*)   l_d) = l_s->val.i8;          break;
-        case nsXPTType::T_I16    : *((int32*)  l_d) = l_s->val.i16;         break;
-        case nsXPTType::T_I32    : *((int32*)  l_d) = l_s->val.i32;         break;
+        case nsXPTType::T_I8     : *((int32_t*)   l_d) = l_s->val.i8;          break;
+        case nsXPTType::T_I16    : *((int32_t*)  l_d) = l_s->val.i16;         break;
+        case nsXPTType::T_I32    : *((int32_t*)  l_d) = l_s->val.i32;         break;
         case nsXPTType::T_I64    : 
         case nsXPTType::T_U64    : 
-        case nsXPTType::T_DOUBLE : *((uint32*) l_d++) = ((DU *)l_s)->hi;
+        case nsXPTType::T_DOUBLE : *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
 				   if (regCount < 5) regCount++;
-                                   *((uint32*) l_d) = ((DU *)l_s)->lo;
+                                   *((uint32_t*) l_d) = ((DU *)l_s)->lo;
                                    break;
-        case nsXPTType::T_U8     : *((uint32*) l_d) = l_s->val.u8;          break;
-        case nsXPTType::T_U16    : *((uint32*) l_d) = l_s->val.u16;         break;
-        case nsXPTType::T_U32    : *((uint32*) l_d) = l_s->val.u32;         break;
+        case nsXPTType::T_U8     : *((uint32_t*) l_d) = l_s->val.u8;          break;
+        case nsXPTType::T_U16    : *((uint32_t*) l_d) = l_s->val.u16;         break;
+        case nsXPTType::T_U32    : *((uint32_t*) l_d) = l_s->val.u32;         break;
         case nsXPTType::T_FLOAT  : *((float*)  l_d) = l_s->val.f;           break;
-        case nsXPTType::T_BOOL   : *((uint32*) l_d) = l_s->val.b;           break;
-        case nsXPTType::T_CHAR   : *((uint32*) l_d) = l_s->val.c;           break;
-        case nsXPTType::T_WCHAR  : *((int32*)  l_d) = l_s->val.wc;          break;
+        case nsXPTType::T_BOOL   : *((uint32_t*) l_d) = l_s->val.b;           break;
+        case nsXPTType::T_CHAR   : *((uint32_t*) l_d) = l_s->val.c;           break;
+        case nsXPTType::T_WCHAR  : *((int32_t*)  l_d) = l_s->val.wc;          break;
         default:
             // all the others are plain pointer types
             *((void**)l_d) = l_s->val.p;
             break;
         }
     }
     return regCount;
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_solaris.cpp
@@ -20,17 +20,17 @@ static inline void
 invoke_count_words(uint32_t paramCount, nsXPTCVariant * s,
                    uint32_t & nr_gpr, uint32_t & nr_fpr, uint32_t & nr_stack)
 {
     nr_gpr = 1; // skip one GP register for 'that'
     nr_fpr = 0;
     nr_stack = 0;
 
     /* Compute number of eightbytes of class MEMORY.  */
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (!s->IsPtrData()
             && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
             if (nr_fpr < FPR_COUNT)
                 nr_fpr++;
             else
                 nr_stack++;
         }
         else {
@@ -45,17 +45,17 @@ invoke_count_words(uint32_t paramCount, 
 static void
 invoke_copy_to_stack(uint64_t * d, uint32_t paramCount, nsXPTCVariant * s,
                      uint64_t * gpregs, double * fpregs)
 {
     uint32_t nr_gpr = 1; // skip one GP register for 'that'
     uint32_t nr_fpr = 0;
     uint64_t value;
 
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (s->IsPtrData())
             value = (uint64_t) s->ptr;
         else {
             switch (s->type) {
             case nsXPTType::T_FLOAT:                                break;
             case nsXPTType::T_DOUBLE:                               break;
             case nsXPTType::T_I8:     value = s->val.i8;            break;
             case nsXPTType::T_I16:    value = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp
@@ -21,17 +21,17 @@ invoke_count_words(uint32_t paramCount, 
 {
     uint32_t nr_gpr;
     uint32_t nr_fpr;
     nr_gpr = 1; // skip one GP register for 'that'
     nr_fpr = 0;
     nr_stack = 0;
 
     /* Compute number of eightbytes of class MEMORY.  */
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (!s->IsPtrData()
             && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
             if (nr_fpr < FPR_COUNT)
                 nr_fpr++;
             else
                 nr_stack++;
         }
         else {
@@ -46,17 +46,17 @@ invoke_count_words(uint32_t paramCount, 
 static void
 invoke_copy_to_stack(uint64_t * d, uint32_t paramCount, nsXPTCVariant * s,
                      uint64_t * gpregs, double * fpregs)
 {
     uint32_t nr_gpr = 1; // skip one GP register for 'that'
     uint32_t nr_fpr = 0;
     uint64_t value;
 
-    for (uint32 i = 0; i < paramCount; i++, s++) {
+    for (uint32_t i = 0; i < paramCount; i++, s++) {
         if (s->IsPtrData())
             value = (uint64_t) s->ptr;
         else {
             switch (s->type) {
             case nsXPTType::T_FLOAT:                                break;
             case nsXPTType::T_DOUBLE:                               break;
             case nsXPTType::T_I8:     value = s->val.i8;            break;
             case nsXPTType::T_I16:    value = s->val.i16;           break;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
@@ -5,21 +5,21 @@
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 /* Prototype specifies unmangled function name and disables unused warning */
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint64_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
 __asm__("PrepareAndDispatch") __attribute__((used));
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint64_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
 {
     const uint8_t PARAM_BUFFER_COUNT = 16;
     const uint8_t NUM_ARG_REGS = 6-1;        // -1 for "this" pointer
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
@@ -20,34 +20,34 @@
 #else
 /* This tells older gccs not to warn about unused vairables.
  * @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
  */
 #define DONT_DROP_OR_WARN __attribute__((unused))
 #endif
 
 /* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol.  */
-static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
+static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
 DONT_DROP_OR_WARN;
 
 #ifdef __ARM_EABI__
 #define DOUBLEWORD_ALIGN(p) ((uint32_t *)((((uint32_t)(p)) + 7) & 0xfffffff8))
 #else
 #define DOUBLEWORD_ALIGN(p) (p)
 #endif
 
 // Apple's iOS toolchain is lame and does not support .cfi directives.
 #ifdef __APPLE__
 #define CFI(str)
 #else
 #define CFI(str) str
 #endif
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
     uint8_t i;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 
 nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     nsIInterfaceInfo* iface_info = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
@@ -16,21 +16,21 @@
 #else
 /* This tells older gccs not to warn about unused vairables.
  * @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
  */
 #define DONT_DROP_OR_WARN __attribute__((unused))
 #endif
 
 /* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol.  */
-static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
+static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
 DONT_DROP_OR_WARN;
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
     uint8_t i;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
@@ -7,17 +7,17 @@
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 #include "xptc_gcc_x86_unix.h"
 
 extern "C" {
 static nsresult ATTRIBUTE_USED
 __attribute__ ((regparm (3)))
-PrepareAndDispatch(uint32 methodIndex, nsXPTCStubBase* self, uint32_t* args)
+PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
     uint8_t i;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
@@ -5,21 +5,21 @@
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 /* Prototype specifies unmangled function name and disables unused warning */
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint64_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
 __asm__("PrepareAndDispatch") __attribute__((used));
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint64_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
 {
     const uint8_t PARAM_BUFFER_COUNT = 16;
     const uint8_t NUM_ARG_REGS = 6-1;        // -1 for "this" pointer
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp
@@ -5,17 +5,17 @@
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 extern "C" {
     nsresult
-    PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args)
+    PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
     {
 #define PARAM_BUFFER_COUNT     16
 
         nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
         nsXPTCMiniVariant* dispatchParams = NULL;
         const nsXPTMethodInfo* info;
         uint8_t paramCount;
         uint8_t i;
@@ -80,17 +80,17 @@ extern "C" {
         return result;
     }
 }
 
 #define STUB_ENTRY(n) \
 nsresult nsXPTCStubBase::Stub##n() \
 { \
   void *frame = __builtin_frame_address(0); \
-  return PrepareAndDispatch(this, n, (uint32*)frame + 3); \
+  return PrepareAndDispatch(this, n, (uint32_t*)frame + 3); \
 }
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, 
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, 
                    uint32_t* a_gpr, uint64_t *a_fpr, uint32_t *a_ov)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_s390x.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, 
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, 
                    uint64_t* a_gpr, uint64_t *a_fpr, uint64_t *a_ov)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
@@ -8,17 +8,17 @@
 #include "xptcprivate.h"
 
 #if !defined(__NetBSD__) || !defined(__m68k__)
 #error This code is for NetBSD/m68k only
 #endif
 
 extern "C" {
     static nsresult
-    PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args)
+    PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
     {
 #define PARAM_BUFFER_COUNT     16
 
         nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
         nsXPTCMiniVariant* dispatchParams = NULL;
         nsIInterfaceInfo* iface_info = NULL;
         const nsXPTMethodInfo* info;
         uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
@@ -7,20 +7,20 @@
 
 #include "xptcprivate.h"
 
 #if !defined(__QNXNTO__) || !defined(__arm__)
 #error "This code is for Neutrino ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour."
 #endif
 
 /* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol.  */
-static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args) asm("_PrepareAndDispatch");
+static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch");
 
 static nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     nsIInterfaceInfo* iface_info = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp
@@ -15,18 +15,18 @@
 #endif
 
 extern "C" nsresult
 PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
   uint32_t* args, uint32_t* floatargs)
 {
 
   typedef struct {
-    uint32 hi;
-    uint32 lo;
+    uint32_t hi;
+    uint32_t lo;
   } DU;
 
 #define PARAM_BUFFER_COUNT     16
 
   nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
   nsXPTCMiniVariant* dispatchParams = NULL;
   const nsXPTMethodInfo* info;
   int32_t regwords = 1; /* self pointer is not in the variant records */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_aix.cpp
@@ -15,18 +15,18 @@
         arrive in a separate chunk of data that has been loaded from the registers. 
         The args pointer has been set to the start of the parameters BEYOND the ones
         arriving in registers
 */
 extern "C" nsresult
 PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, uint32_t *gprData, double *fprData)
 {
     typedef struct {
-        uint32 hi;
-        uint32 lo;      // have to move 64 bit entities as 32 bit halves since
+        uint32_t hi;
+        uint32_t lo;      // have to move 64 bit entities as 32 bit halves since
     } DU;               // stack slots are not guaranteed 16 byte aligned
 
 #define PARAM_BUFFER_COUNT     16
 #define PARAM_GPR_COUNT         7  
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info = NULL;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp
@@ -5,22 +5,22 @@
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 
 #if defined(sparc) || defined(__sparc__)
 
 extern "C" nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     nsIInterfaceInfo* iface_info = NULL;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp
@@ -5,22 +5,22 @@
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 
 #if defined(sparc) || defined(__sparc__)
 
 extern "C" nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     nsIInterfaceInfo* iface_info = NULL;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp
@@ -6,22 +6,22 @@
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 #if defined(sparc) || defined(__sparc__)
 
 extern "C" nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 
     typedef struct {
-        uint32 hi;
-        uint32 lo;
+        uint32_t hi;
+        uint32_t lo;
     } DU;               // have to move 64 bit entities as 32 bit halves since
                         // stack slots are not guaranteed 16 byte aligned
 
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 nsresult
-PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32_t* args)
+PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
 {
 #define PARAM_BUFFER_COUNT     16
 
     nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
     nsXPTCMiniVariant* dispatchParams = NULL;
     const nsXPTMethodInfo* info;
     uint8_t paramCount;
     uint8_t i;
--- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
@@ -152,39 +152,39 @@ xptiInterfaceEntry::IsFunction(bool* res
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     *result = XPT_ID_IS_FUNCTION(mDescriptor->flags);
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetMethodCount(uint16* count)
+xptiInterfaceEntry::GetMethodCount(uint16_t* count)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
     
     *count = mMethodBaseIndex + 
              mDescriptor->num_methods;
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetConstantCount(uint16* count)
+xptiInterfaceEntry::GetConstantCount(uint16_t* count)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     *count = mConstantBaseIndex + 
              mDescriptor->num_constants;
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetMethodInfo(uint16 index, const nsXPTMethodInfo** info)
+xptiInterfaceEntry::GetMethodInfo(uint16_t index, const nsXPTMethodInfo** info)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     if(index < mMethodBaseIndex)
         return mParent->GetMethodInfo(index, info);
 
     if(index >= mMethodBaseIndex + 
@@ -197,24 +197,24 @@ xptiInterfaceEntry::GetMethodInfo(uint16
 
     // else...
     *info = reinterpret_cast<nsXPTMethodInfo*>
        (&mDescriptor->method_descriptors[index - mMethodBaseIndex]);
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetMethodInfoForName(const char* methodName, uint16 *index,
+xptiInterfaceEntry::GetMethodInfoForName(const char* methodName, uint16_t *index,
                                          const nsXPTMethodInfo** result)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     // This is a slow algorithm, but this is not expected to be called much.
-    for(uint16 i = 0; i < mDescriptor->num_methods; ++i)
+    for(uint16_t i = 0; i < mDescriptor->num_methods; ++i)
     {
         const nsXPTMethodInfo* info;
         info = reinterpret_cast<nsXPTMethodInfo*>
                                (&mDescriptor->
                                         method_descriptors[i]);
         if (PL_strcmp(methodName, info->GetName()) == 0) {
             *index = i + mMethodBaseIndex;
             *result = info;
@@ -228,17 +228,17 @@ xptiInterfaceEntry::GetMethodInfoForName
     {
         *index = 0;
         *result = 0;
         return NS_ERROR_INVALID_ARG;
     }
 }
 
 nsresult
-xptiInterfaceEntry::GetConstant(uint16 index, const nsXPTConstant** constant)
+xptiInterfaceEntry::GetConstant(uint16_t index, const nsXPTConstant** constant)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     if(index < mConstantBaseIndex)
         return mParent->GetConstant(index, constant);
 
     if(index >= mConstantBaseIndex + 
@@ -300,17 +300,17 @@ xptiInterfaceEntry::GetEntryForParam(uin
         return NS_ERROR_FAILURE;
     }
 
     *entry = theEntry;
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetInfoForParam(uint16 methodIndex,
+xptiInterfaceEntry::GetInfoForParam(uint16_t methodIndex,
                                     const nsXPTParamInfo *param,
                                     nsIInterfaceInfo** info)
 {
     xptiInterfaceEntry* entry;
     nsresult rv = GetEntryForParam(methodIndex, param, &entry);
     if(NS_FAILED(rv))
         return rv;
 
@@ -319,17 +319,17 @@ xptiInterfaceEntry::GetInfoForParam(uint
     if(NS_FAILED(rv))
         return rv;
 
     *info = static_cast<nsIInterfaceInfo*>(theInfo);
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetIIDForParam(uint16 methodIndex,
+xptiInterfaceEntry::GetIIDForParam(uint16_t methodIndex,
                                    const nsXPTParamInfo* param, nsIID** iid)
 {
     xptiInterfaceEntry* entry;
     nsresult rv = GetEntryForParam(methodIndex, param, &entry);
     if(NS_FAILED(rv))
         return rv;
     return entry->GetIID(iid);
 }
@@ -345,41 +345,41 @@ xptiInterfaceEntry::GetIIDForParamNoAllo
         return rv;
     *iid = entry->mIID;    
     return NS_OK;
 }
 
 // this is a private helper
 nsresult
 xptiInterfaceEntry::GetTypeInArray(const nsXPTParamInfo* param,
-                                  uint16 dimension,
+                                  uint16_t dimension,
                                   const XPTTypeDescriptor** type)
 {
     NS_ASSERTION(IsFullyResolved(), "bad state");
 
     const XPTTypeDescriptor *td = &param->type;
     const XPTTypeDescriptor *additional_types =
                 mDescriptor->additional_types;
 
-    for (uint16 i = 0; i < dimension; i++) {
+    for (uint16_t i = 0; i < dimension; i++) {
         if(XPT_TDP_TAG(td->prefix) != TD_ARRAY) {
             NS_ERROR("bad dimension");
             return NS_ERROR_INVALID_ARG;
         }
         td = &additional_types[td->type.additional_type];
     }
 
     *type = td;
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetTypeForParam(uint16 methodIndex,
+xptiInterfaceEntry::GetTypeForParam(uint16_t methodIndex,
                                     const nsXPTParamInfo* param,
-                                    uint16 dimension,
+                                    uint16_t dimension,
                                     nsXPTType* type)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     if(methodIndex < mMethodBaseIndex)
         return mParent->
             GetTypeForParam(methodIndex, param, dimension, type);
@@ -401,20 +401,20 @@ xptiInterfaceEntry::GetTypeForParam(uint
     else
         td = &param->type;
 
     *type = nsXPTType(td->prefix);
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetSizeIsArgNumberForParam(uint16 methodIndex,
+xptiInterfaceEntry::GetSizeIsArgNumberForParam(uint16_t methodIndex,
                                                const nsXPTParamInfo* param,
-                                               uint16 dimension,
-                                               uint8* argnum)
+                                               uint16_t dimension,
+                                               uint8_t* argnum)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     if(methodIndex < mMethodBaseIndex)
         return mParent->
             GetSizeIsArgNumberForParam(methodIndex, param, dimension, argnum);
 
@@ -446,19 +446,19 @@ xptiInterfaceEntry::GetSizeIsArgNumberFo
         return NS_ERROR_INVALID_ARG;
     }
 
     *argnum = td->argnum;
     return NS_OK;
 }
 
 nsresult
-xptiInterfaceEntry::GetInterfaceIsArgNumberForParam(uint16 methodIndex,
+xptiInterfaceEntry::GetInterfaceIsArgNumberForParam(uint16_t methodIndex,
                                                     const nsXPTParamInfo* param,
-                                                    uint8* argnum)
+                                                    uint8_t* argnum)
 {
     if(!EnsureResolved())
         return NS_ERROR_UNEXPECTED;
 
     if(methodIndex < mMethodBaseIndex)
         return mParent->
             GetInterfaceIsArgNumberForParam(methodIndex, param, argnum);
 
--- a/xpcom/reflect/xptinfo/tests/TestInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/tests/TestInterfaceInfo.cpp
@@ -71,17 +71,17 @@ int main (int argc, char **argv) {
 #endif
 
     // XXX: nsIServiceManager is no more; what do we test with?
     if (info5 == NULL) {
         fprintf(stderr, "\nNo nsIComponentManager; cannot continue.\n");
         return 1;
     }
 
-    uint16 methodcount;
+    uint16_t methodcount;
     info5->GetMethodCount(&methodcount);
     const nsXPTMethodInfo *mi;
     for (i = 0; i < methodcount; i++) {
         info5->GetMethodInfo(i, &mi);
         fprintf(stderr, "method %d, name %s\n", i, mi->GetName());
     }
 
     // 4 is getServiceByContractID, which has juicy params.
@@ -100,17 +100,17 @@ int main (int argc, char **argv) {
     fprintf(stderr, "\nNow check the last param\n");
     const nsXPTParamInfo& param3 = mi->GetParam(3);
 
     if (param3.GetType().TagPart() != nsXPTType::T_INTERFACE_IS) {
         fprintf(stderr, "Param 3 is not type interface is\n");
         // Not returning an error, because this could legitamately change
     }
     // lets see what arg this refers to
-    uint8 argnum;
+    uint8_t argnum;
     info5->GetInterfaceIsArgNumberForParam(6, &param3, &argnum);
     fprintf(stderr, "param 3 referrs to param %d of method 6 - createInstanceByContractID\n", (uint32_t)argnum);
     // Get the type of the parameter referred to
     const nsXPTParamInfo& arg_param = mi->GetParam(argnum);
     const nsXPTType& arg_type = arg_param.GetType();
     // Check to make sure it refers to the proper param
     if(!arg_type.IsPointer() || arg_type.TagPart() != nsXPTType::T_IID) {
         fprintf(stderr, "Param 3 of method 6 refers to a non IID parameter\n"); 
--- a/xpcom/string/src/nsUTF8UtilsSSE2.cpp
+++ b/xpcom/string/src/nsUTF8UtilsSSE2.cpp
@@ -32,19 +32,19 @@ LossyConvertEncoding16to8::write_sse2(co
 
     __m128i source3 = _mm_load_si128(reinterpret_cast<const __m128i*>(aSource + i + 16));
     source3 = _mm_and_si128(source3, vectmask);
 
     __m128i source4 = _mm_load_si128(reinterpret_cast<const __m128i*>(aSource + i + 24));
     source4 = _mm_and_si128(source4, vectmask);
 
 
-    // Pack the source data.  SSE2 views this as a saturating uint16 to
-    // uint8 conversion, but since we masked off the high-order byte of every
-    // uint16, we're really just grabbing the low-order bytes of source1 and
+    // Pack the source data.  SSE2 views this as a saturating uint16_t to
+    // uint8_t conversion, but since we masked off the high-order byte of every
+    // uint16_t, we're really just grabbing the low-order bytes of source1 and
     // source2.
     __m128i packed1 = _mm_packus_epi16(source1, source2);
     __m128i packed2 = _mm_packus_epi16(source3, source4);
 
     // This store needs to be unaligned since there's no guarantee that the
     // alignment we did above for the source will align the destination.
     _mm_storeu_si128(reinterpret_cast<__m128i*>(dest + i),      packed1);
     _mm_storeu_si128(reinterpret_cast<__m128i*>(dest + i + 16), packed2);
--- a/xpcom/typelib/xpt/public/xpt_struct.h
+++ b/xpcom/typelib/xpt/public/xpt_struct.h
@@ -371,22 +371,22 @@ struct XPTTypeDescriptor {
 
 /*
  * A ConstDescriptor is a variable-size record that records the name and 
  * value of a scoped interface constant. 
  *
  * The types of the method parameter are restricted to the following subset 
  * of TypeDescriptors: 
  *
- * int8, uint8, int16, uint16, int32, uint32, 
- * int64, uint64, wchar_t, char, string
+ * int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, 
+ * int64_t, uint64_t, wchar_t, char, string
  * 
  * The type (and thus the size) of the value record is determined by the 
  * contents of the associated TypeDescriptor record. For instance, if type 
- * corresponds to int16, then value is a two-byte record consisting of a 
+ * corresponds to int16_t, then value is a two-byte record consisting of a 
  * 16-bit signed integer.  For a ConstDescriptor type of string, the value 
  * record is of type String*, i.e. an offset within the data pool to a 
  * String record containing the constant string.
  */
 union XPTConstValue {
     int8_t    i8;
     uint8_t   ui8; 
     int16_t   i16; 
--- a/xpcom/typelib/xpt/tests/PrimitiveTest.c
+++ b/xpcom/typelib/xpt/tests/PrimitiveTest.c
@@ -24,19 +24,19 @@
   }
 
 #define TRY(msg, cond)		TRY_(msg, cond, 0)
 #define TRY_Q(msg, cond)	TRY_(msg, cond, 1);
 
 XPTString in_str = { 4, "bazz" };
 
 struct TestData {
-    uint32	bit32;
-    uint16      bit16;
-    uint8       bit8[2];
+    uint32_t	bit32;
+    uint16_t      bit16;
+    uint8_t       bit8[2];
     char	*cstr;
     XPTString   *str;
 } input = { 0xdeadbeef, 0xcafe, {0xba, 0xbe}, "foobar", &in_str},
   output = {0, 0, {0, 0}, NULL, NULL };
 
 void
 dump_struct(char *label, struct TestData *str)
 {
@@ -59,17 +59,17 @@ XDR(XPTArena *arena, XPTCursor *cursor, 
 
 int
 main(int argc, char **argv)
 {
     XPTArena *arena;
     XPTState *state;
     XPTCursor curs, *cursor = &curs;
     char *header, *data, *whole;
-    uint32 hlen, dlen, i;
+    uint32_t hlen, dlen, i;
 
     TRY("XPT_NewArena", (arena = XPT_NewArena(1024, sizeof(double), "main")));
     
     TRY("NewState (ENCODE)", (state = XPT_NewXDRState(XPT_ENCODE, NULL, 0)));
 
     XPT_SetDataOffset(state, sizeof input);
 
     TRY("MakeCursor", XPT_MakeCursor(state, XPT_HEADER, sizeof input, cursor));
@@ -79,26 +79,26 @@ main(int argc, char **argv)
     if (XDR(arena, cursor, &input))
 	return 1;
 
     fprintf(stderr, "ENCODE successful\n");
     XPT_GetXDRData(state, XPT_HEADER, &header, &hlen);
     fprintf(stderr, "XDR header %d bytes at %p:",
 	    hlen, header);
     for (i = 0; i < hlen; i++)
-	fprintf(stderr, "%c%02x", i ? ',' : ' ', (uint8)header[i]);
+	fprintf(stderr, "%c%02x", i ? ',' : ' ', (uint8_t)header[i]);
     fprintf(stderr, "\n");
 
     XPT_GetXDRData(state, XPT_DATA, &data, &dlen);
 
     fprintf(stderr, "XDR data %d bytes at %p:",
 	    dlen, data);
     for (i = 0; i < dlen; i++)
-	fprintf(stderr, "%c%02x/%c", i ? ',' : ' ', (uint8)data[i],
-		(uint8)data[i]);
+	fprintf(stderr, "%c%02x/%c", i ? ',' : ' ', (uint8_t)data[i],
+		(uint8_t)data[i]);
     fprintf(stderr, "\n");
 
     whole = malloc(dlen + hlen);
     if (!whole) {
 	fprintf(stderr, "malloc %d failed!\n", dlen + hlen);
 	return 1;
     }
 
--- a/xpcom/typelib/xpt/tests/SimpleTypeLib.c
+++ b/xpcom/typelib/xpt/tests/SimpleTypeLib.c
@@ -43,17 +43,17 @@ main(int argc, char **argv)
     XPTAnnotation *ann;
     XPTInterfaceDescriptor *id;
     XPTMethodDescriptor *meth;
 
     XPTState *state;
     XPTCursor curs, *cursor = &curs;
     char *data, *head;
     FILE *out;
-    uint32 len, header_sz;
+    uint32_t len, header_sz;
 
     PRBool ok;
 
     td_void.prefix.flags = TD_VOID;
 
     if (argc != 2) {
 	fprintf(stderr, "Usage: %s <filename.xpt>\n"
 		"       Creates a simple typelib file.\n", argv[0]);
@@ -86,17 +86,17 @@ main(int argc, char **argv)
 
     /* void method1(void) */
     meth = &id->method_descriptors[0];
     ok = XPT_FillMethodDescriptor(arena, meth, 0, "method1", 0);
     TRY("FillMethodDescriptor", ok);
     meth->result->flags = 0;
     meth->result->type.prefix.flags = TD_VOID;
 
-    /* wstring method2(in uint32, in bool) */
+    /* wstring method2(in uint32_t, in bool) */
     meth = &id->method_descriptors[1];
     ok = XPT_FillMethodDescriptor(arena, meth, 0, "method2", 2);
     TRY("FillMethodDescriptor", ok);
 
     meth->result->flags = 0;
     meth->result->type.prefix.flags = TD_PSTRING | XPT_TDP_POINTER;
     meth->params[0].type.prefix.flags = TD_UINT32;
     meth->params[0].flags = XPT_PD_IN;