introspection: use (nullable) or (optional) instead of (allow-none)

If we have an input parameter (or return value) we need to use (nullable).
However, if it is an (inout) or (out) parameter, (optional) is sufficient.

It looks like (nullable) could be used for everything according to the
Annotation documentation, but (optional) is more specific.
This commit is contained in:
Christian Hergert
2016-10-28 18:29:02 -07:00
parent a4012abbdf
commit 18a33f72db
151 changed files with 986 additions and 987 deletions

View File

@@ -498,7 +498,7 @@ static const gchar *replace_data =
" * @file: input #GFile.\n"
" * @contents: string of contents to replace the file with.\n"
" * @length: the length of @contents in bytes.\n"
" * @etag: (allow-none): a new <link linkend=\"gfile-etag\">entity tag</link> for the @file, or %NULL\n"
" * @etag: (nullable): a new <link linkend=\"gfile-etag\">entity tag</link> for the @file, or %NULL\n"
" * @make_backup: %TRUE if a backup should be created.\n"
" * @flags: a set of #GFileCreateFlags.\n"
" * @cancellable: optional #GCancellable object, %NULL to ignore.\n"

View File

@@ -36,8 +36,8 @@
/**
* test_pipe:
* @is: (out) (allow-none): used to return a #GInputStream
* @os: (out) (allow-none): used to return a #GOutputStream
* @is: (out) (optional): used to return a #GInputStream
* @os: (out) (optional): used to return a #GOutputStream
* @error: used to raise an error
*
* Return a "pipe to self" connecting @is to @os. This can be used
@@ -82,8 +82,8 @@ test_pipe (GInputStream **is,
/**
* test_bidi_pipe:
* @left: (out) (allow-none): used to return one #GIOStream
* @right: (out) (allow-none): used to return the other #GIOStream
* @left: (out) (optional): used to return one #GIOStream
* @right: (out) (optional): used to return the other #GIOStream
* @error: used to raise an error
*
* Return two #GIOStream<!---->s connected to each other with pipes.