[gjs] Fix a lot of property op and class init warnings



commit 0bd8418aabc6ea3748fef07a015d65059feb6978
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 5 02:02:54 2013 -0400

    Fix a lot of property op and class init warnings
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697309

 gi/boxed.c                      |    2 +-
 gi/function.c                   |    6 +-
 gi/gerror.c                     |   25 +++++--
 gi/gtype.c                      |    9 ++-
 gi/interface.c                  |    3 +-
 gi/object.c                     |   12 ++--
 gi/param.c                      |    5 +-
 gi/union.c                      |    5 +-
 gjs/byteArray.c                 |   14 ++--
 gjs/jsapi-util.c                |    7 ++-
 modules/cairo-context.c         |  158 +++++++++++++++++++-------------------
 modules/cairo-gradient.c        |    4 +-
 modules/cairo-image-surface.c   |   10 +-
 modules/cairo-pattern.c         |    2 +-
 modules/cairo-solid-pattern.c   |    4 +-
 modules/cairo-surface-pattern.c |    8 +-
 modules/cairo-surface.c         |    4 +-
 17 files changed, 149 insertions(+), 129 deletions(-)
---
diff --git a/gi/boxed.c b/gi/boxed.c
index 59c27a4..071a940 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -948,7 +948,7 @@ static JSPropertySpec gjs_boxed_proto_props[] = {
 };
 
 static JSFunctionSpec gjs_boxed_proto_funcs[] = {
-    { "toString", (JSNative)to_string_func, 0, 0 },
+    { "toString", JSOP_WRAPPER((JSNative)to_string_func), 0, 0 },
     { NULL }
 };
 
diff --git a/gi/function.c b/gi/function.c
index 0ae2c4c..71d61cd 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -1371,7 +1371,11 @@ static struct JSClass gjs_function_class = {
 };
 
 static JSPropertySpec gjs_function_proto_props[] = {
-    { "length", 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, (JSPropertyOp)get_num_arguments, NULL 
},
+    { "length", 0,
+      (JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED),
+      JSOP_WRAPPER((JSPropertyOp)get_num_arguments),
+      JSOP_WRAPPER(JS_StrictPropertyStub)
+    },
     { NULL }
 };
 
diff --git a/gi/gerror.c b/gi/gerror.c
index d8596ca..b6a3bad 100644
--- a/gi/gerror.c
+++ b/gi/gerror.c
@@ -310,26 +310,37 @@ static struct JSClass gjs_error_class = {
     error_finalize,
     NULL,
     NULL,
-    NULL,
-    NULL, NULL, NULL, NULL, NULL
+    NULL, NULL, NULL
 };
 
 /* We need to shadow all fields of GError, to prevent calling the getter from GBoxed
    (which would trash memory accessing the instance private data) */
 static JSPropertySpec gjs_error_proto_props[] = {
-    { "domain", PROP_DOMAIN, GJS_MODULE_PROP_FLAGS | JSPROP_READONLY, error_get_domain, NULL },
-    { "code", PROP_CODE, GJS_MODULE_PROP_FLAGS | JSPROP_READONLY, error_get_code, NULL },
-    { "message", PROP_MESSAGE, GJS_MODULE_PROP_FLAGS | JSPROP_READONLY, error_get_message, NULL },
+    { "domain", PROP_DOMAIN,
+      GJS_MODULE_PROP_FLAGS | JSPROP_READONLY,
+      JSOP_WRAPPER((JSPropertyOp)error_get_domain),
+      JSOP_WRAPPER(JS_StrictPropertyStub)
+    },
+    { "code", PROP_CODE,
+      GJS_MODULE_PROP_FLAGS | JSPROP_READONLY,
+      JSOP_WRAPPER((JSPropertyOp)error_get_code),
+      JSOP_WRAPPER(JS_StrictPropertyStub)
+    },
+    { "message", PROP_MESSAGE,
+      GJS_MODULE_PROP_FLAGS | JSPROP_READONLY,
+      JSOP_WRAPPER((JSPropertyOp)error_get_message),
+      JSOP_WRAPPER(JS_StrictPropertyStub)
+    },
     { NULL }
 };
 
 static JSFunctionSpec gjs_error_proto_funcs[] = {
-    { "toString", error_to_string, 0, GJS_MODULE_PROP_FLAGS },
+    { "toString", JSOP_WRAPPER((JSNative)error_to_string), 0, GJS_MODULE_PROP_FLAGS },
     JS_FS_END
 };
 
 static JSFunctionSpec gjs_error_constructor_funcs[] = {
-    { "valueOf", error_constructor_value_of, 0, GJS_MODULE_PROP_FLAGS },
+    { "valueOf", JSOP_WRAPPER((JSNative)error_constructor_value_of), 0, GJS_MODULE_PROP_FLAGS },
     JS_FS_END
 };
 
