Use g_autofree instead of gs_free

This commit is contained in:
Matthew Barnes committed 2015-05-06 21:50:17 -04:00
1 parent 4f33515316
commit 7a62d64968
67 files changed
+316 -316

No files matched your search

+3 -3
View File
@@ -66,9 +66,9 @@ test_bsdiff (void)
struct bsdiff_stream bsdiff_stream;
struct bspatch_stream bspatch_stream;
int i;
gs_free guint8 *old = g_new (guint8, OLD_SIZE);
gs_free guint8 *new = g_new (guint8, NEW_SIZE);
gs_free guint8 *new_generated = g_new0 (guint8, NEW_SIZE);
g_autofree guint8 *old = g_new (guint8, OLD_SIZE);
g_autofree guint8 *new = g_new (guint8, NEW_SIZE);
g_autofree guint8 *new_generated = g_new0 (guint8, NEW_SIZE);
gs_unref_object GOutputStream *out = g_memory_output_stream_new_resizable ();
gs_unref_object GInputStream *in = NULL;
+2 -2
View File
@@ -56,8 +56,8 @@ test_fixture_setup (TestFixture *fixture,
gpgme_data_t data_buffer;
gpgme_data_t signature_buffer;
OstreeGpgVerifyResult *result;
gs_free char *homedir = NULL;
gs_free char *filename = NULL;
g_autofree char *homedir = NULL;
g_autofree char *filename = NULL;
GError *local_error = NULL;
/* Mimic what OstreeGpgVerifier does to create OstreeGpgVerifyResult.
+2 -2
View File
@@ -181,8 +181,8 @@ test_copy_group (void)
for (ii = 0; ii < length; ii++)
{
gs_free char *value = NULL;
gs_free char *value2 = NULL;
g_autofree char *value = NULL;
g_autofree char *value2 = NULL;
value = g_key_file_get_value (g_keyfile, section, keys[ii], NULL);
value2 = g_key_file_get_value (g_keyfile, section, keys[ii], NULL);
+6 -6
View File
@@ -72,7 +72,7 @@ test_mutable_tree_walk (void)
{
gs_unref_object OstreeMutableTree *subdir = NULL;
gs_unref_object OstreeMutableTree *a = NULL;
gs_free char *source_checksum = NULL;
g_autofree char *source_checksum = NULL;
ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error);
g_assert (ostree_mutable_tree_walk (a, split_path, 1, &subdir, &error));
g_assert (subdir);
@@ -88,9 +88,9 @@ test_ensure_parent_dirs (void)
GError *error = NULL;
const char *pathname = "/foo/bar/baz";
const char *checksum = "01234567890123456789012345678901";
gs_free char *source_checksum = NULL;
g_autofree char *source_checksum = NULL;
gs_unref_object OstreeMutableTree *source_subdir = NULL;
gs_free char *source_checksum2 = NULL;
g_autofree char *source_checksum2 = NULL;
gs_unref_object OstreeMutableTree *source_subdir2 = NULL;
g_assert (ot_util_path_split_validate (pathname, &split_path, &error));
@@ -116,7 +116,7 @@ test_ensure_dir (void)
const char *dirname = "foo";
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";
gs_free char *source_checksum = NULL;
g_autofree char *source_checksum = NULL;
gs_unref_object OstreeMutableTree *source_subdir = NULL;
g_assert (ostree_mutable_tree_ensure_dir (tree, dirname, &parent, &error));
@@ -139,7 +139,7 @@ test_replace_file (void)
g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum, &error));
{
gs_free char *out_checksum = NULL;
g_autofree char *out_checksum = NULL;
gs_unref_object OstreeMutableTree *subdir = NULL;
g_assert (ostree_mutable_tree_lookup (tree, filename, &out_checksum, &subdir, &error));
g_assert_cmpstr (checksum, ==, out_checksum);
@@ -147,7 +147,7 @@ test_replace_file (void)
g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum2, &error));
{
gs_free char *out_checksum = NULL;
g_autofree char *out_checksum = NULL;
gs_unref_object OstreeMutableTree *subdir = NULL;
g_assert (ostree_mutable_tree_lookup (tree, filename, &out_checksum, &subdir, &error));
g_assert_cmpstr (checksum2, ==, out_checksum);
+4 -4
View File
@@ -87,8 +87,8 @@ test_ot_parse_keyvalue (void)
for (i = 0; i < G_N_ELEMENTS (keyvalue); i++)
{
gs_free char *out_key = NULL;
gs_free char *out_value = NULL;
g_autofree char *out_key = NULL;
g_autofree char *out_value = NULL;
g_assert_true (ot_parse_keyvalue (keyvalue[i],
&out_key,
&out_value,
@@ -98,8 +98,8 @@ test_ot_parse_keyvalue (void)
}
{
gs_free char *out_key = NULL;
gs_free char *out_value = NULL;
g_autofree char *out_key = NULL;
g_autofree char *out_value = NULL;
g_assert_false (ot_parse_keyvalue ("blabla",
&out_key,
&out_value,
+1 -1
View File
@@ -36,7 +36,7 @@ check_one_roundtrip (guint64 val)
if (g_test_verbose ())
{
gs_unref_variant GVariant *v = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), buf->str, buf->len, TRUE, NULL, NULL);
gs_free char *data = g_variant_print (v, FALSE);
g_autofree char *data = g_variant_print (v, FALSE);
g_test_message ("%" G_GUINT64_FORMAT " -> %s", val, data);
}
g_assert (_ostree_read_varuint64 ((guint8*)buf->str, buf->len, &newval, &bytes_read));