[gjs: 3/8] jsapi-util-args: Make gjs_parse_call_args() const-correct
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 3/8] jsapi-util-args: Make gjs_parse_call_args() const-correct
- Date: Wed, 13 Jun 2018 14:39:38 +0000 (UTC)
commit 1806c4bb49ff6131fd83e6cda1ec9f722cce5829
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Jun 9 00:51:31 2018 -0700
jsapi-util-args: Make gjs_parse_call_args() const-correct
This should correctly take a const JS::CallArgs& reference.
gjs/jsapi-util-args.h | 56 +++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/gjs/jsapi-util-args.h b/gjs/jsapi-util-args.h
index e723919f..b5363ea8 100644
--- a/gjs/jsapi-util-args.h
+++ b/gjs/jsapi-util-args.h
@@ -232,15 +232,15 @@ free_if_necessary(JS::MutableHandleObject param_ref)
template<typename T>
static bool
-parse_call_args_helper(JSContext *cx,
- const char *function_name,
- JS::CallArgs& args,
- bool ignore_trailing_args,
- const char*& fmt_required,
- const char*& fmt_optional,
- unsigned param_ix,
- const char *param_name,
- T param_ref)
+parse_call_args_helper(JSContext *cx,
+ const char *function_name,
+ const JS::CallArgs& args,
+ bool ignore_trailing_args,
+ const char*& fmt_required,
+ const char*& fmt_optional,
+ unsigned param_ix,
+ const char *param_name,
+ T param_ref)
{
bool nullable = false;
const char *fchar = fmt_required;
@@ -279,16 +279,16 @@ parse_call_args_helper(JSContext *cx,
template<typename T, typename... Args>
static bool
-parse_call_args_helper(JSContext *cx,
- const char *function_name,
- JS::CallArgs& args,
- bool ignore_trailing_args,
- const char*& fmt_required,
- const char*& fmt_optional,
- unsigned param_ix,
- const char *param_name,
- T param_ref,
- Args ...params)
+parse_call_args_helper(JSContext *cx,
+ const char *function_name,
+ const JS::CallArgs& args,
+ bool ignore_trailing_args,
+ const char*& fmt_required,
+ const char*& fmt_optional,
+ unsigned param_ix,
+ const char *param_name,
+ T param_ref,
+ Args ...params)
{
bool retval;
@@ -311,10 +311,10 @@ parse_call_args_helper(JSContext *cx,
/* Empty-args version of the template */
G_GNUC_UNUSED
static bool
-gjs_parse_call_args(JSContext *cx,
- const char *function_name,
- JS::CallArgs& args,
- const char *format)
+gjs_parse_call_args(JSContext *cx,
+ const char *function_name,
+ const JS::CallArgs& args,
+ const char *format)
{
bool ignore_trailing_args = false;
@@ -375,11 +375,11 @@ gjs_parse_call_args(JSContext *cx,
*/
template<typename... Args>
static bool
-gjs_parse_call_args(JSContext *cx,
- const char *function_name,
- JS::CallArgs& args,
- const char *format,
- Args ...params)
+gjs_parse_call_args(JSContext *cx,
+ const char *function_name,
+ const JS::CallArgs& args,
+ const char *format,
+ Args ...params)
{
const char *fmt_iter, *fmt_required, *fmt_optional;
unsigned n_required = 0, n_total = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]