uri: add missing (not)nullable annotations

As suggested by Sebastian Dröge:
https://github.com/gtk-rs/glib/pull/697#pullrequestreview-505797722

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-10-10 19:44:11 +04:00 committed by Philip Withnall
parent 3248b7b670
commit ed6ef00c13

View File

@ -1270,7 +1270,7 @@ remove_dot_segments (gchar *path)
* valid [absolute URI][relative-absolute-uris], it will be discarded, and an * valid [absolute URI][relative-absolute-uris], it will be discarded, and an
* error returned. * error returned.
* *
* Return value: (transfer full): a new #GUri. * Return value: (transfer full): a new #GUri, or NULL on error.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1297,7 +1297,7 @@ g_uri_parse (const gchar *uri_string,
* If the result is not a valid absolute URI, it will be discarded, and an error * If the result is not a valid absolute URI, it will be discarded, and an error
* returned. * returned.
* *
* Return value: (transfer full): a new #GUri. * Return value: (transfer full): a new #GUri, or NULL on error.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1414,7 +1414,8 @@ g_uri_parse_relative (GUri *base_uri,
* (If @base_uri_string is %NULL, this just returns @uri_ref, or * (If @base_uri_string is %NULL, this just returns @uri_ref, or
* %NULL if @uri_ref is invalid or not absolute.) * %NULL if @uri_ref is invalid or not absolute.)
* *
* Return value: (transfer full): the resolved URI string. * Return value: (transfer full): the resolved URI string,
* or NULL on error.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1608,7 +1609,7 @@ g_uri_join_internal (GUriFlags flags,
* %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set * %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set
* in @flags. * in @flags.
* *
* Return value: (transfer full): an absolute URI string * Return value: (not nullable) (transfer full): an absolute URI string
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1660,7 +1661,7 @@ g_uri_join (GUriFlags flags,
* %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set * %G_URI_FLAGS_HAS_PASSWORD and %G_URI_FLAGS_HAS_AUTH_PARAMS are ignored if set
* in @flags. * in @flags.
* *
* Return value: (transfer full): an absolute URI string * Return value: (not nullable) (transfer full): an absolute URI string
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1705,7 +1706,7 @@ g_uri_join_with_user (GUriFlags flags,
* See also g_uri_build_with_user(), which allows specifying the * See also g_uri_build_with_user(), which allows specifying the
* components of the "userinfo" separately. * components of the "userinfo" separately.
* *
* Return value: (transfer full): a new #GUri * Return value: (not nullable) (transfer full): a new #GUri
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1760,7 +1761,7 @@ g_uri_build (GUriFlags flags,
* of the userinfo field separately. Note that @user must be non-%NULL * of the userinfo field separately. Note that @user must be non-%NULL
* if either @password or @auth_params is non-%NULL. * if either @password or @auth_params is non-%NULL.
* *
* Return value: (transfer full): a new #GUri * Return value: (not nullable) (transfer full): a new #GUri
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1833,8 +1834,8 @@ g_uri_build_with_user (GUriFlags flags,
* or private data in its query string, and the returned string is going to be * or private data in its query string, and the returned string is going to be
* logged, then consider using g_uri_to_string_partial() to redact parts. * logged, then consider using g_uri_to_string_partial() to redact parts.
* *
* Return value: (transfer full): a string representing @uri, which the caller * Return value: (not nullable) (transfer full): a string representing @uri,
* must free. * which the caller must free.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -1854,8 +1855,8 @@ g_uri_to_string (GUri *uri)
* Returns a string representing @uri, subject to the options in * Returns a string representing @uri, subject to the options in
* @flags. See g_uri_to_string() and #GUriHideFlags for more details. * @flags. See g_uri_to_string() and #GUriHideFlags for more details.
* *
* Return value: (transfer full): a string representing @uri, which the caller * Return value: (not nullable) (transfer full): a string representing
* must free. * @uri, which the caller must free.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -2151,9 +2152,9 @@ g_uri_params_iter_next (GUriParamsIter *iter,
* If @params cannot be parsed (for example, it contains two @separators * If @params cannot be parsed (for example, it contains two @separators
* characters in a row), then @error is set and %NULL is returned. * characters in a row), then @error is set and %NULL is returned.
* *
* Return value: (transfer full) (element-type utf8 utf8): A hash table of * Return value: (transfer full) (element-type utf8 utf8):
* attribute/value pairs, with both names and values fully-decoded; or %NULL * A hash table of attribute/value pairs, with both names and values
* on error. * fully-decoded; or %NULL on error.
* *
* Since: 2.66 * Since: 2.66
*/ */
@ -2446,10 +2447,10 @@ g_uri_get_flags (GUri *uri)
* Note: `NUL` byte is not accepted in the output, in contrast to * Note: `NUL` byte is not accepted in the output, in contrast to
* g_uri_unescape_bytes(). * g_uri_unescape_bytes().
* *
* Returns: an unescaped version of @escaped_string or %NULL on error. * Returns: (nullable): an unescaped version of @escaped_string,
* The returned string should be freed when no longer needed. As a * or %NULL on error. The returned string should be freed when no longer
* special case if %NULL is given for @escaped_string, this function * needed. As a special case if %NULL is given for @escaped_string, this
* will return %NULL. * function will return %NULL.
* *
* Since: 2.16 * Since: 2.16
**/ **/
@ -2502,8 +2503,8 @@ g_uri_unescape_segment (const gchar *escaped_string,
* want to avoid for instance having a slash being expanded in an * want to avoid for instance having a slash being expanded in an
* escaped path element, which might confuse pathname handling. * escaped path element, which might confuse pathname handling.
* *
* Returns: an unescaped version of @escaped_string. The returned string * Returns: (nullable): an unescaped version of @escaped_string.
* should be freed when no longer needed. * The returned string should be freed when no longer needed.
* *
* Since: 2.16 * Since: 2.16
**/ **/
@ -2530,8 +2531,8 @@ g_uri_unescape_string (const gchar *escaped_string,
* in the URI specification, since those are allowed unescaped in some * in the URI specification, since those are allowed unescaped in some
* portions of a URI. * portions of a URI.
* *
* Returns: an escaped version of @unescaped. The returned string * Returns: (not nullable): an escaped version of @unescaped. The
* should be freed when no longer needed. * returned string should be freed when no longer needed.
* *
* Since: 2.16 * Since: 2.16
**/ **/
@ -2571,9 +2572,9 @@ g_uri_escape_string (const gchar *unescaped,
* being expanded in an escaped path element, which might confuse pathname * being expanded in an escaped path element, which might confuse pathname
* handling. * handling.
* *
* Returns: (transfer full): an unescaped version of @escaped_string or %NULL on * Returns: (transfer full): an unescaped version of @escaped_string
* error (if decoding failed, using %G_URI_ERROR_FAILED error code). The * or %NULL on error (if decoding failed, using %G_URI_ERROR_FAILED error
* returned #GBytes should be unreffed when no longer needed. * code). The returned #GBytes should be unreffed when no longer needed.
* *
* Since: 2.66 * Since: 2.66
**/ **/
@ -2624,8 +2625,8 @@ g_uri_unescape_bytes (const gchar *escaped_string,
* Though technically incorrect, this will also allow escaping nul * Though technically incorrect, this will also allow escaping nul
* bytes as `%``00`. * bytes as `%``00`.
* *
* Returns: (transfer full): an escaped version of @unescaped. The returned * Returns: (not nullable) (transfer full): an escaped version of @unescaped.
* string should be freed when no longer needed. * The returned string should be freed when no longer needed.
* *
* Since: 2.66 * Since: 2.66
*/ */