summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-11-20 12:17:20 +0000
committerSimon McVittie <smcv@collabora.com>2018-11-20 12:17:20 +0000
commiteef153e82815e19851d3f6dc1a9b1c901c41eb2b (patch)
tree1dea55c57128374c4bfe647bff503278ac040d06 /bus
parent3987f5a4bd75a7039e9da21d5dd01ffc1fda5063 (diff)
downloaddbus-eef153e82815e19851d3f6dc1a9b1c901c41eb2b.tar.gz
_DBUS_ASSERT_ERROR_XOR_BOOL: Add and use
As suggested by Philip Withnall in dbus!43. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'bus')
-rw-r--r--bus/activation.c5
-rw-r--r--bus/desktop-file.c6
-rw-r--r--bus/driver.c5
3 files changed, 3 insertions, 13 deletions
diff --git a/bus/activation.c b/bus/activation.c
index 8f17711e..706707ce 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -821,10 +821,7 @@ update_directory (BusActivation *activation,
retval = TRUE;
out:
- if (!retval)
- _DBUS_ASSERT_ERROR_IS_SET (error);
- else
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+ _DBUS_ASSERT_ERROR_XOR_BOOL (error, retval);
if (iter != NULL)
_dbus_directory_close (iter);
diff --git a/bus/desktop-file.c b/bus/desktop-file.c
index 69d628c6..af6bb4ee 100644
--- a/bus/desktop-file.c
+++ b/bus/desktop-file.c
@@ -688,11 +688,7 @@ bus_desktop_file_load (DBusString *filename,
parser.desktop_file = NULL;
out:
- if (result != NULL)
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
+ _DBUS_ASSERT_ERROR_XOR_BOOL (error, result != NULL);
parser_clear (&parser);
return result;
}
diff --git a/bus/driver.c b/bus/driver.c
index 9b3e43ee..267c881d 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -2310,10 +2310,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
ret = TRUE;
out:
- if (ret)
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
+ _DBUS_ASSERT_ERROR_XOR_BOOL (error, ret);
for (iter = _dbus_list_get_first_link (&rules);
iter != NULL;