Commit dba6f0bd authored by Chun-wei Fan's avatar Chun-wei Fan Committed by Philip Chimento

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.
parent 9796da0c
......@@ -1592,7 +1592,7 @@ gjs_value_to_g_argument(JSContext *context,
GjsAutoBaseInfo interface_info =
g_type_info_get_interface(type_info);
g_assert(interface_info != NULL);
g_assert(interface_info);
GIInfoType interface_type = g_base_info_get_type(interface_info);
if (interface_type == GI_INFO_TYPE_ENUM ||
......
......@@ -658,7 +658,7 @@ bool ObjectPrototype::resolve_no_info(JSContext* cx, JS::HandleObject obj,
GjsAutoFunctionInfo method_info =
g_interface_info_find_method(iface_info, name);
if (method_info != NULL) {
if (method_info) {
if (g_function_info_get_flags (method_info) & GI_FUNCTION_IS_METHOD) {
if (!gjs_define_function(cx, obj, m_gtype, method_info)) {
g_free(interfaces);
......@@ -760,8 +760,7 @@ bool ObjectPrototype::resolve_impl(JSContext* context, JS::HandleObject obj,
bool defined_by_parent;
GjsAutoVFuncInfo vfunc = find_vfunc_on_parents(
m_info, name_without_vfunc_, &defined_by_parent);
if (vfunc != NULL) {
if (vfunc) {
/* In the event that the vfunc is unchanged, let regular
* prototypal inheritance take over. */
if (defined_by_parent && is_vfunc_unchanged(vfunc)) {
......@@ -2195,7 +2194,7 @@ bool ObjectPrototype::hook_up_vfunc_impl(JSContext* cx,
&field_info))
return false;
if (field_info != NULL) {
if (field_info) {
gint offset;
gpointer method_ptr;
GjsCallbackTrampoline *trampoline;
......
......@@ -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 && 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 */
......
......@@ -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 */
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment