glib: Add missing (nullable) and (optional) annotations

Add various (nullable) and (optional) annotations which were missing
from a variety of functions. Also port a couple of existing (allow-none)
annotations in the same files to use (nullable) and (optional) as
appropriate instead.

Secondly, add various (not nullable) annotations as needed by the new
default in gobject-introspection of marking gpointers as (nullable). See
https://bugzilla.gnome.org/show_bug.cgi?id=729660.

This includes adding some stub documentation comments for the
assertion macro error functions, which weren’t previously documented.
The new comments are purely to allow for annotations, and hence are
marked as (skip) to prevent the symbols appearing in the GIR file.

https://bugzilla.gnome.org/show_bug.cgi?id=719966
This commit is contained in:
Philip Withnall
2013-12-06 12:23:09 +00:00
parent 90808a0279
commit 25a7c817d3
48 changed files with 303 additions and 223 deletions

View File

@@ -343,7 +343,7 @@ get_C_locale (void)
/**
* g_strdup:
* @str: the string to duplicate
* @str: (nullable): the string to duplicate
*
* Duplicates a string. If @str is %NULL it returns %NULL.
* The returned string should be freed with g_free()
@@ -2114,7 +2114,7 @@ out:
/**
* g_strescape:
* @source: a string to escape
* @exceptions: a string of characters not to escape in @source
* @exceptions: (nullable): a string of characters not to escape in @source
*
* Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
* and '"' in the string @source by inserting a '\' before
@@ -2467,7 +2467,7 @@ g_strsplit_set (const gchar *string,
/**
* g_strfreev:
* @str_array: a %NULL-terminated array of strings to free
* @str_array: (nullable): a %NULL-terminated array of strings to free
*
* Frees a %NULL-terminated array of strings, as well as each
* string it contains.
@@ -2490,14 +2490,14 @@ g_strfreev (gchar **str_array)
/**
* g_strdupv:
* @str_array: a %NULL-terminated array of strings
* @str_array: (nullable): a %NULL-terminated array of strings
*
* Copies %NULL-terminated array of strings. The copy is a deep copy;
* the new array should be freed by first freeing each string, then
* the array itself. g_strfreev() does this for you. If called
* on a %NULL value, g_strdupv() simply returns %NULL.
*
* Returns: a new %NULL-terminated array of strings.
* Returns: (nullable): a new %NULL-terminated array of strings.
*/
gchar**
g_strdupv (gchar **str_array)