diff --git a/gi/gtype.c b/gi/gtype.c
index a5638d3..cdf85d2 100644
--- a/gi/gtype.c
+++ b/gi/gtype.c
@@ -103,14 +103,17 @@ get_name_func (JSContext *context,
 
 /* Properties */
 static JSPropertySpec gjs_gtype_proto_props[] = {
-    { "name", 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, (JSPropertyOp)get_name_func, NULL },
+    { "name", 0,
+      JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED,
+      JSOP_WRAPPER((JSPropertyOp)get_name_func),
+      JSOP_WRAPPER(JS_StrictPropertyStub) },
     { NULL },
 };
 
 /* Functions */
 static JSFunctionSpec gjs_gtype_proto_funcs[] = {
-    { "toString", (JSNative)to_string_func, 0, 0 },
-    { NULL },
+    { "toString", JSOP_WRAPPER((JSNative)to_string_func), 0, 0 },
+    { NULL }
 };
 
 JSObject *
diff --git a/gi/interface.c b/gi/interface.c
index c8ebd34..92b0999 100644
--- a/gi/interface.c
+++ b/gi/interface.c
@@ -155,8 +155,7 @@ static struct JSClass gjs_interface_class = {
     interface_finalize,
     NULL,
     NULL,
-    NULL,
-    NULL, NULL, NULL, NULL, NULL
+    NULL, NULL, NULL
 };
 
 static JSPropertySpec gjs_interface_proto_props[] = {
diff --git a/gi/object.c b/gi/object.c
index 9be5089..5c399a2 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1763,12 +1763,12 @@ static JSPropertySpec gjs_object_instance_proto_props[] = {
 };
 
 static JSFunctionSpec gjs_object_instance_proto_funcs[] = {
-    { "_init", (JSNative)init_func, 0, 0 },
-    { "connect", (JSNative)connect_func, 0, 0 },
-    { "connect_after", (JSNative)connect_after_func, 0, 0 },
-    { "disconnect", (JSNative)disconnect_func, 0, 0 },
-    { "emit", (JSNative)emit_func, 0, 0 },
-    { "toString", (JSNative)to_string_func, 0, 0 },
+    { "_init", JSOP_WRAPPER((JSNative)init_func), 0, 0 },
+    { "connect", JSOP_WRAPPER((JSNative)connect_func), 0, 0 },
+    { "connect_after", JSOP_WRAPPER((JSNative)connect_after_func), 0, 0 },
+    { "disconnect", JSOP_WRAPPER((JSNative)disconnect_func), 0, 0 },
+    { "emit", JSOP_WRAPPER((JSNative)emit_func), 0, 0 },
+    { "toString", JSOP_WRAPPER((JSNative)to_string_func), 0, 0 },
     { NULL }
 };
 
diff --git a/gi/param.c b/gi/param.c
index c82cf42..871f6c0 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -439,8 +439,7 @@ static struct JSClass gjs_param_class = {
     param_finalize,
     NULL,
     NULL,
-    NULL,
-    NULL, NULL, NULL, NULL, NULL
+    NULL, NULL, NULL
 };
 
 static JSPropertySpec gjs_param_proto_props[] = {
@@ -452,7 +451,7 @@ static JSFunctionSpec gjs_param_proto_funcs[] = {
 };
 
 static JSFunctionSpec gjs_param_constructor_funcs[] = {
-    { "_new_internal", (JSNative)param_new_internal, 0, 0 },
+    { "_new_internal", JSOP_WRAPPER((JSNative)param_new_internal), 0, 0 },
     { NULL }
 };
 
diff --git a/gi/union.c b/gi/union.c
index e6ad2ff..a8799e7 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -320,8 +320,7 @@ static struct JSClass gjs_union_class = {
     union_finalize,
     NULL,
     NULL,
-    NULL,
-    NULL, NULL, NULL, NULL, NULL
+    NULL, NULL, NULL
 };
 
 static JSPropertySpec gjs_union_proto_props[] = {
@@ -329,7 +328,7 @@ static JSPropertySpec gjs_union_proto_props[] = {
 };
 
 static JSFunctionSpec gjs_union_proto_funcs[] = {
-    { "toString", (JSNative)to_string_func, 0, 0 },
+    { "toString", JSOP_WRAPPER((JSNative)to_string_func), 0, 0 },
     { NULL }
 };
 
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 813deab..4b74d97 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -957,22 +957,22 @@ enum ByteArrayTinyId {
 static JSPropertySpec gjs_byte_array_proto_props[] = {
     { "length", BYTE_ARRAY_TINY_ID_LENGTH,
       JSPROP_PERMANENT,
-      (JSPropertyOp)byte_array_length_getter,
-      (JSStrictPropertyOp)byte_array_length_setter
+      JSOP_WRAPPER ((JSPropertyOp) byte_array_length_getter),
+      JSOP_WRAPPER ((JSStrictPropertyOp) byte_array_length_setter),
     },
     { NULL }
 };
 
 static JSFunctionSpec gjs_byte_array_proto_funcs[] = {
-    { "toString", (JSNative) to_string_func, 0, 0 },
-    { "toGBytes", (JSNative) to_gbytes_func, 0, 0 },
+    { "toString", JSOP_WRAPPER ((JSNative) to_string_func), 0, 0 },
+    { "toGBytes", JSOP_WRAPPER ((JSNative) to_gbytes_func), 0, 0 },
     { NULL }
 };
 
 static JSFunctionSpec gjs_byte_array_module_funcs[] = {
-    { "fromString", (JSNative)from_string_func, 1, 0 },
-    { "fromArray", (JSNative)from_array_func, 1, 0 },
-    { "fromGBytes", (JSNative)from_gbytes_func, 1, 0 },
+    { "fromString", JSOP_WRAPPER (from_string_func), 1, 0 },
+    { "fromArray", JSOP_WRAPPER (from_array_func), 1, 0 },
+    { "fromGBytes", JSOP_WRAPPER (from_gbytes_func), 1, 0 },
     { NULL }
 };
 
diff --git a/gjs/jsapi-util.c b/gjs/jsapi-util.c
index 47a58f8..860c859 100644
--- a/gjs/jsapi-util.c
+++ b/gjs/jsapi-util.c
@@ -84,10 +84,15 @@ gjs_runtime_get_context(JSRuntime *runtime)
     return (JSContext *) JS_GetRuntimePrivate (runtime);
 }
 
+static void
+finalize_stub(JSFreeOp *fop, JSObject *global)
+{
+}
+
 static JSClass global_class = {
     "GjsGlobal", JSCLASS_GLOBAL_FLAGS,
     JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
-    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
+    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, finalize_stub,
     JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
diff --git a/modules/cairo-context.c b/modules/cairo-context.c
index 091275d..4c0df1a 100644
--- a/modules/cairo-context.c
+++ b/modules/cairo-context.c
@@ -871,104 +871,104 @@ getGroupTarget_func(JSContext *context,
 }
 
 static JSFunctionSpec gjs_cairo_context_proto_funcs[] = {
-    { "$dispose", (JSNative)dispose_func, 0, 0 },
-    { "appendPath", (JSNative)appendPath_func, 0, 0},
-    { "arc", (JSNative)arc_func, 0, 0 },
-    { "arcNegative", (JSNative)arcNegative_func, 0, 0 },
-    { "clip", (JSNative)clip_func, 0, 0 },
-    { "clipExtents", (JSNative)clipExtents_func, 0, 0 },
-    { "clipPreserve", (JSNative)clipPreserve_func, 0, 0 },
-    { "closePath", (JSNative)closePath_func, 0, 0 },
-    { "copyPage", (JSNative)copyPage_func, 0, 0 },
-    { "copyPath", (JSNative)copyPath_func, 0, 0 },
-    { "copyPathFlat", (JSNative)copyPathFlat_func, 0, 0 },
-    { "curveTo", (JSNative)curveTo_func, 0, 0 },
-    { "deviceToUser", (JSNative)deviceToUser_func, 0, 0 },
-    { "deviceToUserDistance", (JSNative)deviceToUserDistance_func, 0, 0 },
-    { "fill", (JSNative)fill_func, 0, 0 },
-    { "fillPreserve", (JSNative)fillPreserve_func, 0, 0 },
-    { "fillExtents", (JSNative)fillExtents_func, 0, 0 },
+    { "$dispose", JSOP_WRAPPER((JSNative)dispose_func), 0, 0 },
+    { "appendPath", JSOP_WRAPPER((JSNative)appendPath_func), 0, 0},
+    { "arc", JSOP_WRAPPER((JSNative)arc_func), 0, 0 },
+    { "arcNegative", JSOP_WRAPPER((JSNative)arcNegative_func), 0, 0 },
+    { "clip", JSOP_WRAPPER((JSNative)clip_func), 0, 0 },
+    { "clipExtents", JSOP_WRAPPER((JSNative)clipExtents_func), 0, 0 },
+    { "clipPreserve", JSOP_WRAPPER((JSNative)clipPreserve_func), 0, 0 },
+    { "closePath", JSOP_WRAPPER((JSNative)closePath_func), 0, 0 },
+    { "copyPage", JSOP_WRAPPER((JSNative)copyPage_func), 0, 0 },
+    { "copyPath", JSOP_WRAPPER((JSNative)copyPath_func), 0, 0 },
+    { "copyPathFlat", JSOP_WRAPPER((JSNative)copyPathFlat_func), 0, 0 },
+    { "curveTo", JSOP_WRAPPER((JSNative)curveTo_func), 0, 0 },
+    { "deviceToUser", JSOP_WRAPPER((JSNative)deviceToUser_func), 0, 0 },
+    { "deviceToUserDistance",JSOP_WRAPPER((JSNative)deviceToUserDistance_func), 0, 0 },
+    { "fill", JSOP_WRAPPER((JSNative)fill_func), 0, 0 },
+    { "fillPreserve", JSOP_WRAPPER((JSNative)fillPreserve_func), 0, 0 },
+    { "fillExtents", JSOP_WRAPPER((JSNative)fillExtents_func), 0, 0 },
     // fontExtents
-    { "getAntialias", (JSNative)getAntialias_func, 0, 0 },
-    { "getCurrentPoint", (JSNative)getCurrentPoint_func, 0, 0 },
+    { "getAntialias", JSOP_WRAPPER((JSNative)getAntialias_func), 0, 0 },
+    { "getCurrentPoint", JSOP_WRAPPER((JSNative)getCurrentPoint_func), 0, 0 },
     // getDash
-    { "getDashCount", (JSNative)getDashCount_func, 0, 0 },
-    { "getFillRule", (JSNative)getFillRule_func, 0, 0 },
+    { "getDashCount", JSOP_WRAPPER((JSNative)getDashCount_func), 0, 0 },
+    { "getFillRule", JSOP_WRAPPER((JSNative)getFillRule_func), 0, 0 },
     // getFontFace
     // getFontMatrix
     // getFontOptions
-    { "getGroupTarget", (JSNative)getGroupTarget_func, 0, 0 },
-    { "getLineCap", (JSNative)getLineCap_func, 0, 0 },
-    { "getLineJoin", (JSNative)getLineJoin_func, 0, 0 },
-    { "getLineWidth", (JSNative)getLineWidth_func, 0, 0 },
+    { "getGroupTarget", JSOP_WRAPPER((JSNative)getGroupTarget_func), 0, 0 },
+    { "getLineCap", JSOP_WRAPPER((JSNative)getLineCap_func), 0, 0 },
+    { "getLineJoin", JSOP_WRAPPER((JSNative)getLineJoin_func), 0, 0 },
+    { "getLineWidth", JSOP_WRAPPER((JSNative)getLineWidth_func), 0, 0 },
     // getMatrix
-    { "getMiterLimit", (JSNative)getMiterLimit_func, 0, 0 },
-    { "getOperator", (JSNative)getOperator_func, 0, 0 },
+    { "getMiterLimit", JSOP_WRAPPER((JSNative)getMiterLimit_func), 0, 0 },
+    { "getOperator", JSOP_WRAPPER((JSNative)getOperator_func), 0, 0 },
     // getScaledFont
-    { "getSource", (JSNative)getSource_func, 0, 0 },
-    { "getTarget", (JSNative)getTarget_func, 0, 0 },
-    { "getTolerance", (JSNative)getTolerance_func, 0, 0 },
+    { "getSource", JSOP_WRAPPER((JSNative)getSource_func), 0, 0 },
+    { "getTarget", JSOP_WRAPPER((JSNative)getTarget_func), 0, 0 },
+    { "getTolerance", JSOP_WRAPPER((JSNative)getTolerance_func), 0, 0 },
     // glyphPath
     // glyphExtents
-    { "hasCurrentPoint", (JSNative)hasCurrentPoint_func, 0, 0 },
-    { "identityMatrix", (JSNative)identityMatrix_func, 0, 0 },
-    { "inFill", (JSNative)inFill_func, 0, 0 },
-    { "inStroke", (JSNative)inStroke_func, 0, 0 },
-    { "lineTo", (JSNative)lineTo_func, 0, 0 },
-    { "mask", (JSNative)mask_func, 0, 0 },
-    { "maskSurface", (JSNative)maskSurface_func, 0, 0 },
-    { "moveTo", (JSNative)moveTo_func, 0, 0 },
-    { "newPath", (JSNative)newPath_func, 0, 0 },
-    { "newSubPath", (JSNative)newSubPath_func, 0, 0 },
-    { "paint", (JSNative)paint_func, 0, 0 },
-    { "paintWithAlpha", (JSNative)paintWithAlpha_func, 0, 0 },
-    { "pathExtents", (JSNative)pathExtents_func, 0, 0 },
-    { "popGroup", (JSNative)popGroup_func, 0, 0 },
-    { "popGroupToSource", (JSNative)popGroupToSource_func, 0, 0 },
-    { "pushGroup", (JSNative)pushGroup_func, 0, 0 },
-    { "pushGroupWithContent", (JSNative)pushGroupWithContent_func, 0, 0 },
-    { "rectangle", (JSNative)rectangle_func, 0, 0 },
-    { "relCurveTo", (JSNative)relCurveTo_func, 0, 0 },
-    { "relLineTo", (JSNative)relLineTo_func, 0, 0 },
-    { "relMoveTo", (JSNative)relMoveTo_func, 0, 0 },
-    { "resetClip", (JSNative)resetClip_func, 0, 0 },
-    { "restore", (JSNative)restore_func, 0, 0 },
-    { "rotate", (JSNative)rotate_func, 0, 0 },
-    { "save", (JSNative)save_func, 0, 0 },
-    { "scale", (JSNative)scale_func, 0, 0 },
-    { "selectFontFace", (JSNative)selectFontFace_func, 0, 0 },
-    { "setAntialias", (JSNative)setAntialias_func, 0, 0 },
-    { "setDash", (JSNative)setDash_func, 0, 0 },
+    { "hasCurrentPoint", JSOP_WRAPPER((JSNative)hasCurrentPoint_func), 0, 0 },
+    { "identityMatrix", JSOP_WRAPPER((JSNative)identityMatrix_func), 0, 0 },
+    { "inFill", JSOP_WRAPPER((JSNative)inFill_func), 0, 0 },
+    { "inStroke", JSOP_WRAPPER((JSNative)inStroke_func), 0, 0 },
+    { "lineTo", JSOP_WRAPPER((JSNative)lineTo_func), 0, 0 },
+    { "mask", JSOP_WRAPPER((JSNative)mask_func), 0, 0 },
+    { "maskSurface", JSOP_WRAPPER((JSNative)maskSurface_func), 0, 0 },
+    { "moveTo", JSOP_WRAPPER((JSNative)moveTo_func), 0, 0 },
+    { "newPath", JSOP_WRAPPER((JSNative)newPath_func), 0, 0 },
+    { "newSubPath", JSOP_WRAPPER((JSNative)newSubPath_func), 0, 0 },
+    { "paint", JSOP_WRAPPER((JSNative)paint_func), 0, 0 },
+    { "paintWithAlpha", JSOP_WRAPPER((JSNative)paintWithAlpha_func), 0, 0 },
+    { "pathExtents", JSOP_WRAPPER((JSNative)pathExtents_func), 0, 0 },
+    { "popGroup", JSOP_WRAPPER((JSNative)popGroup_func), 0, 0 },
+    { "popGroupToSource", JSOP_WRAPPER((JSNative)popGroupToSource_func), 0, 0 },
+    { "pushGroup", JSOP_WRAPPER((JSNative)pushGroup_func), 0, 0 },
+    { "pushGroupWithContent", JSOP_WRAPPER((JSNative)pushGroupWithContent_func), 0, 0 },
+    { "rectangle", JSOP_WRAPPER((JSNative)rectangle_func), 0, 0 },
+    { "relCurveTo", JSOP_WRAPPER((JSNative)relCurveTo_func), 0, 0 },
+    { "relLineTo", JSOP_WRAPPER((JSNative)relLineTo_func), 0, 0 },
+    { "relMoveTo", JSOP_WRAPPER((JSNative)relMoveTo_func), 0, 0 },
+    { "resetClip", JSOP_WRAPPER((JSNative)resetClip_func), 0, 0 },
+    { "restore", JSOP_WRAPPER((JSNative)restore_func), 0, 0 },
+    { "rotate", JSOP_WRAPPER((JSNative)rotate_func), 0, 0 },
+    { "save", JSOP_WRAPPER((JSNative)save_func), 0, 0 },
+    { "scale", JSOP_WRAPPER((JSNative)scale_func), 0, 0 },
+    { "selectFontFace", JSOP_WRAPPER((JSNative)selectFontFace_func), 0, 0 },
+    { "setAntialias", JSOP_WRAPPER((JSNative)setAntialias_func), 0, 0 },
+    { "setDash", JSOP_WRAPPER((JSNative)setDash_func), 0, 0 },
     // setFontFace
     // setFontMatrix
     // setFontOptions
-    { "setFontSize", (JSNative)setFontSize_func, 0, 0 },
-    { "setFillRule", (JSNative)setFillRule_func, 0, 0 },
-    { "setLineCap", (JSNative)setLineCap_func, 0, 0 },
-    { "setLineJoin", (JSNative)setLineJoin_func, 0, 0 },
-    { "setLineWidth", (JSNative)setLineWidth_func, 0, 0 },
+    { "setFontSize", JSOP_WRAPPER((JSNative)setFontSize_func), 0, 0 },
+    { "setFillRule", JSOP_WRAPPER((JSNative)setFillRule_func), 0, 0 },
+    { "setLineCap", JSOP_WRAPPER((JSNative)setLineCap_func), 0, 0 },
+    { "setLineJoin", JSOP_WRAPPER((JSNative)setLineJoin_func), 0, 0 },
+    { "setLineWidth", JSOP_WRAPPER((JSNative)setLineWidth_func), 0, 0 },
     // setMatrix
-    { "setMiterLimit", (JSNative)setMiterLimit_func, 0, 0 },
-    { "setOperator", (JSNative)setOperator_func, 0, 0 },
+    { "setMiterLimit", JSOP_WRAPPER((JSNative)setMiterLimit_func), 0, 0 },
+    { "setOperator", JSOP_WRAPPER((JSNative)setOperator_func), 0, 0 },
     // setScaledFont
-    { "setSource", (JSNative)setSource_func, 0, 0 },
-    { "setSourceRGB", (JSNative)setSourceRGB_func, 0, 0 },
-    { "setSourceRGBA", (JSNative)setSourceRGBA_func, 0, 0 },
-    { "setSourceSurface", (JSNative)setSourceSurface_func, 0, 0 },
-    { "setTolerance", (JSNative)setTolerance_func, 0, 0 },
+    { "setSource", JSOP_WRAPPER((JSNative)setSource_func), 0, 0 },
+    { "setSourceRGB", JSOP_WRAPPER((JSNative)setSourceRGB_func), 0, 0 },
+    { "setSourceRGBA", JSOP_WRAPPER((JSNative)setSourceRGBA_func), 0, 0 },
+    { "setSourceSurface", JSOP_WRAPPER((JSNative)setSourceSurface_func), 0, 0 },
+    { "setTolerance", JSOP_WRAPPER((JSNative)setTolerance_func), 0, 0 },
     // showGlyphs
-    { "showPage", (JSNative)showPage_func, 0, 0 },
-    { "showText", (JSNative)showText_func, 0, 0 },
+    { "showPage", JSOP_WRAPPER((JSNative)showPage_func), 0, 0 },
+    { "showText", JSOP_WRAPPER((JSNative)showText_func), 0, 0 },
     // showTextGlyphs
-    { "stroke", (JSNative)stroke_func, 0, 0 },
-    { "strokeExtents", (JSNative)strokeExtents_func, 0, 0 },
-    { "strokePreserve", (JSNative)strokePreserve_func, 0, 0 },
+    { "stroke", JSOP_WRAPPER((JSNative)stroke_func), 0, 0 },
+    { "strokeExtents", JSOP_WRAPPER((JSNative)strokeExtents_func), 0, 0 },
+    { "strokePreserve", JSOP_WRAPPER((JSNative)strokePreserve_func), 0, 0 },
     // textPath
     // textExtends
     // transform
-    { "translate", (JSNative)translate_func, 0, 0 },
-    { "userToDevice", (JSNative)userToDevice_func, 0, 0 },
-    { "userToDeviceDistance", (JSNative)userToDeviceDistance_func, 0, 0 },
+    { "translate", JSOP_WRAPPER((JSNative)translate_func), 0, 0 },
+    { "userToDevice", JSOP_WRAPPER((JSNative)userToDevice_func), 0, 0 },
+    { "userToDeviceDistance", JSOP_WRAPPER((JSNative)userToDeviceDistance_func), 0, 0 },
     { NULL }
 };
 
diff --git a/modules/cairo-gradient.c b/modules/cairo-gradient.c
index 91c74a8..b55c852 100644
--- a/modules/cairo-gradient.c
+++ b/modules/cairo-gradient.c
@@ -100,8 +100,8 @@ addColorStopRGBA_func(JSContext *context,
 }
 
 static JSFunctionSpec gjs_cairo_gradient_proto_funcs[] = {
-    { "addColorStopRGB", (JSNative)addColorStopRGB_func, 0, 0 },
-    { "addColorStopRGBA", (JSNative)addColorStopRGBA_func, 0, 0 },
+    { "addColorStopRGB", JSOP_WRAPPER((JSNative)addColorStopRGB_func), 0, 0 },
+    { "addColorStopRGBA", JSOP_WRAPPER((JSNative)addColorStopRGBA_func), 0, 0 },
     // getColorStopRGB
     // getColorStopRGBA
     { NULL }
diff --git a/modules/cairo-image-surface.c b/modules/cairo-image-surface.c
index 815bb4e..c0d6f05 100644
--- a/modules/cairo-image-surface.c
+++ b/modules/cairo-image-surface.c
@@ -196,12 +196,12 @@ getStride_func(JSContext *context,
 }
 
 static JSFunctionSpec gjs_cairo_image_surface_proto_funcs[] = {
-    { "createFromPNG", (JSNative)createFromPNG_func, 0, 0},
+    { "createFromPNG", JSOP_WRAPPER((JSNative)createFromPNG_func), 0, 0},
     // getData
-    { "getFormat", (JSNative)getFormat_func, 0, 0 },
-    { "getWidth", (JSNative)getWidth_func, 0, 0 },
-    { "getHeight", (JSNative)getHeight_func, 0, 0 },
-    { "getStride", (JSNative)getStride_func, 0, 0 },
+    { "getFormat", JSOP_WRAPPER((JSNative)getFormat_func), 0, 0 },
+    { "getWidth", JSOP_WRAPPER((JSNative)getWidth_func), 0, 0 },
+    { "getHeight", JSOP_WRAPPER((JSNative)getHeight_func), 0, 0 },
+    { "getStride", JSOP_WRAPPER((JSNative)getStride_func), 0, 0 },
     { NULL }
 };
 
diff --git a/modules/cairo-pattern.c b/modules/cairo-pattern.c
index cb52b24..220c798 100644
--- a/modules/cairo-pattern.c
+++ b/modules/cairo-pattern.c
@@ -82,7 +82,7 @@ getType_func(JSContext *context,
 
 static JSFunctionSpec gjs_cairo_pattern_proto_funcs[] = {
     // getMatrix
-    { "getType", (JSNative)getType_func, 0, 0 },
+    { "getType", JSOP_WRAPPER((JSNative)getType_func), 0, 0 },
     // setMatrix
     { NULL }
 };
diff --git a/modules/cairo-solid-pattern.c b/modules/cairo-solid-pattern.c
index 60733ef..879d446 100644
--- a/modules/cairo-solid-pattern.c
+++ b/modules/cairo-solid-pattern.c
@@ -98,8 +98,8 @@ createRGBA_func(JSContext *context,
 }
 
 static JSFunctionSpec gjs_cairo_solid_pattern_proto_funcs[] = {
-    { "createRGB", (JSNative)createRGB_func, 0, 0 },
-    { "createRGBA", (JSNative)createRGBA_func, 0, 0 },
+    { "createRGB", JSOP_WRAPPER((JSNative)createRGB_func), 0, 0 },
+    { "createRGBA", JSOP_WRAPPER((JSNative)createRGBA_func), 0, 0 },
     { NULL }
 };
 
diff --git a/modules/cairo-surface-pattern.c b/modules/cairo-surface-pattern.c
index 9cdc123..9eca2b8 100644
--- a/modules/cairo-surface-pattern.c
+++ b/modules/cairo-surface-pattern.c
@@ -173,10 +173,10 @@ getFilter_func(JSContext *context,
 }
 
 static JSFunctionSpec gjs_cairo_surface_pattern_proto_funcs[] = {
-    { "setExtend", (JSNative)setExtend_func, 0, 0 },
-    { "getExtend", (JSNative)getExtend_func, 0, 0 },
-    { "setFilter", (JSNative)setFilter_func, 0, 0 },
-    { "getFilter", (JSNative)getFilter_func, 0, 0 },
+    { "setExtend", JSOP_WRAPPER((JSNative)setExtend_func), 0, 0 },
+    { "getExtend", JSOP_WRAPPER((JSNative)getExtend_func), 0, 0 },
+    { "setFilter", JSOP_WRAPPER((JSNative)setFilter_func), 0, 0 },
+    { "getFilter", JSOP_WRAPPER((JSNative)getFilter_func), 0, 0 },
     { NULL }
 };
 
diff --git a/modules/cairo-surface.c b/modules/cairo-surface.c
index 5926930..7d3044a 100644
--- a/modules/cairo-surface.c
+++ b/modules/cairo-surface.c
@@ -111,7 +111,7 @@ static JSFunctionSpec gjs_cairo_surface_proto_funcs[] = {
     // flush
     // getContent
     // getFontOptions
-    { "getType", (JSNative)getType_func, 0, 0},
+    { "getType", JSOP_WRAPPER((JSNative)getType_func), 0, 0},
     // markDirty
     // markDirtyRectangle
     // setDeviceOffset
@@ -121,7 +121,7 @@ static JSFunctionSpec gjs_cairo_surface_proto_funcs[] = {
     // copyPage
     // showPage
     // hasShowTextGlyphs
-    { "writeToPNG", (JSNative)writeToPNG_func, 0, 0 },
+    { "writeToPNG", JSOP_WRAPPER((JSNative)writeToPNG_func), 0, 0 },
     { NULL }
 };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]