From 050c9016d67e47a7692e18e6cec656a34298ef3c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 23 Jul 2018 17:19:53 +0100 Subject: [PATCH 1/7] test: Fix signature of dbus_internal_do_not_use_try_message_file In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns about casting a function pointer to an incompatible type. In this case the cast was because we were ignoring the void * argument, which in this case is NULL. Since this function is only used within dbus-message-util.c anyway, we might as well just use the correct signature and remove the cast. Signed-off-by: Simon McVittie --- dbus/dbus-message-util.c | 11 ++++++----- dbus/dbus-test.h | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dbus/dbus-message-util.c b/dbus/dbus-message-util.c index 6b4acf60..7df28f11 100644 --- a/dbus/dbus-message-util.c +++ b/dbus/dbus-message-util.c @@ -449,11 +449,13 @@ dbus_internal_do_not_use_load_message_file (const DBusString *filename, * * @param filename filename to load * @param expected_validity what the message has to be like to return #TRUE + * @param unused ignored * @returns #TRUE if the message has the expected validity */ -dbus_bool_t +static dbus_bool_t dbus_internal_do_not_use_try_message_file (const DBusString *filename, - DBusValidity expected_validity) + DBusValidity expected_validity, + void *unused) { DBusString data; dbus_bool_t retval; @@ -1801,9 +1803,8 @@ _dbus_message_test (const char *test_data_dir) initial_fds = _dbus_check_fdleaks_enter (); if (!dbus_internal_do_not_use_foreach_message_file (test_data_dir, - (DBusForeachMessageFileFunc) - dbus_internal_do_not_use_try_message_file, - NULL)) + dbus_internal_do_not_use_try_message_file, + NULL)) _dbus_test_fatal ("foreach_message_file test failed"); _dbus_check_fdleaks_leave (initial_fds); diff --git a/dbus/dbus-test.h b/dbus/dbus-test.h index 113aded4..dcffd8a1 100644 --- a/dbus/dbus-test.h +++ b/dbus/dbus-test.h @@ -99,8 +99,6 @@ dbus_bool_t _dbus_credentials_test (const char *test_data_dir); void _dbus_run_tests (const char *test_data_dir, const char *specific_test); -dbus_bool_t dbus_internal_do_not_use_try_message_file (const DBusString *filename, - DBusValidity expected_validity); dbus_bool_t dbus_internal_do_not_use_try_message_data (const DBusString *data, DBusValidity expected_validity); dbus_bool_t dbus_internal_do_not_use_load_message_file (const DBusString *filename, -- 2.18.0