[telepathy-glib/master] various: warn about unused results that would indicate an obvious leak

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Dec 18 10:09:09 PST 2009


---
 telepathy-glib/account-manager.h            |   11 +++++++----
 telepathy-glib/account.h                    |    2 +-
 telepathy-glib/channel-dispatch-operation.h |    3 ++-
 telepathy-glib/channel-dispatcher.h         |    3 ++-
 telepathy-glib/channel-request.h            |    2 +-
 telepathy-glib/channel.h                    |    4 ++--
 telepathy-glib/connection-manager.h         |    9 ++++++---
 telepathy-glib/connection.h                 |    2 +-
 telepathy-glib/dbus-daemon.h                |    5 +++--
 telepathy-glib/dbus-internal.h              |    3 ++-
 telepathy-glib/dbus-properties-mixin.h      |    3 ++-
 telepathy-glib/debug-sender.h               |    2 +-
 telepathy-glib/heap.h                       |    3 ++-
 telepathy-glib/media-interfaces.h           |    6 ++++--
 telepathy-glib/message-mixin.h              |    2 +-
 telepathy-glib/presence-mixin.h             |    2 +-
 telepathy-glib/proxy-internal.h             |    3 ++-
 telepathy-glib/util-internal.h              |    4 ++--
 18 files changed, 42 insertions(+), 27 deletions(-)

diff --git a/telepathy-glib/account-manager.h b/telepathy-glib/account-manager.h
index f117cd2..e5e0ebd 100644
--- a/telepathy-glib/account-manager.h
+++ b/telepathy-glib/account-manager.h
@@ -69,16 +69,18 @@ GType tp_account_manager_get_type (void);
 
 GQuark tp_account_manager_get_feature_quark_core (void) G_GNUC_CONST;
 
-TpAccountManager *tp_account_manager_new (TpDBusDaemon *bus_daemon);
+TpAccountManager *tp_account_manager_new (TpDBusDaemon *bus_daemon)
+  G_GNUC_WARN_UNUSED_RESULT;
 
-TpAccountManager *tp_account_manager_dup (void);
+TpAccountManager *tp_account_manager_dup (void) G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_account_manager_init_known_interfaces (void);
 
 TpAccount *tp_account_manager_ensure_account (TpAccountManager *manager,
     const gchar *path);
 
-GList *tp_account_manager_get_valid_accounts (TpAccountManager *manager);
+GList *tp_account_manager_get_valid_accounts (TpAccountManager *manager)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_account_manager_set_all_requested_presences (TpAccountManager *manager,
     TpConnectionPresenceType type, const gchar *status, const gchar *message);
@@ -92,7 +94,8 @@ void tp_account_manager_create_account_async (TpAccountManager *manager,
     GAsyncReadyCallback callback, gpointer user_data);
 
 TpAccount * tp_account_manager_create_account_finish (
-    TpAccountManager *manager, GAsyncResult *result, GError **error);
+    TpAccountManager *manager, GAsyncResult *result, GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 gboolean tp_account_manager_is_prepared (TpAccountManager *manager,
     GQuark feature);
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index b9d9feb..4291bc4 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -72,7 +72,7 @@ GType tp_account_get_type (void);
 GQuark tp_account_get_feature_quark_core (void) G_GNUC_CONST;
 
 TpAccount *tp_account_new (TpDBusDaemon *bus_daemon, const gchar *object_path,
-    GError **error);
+    GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 gboolean tp_account_parse_object_path (const gchar *object_path,
     gchar **cm, gchar **protocol, gchar **account_id, GError **error);
