From: Simon McVittie Date: Mon, 23 Jul 2018 16:19:53 +0000 (+0100) Subject: test: Fix signature of dbus_internal_do_not_use_try_message_file X-Git-Tag: dbus-1.13.6~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09300a5e6f7a3cedf5c60728cdfda50cf2e81904;p=thirdparty%2Fdbus.git 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 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349 Reviewed-by: Thiago Macieira --- diff --git a/dbus/dbus-message-util.c b/dbus/dbus-message-util.c index 6b4acf607..7df28f11a 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 113aded42..dcffd8a14 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,