[gjs/wip/ptomato/warnings: 11/15] js: Change order of gjs_parse_call_args() params



commit ea9362c771e56f79c3dbcf67da9b224a0fe941d5
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Oct 2 16:07:48 2016 -0700

    js: Change order of gjs_parse_call_args() params
    
    Using a reference parameter in va_start() is undefined behaviour.
    Here's a good explanation of what can go wrong:
    http://stackoverflow.com/a/222288/172999
    
    The simplest way is to change the order of the arguments so that the
    JS::CallArgs& parameter isn't right before the va_list. This is an API
    change for libgjs but it seems like this API isn't used anywhere else.

 gi/object.cpp                     |   10 +++-----
 gjs/byteArray.cpp                 |    4 +-
 gjs/coverage.cpp                  |    4 +-
 gjs/jsapi-util.cpp                |    4 +-
 gjs/jsapi-util.h                  |    2 +-
 modules/cairo-context.cpp         |   38 ++++++++++++++++++------------------
 modules/cairo-gradient.cpp        |    4 +-
 modules/cairo-image-surface.cpp   |    4 +-
 modules/cairo-linear-gradient.cpp |    2 +-
 modules/cairo-pdf-surface.cpp     |    2 +-
 modules/cairo-ps-surface.cpp      |    2 +-
 modules/cairo-radial-gradient.cpp |    2 +-
 modules/cairo-region.cpp          |   10 ++++----
 modules/cairo-solid-pattern.cpp   |    4 +-
 modules/cairo-surface-pattern.cpp |    6 ++--
 modules/cairo-surface.cpp         |    2 +-
 modules/cairo-svg-surface.cpp     |    2 +-
 modules/system.cpp                |   11 +++++----
 18 files changed, 56 insertions(+), 57 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index a924c54..57430d7 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -2252,8 +2252,7 @@ gjs_hook_up_vfunc(JSContext *cx,
     gpointer implementor_vtable;
     GIFieldInfo *field_info;
 
-    if (!gjs_parse_call_args(cx, "hook_up_vfunc",
-                        "oso", argv,
+    if (!gjs_parse_call_args(cx, argv, "hook_up_vfunc", "oso",
                         "object", object.address(),
                         "name", &name,
                         "function", &function))
@@ -2501,7 +2500,7 @@ gjs_override_property(JSContext *cx,
     GParamSpec *new_pspec;
     GType gtype;
 
-    if (!gjs_parse_call_args(cx, "override_property", "so", args,
+    if (!gjs_parse_call_args(cx, args, "override_property", "so",
                              "name", &name,
                              "type", type.address()))
         return false;
@@ -2778,7 +2777,7 @@ gjs_register_interface(JSContext *cx,
         NULL, /* instance_init */
     };
 
-    if (!gjs_parse_call_args(cx, "register_interface", "soo", args,
+    if (!gjs_parse_call_args(cx, args, "register_interface", "soo",
                              "name", &name,
                              "interfaces", &interfaces,
                              "properties", &properties))
@@ -2863,8 +2862,7 @@ gjs_register_type(JSContext *cx,
 
     JS_BeginRequest(cx);
 
-    if (!gjs_parse_call_args(cx, "register_type",
-                        "osoo", argv,
+    if (!gjs_parse_call_args(cx, argv, "register_type", "osoo",
                         "parent", parent.address(),
                         "name", &name,
                         "interfaces", &interfaces,
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 7975feb..c8ca001 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -732,8 +732,8 @@ from_gbytes_func(JSContext *context,
     GBytes *gbytes;
     ByteArrayInstance *priv;
 
-    if (!gjs_parse_call_args(context, "overrides_gbytes_to_array", "o", argv,
-                             "bytes", bytes_obj.address()))
+    if (!gjs_parse_call_args(context, argv, "overrides_gbytes_to_array", "o",
+                        "bytes", bytes_obj.address()))
         return false;
 
     if (!gjs_typecheck_boxed(context, bytes_obj, NULL, G_TYPE_BYTES, true))
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 54f808b..53fa6b6 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1364,7 +1364,7 @@ get_filename_from_filename_as_js_string(JSContext    *context,
                                         JS::CallArgs &args) {
     char *filename = NULL;
 
-    if (!gjs_parse_call_args(context, "getFileContents", "s", args,
+    if (!gjs_parse_call_args(context, args, "getFileContents", "s",
                              "filename", &filename))
         return NULL;
 
@@ -1445,7 +1445,7 @@ coverage_get_file_contents(JSContext *context,
     gsize script_len;
     GError *error = NULL;
 
-    if (!gjs_parse_call_args(context, "getFileContents", "s", args,
+    if (!gjs_parse_call_args(context, args, "getFileContents", "s",
                              "filename", &filename))
         goto out;
 
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 6b6e95d..0766830 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -1068,14 +1068,14 @@ gjs_parse_args (JSContext  *context,
 
 bool
 gjs_parse_call_args (JSContext    *context,
+                     JS::CallArgs &call_args,
                      const char   *function_name,
                      const char   *format,
-                     JS::CallArgs &call_args,
                      ...)
 {
     va_list args;
     bool ret;
-    va_start (args, call_args);
+    va_start (args, format);
     ret = gjs_parse_args_valist (context, function_name, format, call_args.length(), call_args.array(), 
args);
     va_end (args);
     return ret;
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 8744c1a..a2c9acb 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -412,9 +412,9 @@ bool        gjs_parse_args                   (JSContext  *context,
                                               ...);
 
 bool        gjs_parse_call_args              (JSContext    *context,
+                                              JS::CallArgs &args,
                                               const char   *function_name,
                                               const char   *format,
-                                              JS::CallArgs &args,
                                               ...);
 
 /* Functions intended for more "internal" use */
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index 94f5ad9..23c96eb 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -79,7 +79,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
 #define _GJS_CAIRO_CONTEXT_DEFINE_FUNC2FFAFF(method, cfunc, n1, n2)        \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     double arg1, arg2;                                                     \
-    if (!gjs_parse_call_args(context, #method, "ff", argv,                 \
+    if (!gjs_parse_call_args(context, argv, #method, "ff",                 \
                         #n1, &arg1, #n2, &arg2))                           \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -151,7 +151,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
 #define _GJS_CAIRO_CONTEXT_DEFINE_FUNC1(method, cfunc, fmt, t1, n1)        \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t1 arg1;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1))                                       \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -163,7 +163,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t1 arg1;                                                               \
     t2 arg2;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2))                           \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -176,7 +176,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t1 arg1;                                                               \
     t2 arg2;                                                               \
     cairo_bool_t ret;                                                      \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                 \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2))                           \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -189,7 +189,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t1 arg1;                                                               \
     t2 arg2;                                                               \
     t3 arg3;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3))               \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -203,7 +203,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t2 arg2;                                                               \
     t3 arg3;                                                               \
     t4 arg4;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3, #n4, &arg4))   \
         return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
@@ -217,7 +217,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t3 arg3;                                                               \
     t4 arg4;                                                               \
     t5 arg5;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3,                \
                         #n4, &arg4, #n5, &arg5))                           \
         return false;                                                      \
@@ -234,7 +234,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t4 arg4;                                                               \
     t5 arg5;                                                               \
     t6 arg6;                                                               \
-    if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
+    if (!gjs_parse_call_args(context, argv, #method, fmt,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3,                \
                         #n4, &arg4, #n5, &arg5, #n6, &arg6))               \
         return false;                                                      \
@@ -279,7 +279,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_context)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_context);
 
-    if (!gjs_parse_call_args(context, "Context", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "Context", "o",
                         "surface", &surface_wrapper))
         return false;
 
@@ -433,7 +433,7 @@ appendPath_func(JSContext *context,
     cairo_path_t *path;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "path", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "path", "o",
                         "path", &path_wrapper))
         return false;
 
@@ -460,7 +460,7 @@ copyPath_func(JSContext *context,
     cairo_path_t *path;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "", "", argv))
+    if (!gjs_parse_call_args(context, argv, "", ""))
         return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
@@ -480,7 +480,7 @@ copyPathFlat_func(JSContext *context,
     cairo_path_t *path;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "", "", argv))
+    if (!gjs_parse_call_args(context, argv, "", ""))
         return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
@@ -501,7 +501,7 @@ mask_func(JSContext *context,
     cairo_pattern_t *pattern;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "mask", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "mask", "o",
                         "pattern", &pattern_wrapper))
         return false;
 
@@ -534,7 +534,7 @@ maskSurface_func(JSContext *context,
     cairo_surface_t *surface;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "maskSurface", "off", argv,
+    if (!gjs_parse_call_args(context, argv, "maskSurface", "off",
                         "surface", &surface_wrapper,
                         "x", &x,
                         "y", &y))
@@ -571,7 +571,7 @@ setDash_func(JSContext *context,
     double offset;
     guint len;
 
-    if (!gjs_parse_call_args(context, "setDash", "of", argv,
+    if (!gjs_parse_call_args(context, argv, "setDash", "of",
                         "dashes", dashes.address(), "offset", &offset))
         return false;
 
@@ -626,7 +626,7 @@ setSource_func(JSContext *context,
     cairo_pattern_t *pattern;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "setSource", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "setSource", "o",
                         "pattern", &pattern_wrapper))
         return false;
 
@@ -661,7 +661,7 @@ setSourceSurface_func(JSContext *context,
     cairo_surface_t *surface;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "setSourceSurface", "off", argv,
+    if (!gjs_parse_call_args(context, argv, "setSourceSurface", "off",
                         "surface", &surface_wrapper,
                         "x", &x,
                         "y", &y))
@@ -696,7 +696,7 @@ showText_func(JSContext *context,
     char *utf8;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "showText", "s", argv,
+    if (!gjs_parse_call_args(context, argv, "showText", "s",
                         "utf8", &utf8))
         return false;
 
@@ -726,7 +726,7 @@ selectFontFace_func(JSContext *context,
     cairo_font_weight_t weight;
     cairo_t *cr;
 
-    if (!gjs_parse_call_args(context, "selectFontFace", "sii", argv,
+    if (!gjs_parse_call_args(context, argv, "selectFontFace", "sii",
                         "family", &family,
                         "slang", &slant,
                         "weight", &weight))
diff --git a/modules/cairo-gradient.cpp b/modules/cairo-gradient.cpp
index 3e1e253..7fc18d2 100644
--- a/modules/cairo-gradient.cpp
+++ b/modules/cairo-gradient.cpp
@@ -53,7 +53,7 @@ addColorStopRGB_func(JSContext *context,
     double offset, red, green, blue;
     cairo_pattern_t *pattern;
 
-    if (!gjs_parse_call_args(context, "addColorStopRGB", "ffff", argv,
+    if (!gjs_parse_call_args(context, argv, "addColorStopRGB", "ffff",
                         "offset", &offset,
                         "red", &red,
                         "green", &green,
@@ -82,7 +82,7 @@ addColorStopRGBA_func(JSContext *context,
     double offset, red, green, blue, alpha;
     cairo_pattern_t *pattern;
 
-    if (!gjs_parse_call_args(context, "addColorStopRGBA", "fffff", argv,
+    if (!gjs_parse_call_args(context, argv, "addColorStopRGBA", "fffff",
                         "offset", &offset,
                         "red", &red,
                         "green", &green,
diff --git a/modules/cairo-image-surface.cpp b/modules/cairo-image-surface.cpp
index dfd11ed..2b9e827 100644
--- a/modules/cairo-image-surface.cpp
+++ b/modules/cairo-image-surface.cpp
@@ -37,7 +37,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_image_surface)
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_image_surface);
 
     // create_for_data optional parameter
-    if (!gjs_parse_call_args(context, "ImageSurface", "iii", argv,
+    if (!gjs_parse_call_args(context, argv, "ImageSurface", "iii",
                         "format", &format,
                         "width", &width,
                         "height", &height))
@@ -76,7 +76,7 @@ createFromPNG_func(JSContext *context,
     char *filename;
     cairo_surface_t *surface;
 
-    if (!gjs_parse_call_args(context, "createFromPNG", "s", argv,
+    if (!gjs_parse_call_args(context, argv, "createFromPNG", "s",
                         "filename", &filename))
         return false;
 
diff --git a/modules/cairo-linear-gradient.cpp b/modules/cairo-linear-gradient.cpp
index 6571779..01738e9 100644
--- a/modules/cairo-linear-gradient.cpp
+++ b/modules/cairo-linear-gradient.cpp
@@ -36,7 +36,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_linear_gradient)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_linear_gradient);
 
-    if (!gjs_parse_call_args(context, "LinearGradient", "ffff", argv,
+    if (!gjs_parse_call_args(context, argv, "LinearGradient", "ffff",
                         "x0", &x0,
                         "y0", &y0,
                         "x1", &x1,
diff --git a/modules/cairo-pdf-surface.cpp b/modules/cairo-pdf-surface.cpp
index 2812208..ee7f350 100644
--- a/modules/cairo-pdf-surface.cpp
+++ b/modules/cairo-pdf-surface.cpp
@@ -40,7 +40,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_pdf_surface)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_pdf_surface);
 
-    if (!gjs_parse_call_args(context, "PDFSurface", "sff", argv,
+    if (!gjs_parse_call_args(context, argv, "PDFSurface", "sff",
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
diff --git a/modules/cairo-ps-surface.cpp b/modules/cairo-ps-surface.cpp
index 63c60e3..3eb7bba 100644
--- a/modules/cairo-ps-surface.cpp
+++ b/modules/cairo-ps-surface.cpp
@@ -40,7 +40,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_ps_surface)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_ps_surface);
 
-    if (!gjs_parse_call_args(context, "PSSurface", "sff", argv,
+    if (!gjs_parse_call_args(context, argv, "PSSurface", "sff",
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
diff --git a/modules/cairo-radial-gradient.cpp b/modules/cairo-radial-gradient.cpp
index 23052f3..8b879f3 100644
--- a/modules/cairo-radial-gradient.cpp
+++ b/modules/cairo-radial-gradient.cpp
@@ -36,7 +36,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_radial_gradient)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_radial_gradient);
 
-    if (!gjs_parse_call_args(context, "RadialGradient", "ffffff", argv,
+    if (!gjs_parse_call_args(context, argv, "RadialGradient", "ffffff",
                         "cx0", &cx0,
                         "cy0", &cy0,
                         "radius0", &radius0,
diff --git a/modules/cairo-region.cpp b/modules/cairo-region.cpp
index 66e1098..3212afc 100644
--- a/modules/cairo-region.cpp
+++ b/modules/cairo-region.cpp
@@ -70,7 +70,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
         PRELUDE;                                                \
         JS::RootedObject other_obj(context);                    \
         cairo_region_t *other_region;                           \
-        if (!gjs_parse_call_args(context, #method, "o", argv,   \
+        if (!gjs_parse_call_args(context, argv, #method, "o",   \
                                  "other_region", other_obj.address())) \
             return false;                                       \
                                                                 \
@@ -91,7 +91,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
         PRELUDE;                                                \
         JSObject *rect_obj;                                     \
         cairo_rectangle_int_t rect;                             \
-        if (!gjs_parse_call_args(context, #method, "o", argv,   \
+        if (!gjs_parse_call_args(context, argv, #method, "o",   \
                             "rect", &rect_obj))                 \
             return false;                                       \
                                                                 \
@@ -172,7 +172,7 @@ num_rectangles_func(JSContext *context,
     PRELUDE;
     int n_rects;
 
-    if (!gjs_parse_call_args(context, "num_rectangles", "", argv))
+    if (!gjs_parse_call_args(context, argv, "num_rectangles", ""))
         return false;
 
     n_rects = cairo_region_num_rectangles(this_region);
@@ -190,7 +190,7 @@ get_rectangle_func(JSContext *context,
     JSObject *rect_obj;
     cairo_rectangle_int_t rect;
 
-    if (!gjs_parse_call_args(context, "get_rectangle", "i", argv, "rect", &i))
+    if (!gjs_parse_call_args(context, argv, "get_rectangle", "i", "rect", &i))
         return false;
 
     cairo_region_get_rectangle(this_region, i, &rect);
@@ -244,7 +244,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_region)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_region);
 
-    if (!gjs_parse_call_args(context, "Region", "", argv))
+    if (!gjs_parse_call_args(context, argv, "Region", ""))
         return false;
 
     region = cairo_region_create();
diff --git a/modules/cairo-solid-pattern.cpp b/modules/cairo-solid-pattern.cpp
index e9ca032..b4ff90c 100644
--- a/modules/cairo-solid-pattern.cpp
+++ b/modules/cairo-solid-pattern.cpp
@@ -49,7 +49,7 @@ createRGB_func(JSContext *context,
     cairo_pattern_t *pattern;
     JSObject *pattern_wrapper;
 
-    if (!gjs_parse_call_args(context, "createRGB", "fff", argv,
+    if (!gjs_parse_call_args(context, argv, "createRGB", "fff",
                         "red", &red,
                         "green", &green,
                         "blue", &blue))
@@ -77,7 +77,7 @@ createRGBA_func(JSContext *context,
     cairo_pattern_t *pattern;
     JSObject *pattern_wrapper;
 
-    if (!gjs_parse_call_args(context, "createRGBA", "ffff", argv,
+    if (!gjs_parse_call_args(context, argv, "createRGBA", "ffff",
                         "red", &red,
                         "green", &green,
                         "blue", &blue,
diff --git a/modules/cairo-surface-pattern.cpp b/modules/cairo-surface-pattern.cpp
index 3440f32..79bea26 100644
--- a/modules/cairo-surface-pattern.cpp
+++ b/modules/cairo-surface-pattern.cpp
@@ -37,7 +37,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_surface_pattern)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_surface_pattern);
 
-    if (!gjs_parse_call_args(context, "SurfacePattern", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "SurfacePattern", "o",
                         "surface", &surface_wrapper))
         return false;
 
@@ -84,7 +84,7 @@ setExtend_func(JSContext *context,
     cairo_extend_t extend;
     cairo_pattern_t *pattern;
 
-    if (!gjs_parse_call_args(context, "setExtend", "i", argv,
+    if (!gjs_parse_call_args(context, argv, "setExtend", "i",
                         "extend", &extend))
         return false;
 
@@ -136,7 +136,7 @@ setFilter_func(JSContext *context,
     cairo_filter_t filter;
     cairo_pattern_t *pattern;
 
-    if (!gjs_parse_call_args(context, "setFilter", "i", argv,
+    if (!gjs_parse_call_args(context, argv, "setFilter", "i",
                         "filter", &filter))
         return false;
 
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index 7d2dc67..6afac87 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -67,7 +67,7 @@ writeToPNG_func(JSContext *context,
     char *filename;
     cairo_surface_t *surface;
 
-    if (!gjs_parse_call_args(context, "writeToPNG", "s", argv,
+    if (!gjs_parse_call_args(context, argv, "writeToPNG", "s"
                         "filename", &filename))
         return false;
 
diff --git a/modules/cairo-svg-surface.cpp b/modules/cairo-svg-surface.cpp
index 483cf2d..1db5f8e 100644
--- a/modules/cairo-svg-surface.cpp
+++ b/modules/cairo-svg-surface.cpp
@@ -40,7 +40,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_svg_surface)
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_svg_surface);
 
-    if (!gjs_parse_call_args(context, "SVGSurface", "sff", argv,
+    if (!gjs_parse_call_args(context, argv, "SVGSurface", "sff",
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
diff --git a/modules/system.cpp b/modules/system.cpp
index bab0667..0ad11c7 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -44,7 +44,8 @@ gjs_address_of(JSContext *context,
     char *pointer_string;
     JS::Value retval;
 
-    if (!gjs_parse_call_args(context, "addressOf", "o", argv, "object", &target_obj))
+    if (!gjs_parse_call_args(context, argv, "addressOf", "o",
+                             "object", &target_obj))
         return false;
 
     pointer_string = g_strdup_printf("%p", target_obj);
@@ -67,7 +68,7 @@ gjs_refcount(JSContext *context,
     JS::RootedObject target_obj(context);
     GObject *obj;
 
-    if (!gjs_parse_call_args(context, "refcount", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "refcount", "o",
                              "object", target_obj.address()))
         return false;
 
@@ -88,7 +89,7 @@ gjs_breakpoint(JSContext *context,
                JS::Value *vp)
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
-    if (!gjs_parse_call_args(context, "breakpoint", "", argv))
+    if (!gjs_parse_call_args(context, argv, "breakpoint", ""))
         return false;
     G_BREAKPOINT();
     argv.rval().setUndefined();
@@ -101,7 +102,7 @@ gjs_gc(JSContext *context,
        JS::Value *vp)
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
-    if (!gjs_parse_call_args(context, "gc", "", argv))
+    if (!gjs_parse_call_args(context, argv, "gc", ""))
         return false;
     JS_GC(JS_GetRuntime(context));
     argv.rval().setUndefined();
@@ -115,7 +116,7 @@ gjs_exit(JSContext *context,
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     gint32 ecode;
-    if (!gjs_parse_call_args(context, "exit", "i", argv, "ecode", &ecode))
+    if (!gjs_parse_call_args(context, argv, "exit", "i", "ecode", &ecode))
         return false;
     exit(ecode);
     return true;


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