diff --git a/telepathy-glib/channel-dispatch-operation.h b/telepathy-glib/channel-dispatch-operation.h
index f9bc585..2518b20 100644
--- a/telepathy-glib/channel-dispatch-operation.h
+++ b/telepathy-glib/channel-dispatch-operation.h
@@ -69,7 +69,8 @@ GType tp_channel_dispatch_operation_get_type (void);
 
 TpChannelDispatchOperation *tp_channel_dispatch_operation_new (
     TpDBusDaemon *bus_daemon, const gchar *object_path,
-    GHashTable *immutable_properties, GError **error);
+    GHashTable *immutable_properties, GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_channel_dispatch_operation_init_known_interfaces (void);
 
diff --git a/telepathy-glib/channel-dispatcher.h b/telepathy-glib/channel-dispatcher.h
index b886916..31aa3d0 100644
--- a/telepathy-glib/channel-dispatcher.h
+++ b/telepathy-glib/channel-dispatcher.h
@@ -64,7 +64,8 @@ GType tp_channel_dispatcher_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL_DISPATCHER, \
                               TpChannelDispatcherClass))
 
-TpChannelDispatcher *tp_channel_dispatcher_new (TpDBusDaemon *bus_daemon);
+TpChannelDispatcher *tp_channel_dispatcher_new (TpDBusDaemon *bus_daemon)
+    G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_channel_dispatcher_init_known_interfaces (void);
 
diff --git a/telepathy-glib/channel-request.h b/telepathy-glib/channel-request.h
index 1c37d5f..9799a43 100644
--- a/telepathy-glib/channel-request.h
+++ b/telepathy-glib/channel-request.h
@@ -65,7 +65,7 @@ GType tp_channel_request_get_type (void);
 
 TpChannelRequest *tp_channel_request_new (TpDBusDaemon *bus_daemon,
     const gchar *object_path, GHashTable *immutable_properties,
-    GError **error);
+    GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_channel_request_init_known_interfaces (void);
 
diff --git a/telepathy-glib/channel.h b/telepathy-glib/channel.h
index e9a1ccb..e8751ae 100644
--- a/telepathy-glib/channel.h
+++ b/telepathy-glib/channel.h
@@ -74,11 +74,11 @@ GQuark tp_errors_removed_from_group_quark (void);
 TpChannel *tp_channel_new (TpConnection *conn,
     const gchar *object_path, const gchar *optional_channel_type,
     TpHandleType optional_handle_type, TpHandle optional_handle,
-    GError **error);
+    GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 TpChannel *tp_channel_new_from_properties (TpConnection *conn,
     const gchar *object_path, const GHashTable *immutable_properties,
-    GError **error);
+    GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 gboolean tp_channel_run_until_ready (TpChannel *self, GError **error,
     GMainLoop **loop);
diff --git a/telepathy-glib/connection-manager.h b/telepathy-glib/connection-manager.h
index c9574a0..032f88f 100644
--- a/telepathy-glib/connection-manager.h
+++ b/telepathy-glib/connection-manager.h
@@ -104,7 +104,8 @@ struct _TpConnectionManagerClass {
 };
 
 TpConnectionManager *tp_connection_manager_new (TpDBusDaemon *dbus,
-    const gchar *name, const gchar *manager_filename, GError **error);
+    const gchar *name, const gchar *manager_filename, GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 gboolean tp_connection_manager_activate (TpConnectionManager *self);
 
@@ -136,14 +137,16 @@ gboolean tp_connection_manager_check_valid_name (const gchar *name,
 gboolean tp_connection_manager_check_valid_protocol_name (const gchar *name,
     GError **error);
 
-gchar **tp_connection_manager_dup_protocol_names (TpConnectionManager *self);
+gchar **tp_connection_manager_dup_protocol_names (TpConnectionManager *self)
+  G_GNUC_WARN_UNUSED_RESULT;
 gboolean tp_connection_manager_has_protocol (TpConnectionManager *self,
     const gchar *protocol);
 const TpConnectionManagerProtocol *tp_connection_manager_get_protocol (
     TpConnectionManager *self, const gchar *protocol);
 
 gchar **tp_connection_manager_protocol_dup_param_names (
-    const TpConnectionManagerProtocol *protocol);
+    const TpConnectionManagerProtocol *protocol)
+  G_GNUC_WARN_UNUSED_RESULT;
 gboolean tp_connection_manager_protocol_has_param (
     const TpConnectionManagerProtocol *protocol,
     const gchar *param);
diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h
index 8b081ec..fcacb7c 100644
--- a/telepathy-glib/connection.h
+++ b/telepathy-glib/connection.h
@@ -71,7 +71,7 @@ GQuark tp_errors_disconnected_quark (void);
                               TpConnectionClass))
 
 TpConnection *tp_connection_new (TpDBusDaemon *dbus, const gchar *bus_name,
-    const gchar *object_path, GError **error);
+    const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
 TpConnectionStatus tp_connection_get_status (TpConnection *self,
     TpConnectionStatusReason *reason);
diff --git a/telepathy-glib/dbus-daemon.h b/telepathy-glib/dbus-daemon.h
index 0fe3549..f8b14cb 100644
--- a/telepathy-glib/dbus-daemon.h
+++ b/telepathy-glib/dbus-daemon.h
@@ -51,9 +51,10 @@ GType tp_dbus_daemon_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DBUS_DAEMON, \
                               TpDBusDaemonClass))
 
-TpDBusDaemon *tp_dbus_daemon_dup (GError **error);
+TpDBusDaemon *tp_dbus_daemon_dup (GError **error) G_GNUC_WARN_UNUSED_RESULT;
 
-TpDBusDaemon *tp_dbus_daemon_new (DBusGConnection *connection);
+TpDBusDaemon *tp_dbus_daemon_new (DBusGConnection *connection)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_dbus_daemon_init_known_interfaces (void);
 
diff --git a/telepathy-glib/dbus-internal.h b/telepathy-glib/dbus-internal.h
index 883e69b..4cce7fa 100644
--- a/telepathy-glib/dbus-internal.h
+++ b/telepathy-glib/dbus-internal.h
@@ -31,7 +31,8 @@ gboolean _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, gint timeout_ms,
 
 void _tp_register_dbus_glib_marshallers (void);
 
