From: Behdad Esfahbod Date: Thu, 1 Jun 2006 04:51:25 +0000 (+0000) Subject: Cleanup. Use return value of g_string_free(...). (#343548, Chris Wilson) X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=38b53eed54388d5268447ca73c20fbffb73c7035;p=dana%2Fcg-glib.git Cleanup. Use return value of g_string_free(...). (#343548, Chris Wilson) 2006-06-01 Behdad Esfahbod * glib/gkeyfile.c (g_key_file_to_data), (g_key_file_parse_value_as_comment), (g_key_file_parse_comment_as_value): * glib/gscanner.c (g_scanner_get_token_ll): Cleanup. Use return value of g_string_free(...). (#343548, Chris Wilson) --- diff --git a/ChangeLog b/ChangeLog index 749fb562..dd8dd06e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-01 Behdad Esfahbod + + * glib/gkeyfile.c (g_key_file_to_data), + (g_key_file_parse_value_as_comment), + (g_key_file_parse_comment_as_value): + * glib/gscanner.c (g_scanner_get_token_ll): Cleanup. Use return + value of g_string_free(...). (#343548, Chris Wilson) + 2006-05-28 Matthias Clasen * glib/gmarkup.c (g_markup_parse_context_parse): diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 749fb562..dd8dd06e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2006-06-01 Behdad Esfahbod + + * glib/gkeyfile.c (g_key_file_to_data), + (g_key_file_parse_value_as_comment), + (g_key_file_parse_comment_as_value): + * glib/gscanner.c (g_scanner_get_token_ll): Cleanup. Use return + value of g_string_free(...). (#343548, Chris Wilson) + 2006-05-28 Matthias Clasen * glib/gmarkup.c (g_markup_parse_context_parse): diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index b14da798..0e3dddcd 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -929,7 +929,6 @@ g_key_file_to_data (GKeyFile *key_file, GError **error) { GString *data_string; - gchar *data; GList *group_node, *key_file_node; g_return_val_if_fail (key_file != NULL, NULL); @@ -967,11 +966,7 @@ g_key_file_to_data (GKeyFile *key_file, if (length) *length = data_string->len; - data = data_string->str; - - g_string_free (data_string, FALSE); - - return data; + return g_string_free (data_string, FALSE); } /** @@ -3514,7 +3509,7 @@ g_key_file_parse_value_as_comment (GKeyFile *key_file, const gchar *value) { GString *string; - gchar **lines, *comment; + gchar **lines; gsize i; string = g_string_sized_new (512); @@ -3530,11 +3525,7 @@ g_key_file_parse_value_as_comment (GKeyFile *key_file, } g_strfreev (lines); - comment = string->str; - - g_string_free (string, FALSE); - - return comment; + return g_string_free (string, FALSE); } static gchar * @@ -3542,7 +3533,7 @@ g_key_file_parse_comment_as_value (GKeyFile *key_file, const gchar *comment) { GString *string; - gchar **lines, *value; + gchar **lines; gsize i; string = g_string_sized_new (512); @@ -3554,11 +3545,7 @@ g_key_file_parse_comment_as_value (GKeyFile *key_file, lines[i + 1] == NULL? "" : "\n"); g_strfreev (lines); - value = string->str; - - g_string_free (string, FALSE); - - return value; + return g_string_free (string, FALSE); } #define __G_KEY_FILE_C__ diff --git a/glib/gscanner.c b/glib/gscanner.c index 627262c2..f7e5682e 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -1705,8 +1705,7 @@ g_scanner_get_token_ll (GScanner *scanner, if (gstring) { - value.v_string = gstring->str; - g_string_free (gstring, FALSE); + value.v_string = g_string_free (gstring, FALSE); gstring = NULL; }