Always use JSBool (not bool sometimes, JSBool others) as JSVAL_IS_BOOLEAN's native slot type.
authorBrendan Eich <brendan@mozilla.org>
Mon, 29 Sep 2008 22:27:43 -0400
changeset 20002 25c30c40c71025ed7099f25186d111a814c0c914
parent 20001 3c899d350d7ff93e4c3c915221c8ff10a9ca9fa3
child 20003 419ce5b4c0d6aced2aab1e40a78fa489ebddf8d0
push id2577
push userbrendan@mozilla.com
push dateWed, 01 Oct 2008 04:35:27 +0000
treeherdermozilla-central@a613924403d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1b1pre
Always use JSBool (not bool sometimes, JSBool others) as JSVAL_IS_BOOLEAN's native slot type.
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1116,17 +1116,17 @@ ValueToNative(JSContext* cx, jsval v, ui
         debug_only_v(printf("double<%g> ", d);)
         return true;
       case JSVAL_BOOLEAN:
         if (tag != JSVAL_BOOLEAN) {
              debug_only_v(printf("bool != tag%u ", tag);)
              return false;
         }
         *(JSBool*)slot = JSVAL_TO_BOOLEAN(v);
-        debug_only_v(printf("boolean<%d> ", *(bool*)slot);)
+        debug_only_v(printf("boolean<%d> ", *(JSBool*)slot);)
         return true;
       case JSVAL_STRING:
         if (v == JSVAL_VOID) {
             *(JSString**)slot = ATOM_TO_STRING(cx->runtime->atomState.typeAtoms[JSTYPE_VOID]); 
             return true;
         } 
         if (tag != JSVAL_STRING) {
             debug_only_v(printf("string != tag%u ", tag);)
@@ -1205,18 +1205,18 @@ ReplenishReservePool(JSContext* cx, JSTr
    heap-allocated doubles. */
 static bool
 NativeToValue(JSContext* cx, jsval& v, uint8 type, double* slot)
 {
     jsint i;
     jsdouble d;
     switch (type) {
       case JSVAL_BOOLEAN:
-        v = BOOLEAN_TO_JSVAL(*(bool*)slot);
-        debug_only_v(printf("boolean<%d> ", *(bool*)slot);)
+        v = BOOLEAN_TO_JSVAL(*(JSBool*)slot);
+        debug_only_v(printf("boolean<%d> ", *(JSBool*)slot);)
         break;
       case JSVAL_INT:
         i = *(jsint*)slot;
         debug_only_v(printf("int<%d> ", i);)
       store_int:
         if (INT_FITS_IN_JSVAL(i)) {
             v = INT_TO_JSVAL(i);
             break;