-DBusGConnection *_tp_dbus_starter_bus_conn (GError **error);
+DBusGConnection *_tp_dbus_starter_bus_conn (GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 G_END_DECLS
 
diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h
index 80962a9..2872a3e 100644
--- a/telepathy-glib/dbus-properties-mixin.h
+++ b/telepathy-glib/dbus-properties-mixin.h
@@ -127,7 +127,8 @@ gboolean tp_dbus_properties_mixin_get (GObject *self,
 
 GHashTable *tp_dbus_properties_mixin_make_properties_hash (
     GObject *object, const gchar *first_interface,
-    const gchar *first_property, ...) G_GNUC_NULL_TERMINATED;
+    const gchar *first_property, ...)
+  G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT;
 
 G_END_DECLS
 
diff --git a/telepathy-glib/debug-sender.h b/telepathy-glib/debug-sender.h
index b21a27e..bedc20e 100644
--- a/telepathy-glib/debug-sender.h
+++ b/telepathy-glib/debug-sender.h
@@ -61,7 +61,7 @@ struct _TpDebugSenderClass {
 
 GType tp_debug_sender_get_type (void);
 
-TpDebugSender *tp_debug_sender_dup (void);
+TpDebugSender *tp_debug_sender_dup (void) G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_debug_sender_add_message (TpDebugSender *self,
     GTimeVal *timestamp,
diff --git a/telepathy-glib/heap.h b/telepathy-glib/heap.h
index bb53569..cca243c 100644
--- a/telepathy-glib/heap.h
+++ b/telepathy-glib/heap.h
@@ -29,7 +29,8 @@ G_BEGIN_DECLS
 
 typedef struct _TpHeap TpHeap;
 
-TpHeap *tp_heap_new (GCompareFunc comparator, GDestroyNotify destructor);
+TpHeap *tp_heap_new (GCompareFunc comparator, GDestroyNotify destructor)
+  G_GNUC_WARN_UNUSED_RESULT;
 void tp_heap_destroy (TpHeap *heap);
 void tp_heap_clear (TpHeap *heap);
 
diff --git a/telepathy-glib/media-interfaces.h b/telepathy-glib/media-interfaces.h
index 497af8a..f6126f1 100644
--- a/telepathy-glib/media-interfaces.h
+++ b/telepathy-glib/media-interfaces.h
@@ -72,10 +72,12 @@ GType tp_media_session_handler_get_type (void);
                               TpMediaSessionHandlerClass))
 
 TpMediaSessionHandler *tp_media_session_handler_new (TpDBusDaemon *dbus,
-    const gchar *unique_name, const gchar *object_path, GError **error);
+    const gchar *unique_name, const gchar *object_path, GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 TpMediaStreamHandler *tp_media_stream_handler_new (TpDBusDaemon *dbus,
-    const gchar *unique_name, const gchar *object_path, GError **error);
+    const gchar *unique_name, const gchar *object_path, GError **error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 void tp_media_session_handler_init_known_interfaces (void);
 void tp_media_stream_handler_init_known_interfaces (void);
diff --git a/telepathy-glib/message-mixin.h b/telepathy-glib/message-mixin.h
index ff9a769..0388ee4 100644
--- a/telepathy-glib/message-mixin.h
+++ b/telepathy-glib/message-mixin.h
@@ -40,7 +40,7 @@ struct _TpMessageMixin {
 typedef struct _TpMessage TpMessage;
 
 TpMessage *tp_message_new (TpBaseConnection *connection, guint initial_parts,
-    guint size_hint);
+    guint size_hint) G_GNUC_WARN_UNUSED_RESULT;
 void tp_message_destroy (TpMessage *self);
 guint tp_message_count_parts (TpMessage *self);
 const GHashTable *tp_message_peek (TpMessage *self, guint part);
diff --git a/telepathy-glib/presence-mixin.h b/telepathy-glib/presence-mixin.h
index 93ad88b..3d337fc 100644
--- a/telepathy-glib/presence-mixin.h
+++ b/telepathy-glib/presence-mixin.h
@@ -105,7 +105,7 @@ struct _TpPresenceStatus {
 };
 
 TpPresenceStatus *tp_presence_status_new (guint which,
-    GHashTable *optional_arguments);
+    GHashTable *optional_arguments) G_GNUC_WARN_UNUSED_RESULT;
 void tp_presence_status_free (TpPresenceStatus *status);
 
 /**
diff --git a/telepathy-glib/proxy-internal.h b/telepathy-glib/proxy-internal.h
index a49c497..446582a 100644
--- a/telepathy-glib/proxy-internal.h
+++ b/telepathy-glib/proxy-internal.h
@@ -22,6 +22,7 @@
 
 #include <telepathy-glib/proxy.h>
 
-GError *_tp_proxy_take_and_remap_error (TpProxy *self, GError *error);
+GError *_tp_proxy_take_and_remap_error (TpProxy *self, GError *error)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 #endif
diff --git a/telepathy-glib/util-internal.h b/telepathy-glib/util-internal.h
index 30ba017..6b6aaa5 100644
--- a/telepathy-glib/util-internal.h
+++ b/telepathy-glib/util-internal.h
@@ -23,6 +23,6 @@
 
 #include <glib.h>
 
-GArray *_tp_quark_array_copy (const GQuark *quarks);
+GArray *_tp_quark_array_copy (const GQuark *quarks) G_GNUC_WARN_UNUSED_RESULT;
 
-#endif /* __TP_UTIL_INTERNAL_H__ */
\ No newline at end of file
+#endif /* __TP_UTIL_INTERNAL_H__ */
-- 
1.5.6.5



More information about the telepathy-commits mailing list