gobject: Add missing (nullable) and (out) annotations on the data/qdata API

https://bugzilla.gnome.org/show_bug.cgi?id=756588
This commit is contained in:
Mikhail Zabaluev 2015-10-14 21:38:48 +03:00 committed by Philip Withnall
parent 28e8684168
commit 1e45c0a0e1

View File

@ -3375,7 +3375,7 @@ g_clear_object (volatile GObject **object_ptr)
* This function gets back user data pointers stored via * This function gets back user data pointers stored via
* g_object_set_qdata(). * g_object_set_qdata().
* *
* Returns: (transfer none): The user data pointer set, or %NULL * Returns: (transfer none) (nullable): The user data pointer set, or %NULL
*/ */
gpointer gpointer
g_object_get_qdata (GObject *object, g_object_get_qdata (GObject *object,
@ -3390,7 +3390,7 @@ g_object_get_qdata (GObject *object,
* g_object_set_qdata: (skip) * g_object_set_qdata: (skip)
* @object: The GObject to set store a user data pointer * @object: The GObject to set store a user data pointer
* @quark: A #GQuark, naming the user data pointer * @quark: A #GQuark, naming the user data pointer
* @data: An opaque user data pointer * @data: (nullable): An opaque user data pointer
* *
* This sets an opaque, named pointer on an object. * This sets an opaque, named pointer on an object.
* The name is specified through a #GQuark (retrived e.g. via * The name is specified through a #GQuark (retrived e.g. via
@ -3460,7 +3460,7 @@ g_object_dup_qdata (GObject *object,
* @oldval: (nullable): the old value to compare against * @oldval: (nullable): the old value to compare against
* @newval: (nullable): the new value * @newval: (nullable): the new value
* @destroy: (nullable): a destroy notify for the new value * @destroy: (nullable): a destroy notify for the new value
* @old_destroy: (nullable): destroy notify for the existing value * @old_destroy: (out) (optional): destroy notify for the existing value
* *
* Compares the user data for the key @quark on @object with * Compares the user data for the key @quark on @object with
* @oldval, and if they are the same, replaces @oldval with * @oldval, and if they are the same, replaces @oldval with
@ -3501,8 +3501,8 @@ g_object_replace_qdata (GObject *object,
* g_object_set_qdata_full: (skip) * g_object_set_qdata_full: (skip)
* @object: The GObject to set store a user data pointer * @object: The GObject to set store a user data pointer
* @quark: A #GQuark, naming the user data pointer * @quark: A #GQuark, naming the user data pointer
* @data: An opaque user data pointer * @data: (nullable): An opaque user data pointer
* @destroy: Function to invoke with @data as argument, when @data * @destroy: (nullable): Function to invoke with @data as argument, when @data
* needs to be freed * needs to be freed
* *
* This function works like g_object_set_qdata(), but in addition, * This function works like g_object_set_qdata(), but in addition,
@ -3565,7 +3565,7 @@ g_object_set_qdata_full (GObject *object,
* and thus the partial string list would have been freed upon * and thus the partial string list would have been freed upon
* g_object_set_qdata_full(). * g_object_set_qdata_full().
* *
* Returns: (transfer full): The user data pointer set, or %NULL * Returns: (transfer full) (nullable): The user data pointer set, or %NULL
*/ */
gpointer gpointer
g_object_steal_qdata (GObject *object, g_object_steal_qdata (GObject *object,
@ -3584,7 +3584,8 @@ g_object_steal_qdata (GObject *object,
* *
* Gets a named field from the objects table of associations (see g_object_set_data()). * Gets a named field from the objects table of associations (see g_object_set_data()).
* *
* Returns: (transfer none): the data if found, or %NULL if no such data exists. * Returns: (transfer none) (nullable): the data if found,
* or %NULL if no such data exists.
*/ */
gpointer gpointer
g_object_get_data (GObject *object, g_object_get_data (GObject *object,
@ -3600,7 +3601,7 @@ g_object_get_data (GObject *object,
* g_object_set_data: * g_object_set_data:
* @object: #GObject containing the associations. * @object: #GObject containing the associations.
* @key: name of the key * @key: name of the key
* @data: data to associate with that key * @data: (nullable): data to associate with that key
* *
* Each object carries around a table of associations from * Each object carries around a table of associations from
* strings to pointers. This function lets you set an association. * strings to pointers. This function lets you set an association.
@ -3669,7 +3670,7 @@ g_object_dup_data (GObject *object,
* @oldval: (nullable): the old value to compare against * @oldval: (nullable): the old value to compare against
* @newval: (nullable): the new value * @newval: (nullable): the new value
* @destroy: (nullable): a destroy notify for the new value * @destroy: (nullable): a destroy notify for the new value
* @old_destroy: (nullable): destroy notify for the existing value * @old_destroy: (out) (optional): destroy notify for the existing value
* *
* Compares the user data for the key @key on @object with * Compares the user data for the key @key on @object with
* @oldval, and if they are the same, replaces @oldval with * @oldval, and if they are the same, replaces @oldval with
@ -3711,8 +3712,8 @@ g_object_replace_data (GObject *object,
* g_object_set_data_full: (skip) * g_object_set_data_full: (skip)
* @object: #GObject containing the associations * @object: #GObject containing the associations
* @key: name of the key * @key: name of the key
* @data: data to associate with that key * @data: (nullable): data to associate with that key
* @destroy: function to call when the association is destroyed * @destroy: (nullable): function to call when the association is destroyed
* *
* Like g_object_set_data() except it adds notification * Like g_object_set_data() except it adds notification
* for when the association is destroyed, either by setting it * for when the association is destroyed, either by setting it
@ -3741,7 +3742,8 @@ g_object_set_data_full (GObject *object,
* Remove a specified datum from the object's data associations, * Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler. * without invoking the association's destroy handler.
* *
* Returns: (transfer full): the data if found, or %NULL if no such data exists. * Returns: (transfer full) (nullable): the data if found, or %NULL
* if no such data exists.
*/ */
gpointer gpointer
g_object_steal_data (GObject *object, g_object_steal_data (GObject *object,