diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-12-18 17:42:53 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-12-18 17:42:53 +0000 |
commit | 4073c3cdb0ae56f64599a603d46e58917cb53afb (patch) | |
tree | ec1e84cc505eff69986d7ce841121cfbbad9e5b0 /telepathy-glib/util.h | |
parent | d8eab2474943e7ad43b7132a1e7f1f5392955bc4 (diff) | |
download | telepathy-glib-4073c3cdb0ae56f64599a603d46e58917cb53afb.tar.gz |
util: warn if the results of allocators are ignored (hence leaked)
Diffstat (limited to 'telepathy-glib/util.h')
-rw-r--r-- | telepathy-glib/util.h | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/telepathy-glib/util.h b/telepathy-glib/util.h index 250366c50..5175bb04c 100644 --- a/telepathy-glib/util.h +++ b/telepathy-glib/util.h @@ -34,26 +34,32 @@ G_BEGIN_DECLS gboolean tp_g_ptr_array_contains (GPtrArray *haystack, gpointer needle); -GValue *tp_g_value_slice_new (GType type); - -GValue *tp_g_value_slice_new_boolean (gboolean b); -GValue *tp_g_value_slice_new_int (gint n); -GValue *tp_g_value_slice_new_int64 (gint64 n); -GValue *tp_g_value_slice_new_uint (guint n); -GValue *tp_g_value_slice_new_uint64 (guint64 n); -GValue *tp_g_value_slice_new_double (double d); - -GValue *tp_g_value_slice_new_string (const gchar *string); -GValue *tp_g_value_slice_new_static_string (const gchar *string); -GValue *tp_g_value_slice_new_take_string (gchar *string); - -GValue *tp_g_value_slice_new_boxed (GType type, gconstpointer p); -GValue *tp_g_value_slice_new_static_boxed (GType type, gconstpointer p); -GValue *tp_g_value_slice_new_take_boxed (GType type, gpointer p); +GValue *tp_g_value_slice_new (GType type) G_GNUC_WARN_UNUSED_RESULT; + +GValue *tp_g_value_slice_new_boolean (gboolean b) G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_int (gint n) G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_int64 (gint64 n) G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_uint (guint n) G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_uint64 (guint64 n) G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_double (double d) G_GNUC_WARN_UNUSED_RESULT; + +GValue *tp_g_value_slice_new_string (const gchar *string) + G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_static_string (const gchar *string) + G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_take_string (gchar *string) + G_GNUC_WARN_UNUSED_RESULT; + +GValue *tp_g_value_slice_new_boxed (GType type, gconstpointer p) + G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_static_boxed (GType type, gconstpointer p) + G_GNUC_WARN_UNUSED_RESULT; +GValue *tp_g_value_slice_new_take_boxed (GType type, gpointer p) + G_GNUC_WARN_UNUSED_RESULT; void tp_g_value_slice_free (GValue *value); -GValue *tp_g_value_slice_dup (const GValue *value); +GValue *tp_g_value_slice_dup (const GValue *value) G_GNUC_WARN_UNUSED_RESULT; void tp_g_hash_table_update (GHashTable *target, GHashTable *source, GBoxedCopyFunc key_dup, GBoxedCopyFunc value_dup); @@ -64,7 +70,7 @@ gpointer tp_mixin_offset_cast (gpointer instance, guint offset); guint tp_mixin_instance_get_offset (gpointer instance, GQuark quark); guint tp_mixin_class_get_offset (gpointer klass, GQuark quark); -gchar *tp_escape_as_identifier (const gchar *name); +gchar *tp_escape_as_identifier (const gchar *name) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_strv_contains (const gchar * const *strv, const gchar *str); @@ -79,7 +85,7 @@ gulong tp_g_signal_connect_object (gpointer instance, GValueArray *tp_value_array_build (gsize length, GType type, - ...); + ...) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS |