From 3fef04947288c65749ab2f1b8d3ece2357778a20 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 11 Dec 2020 23:20:56 +0000 Subject: [PATCH] gchecksum: Add missing (transfer) and (nullable) return annotations This commit only looks at the `Returns:` lines in the documentation, and has examined all of them in the file. Function arguments have not been checked. Signed-off-by: Philip Withnall Helps: #2227 --- glib/gchecksum.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/glib/gchecksum.c b/glib/gchecksum.c index f8a3f9ab8..f5ef9a443 100644 --- a/glib/gchecksum.c +++ b/glib/gchecksum.c @@ -1461,7 +1461,7 @@ g_checksum_type_get_length (GChecksumType checksum_type) * will be closed and it won't be possible to call g_checksum_update() * on it anymore. * - * Returns: (transfer full): the newly created #GChecksum, or %NULL. + * Returns: (transfer full) (nullable): the newly created #GChecksum, or %NULL. * Use g_checksum_free() to free the memory allocated by it. * * Since: 2.16 @@ -1529,8 +1529,8 @@ g_checksum_reset (GChecksum *checksum) * g_checksum_get_string() or g_checksum_get_digest(), the copied * checksum will be closed as well. * - * Returns: the copy of the passed #GChecksum. Use g_checksum_free() - * when finished using it. + * Returns: (transfer full): the copy of the passed #GChecksum. Use + * g_checksum_free() when finished using it. * * Since: 2.16 */ @@ -1775,8 +1775,10 @@ g_checksum_get_digest (GChecksum *checksum, * * The hexadecimal string returned will be in lower case. * - * Returns: the digest of the binary data as a string in hexadecimal. - * The returned string should be freed with g_free() when done using it. + * Returns: (transfer full) (nullable): the digest of the binary data as a + * string in hexadecimal, or %NULL if g_checksum_new() fails for + * @checksum_type. The returned string should be freed with g_free() when + * done using it. * * Since: 2.16 */ @@ -1812,7 +1814,8 @@ g_compute_checksum_for_data (GChecksumType checksum_type, * * The hexadecimal string returned will be in lower case. * - * Returns: the checksum as a hexadecimal string. The returned string + * Returns: (transfer full) (nullable): the checksum as a hexadecimal string, + * or %NULL if g_checksum_new() fails for @checksum_type. The returned string * should be freed with g_free() when done using it. * * Since: 2.16 @@ -1842,8 +1845,10 @@ g_compute_checksum_for_string (GChecksumType checksum_type, * * The hexadecimal string returned will be in lower case. * - * Returns: the digest of the binary data as a string in hexadecimal. - * The returned string should be freed with g_free() when done using it. + * Returns: (transfer full) (nullable): the digest of the binary data as a + * string in hexadecimal, or %NULL if g_checksum_new() fails for + * @checksum_type. The returned string should be freed with g_free() when + * done using it. * * Since: 2.34 */