From 83471e869e464c63063e9e254bc8c40b25de03b7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 31 May 2011 16:04:29 +0100 Subject: 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). Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: NB#218973 --- dbus/dbus-gproxy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c index 5d642f5..6af93ba 100644 --- a/dbus/dbus-gproxy.c +++ b/dbus/dbus-gproxy.c @@ -2653,14 +2653,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, @@ -2703,7 +2703,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, @@ -2763,7 +2763,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, -- cgit v1.2.3