From 9f1a60dbba69844c0a04b3dd86280352736187ce Mon Sep 17 00:00:00 2001 From: Mikael Hallendal Date: Thu, 27 Nov 2003 01:25:50 +0000 Subject: 2003-11-26 Mikael Hallendal * bus/*.[ch]: * dbus/*.[ch]: * glib/*.[ch]: Made ref functions return the pointer --- dbus/dbus-connection.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'dbus/dbus-connection.c') diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index 7871f922..01ebeb1c 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -219,11 +219,13 @@ static void _dbus_connection_update_dispatch_status_and_unlock (DB DBusDispatchStatus new_status); static void _dbus_connection_last_unref (DBusConnection *connection); -static void +static DBusMessageFilter * _dbus_message_filter_ref (DBusMessageFilter *filter) { _dbus_assert (filter->refcount.value > 0); _dbus_atomic_inc (&filter->refcount); + + return filter; } static void @@ -963,8 +965,9 @@ _dbus_connection_new_for_transport (DBusTransport *transport) * Requires that the caller already holds the connection lock. * * @param connection the connection. + * @returns the connection. */ -void +DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection) { #ifdef DBUS_HAVE_ATOMIC_INT @@ -973,6 +976,8 @@ _dbus_connection_ref_unlocked (DBusConnection *connection) _dbus_assert (connection->refcount.value > 0); connection->refcount.value += 1; #endif + + return connection; } /** @@ -1117,11 +1122,12 @@ dbus_connection_open (const char *address, * Increments the reference count of a DBusConnection. * * @param connection the connection. + * @returns the connection. */ -void +DBusConnection * dbus_connection_ref (DBusConnection *connection) { - _dbus_return_if_fail (connection != NULL); + _dbus_return_val_if_fail (connection != NULL, NULL); /* The connection lock is better than the global * lock in the atomic increment fallback @@ -1136,6 +1142,8 @@ dbus_connection_ref (DBusConnection *connection) connection->refcount.value += 1; CONNECTION_UNLOCK (connection); #endif + + return connection; } static void -- cgit