Bug 410929 - Bad C++isms in js/src, r=crowder
authorbenjamin@smedbergs.us
Sun, 06 Jan 2008 08:28:46 -0800
changeset 9930 c564e01c46ffa0ded227df292845b0ba64d8f294
parent 9929 b071de0b58ec7f4f2411ae9123936740778779c8
child 9931 f396bd3d1a5495264071f5efc657bf98beba93d9
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscrowder
bugs410929
milestone1.9b3pre
Bug 410929 - Bad C++isms in js/src, r=crowder
js/src/jsarray.c
js/src/jsemit.c
--- a/js/src/jsarray.c
+++ b/js/src/jsarray.c
@@ -1227,17 +1227,18 @@ array_sort(JSContext *cx, uintN argc, js
                     ok = JS_FALSE;
                     goto out;
                 }
                 vec[2 * i] = STRING_TO_JSVAL(str);
                 vec[2 * i + 1] = v;
             } while (i != 0);
 
             JS_ASSERT(tvr.u.array == vec);
-            vec = JS_realloc(cx, vec, 4 * (size_t) newlen * sizeof(jsval));
+            vec = (jsval *) JS_realloc(cx, vec,
+                                       4 * (size_t) newlen * sizeof(jsval));
             if (!vec) {
                 vec = tvr.u.array;
                 ok = JS_FALSE;
                 goto out;
             }
             tvr.u.array = vec;
             mergesort_tmp = vec + 2 * newlen;
             memset(mergesort_tmp, 0, newlen * 2 * sizeof(jsval));
--- a/js/src/jsemit.c
+++ b/js/src/jsemit.c
@@ -3270,17 +3270,17 @@ typedef JSBool
 
 static JSBool
 EmitDestructuringDecl(JSContext *cx, JSCodeGenerator *cg, JSOp prologOp,
                       JSParseNode *pn)
 {
     JSOp decltype;
 
     JS_ASSERT(pn->pn_type == TOK_NAME);
-    decltype = (prologOp == JSOP_NOP) ? LET_DECL : VAR_DECL;
+    decltype = (prologOp == JSOP_NOP) ? (JSOp) LET_DECL : (JSOp) VAR_DECL;
     if (!BindNameToSlot(cx, cg, pn, decltype))
         return JS_FALSE;
 
     JS_ASSERT(pn->pn_op != JSOP_ARGUMENTS);
     return MaybeEmitVarDecl(cx, cg, prologOp, pn, NULL);
 }
 
 static JSBool