From 16831ed729186a948f826c8ac02e9a66c83714df Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 25 Feb 2015 10:36:03 +0100 Subject: [PATCH] Fix warning: 'the comparison will always evaluate as 'false' for the address of '....' will never be NULL [-Waddress]' --- dbus/dbus-internals.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index d394680..a3f0a78 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -202,8 +202,18 @@ extern const char *_dbus_return_if_fail_warning_format; #define _DBUS_ASSERT_ERROR_IS_SET(error) do { } while (0) #define _DBUS_ASSERT_ERROR_IS_CLEAR(error) do { } while (0) #else -#define _DBUS_ASSERT_ERROR_IS_SET(error) _dbus_assert ((error) == NULL || dbus_error_is_set ((error))) -#define _DBUS_ASSERT_ERROR_IS_CLEAR(error) _dbus_assert ((error) == NULL || !dbus_error_is_set ((error))) +static inline void _dbus_assert_error_is_set(const DBusError *error) +{ + _dbus_assert (error == NULL || dbus_error_is_set (error)); +} + +static inline void _dbus_assert_error_is_clear(const DBusError *error) +{ + _dbus_assert (error == NULL || !dbus_error_is_set (error)); +} + +#define _DBUS_ASSERT_ERROR_IS_SET(error) _dbus_assert_error_is_set(error) +#define _DBUS_ASSERT_ERROR_IS_CLEAR(error) _dbus_assert_error_is_clear(error) #endif #define _dbus_return_if_error_is_set(error) _dbus_return_if_fail ((error) == NULL || !dbus_error_is_set ((error))) -- 1.8.4.5