From 995b2cd69158a54d3868bcc1e9bab0883dfbf7a7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 21:41:50 +0200 Subject: libayatana-indicator/indicator-service.c: Silence unused parameter warnings/errors for callback functions. --- libayatana-indicator/indicator-service.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libayatana-indicator/indicator-service.c') diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 9caa347..6a281e3 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -345,7 +345,7 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe /* Callback for getting our connection to DBus */ static void -bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data) +bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpointer user_data) { GError * error = NULL; GDBusConnection * connection = g_bus_get_finish(res, &error); @@ -387,7 +387,7 @@ bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data) /* A method has been called from our dbus inteface. Figure out what it is and dispatch it. */ static void -bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * method, GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data) +bus_method_call (__attribute__((unused)) GDBusConnection * connection, const gchar * sender, __attribute__((unused)) const gchar * path, __attribute__((unused)) const gchar * interface, const gchar * method, __attribute__((unused)) GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data) { IndicatorService * service = INDICATOR_SERVICE(user_data); GVariant * retval = NULL; @@ -434,7 +434,7 @@ timeout_no_watchers (gpointer data) found and we've got it. Now start the timer to see if anyone cares about us. */ static void -try_and_get_name_acquired_cb (GDBusConnection * connection, const gchar * name, gpointer user_data) +try_and_get_name_acquired_cb (GDBusConnection * connection, __attribute__((unused)) const gchar * name, gpointer user_data) { g_return_if_fail(connection != NULL); g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); @@ -516,7 +516,7 @@ try_and_get_name (IndicatorService * service) /* When the watcher vanishes we don't really care about it anymore. */ static void -watcher_vanished_cb (GDBusConnection * connection, const gchar * name, gpointer user_data) +watcher_vanished_cb (__attribute__((unused)) GDBusConnection * connection, const gchar * name, gpointer user_data) { g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); IndicatorServicePrivate * priv = indicator_service_get_instance_private(user_data); -- cgit v1.2.3 From cc7f8ce9b9720e0b615f6eee22e807c3ad1d6c6c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 21:42:52 +0200 Subject: libayatana-indicator/indicator-service.c: Avoid error: use of GNU old-style field designator extension. --- libayatana-indicator/indicator-service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libayatana-indicator/indicator-service.c') diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 6a281e3..06d5a0e 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -102,9 +102,9 @@ static void bus_method_call (GDBusConnection * connection, const gchar * sender, static GDBusNodeInfo * node_info = NULL; static GDBusInterfaceInfo * interface_info = NULL; static GDBusInterfaceVTable interface_table = { - method_call: bus_method_call, - get_property: NULL, /* No properties */ - set_property: NULL /* No properties */ + .method_call = bus_method_call, + .get_property = NULL, /* No properties */ + .set_property = NULL /* No properties */ }; /* THE define */ -- cgit v1.2.3 From 83380695633e0b9dc79ce8eefd3c0e97ff5503c8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:15:43 +0200 Subject: libayatana-indicator/indicator-service{,-manager}.c: Drop return statements and g_error_free() calls that never get reached. --- libayatana-indicator/indicator-service.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libayatana-indicator/indicator-service.c') diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 06d5a0e..de3a0cf 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -289,7 +289,6 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec if (G_VALUE_HOLDS_STRING(value)) { if (priv->name != NULL) { g_error("Name can not be set twice!"); - return; } priv->name = g_value_dup_string(value); try_and_get_name(self); @@ -354,7 +353,6 @@ bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpoint g_warning("Unable to get a connection to the session DBus: %s", error->message); g_error_free(error); exit (0); - return; } IndicatorServicePrivate * priv = indicator_service_get_instance_private(user_data); @@ -377,8 +375,6 @@ bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpoint &error); if (error != NULL) { g_error("Unable to register the object to DBus: %s", error->message); - g_error_free(error); - return; } return; -- cgit v1.2.3