mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
Cleanup. Use return value of g_string_free(...). (#343548, Chris Wilson)
2006-06-01 Behdad Esfahbod <behdad@gnome.org> * 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)
This commit is contained in:
parent
01e5d78f6d
commit
38b53eed54
@ -1,3 +1,11 @@
|
|||||||
|
2006-06-01 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* 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 <mclasen@redhat.com>
|
2006-05-28 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gmarkup.c (g_markup_parse_context_parse):
|
* glib/gmarkup.c (g_markup_parse_context_parse):
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2006-06-01 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* 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 <mclasen@redhat.com>
|
2006-05-28 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gmarkup.c (g_markup_parse_context_parse):
|
* glib/gmarkup.c (g_markup_parse_context_parse):
|
||||||
|
@ -929,7 +929,6 @@ g_key_file_to_data (GKeyFile *key_file,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GString *data_string;
|
GString *data_string;
|
||||||
gchar *data;
|
|
||||||
GList *group_node, *key_file_node;
|
GList *group_node, *key_file_node;
|
||||||
|
|
||||||
g_return_val_if_fail (key_file != NULL, NULL);
|
g_return_val_if_fail (key_file != NULL, NULL);
|
||||||
@ -967,11 +966,7 @@ g_key_file_to_data (GKeyFile *key_file,
|
|||||||
if (length)
|
if (length)
|
||||||
*length = data_string->len;
|
*length = data_string->len;
|
||||||
|
|
||||||
data = data_string->str;
|
return g_string_free (data_string, FALSE);
|
||||||
|
|
||||||
g_string_free (data_string, FALSE);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3514,7 +3509,7 @@ g_key_file_parse_value_as_comment (GKeyFile *key_file,
|
|||||||
const gchar *value)
|
const gchar *value)
|
||||||
{
|
{
|
||||||
GString *string;
|
GString *string;
|
||||||
gchar **lines, *comment;
|
gchar **lines;
|
||||||
gsize i;
|
gsize i;
|
||||||
|
|
||||||
string = g_string_sized_new (512);
|
string = g_string_sized_new (512);
|
||||||
@ -3530,11 +3525,7 @@ g_key_file_parse_value_as_comment (GKeyFile *key_file,
|
|||||||
}
|
}
|
||||||
g_strfreev (lines);
|
g_strfreev (lines);
|
||||||
|
|
||||||
comment = string->str;
|
return g_string_free (string, FALSE);
|
||||||
|
|
||||||
g_string_free (string, FALSE);
|
|
||||||
|
|
||||||
return comment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
@ -3542,7 +3533,7 @@ g_key_file_parse_comment_as_value (GKeyFile *key_file,
|
|||||||
const gchar *comment)
|
const gchar *comment)
|
||||||
{
|
{
|
||||||
GString *string;
|
GString *string;
|
||||||
gchar **lines, *value;
|
gchar **lines;
|
||||||
gsize i;
|
gsize i;
|
||||||
|
|
||||||
string = g_string_sized_new (512);
|
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");
|
lines[i + 1] == NULL? "" : "\n");
|
||||||
g_strfreev (lines);
|
g_strfreev (lines);
|
||||||
|
|
||||||
value = string->str;
|
return g_string_free (string, FALSE);
|
||||||
|
|
||||||
g_string_free (string, FALSE);
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __G_KEY_FILE_C__
|
#define __G_KEY_FILE_C__
|
||||||
|
@ -1705,8 +1705,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
|
|
||||||
if (gstring)
|
if (gstring)
|
||||||
{
|
{
|
||||||
value.v_string = gstring->str;
|
value.v_string = g_string_free (gstring, FALSE);
|
||||||
g_string_free (gstring, FALSE);
|
|
||||||
gstring = NULL;
|
gstring = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user