summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-09-22 09:53:20 +0200
committerThomas Haller <thaller@redhat.com>2014-09-22 16:32:01 +0200
commit351cf9b328ae30a959c63c10fd4bac273d71925f (patch)
treef1ca956cae1f978b22f29e8c15e985fdd439475f
parent85566e46d9f56d22c4ce9840877f913cec698c92 (diff)
downloadNetworkManager-351cf9b328ae30a959c63c10fd4bac273d71925f.tar.gz
libnm: fix warning about returning zero instead of %NULL in _nm_object_create()
clang warns: make[4]: Entering directory `./NetworkManager/libnm' CC nm-object.lo nm-object.c:640:11: error: expression which evaluates to zero treated as a null pointer constant of type 'GObject *' (aka 'struct _GObject *') [-Werror,-Wnon-literal-null-conversion] return G_TYPE_INVALID; ^~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:57:26: note: expanded from macro 'G_TYPE_INVALID' #define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:221:36: note: expanded from macro 'G_TYPE_MAKE_FUNDAMENTAL' #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nm-object.c:655:11: error: expression which evaluates to zero treated as a null pointer constant of type 'GObject *' (aka 'struct _GObject *') [-Werror,-Wnon-literal-null-conversion] return G_TYPE_INVALID; ^~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:57:26: note: expanded from macro 'G_TYPE_INVALID' #define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:221:36: note: expanded from macro 'G_TYPE_MAKE_FUNDAMENTAL' #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Fixes: b3c4917b0fb58bdcf91531fa85a1ee2a57a7285d Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--libnm/nm-object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index eef6128573..027f66bd8f 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -637,7 +637,7 @@ _nm_object_create (GType type, GDBusConnection *connection, const char *path)
if (!proxy) {
g_warning ("Could not create proxy for %s: %s.", path, error->message);
g_error_free (error);
- return G_TYPE_INVALID;
+ return NULL;
}
ret = g_dbus_proxy_call_sync (proxy,
@@ -652,7 +652,7 @@ _nm_object_create (GType type, GDBusConnection *connection, const char *path)
g_warning ("Could not fetch property '%s' of interface '%s' on %s: %s\n",
type_data->property, type_data->interface, path, error->message);
g_error_free (error);
- return G_TYPE_INVALID;
+ return NULL;
}
g_variant_get (ret, "(v)", &value);