]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Fix signature of dbus_internal_do_not_use_try_message_file
authorSimon McVittie <smcv@collabora.com>
Mon, 23 Jul 2018 16:19:53 +0000 (17:19 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 2 Aug 2018 14:24:55 +0000 (15:24 +0100)
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 <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
dbus/dbus-message-util.c
dbus/dbus-test.h

index 6b4acf6074bd109aa04e94d78e44951d6a4d81fb..7df28f11aa302a6c1450edd85c3ab56e359c62e6 100644 (file)
@@ -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);
index 113aded4296bd2140f37b17719646dd7c5534c80..dcffd8a1441fff066a272727833667146b9431aa 100644 (file)
@@ -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,