Fix some compiler warnings. r=gcc.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 10 Jan 2011 20:33:53 -0800
changeset 60546 0ccd15d193933c7291e06d4ae74a818db9e8f6f6
parent 60545 881166c2051faa34738386ec8404f40993d0e6eb
child 60547 63d4e88f112fab678ac1e6d71126fe52950aa41f
push id18037
push usercleary@mozilla.com
push dateFri, 14 Jan 2011 17:42:55 +0000
treeherdermozilla-central@4e0501a0c5e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcc
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix some compiler warnings. r=gcc.
js/src/jsfun.cpp
js/src/methodjit/StubCalls.cpp
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1097,17 +1097,18 @@ js_PutCallObject(JSContext *cx, JSStackF
 
         /* This could be optimized as below, but keep it simple for now. */
         CopyValuesToCallObject(callobj, 0, NULL, bindings.countVars(), fp->slots());
     } else {
         JSFunction *fun = fp->fun();
         JS_ASSERT(fun == callobj.getCallObjCalleeFunction());
         JS_ASSERT(script == fun->script());
 
-        if (uintN n = bindings.countArgsAndVars()) {
+        uintN n = bindings.countArgsAndVars();
+        if (n > 0) {
             JS_ASSERT(JSObject::CALL_RESERVED_SLOTS + n <= callobj.numSlots());
 
             uint32 nvars = bindings.countVars();
             uint32 nargs = bindings.countArgs();
             JS_ASSERT(fun->nargs == nargs);
             JS_ASSERT(nvars + nargs == n);
 
             JSScript *script = fun->script();
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -2690,17 +2690,17 @@ stubs::ConvertToTypedInt(JSContext *cx, 
     if (vp->isNull() || vp->isObject() || vp->isUndefined())
         return 0;
 
     if (vp->isBoolean())
         return vp->toBoolean() ? 1 : 0;
 
     JS_ASSERT(vp->isString());
 
-    int32 i32;
+    int32 i32 = 0;
 #ifdef DEBUG
     bool success = 
 #endif
         StringToNumberType<jsint>(cx, vp->toString(), &i32);
     JS_ASSERT(success);
 
     return i32;
 }
@@ -2716,17 +2716,17 @@ stubs::ConvertToTypedFloat(JSContext *cx
     if (vp->isNull()) {
         vp->setDouble(0);
     } else if (vp->isObject() || vp->isUndefined()) {
         vp->setDouble(js_NaN);
     } else if (vp->isBoolean()) {
         vp->setDouble(vp->toBoolean() ? 1 : 0);
     } else {
         JS_ASSERT(vp->isString());
-        double d;
+        double d = 0;
 #ifdef DEBUG
         bool success = 
 #endif
             StringToNumberType<double>(cx, vp->toString(), &d);
         JS_ASSERT(success);
         vp->setDouble(d);
     }
 }