core: Drop ot_clear_gvariant() in favor of g_clear_pointer
This commit is contained in:
1 parent
57fcafd1ab
commit
2ced4abf11
7 files changed
+24
-30
No files matched your search
@@ -729,7 +729,7 @@ ostree_set_xattrs (GFile *f,
|
||||
value_data = g_variant_get_fixed_array (value, &value_len, 1);
|
||||
|
||||
loop_err = lsetxattr (path, (char*)name, (char*)value_data, value_len, XATTR_REPLACE) < 0;
|
||||
ot_clear_gvariant (&value);
|
||||
g_clear_pointer (&value, (GDestroyNotify) g_variant_unref);
|
||||
if (loop_err)
|
||||
{
|
||||
ot_util_set_error_from_errno (error, errno);
|
||||
|
||||
@@ -59,8 +59,8 @@ ostree_repo_file_finalize (GObject *object)
|
||||
|
||||
self = OSTREE_REPO_FILE (object);
|
||||
|
||||
ot_clear_gvariant (&self->tree_contents);
|
||||
ot_clear_gvariant (&self->tree_metadata);
|
||||
g_clear_pointer (&self->tree_contents, (GDestroyNotify) g_variant_unref);
|
||||
g_clear_pointer (&self->tree_metadata, (GDestroyNotify) g_variant_unref);
|
||||
g_free (self->cached_file_checksum);
|
||||
g_free (self->tree_contents_checksum);
|
||||
g_free (self->tree_metadata_checksum);
|
||||
@@ -217,7 +217,7 @@ do_resolve_nonroot (OstreeRepoFile *self,
|
||||
|
||||
files_variant = g_variant_get_child_value (self->parent->tree_contents, 0);
|
||||
self->index = g_variant_n_children (files_variant) + i;
|
||||
ot_clear_gvariant (&files_variant);
|
||||
g_clear_pointer (&files_variant, (GDestroyNotify) g_variant_unref);
|
||||
|
||||
g_variant_get_child (container, i, "(&s@ay@ay)",
|
||||
&name, &content_csum_v, &metadata_csum_v);
|
||||
@@ -331,7 +331,7 @@ ostree_repo_file_tree_set_metadata (OstreeRepoFile *self,
|
||||
const char *checksum,
|
||||
GVariant *metadata)
|
||||
{
|
||||
ot_clear_gvariant (&self->tree_metadata);
|
||||
g_clear_pointer (&self->tree_metadata, (GDestroyNotify) g_variant_unref);
|
||||
self->tree_metadata = g_variant_ref (metadata);
|
||||
g_free (self->tree_metadata_checksum);
|
||||
self->tree_metadata_checksum = g_strdup (checksum);
|
||||
@@ -396,8 +396,8 @@ ostree_repo_file_get_checksum (OstreeRepoFile *self)
|
||||
g_variant_get_child (files_variant, n,
|
||||
"(@s@ay)", NULL, &csum_bytes);
|
||||
}
|
||||
ot_clear_gvariant (&files_variant);
|
||||
ot_clear_gvariant (&dirs_variant);
|
||||
g_clear_pointer (&files_variant, (GDestroyNotify) g_variant_unref);
|
||||
g_clear_pointer (&dirs_variant, (GDestroyNotify) g_variant_unref);
|
||||
|
||||
self->cached_file_checksum = ostree_checksum_from_bytes_v (csum_bytes);
|
||||
|
||||
@@ -792,9 +792,9 @@ ostree_repo_file_tree_find_child (OstreeRepoFile *self,
|
||||
*out_container = ret_container;
|
||||
ret_container = NULL;
|
||||
}
|
||||
ot_clear_gvariant (&ret_container);
|
||||
ot_clear_gvariant (&files_variant);
|
||||
ot_clear_gvariant (&dirs_variant);
|
||||
g_clear_pointer (&ret_container, (GDestroyNotify) g_variant_unref);
|
||||
g_clear_pointer (&files_variant, (GDestroyNotify) g_variant_unref);
|
||||
g_clear_pointer (&dirs_variant, (GDestroyNotify) g_variant_unref);
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@@ -2802,7 +2802,7 @@ stage_directory_to_mtree_internal (OstreeRepo *self,
|
||||
|
||||
if (!(modifier && modifier->skip_xattrs))
|
||||
{
|
||||
ot_clear_gvariant (&xattrs);
|
||||
g_clear_pointer (&xattrs, (GDestroyNotify) g_variant_unref);
|
||||
if (!ostree_get_xattrs_for_file (child, &xattrs, cancellable, error))
|
||||
goto out;
|
||||
}
|
||||
@@ -3751,7 +3751,7 @@ find_object_in_packs (OstreeRepo *self,
|
||||
const char *pack_checksum = index_checksums->pdata[i];
|
||||
guint64 offset;
|
||||
|
||||
ot_clear_gvariant (&index_variant);
|
||||
g_clear_pointer (&index_variant, (GDestroyNotify) g_variant_unref);
|
||||
if (!ostree_repo_load_pack_index (self, pack_checksum, is_meta, &index_variant,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
@@ -4549,7 +4549,7 @@ ostree_repo_checkout_tree_async (OstreeRepo *self,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
|
||||
ot_clear_gvariant (&xattrs);
|
||||
g_clear_pointer (&xattrs, (GDestroyNotify) g_variant_unref);
|
||||
|
||||
dir_enum = g_file_enumerate_children ((GFile*)checkout_data->source,
|
||||
OSTREE_GIO_FAST_QUERYINFO,
|
||||
|
||||
@@ -76,7 +76,7 @@ traverse_dirtree_internal (OstreeRepo *repo,
|
||||
{
|
||||
const char *filename;
|
||||
|
||||
ot_clear_gvariant (&csum_v);
|
||||
g_clear_pointer (&csum_v, (GDestroyNotify) g_variant_unref);
|
||||
g_variant_get_child (files_variant, i, "(&s@ay)", &filename, &csum_v);
|
||||
g_free (tmp_checksum);
|
||||
tmp_checksum = ostree_checksum_from_bytes_v (csum_v);
|
||||
@@ -91,8 +91,8 @@ traverse_dirtree_internal (OstreeRepo *repo,
|
||||
{
|
||||
const char *dirname;
|
||||
|
||||
ot_clear_gvariant (&content_csum_v);
|
||||
ot_clear_gvariant (&metadata_csum_v);
|
||||
g_clear_pointer (&content_csum_v, (GDestroyNotify) g_variant_unref);
|
||||
g_clear_pointer (&metadata_csum_v, (GDestroyNotify) g_variant_unref);
|
||||
g_variant_get_child (dirs_variant, i, "(&s@ay@ay)",
|
||||
&dirname, &content_csum_v, &metadata_csum_v);
|
||||
|
||||
|
||||
Reference in new issue
Block a user