summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-09-04 14:56:39 +0100
committerSimon McVittie <smcv@collabora.com>2022-09-05 09:18:53 +0100
commitca44e69b3db5c0b9eb45a6c3c60b7f2faf606e35 (patch)
tree82381febc6fdfcf50699481bdaf7e18e77e0d663
parentcbac331caf7bc6ea35e710972f7fc78c602434b1 (diff)
downloaddbus-python-ca44e69b3db5c0b9eb45a6c3c60b7f2faf606e35.tar.gz
Add G_GNUC_UNUSED to unused function parameters
It's easier to integrate subprojects into a larger project if they are as close to warnings-clean as possible. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--dbus-gmain.c18
-rw-r--r--meson.build8
-rw-r--r--tests/30574.c2
-rw-r--r--tests/test-thread-server.c8
4 files changed, 16 insertions, 20 deletions
diff --git a/dbus-gmain.c b/dbus-gmain.c
index ee4e8ca..3b7e596 100644
--- a/dbus-gmain.c
+++ b/dbus-gmain.c
@@ -73,15 +73,15 @@ message_queue_prepare (GSource *source,
}
static gboolean
-message_queue_check (GSource *source)
+message_queue_check (G_GNUC_UNUSED GSource *source)
{
return FALSE;
}
static gboolean
-message_queue_dispatch (GSource *source,
- GSourceFunc callback,
- gpointer user_data)
+message_queue_dispatch (GSource *source,
+ G_GNUC_UNUSED GSourceFunc callback,
+ G_GNUC_UNUSED gpointer user_data)
{
DBusConnection *connection = ((DBusGMessageQueue *)source)->connection;
@@ -191,9 +191,9 @@ io_handler_watch_freed (void *data)
}
static gboolean
-io_handler_dispatch (GIOChannel *source,
- GIOCondition condition,
- gpointer data)
+io_handler_dispatch (G_GNUC_UNUSED GIOChannel *source,
+ GIOCondition condition,
+ gpointer data)
{
IOHandler *handler;
guint dbus_condition = 0;
@@ -361,8 +361,8 @@ connection_setup_add_timeout (ConnectionSetup *cs,
}
static void
-connection_setup_remove_timeout (ConnectionSetup *cs,
- DBusTimeout *timeout)
+connection_setup_remove_timeout (G_GNUC_UNUSED ConnectionSetup *cs,
+ DBusTimeout *timeout)
{
TimeoutHandler *handler;
diff --git a/meson.build b/meson.build
index 4b96061..09f60b5 100644
--- a/meson.build
+++ b/meson.build
@@ -21,13 +21,9 @@ if cc.get_id() != 'msvc'
compile_warnings += ['-fno-common']
compile_warnings += [
- # These warnings are intentionally disabled:
- # - missing field initializers being implicitly 0 is a feature,
- # not a bug
- # - -Wunused-parameter is annoying when writing callbacks that follow
- # a fixed signature but do not necessarily need all of its parameters
+ # Intentionally disabled: missing field initializers being implicitly
+ # default-initialized is a feature, not a bug
'-Wno-missing-field-initializers',
- '-Wno-unused-parameter',
# General warnings for both C and C++, excluding those that are part
# of -Wall or -Wextra
diff --git a/tests/30574.c b/tests/30574.c
index 7098b55..6fe2b90 100644
--- a/tests/30574.c
+++ b/tests/30574.c
@@ -116,7 +116,7 @@ send_test_message (dbus_bool_t switch_after_send)
}
int
-main(int argc, const char *argv[])
+main (G_GNUC_UNUSED int argc, G_GNUC_UNUSED const char *argv[])
{
DBusError error;
diff --git a/tests/test-thread-server.c b/tests/test-thread-server.c
index 54f43b6..df821fb 100644
--- a/tests/test-thread-server.c
+++ b/tests/test-thread-server.c
@@ -158,7 +158,7 @@ filter_test_message (DBusConnection *connection,
static DBusHandlerResult
filter_disconnect (DBusConnection *connection,
DBusMessage *message,
- void *user_data)
+ G_GNUC_UNUSED void *user_data)
{
if (!dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL,
"Disconnected"))
@@ -171,9 +171,9 @@ filter_disconnect (DBusConnection *connection,
}
static void
-new_connection_callback (DBusServer *server,
- DBusConnection *new_connection,
- void *user_data)
+new_connection_callback (G_GNUC_UNUSED DBusServer *server,
+ DBusConnection *new_connection,
+ G_GNUC_UNUSED void *user_data)
{
ThreadTestData * data;