Commit b63469d7 authored by Philip Withnall's avatar Philip Withnall

docs: Fix (nullable) (optional) annotations

There are a few places where commit 18a33f72 replaced valid (nullable)
(optional) annotations with just (optional). That has a different
meaning.

(nullable) (optional) can only be applied to gpointer* parameters, and
means that both the gpointer* and returned gpointer can be NULL. i.e.
The caller can pass in NULL to ignore the return value; and the returned
value can be NULL.

(optional) can be applied to anything* parameters, and means that the
anything* can be NULL. i.e. The caller can pass in NULL to ignore the
return value. The return value cannot be NULL.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent 88ad0dab
......@@ -5264,8 +5264,8 @@ g_socket_receive_messages_with_timeout (GSocket *socket,
* pointer, or %NULL
* @vectors: (array length=num_vectors): an array of #GInputVector structs
* @num_vectors: the number of elements in @vectors, or -1
* @messages: (array length=num_messages) (out) (optional): a pointer which
* may be filled with an array of #GSocketControlMessages, or %NULL
* @messages: (array length=num_messages) (out) (optional) (nullable): a pointer
* which may be filled with an array of #GSocketControlMessages, or %NULL
* @num_messages: (out): a pointer which will be filled with the number of
* elements in @messages, or %NULL
* @flags: (inout): a pointer to an int containing #GSocketMsgFlags flags
......
......@@ -639,7 +639,7 @@ accept_callback (GSocket *socket,
/**
* g_socket_listener_accept_socket:
* @listener: a #GSocketListener
* @source_object: (out) (transfer none) (optional): location where #GObject pointer will be stored, or %NULL.
* @source_object: (out) (transfer none) (optional) (nullable): location where #GObject pointer will be stored, or %NULL.
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
* @error: #GError for error reporting, or %NULL to ignore.
*
......@@ -716,7 +716,7 @@ g_socket_listener_accept_socket (GSocketListener *listener,
/**
* g_socket_listener_accept:
* @listener: a #GSocketListener
* @source_object: (out) (transfer none) (optional): location where #GObject pointer will be stored, or %NULL
* @source_object: (out) (transfer none) (optional) (nullable): location where #GObject pointer will be stored, or %NULL
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
* @error: #GError for error reporting, or %NULL to ignore.
*
......@@ -834,7 +834,7 @@ g_socket_listener_accept_socket_async (GSocketListener *listener,
* g_socket_listener_accept_socket_finish:
* @listener: a #GSocketListener
* @result: a #GAsyncResult.
* @source_object: (out) (transfer none) (optional): Optional #GObject identifying this source
* @source_object: (out) (transfer none) (optional) (nullable): Optional #GObject identifying this source
* @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
......@@ -890,7 +890,7 @@ g_socket_listener_accept_async (GSocketListener *listener,
* g_socket_listener_accept_finish:
* @listener: a #GSocketListener
* @result: a #GAsyncResult.
* @source_object: (out) (transfer none) (optional): Optional #GObject identifying this source
* @source_object: (out) (transfer none) (optional) (nullable): Optional #GObject identifying this source
* @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
......
......@@ -484,7 +484,7 @@ g_win32_registry_key_new (const gchar *path,
/**
* g_win32_registry_key_new_w:
* @path: (in) (transfer none): absolute full name of a key to open (in UTF-16)
* @error: (inout) (optional): a pointer to a %NULL #GError, or %NULL
* @error: (inout) (optional) (nullable): a pointer to a %NULL #GError, or %NULL
*
* Creates an object that represents a registry key specified by @path.
* @path must start with one of the following pre-defined names:
......@@ -628,7 +628,7 @@ g_win32_registry_key_initable_init (GInitable *initable,
* g_win32_registry_key_get_child:
* @key: (in) (transfer none): a parent #GWin32RegistryKey
* @subkey: (in) (transfer none): name of a child key to open (in UTF-8), relative to @key
* @error: (inout) (optional): a pointer to a %NULL #GError, or %NULL
* @error: (inout) (optional) (nullable): a pointer to a %NULL #GError, or %NULL
*
* Opens a @subkey of the @key.
*
......@@ -662,7 +662,7 @@ g_win32_registry_key_get_child (GWin32RegistryKey *key,
* g_win32_registry_key_get_child_w:
* @key: (in) (transfer none): a parent #GWin32RegistryKey
* @subkey: (in) (transfer none): name of a child key to open (in UTF-8), relative to @key
* @error: (inout) (optional): a pointer to a %NULL #GError, or %NULL
* @error: (inout) (optional) (nullable): a pointer to a %NULL #GError, or %NULL
*
* Opens a @subkey of the @key.
*
......@@ -739,7 +739,7 @@ g_win32_registry_key_get_child_w (GWin32RegistryKey *key,
* g_win32_registry_subkey_iter_init:
* @iter: (in) (transfer none): a pointer to a #GWin32RegistrySubkeyIter
* @key: (in) (transfer none): a #GWin32RegistryKey to iterate over
* @error: (inout) (optional): a pointer to %NULL #GError, or %NULL
* @error: (inout) (optional) (nullable): a pointer to %NULL #GError, or %NULL
*
* Initialises (without allocating) a #GWin32RegistrySubkeyIter. @iter may be
* completely uninitialised prior to this call; its old value is
......
......@@ -1477,7 +1477,7 @@ hostname_validate (const char *hostname)
/**
* g_filename_from_uri:
* @uri: a uri describing a filename (escaped, encoded in ASCII).
* @hostname: (out) (optional): Location to store hostname for the URI.
* @hostname: (out) (optional) (nullable): Location to store hostname for the URI.
* If there is no hostname in the URI, %NULL will be
* stored in this location.
* @error: location to store the error occurring, or %NULL to ignore
......
......@@ -694,7 +694,7 @@ g_error_add_prefix (gchar **string,
/**
* g_prefix_error:
* @err: (inout) (optional): a return location for a #GError
* @err: (inout) (optional) (nullable): a return location for a #GError
* @format: printf()-style format string
* @...: arguments to @format
*
......
......@@ -770,7 +770,7 @@ g_hash_table_iter_init (GHashTableIter *iter,
* g_hash_table_iter_next:
* @iter: an initialized #GHashTableIter
* @key: (out) (optional): a location to store the key
* @value: (out) (optional): a location to store the value
* @value: (out) (optional) (nullable): a location to store the value
*
* Advances @iter and retrieves the key and/or value that are now
* pointed to as a result of this advancement. If %FALSE is returned,
......@@ -1158,7 +1158,7 @@ g_hash_table_lookup (GHashTable *hash_table,
* @hash_table: a #GHashTable
* @lookup_key: the key to look up
* @orig_key: (out) (optional): return location for the original key
* @value: (out) (optional): return location for the value associated
* @value: (out) (optional) (nullable): return location for the value associated
* with the key
*
* Looks up a key in the #GHashTable, returning the original key and the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment