Fix a JSBool-returning function to return false rather than NULL in one place, and use the func-to-pointer macro to avoid two further warnings. r+a=warning-fix
authorJeff Walden <jwalden@mit.edu>
Thu, 17 Feb 2011 14:21:52 -0800
changeset 62936 989687ae6fa3df9463e5d28283644b52130eb4ba
parent 62935 d3dd12467800cfa8735b31b0724875abde2fe9b2
child 62937 902e844c46bdd1ddacbb6fe6029b171de7b88ea2
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
milestone2.0b12pre
Fix a JSBool-returning function to return false rather than NULL in one place, and use the func-to-pointer macro to avoid two further warnings. r+a=warning-fix
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -4767,17 +4767,17 @@ js_DefineNativeProperty(JSContext *cx, J
                  * the joined function object value as the getter object for
                  * the redefined property. The joined function object cannot
                  * yet have leaked, so only an internal code path could attempt
                  * such a thing. Any such path would be a bug to fix.
                  */
                 JS_ASSERT(existingShape->getter() != getter);
 
                 if (!obj->methodReadBarrier(cx, *existingShape, &valueCopy))
-                    return NULL;
+                    return false;
             }
         } else {
             adding = true;
         }
 
         uint32 oldShape = obj->shape();
         shape = obj->putProperty(cx, id, getter, setter, SHAPE_INVALID_SLOT,
                                  attrs, flags, shortid);
@@ -6805,24 +6805,24 @@ DumpProperty(JSObject *obj, const Shape 
     if (attrs & JSPROP_PERMANENT) fprintf(stderr, "permanent ");
     if (attrs & JSPROP_SHARED) fprintf(stderr, "shared ");
     if (shape.isAlias()) fprintf(stderr, "alias ");
     if (shape.isMethod()) fprintf(stderr, "method=%p ", (void *) &shape.methodObject());
 
     if (shape.hasGetterValue())
         fprintf(stderr, "getterValue=%p ", (void *) shape.getterObject());
     else if (!shape.hasDefaultGetter())
-        fprintf(stderr, "getterOp=%p ", (void *) shape.getterOp());
+        fprintf(stderr, "getterOp=%p ", JS_FUNC_TO_DATA_PTR(void *, shape.getterOp()));
 
     if (shape.hasSetterValue())
         fprintf(stderr, "setterValue=%p ", (void *) shape.setterObject());
     else if (shape.setterOp() == js_watch_set)
         fprintf(stderr, "setterOp=js_watch_set ");
     else if (!shape.hasDefaultSetter())
-        fprintf(stderr, "setterOp=%p ", (void *) shape.setterOp());
+        fprintf(stderr, "setterOp=%p ", JS_FUNC_TO_DATA_PTR(void *, shape.setterOp()));
 
     if (JSID_IS_ATOM(id))
         dumpString(JSID_TO_STRING(id));
     else if (JSID_IS_INT(id))
         fprintf(stderr, "%d", (int) JSID_TO_INT(id));
     else
         fprintf(stderr, "unknown jsid %p", (void *) JSID_BITS(id));
     fprintf(stderr, ": slot %d", shape.slot);