diff --git a/js/src/xpconnect/src/xpcconvert.cpp b/js/src/xpconnect/src/xpcconvert.cpp index a46138bfb24..0f6b745d90e 100644 --- a/js/src/xpconnect/src/xpcconvert.cpp +++ b/js/src/xpconnect/src/xpcconvert.cpp @@ -2109,7 +2109,7 @@ XPCConvert::JSArray2Native(XPCCallContext& ccx, void** d, jsval s, #define POPULATE(_mode, _t) \ PR_BEGIN_MACRO \ cleanupMode = _mode; \ - if (capacity > ~(size_t)0 / sizeof(_t) || \ + if (capacity > PR_UINT32_MAX / sizeof(_t) || \ nsnull == (array = nsMemory::Alloc(capacity * sizeof(_t)))) \ { \ if(pErr) \ diff --git a/js/src/xpconnect/src/xpcjsruntime.cpp b/js/src/xpconnect/src/xpcjsruntime.cpp index 67625d3b07f..c7ad2488481 100644 --- a/js/src/xpconnect/src/xpcjsruntime.cpp +++ b/js/src/xpconnect/src/xpcjsruntime.cpp @@ -769,7 +769,7 @@ JSBool XPCJSRuntime::GCCallback(JSContext *cx, JSGCStatus status) } nsTArray callbacks(self->extraGCCallbacks); - for (PRInt32 i = 0; i < callbacks.Length(); ++i) { + for (PRUint32 i = 0; i < callbacks.Length(); ++i) { if (!callbacks[i](cx, status)) return JS_FALSE; }