[gjs/master.windows: 19/20] gjs: Avoid ambiguity in smart pointers
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/master.windows: 19/20] gjs: Avoid ambiguity in smart pointers
- Date: Wed, 27 Feb 2019 03:48:58 +0000 (UTC)
commit d991823f4e32c801198a29ca28ab81d384f53999
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Feb 22 18:03:01 2019 +0800
gjs: Avoid ambiguity in smart pointers
Use the .get() accessor to be concrete enough about things so that
we avoid the compiler complaining about ambguity.
gjs/debugger.cpp | 2 +-
gjs/importer.cpp | 2 +-
gjs/jsapi-util-args.h | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gjs/debugger.cpp b/gjs/debugger.cpp
index 28162007..8da90ee6 100644
--- a/gjs/debugger.cpp
+++ b/gjs/debugger.cpp
@@ -97,7 +97,7 @@ static bool do_readline(JSContext* cx, unsigned argc, JS::Value* vp) {
args.rval().setUndefined();
return true;
}
- } while (line && line[0] == '\0');
+ } while (line.get() && line.get()[0] == '\0');
/* Add line to history and convert it to a JSString so that we can pass it
* back as the return value */
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index aa6b80e9..d1178c2e 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -707,7 +707,7 @@ static bool importer_new_enumerate(JSContext* context, JS::HandleObject object,
GjsAutoChar filename = g_file_get_basename(file);
/* skip hidden files and directories (.svn, .git, ...) */
- if (filename[0] == '.')
+ if (filename.get()[0] == '.')
continue;
/* skip module init file */
diff --git a/gjs/jsapi-util-args.h b/gjs/jsapi-util-args.h
index b7a982d4..535e31db 100644
--- a/gjs/jsapi-util-args.h
+++ b/gjs/jsapi-util-args.h
@@ -399,8 +399,8 @@ GJS_JSAPI_RETURN_CONVENTION static bool gjs_parse_call_args(
}
GjsAutoStrv parts = g_strsplit(format, "|", 2);
- fmt_required = parts[0];
- fmt_optional = parts[1]; /* may be NULL */
+ fmt_required = parts.get()[0];
+ fmt_optional = parts.get()[1]; /* may be NULL */
retval = parse_call_args_helper(cx, function_name, args,
ignore_trailing_args, fmt_required,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]