[gjs/wip/ptomato/warnings: 14/18] js: Change order of gjs_parse_call_args() params
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/warnings: 14/18] js: Change order of gjs_parse_call_args() params
- Date: Wed, 5 Oct 2016 07:26:21 +0000 (UTC)
commit 713cb74279f9610f86a131c2802c198d1a77484b
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 797bff3..f1fee8f 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -2253,8 +2253,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))
@@ -2502,7 +2501,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;
@@ -2779,7 +2778,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))
@@ -2864,8 +2863,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 9378ebb..bb07de6 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -735,8 +735,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 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 3e7b169..b381c2b 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -1087,14 +1087,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 811074f..5849c28 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -417,9 +417,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 78d42ac..d2ea544 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 645257f..27b8d64 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))
@@ -77,7 +77,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 37b9f92..6b85a0f 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 0aee113..0a73eed 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 a7e4736..cbd4039 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 9df421e..7509651 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 e635ecf..071a149 100644
--- a/modules/cairo-region.cpp
+++ b/modules/cairo-region.cpp
@@ -71,7 +71,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; \
\
@@ -92,7 +92,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; \
\
@@ -173,7 +173,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);
@@ -191,7 +191,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);
@@ -245,7 +245,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 3b8673d..e8d5781 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 13f885b..f34c8d1 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 5d51022..af9ca15 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 3b3eb6c..6c87256 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 22b5a86..f5b5e3b 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,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;
@@ -87,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();
@@ -100,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();
@@ -114,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]