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



commit 7d476eaad13d69f92a606d4416a1d72135e9ff1c
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                 |    2 +-
 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                |   12 ++++++----
 18 files changed, 56 insertions(+), 56 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index 662eb53..1ed8f7f 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -2250,8 +2250,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,
                         "name", &name,
                         "function", &function))
@@ -2499,7 +2498,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))
         return false;
@@ -2775,7 +2774,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))
@@ -2859,8 +2858,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,
                         "name", &name,
                         "interfaces", &interfaces,
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index fc9273d..58ad719 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -753,7 +753,7 @@ from_gbytes_func(JSContext *context,
     JSObject *obj;
     bool ret = false;
 
-    if (!gjs_parse_call_args(context, "overrides_gbytes_to_array", "o", argv,
+    if (!gjs_parse_call_args(context, argv, "overrides_gbytes_to_array", "o",
                         "bytes", &bytes_obj))
         return false;
 
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index c5e80fc..b189eeb 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 c4c85fc..13625cf 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -1116,14 +1116,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 ef7b216..7aafc42 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -416,9 +416,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,
                                               ...);
 
 GjsRootedArray*   gjs_rooted_array_new        (void);
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index 0e55823..ca8817c 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -80,7 +80,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);                      \
@@ -152,7 +152,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);                      \
@@ -164,7 +164,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);                      \
@@ -177,7 +177,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);                      \
@@ -190,7 +190,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);                      \
@@ -204,7 +204,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);                      \
@@ -218,7 +218,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;                                                      \
@@ -235,7 +235,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;                                                      \
@@ -280,7 +280,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;
 
@@ -434,7 +434,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;
 
@@ -461,7 +461,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);
@@ -481,7 +481,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);
@@ -502,7 +502,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;
 
@@ -535,7 +535,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))
@@ -572,7 +572,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;
 
@@ -627,7 +627,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;
 
@@ -662,7 +662,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))
@@ -697,7 +697,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;
 
@@ -727,7 +727,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 a4e81c6..e08bcd4 100644
--- a/modules/cairo-gradient.cpp
+++ b/modules/cairo-gradient.cpp
@@ -54,7 +54,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,
@@ -83,7 +83,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 f3e08dc..c22c6ac 100644
--- a/modules/cairo-image-surface.cpp
+++ b/modules/cairo-image-surface.cpp
@@ -38,7 +38,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))
@@ -78,7 +78,7 @@ createFromPNG_func(JSContext *context,
     cairo_surface_t *surface;
     JSObject *surface_wrapper;
 
-    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 27e346d..d9c66ab 100644
--- a/modules/cairo-linear-gradient.cpp
+++ b/modules/cairo-linear-gradient.cpp
@@ -37,7 +37,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 f971a3b..19557da 100644
--- a/modules/cairo-pdf-surface.cpp
+++ b/modules/cairo-pdf-surface.cpp
@@ -41,7 +41,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 b33b85e..15487f2 100644
--- a/modules/cairo-ps-surface.cpp
+++ b/modules/cairo-ps-surface.cpp
@@ -41,7 +41,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 f5c21ec..e82b378 100644
--- a/modules/cairo-radial-gradient.cpp
+++ b/modules/cairo-radial-gradient.cpp
@@ -37,7 +37,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 1745f17..4c61fa9 100644
--- a/modules/cairo-region.cpp
+++ b/modules/cairo-region.cpp
@@ -70,7 +70,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
         PRELUDE;                                                \
         JSObject *other_obj;                                    \
         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))        \
             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 8ecb1a4..9312815 100644
--- a/modules/cairo-solid-pattern.cpp
+++ b/modules/cairo-solid-pattern.cpp
@@ -50,7 +50,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))
@@ -78,7 +78,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 4598e5a..6b75ae4 100644
--- a/modules/cairo-surface-pattern.cpp
+++ b/modules/cairo-surface-pattern.cpp
@@ -38,7 +38,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;
 
@@ -85,7 +85,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;
 
@@ -137,7 +137,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 82848a0..0252936 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -68,7 +68,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 d95d00c..1bdb624 100644
--- a/modules/cairo-svg-surface.cpp
+++ b/modules/cairo-svg-surface.cpp
@@ -41,7 +41,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 333f86a..2c1b751 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -43,7 +43,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);
@@ -66,7 +67,8 @@ gjs_refcount(JSContext *context,
     JSObject *target_obj;
     GObject *obj;
 
-    if (!gjs_parse_call_args(context, "refcount", "o", argv, "object", &target_obj))
+    if (!gjs_parse_call_args(context, argv, "refcount", "o",
+                             "object", &target_obj))
         return false;
 
     if (!gjs_typecheck_object(context, target_obj, G_TYPE_OBJECT, true))
@@ -86,7 +88,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();
@@ -99,7 +101,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();
@@ -113,7 +115,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]