From 127e1d3be914dcbadd34232341cdac2379d8cb5d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 31 May 2011 16:04:29 +0100 Subject: [PATCH 14/14] DBusGProxy: be more pedantic about boolean returns Returning false doesn't strictly imply that the error is set; if you're being pedantic enough, it's really a tri-state where TRUE indicates success, FALSE indicates failure, and calling the function incorrectly results in undefined behaviour (currently a critical warning and returning FALSE). Bug-NB: NB#218973 --- dbus/dbus-gproxy.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c index f39c5b7..b05d56b 100644 --- a/dbus/dbus-gproxy.c +++ b/dbus/dbus-gproxy.c @@ -2616,14 +2616,14 @@ dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy, * case this function will block if the results haven't yet been * received. * - * If the call results in an error, the error is set as normal for - * GError and the function returns #FALSE. + * All D-Bus method calls can fail with a remote error. If this occurs, + * the @error will be set and this function will return %FALSE. * * Otherwise, the "out" parameters and return value of the * method are stored in the provided varargs list. * The list should be terminated with G_TYPE_INVALID. * - * Returns: #FALSE if an error is set. + * Returns: %TRUE on success */ gboolean dbus_g_proxy_end_call (DBusGProxy *proxy, @@ -2666,7 +2666,7 @@ dbus_g_proxy_end_call (DBusGProxy *proxy, * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * - * Returns: #FALSE if an error is set, #TRUE otherwise. + * Returns: %TRUE if the method succeeds, %FALSE if it fails */ gboolean dbus_g_proxy_call (DBusGProxy *proxy, @@ -2731,7 +2731,7 @@ dbus_g_proxy_call (DBusGProxy *proxy, * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * - * Returns: #FALSE if an error is set, #TRUE otherwise. + * Returns: %TRUE if the method succeeds, %FALSE if it fails */ gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy, -- 1.7.5.3