[glib] docs: Fix (nullable) (optional) annotations
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] docs: Fix (nullable) (optional) annotations
- Date: Fri, 28 Apr 2017 11:32:54 +0000 (UTC)
commit b63469d7261a3d98207647a7f05167f21f22dbc1
Author: Philip Withnall <withnall endlessm com>
Date: Fri Apr 28 12:29:44 2017 +0100
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 <withnall endlessm com>
gio/gsocket.c | 4 ++--
gio/gsocketlistener.c | 8 ++++----
gio/gwin32registrykey.c | 8 ++++----
glib/gconvert.c | 2 +-
glib/gerror.c | 2 +-
glib/ghash.c | 4 ++--
6 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index c5fc855..d2f4970 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -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
diff --git a/gio/gsocketlistener.c b/gio/gsocketlistener.c
index fd19668..8790e68 100644
--- a/gio/gsocketlistener.c
+++ b/gio/gsocketlistener.c
@@ -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.
*
diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
index 313980b..096e96c 100644
--- a/gio/gwin32registrykey.c
+++ b/gio/gwin32registrykey.c
@@ -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
diff --git a/glib/gconvert.c b/glib/gconvert.c
index 0d8f47d..6e5a7cf 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -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
diff --git a/glib/gerror.c b/glib/gerror.c
index 625e67b..380382b 100644
--- a/glib/gerror.c
+++ b/glib/gerror.c
@@ -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
*
diff --git a/glib/ghash.c b/glib/ghash.c
index 25b8c56..9afa121 100644
--- a/glib/ghash.c
+++ b/glib/ghash.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]