[ostree] Use g_autoptr(GHashTable) instead of gs_unref_hashtable
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] Use g_autoptr(GHashTable) instead of gs_unref_hashtable
- Date: Thu, 7 May 2015 02:17:33 +0000 (UTC)
commit 196d983af930c665bbb385f59f6480b1032fd6bb
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue May 5 11:43:31 2015 -0400
Use g_autoptr(GHashTable) instead of gs_unref_hashtable
src/libostree/ostree-bootconfig-parser.c | 2 +-
src/libostree/ostree-repo-checkout.c | 2 +-
src/libostree/ostree-repo-commit.c | 4 +-
src/libostree/ostree-repo-prune.c | 4 +-
src/libostree/ostree-repo-pull.c | 4 +-
src/libostree/ostree-repo-refs.c | 4 +-
...ostree-repo-static-delta-compilation-analysis.c | 4 +-
.../ostree-repo-static-delta-compilation.c | 28 ++++++++++----------
src/libostree/ostree-repo-traverse.c | 2 +-
src/libostree/ostree-repo.c | 6 ++--
src/libostree/ostree-rollsum.c | 4 +-
src/libostree/ostree-sysroot-cleanup.c | 6 ++--
src/libostree/ostree-sysroot-deploy.c | 4 +-
src/ostree/ot-builtin-commit.c | 4 +-
src/ostree/ot-builtin-diff.c | 6 ++--
src/ostree/ot-builtin-fsck.c | 6 ++--
src/ostree/ot-builtin-pull-local.c | 4 +-
src/ostree/ot-builtin-refs.c | 2 +-
src/ostree/ot-builtin-reset.c | 2 +-
19 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/src/libostree/ostree-bootconfig-parser.c b/src/libostree/ostree-bootconfig-parser.c
index 44e9ce8..6320b5b 100644
--- a/src/libostree/ostree-bootconfig-parser.c
+++ b/src/libostree/ostree-bootconfig-parser.c
@@ -171,7 +171,7 @@ ostree_bootconfig_parser_write (OstreeBootconfigParser *self,
GString *buf = g_string_new ("");
g_autoptr(GBytes) bytes = NULL;
guint i;
- gs_unref_hashtable GHashTable *written_overrides = NULL;
+ g_autoptr(GHashTable) written_overrides = NULL;
written_overrides = g_hash_table_new (g_str_hash, g_str_equal);
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c
index 63a0890..1aeae13 100644
--- a/src/libostree/ostree-repo-checkout.c
+++ b/src/libostree/ostree-repo-checkout.c
@@ -850,7 +850,7 @@ ostree_repo_checkout_gc (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *to_clean_dirs = NULL;
+ g_autoptr(GHashTable) to_clean_dirs = NULL;
GHashTableIter iter;
gpointer key, value;
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
index bb1cef2..62e3f78 100644
--- a/src/libostree/ostree-repo-commit.c
+++ b/src/libostree/ostree-repo-commit.c
@@ -2756,8 +2756,8 @@ ostree_repo_write_mtree (OstreeRepo *self,
}
else
{
- gs_unref_hashtable GHashTable *dir_metadata_checksums = NULL;
- gs_unref_hashtable GHashTable *dir_contents_checksums = NULL;
+ g_autoptr(GHashTable) dir_metadata_checksums = NULL;
+ g_autoptr(GHashTable) dir_contents_checksums = NULL;
gs_unref_variant GVariant *serialized_tree = NULL;
g_autofree guchar *contents_csum = NULL;
char contents_checksum_buf[65];
diff --git a/src/libostree/ostree-repo-prune.c b/src/libostree/ostree-repo-prune.c
index 854627a..b0dc8a6 100644
--- a/src/libostree/ostree-repo-prune.c
+++ b/src/libostree/ostree-repo-prune.c
@@ -150,8 +150,8 @@ ostree_repo_prune (OstreeRepo *self,
gboolean ret = FALSE;
GHashTableIter hash_iter;
gpointer key, value;
- gs_unref_hashtable GHashTable *objects = NULL;
- gs_unref_hashtable GHashTable *all_refs = NULL;
+ g_autoptr(GHashTable) objects = NULL;
+ g_autoptr(GHashTable) all_refs = NULL;
OtPruneData data = { 0, };
gboolean refs_only = flags & OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY;
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 433f3f5..18b2f27 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1637,8 +1637,8 @@ ostree_repo_pull_with_options (OstreeRepo *self,
g_autofree char *path = NULL;
g_autofree char *baseurl = NULL;
g_autofree char *metalink_url_str = NULL;
- gs_unref_hashtable GHashTable *requested_refs_to_fetch = NULL;
- gs_unref_hashtable GHashTable *commits_to_fetch = NULL;
+ g_autoptr(GHashTable) requested_refs_to_fetch = NULL;
+ g_autoptr(GHashTable) commits_to_fetch = NULL;
g_autofree char *remote_mode_str = NULL;
glnx_unref_object OstreeMetalink *metalink = NULL;
OtPullData pull_data_real = { 0, };
diff --git a/src/libostree/ostree-repo-refs.c b/src/libostree/ostree-repo-refs.c
index 723b447..4bb6e0a 100644
--- a/src/libostree/ostree-repo-refs.c
+++ b/src/libostree/ostree-repo-refs.c
@@ -293,7 +293,7 @@ ostree_repo_resolve_partial_checksum (OstreeRepo *self,
gboolean ret = FALSE;
static const char hexchars[] = "0123456789abcdef";
gsize off;
- gs_unref_hashtable GHashTable *ref_list = NULL;
+ g_autoptr(GHashTable) ref_list = NULL;
g_autofree char *ret_rev = NULL;
guint length;
const char *checksum = NULL;
@@ -497,7 +497,7 @@ ostree_repo_list_refs (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *ret_all_refs = NULL;
+ g_autoptr(GHashTable) ret_all_refs = NULL;
g_autofree char *remote = NULL;
g_autofree char *ref_prefix = NULL;
diff --git a/src/libostree/ostree-repo-static-delta-compilation-analysis.c
b/src/libostree/ostree-repo-static-delta-compilation-analysis.c
index 8bcf438..a1344e3 100644
--- a/src/libostree/ostree-repo-static-delta-compilation-analysis.c
+++ b/src/libostree/ostree-repo-static-delta-compilation-analysis.c
@@ -155,7 +155,7 @@ build_content_sizenames_filtered (OstreeRepo *repo,
gboolean ret = FALSE;
gs_unref_ptrarray GPtrArray *ret_sizenames =
g_ptr_array_new_with_free_func (_ostree_delta_content_sizenames_free);
- gs_unref_hashtable GHashTable *sizenames_map =
+ g_autoptr(GHashTable) sizenames_map =
g_hash_table_new_full (g_str_hash, g_str_equal, NULL, _ostree_delta_content_sizenames_free);
ostree_cleanup_repo_commit_traverse_iter
OstreeRepoCommitTraverseIter iter = { 0, };
@@ -231,7 +231,7 @@ _ostree_delta_compute_similar_objects (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *ret_modified_regfile_content =
+ g_autoptr(GHashTable) ret_modified_regfile_content =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_ptr_array_unref);
gs_unref_ptrarray GPtrArray *from_sizes = NULL;
gs_unref_ptrarray GPtrArray *to_sizes = NULL;
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c
b/src/libostree/ostree-repo-static-delta-compilation.c
index b2e206e..9f988c6 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -504,8 +504,8 @@ try_content_bsdiff (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *from_bsdiff = NULL;
- gs_unref_hashtable GHashTable *to_bsdiff = NULL;
+ g_autoptr(GHashTable) from_bsdiff = NULL;
+ g_autoptr(GHashTable) to_bsdiff = NULL;
g_autoptr(GBytes) tmp_from = NULL;
g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
@@ -546,8 +546,8 @@ try_content_rollsum (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *from_rollsum = NULL;
- gs_unref_hashtable GHashTable *to_rollsum = NULL;
+ g_autoptr(GHashTable) from_rollsum = NULL;
+ g_autoptr(GHashTable) to_rollsum = NULL;
g_autoptr(GBytes) tmp_from = NULL;
g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
@@ -875,16 +875,16 @@ generate_delta_lowlatency (OstreeRepo *repo,
gs_unref_variant GVariant *from_commit = NULL;
g_autoptr(GFile) root_to = NULL;
gs_unref_variant GVariant *to_commit = NULL;
- gs_unref_hashtable GHashTable *to_reachable_objects = NULL;
- gs_unref_hashtable GHashTable *from_reachable_objects = NULL;
- gs_unref_hashtable GHashTable *from_regfile_content = NULL;
- gs_unref_hashtable GHashTable *new_reachable_metadata = NULL;
- gs_unref_hashtable GHashTable *new_reachable_regfile_content = NULL;
- gs_unref_hashtable GHashTable *new_reachable_symlink_content = NULL;
- gs_unref_hashtable GHashTable *modified_regfile_content = NULL;
- gs_unref_hashtable GHashTable *rollsum_optimized_content_objects = NULL;
- gs_unref_hashtable GHashTable *bsdiff_optimized_content_objects = NULL;
- gs_unref_hashtable GHashTable *content_object_to_size = NULL;
+ g_autoptr(GHashTable) to_reachable_objects = NULL;
+ g_autoptr(GHashTable) from_reachable_objects = NULL;
+ g_autoptr(GHashTable) from_regfile_content = NULL;
+ g_autoptr(GHashTable) new_reachable_metadata = NULL;
+ g_autoptr(GHashTable) new_reachable_regfile_content = NULL;
+ g_autoptr(GHashTable) new_reachable_symlink_content = NULL;
+ g_autoptr(GHashTable) modified_regfile_content = NULL;
+ g_autoptr(GHashTable) rollsum_optimized_content_objects = NULL;
+ g_autoptr(GHashTable) bsdiff_optimized_content_objects = NULL;
+ g_autoptr(GHashTable) content_object_to_size = NULL;
if (from != NULL)
{
diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c
index 7b425bb..c0d51fe 100644
--- a/src/libostree/ostree-repo-traverse.c
+++ b/src/libostree/ostree-repo-traverse.c
@@ -496,7 +496,7 @@ ostree_repo_traverse_commit (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *ret_reachable =
+ g_autoptr(GHashTable) ret_reachable =
ostree_repo_traverse_new_reachable ();
if (!ostree_repo_traverse_commit_union (repo, commit_checksum, maxdepth,
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index d21124f..225a5b5 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -2726,7 +2726,7 @@ ostree_repo_list_objects (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *ret_objects = NULL;
+ g_autoptr(GHashTable) ret_objects = NULL;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (self->inited, FALSE);
@@ -2781,7 +2781,7 @@ ostree_repo_list_commit_objects_starting_with (OstreeRepo *self
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *ret_commits = NULL;
+ g_autoptr(GHashTable) ret_commits = NULL;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (self->inited, FALSE);
@@ -3591,7 +3591,7 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
- gs_unref_hashtable GHashTable *refs = NULL;
+ g_autoptr(GHashTable) refs = NULL;
gs_unref_variant_builder GVariantBuilder *refs_builder = NULL;
gs_unref_variant GVariant *summary = NULL;
GList *ordered_keys = NULL;
diff --git a/src/libostree/ostree-rollsum.c b/src/libostree/ostree-rollsum.c
index c6f0876..17830f5 100644
--- a/src/libostree/ostree-rollsum.c
+++ b/src/libostree/ostree-rollsum.c
@@ -112,8 +112,8 @@ _ostree_compute_rollsum_matches (GBytes *from,
GBytes *to)
{
OstreeRollsumMatches *ret_rollsum = NULL;
- gs_unref_hashtable GHashTable *from_rollsum = NULL;
- gs_unref_hashtable GHashTable *to_rollsum = NULL;
+ g_autoptr(GHashTable) from_rollsum = NULL;
+ g_autoptr(GHashTable) to_rollsum = NULL;
gs_unref_ptrarray GPtrArray *matches = NULL;
const guint8 *from_buf;
gsize from_len;
diff --git a/src/libostree/ostree-sysroot-cleanup.c b/src/libostree/ostree-sysroot-cleanup.c
index 7910a1a..5b8062a 100644
--- a/src/libostree/ostree-sysroot-cleanup.c
+++ b/src/libostree/ostree-sysroot-cleanup.c
@@ -294,8 +294,8 @@ cleanup_old_deployments (OstreeSysroot *self,
gboolean ret = FALSE;
struct stat root_stbuf;
guint i;
- gs_unref_hashtable GHashTable *active_deployment_dirs = NULL;
- gs_unref_hashtable GHashTable *active_boot_checksums = NULL;
+ g_autoptr(GHashTable) active_deployment_dirs = NULL;
+ g_autoptr(GHashTable) active_boot_checksums = NULL;
gs_unref_ptrarray GPtrArray *all_deployment_dirs = NULL;
gs_unref_ptrarray GPtrArray *all_boot_dirs = NULL;
@@ -396,7 +396,7 @@ cleanup_ref_prefix (OstreeRepo *repo,
{
gboolean ret = FALSE;
g_autofree char *prefix = NULL;
- gs_unref_hashtable GHashTable *refs = NULL;
+ g_autoptr(GHashTable) refs = NULL;
GHashTableIter hashiter;
gpointer hashkey, hashvalue;
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 34ab23e..662ef13 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -1186,7 +1186,7 @@ install_deployment_kernel (OstreeSysroot *sysroot,
glnx_fd_close int deployment_dfd = -1;
g_autofree char *contents = NULL;
g_autofree char *deployment_version = NULL;
- gs_unref_hashtable GHashTable *osrelease_values = NULL;
+ g_autoptr(GHashTable) osrelease_values = NULL;
g_autofree char *linux_relpath = NULL;
g_autofree char *linux_key = NULL;
g_autofree char *initramfs_relpath = NULL;
@@ -1468,7 +1468,7 @@ cleanup_legacy_current_symlinks (OstreeSysroot *self,
{
gboolean ret = FALSE;
guint i;
- gs_unref_hashtable GHashTable *created_current_for_osname =
+ g_autoptr(GHashTable) created_current_for_osname =
g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < self->deployments->len; i++)
diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c
index f75def1..233da0f 100644
--- a/src/ostree/ot-builtin-commit.c
+++ b/src/ostree/ot-builtin-commit.c
@@ -95,7 +95,7 @@ parse_statoverride_file (GHashTable **out_mode_add,
gboolean ret = FALSE;
gsize len;
char **iter = NULL; /* nofree */
- gs_unref_hashtable GHashTable *ret_hash = NULL;
+ g_autoptr(GHashTable) ret_hash = NULL;
g_autoptr(GFile) path = NULL;
g_autofree char *contents = NULL;
char **lines = NULL;
@@ -303,7 +303,7 @@ ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError
gs_unref_variant GVariant *detached_metadata = NULL;
glnx_unref_object OstreeMutableTree *mtree = NULL;
g_autofree char *tree_type = NULL;
- gs_unref_hashtable GHashTable *mode_adds = NULL;
+ g_autoptr(GHashTable) mode_adds = NULL;
OstreeRepoCommitModifierFlags flags = 0;
OstreeRepoCommitModifier *modifier = NULL;
OstreeRepoTransactionStats stats;
diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c
index 385d910..8e2d237 100644
--- a/src/ostree/ot-builtin-diff.c
+++ b/src/ostree/ot-builtin-diff.c
@@ -180,9 +180,9 @@ ostree_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **
if (opt_stats)
{
- gs_unref_hashtable GHashTable *reachable_a = NULL;
- gs_unref_hashtable GHashTable *reachable_b = NULL;
- gs_unref_hashtable GHashTable *reachable_intersection = NULL;
+ g_autoptr(GHashTable) reachable_a = NULL;
+ g_autoptr(GHashTable) reachable_b = NULL;
+ g_autoptr(GHashTable) reachable_intersection = NULL;
g_autofree char *rev_a = NULL;
g_autofree char *rev_b = NULL;
g_autofree char *size = NULL;
diff --git a/src/ostree/ot-builtin-fsck.c b/src/ostree/ot-builtin-fsck.c
index e13c1a8..86ca393 100644
--- a/src/ostree/ot-builtin-fsck.c
+++ b/src/ostree/ot-builtin-fsck.c
@@ -185,7 +185,7 @@ fsck_reachable_objects_from_commits (OstreeRepo *repo,
gboolean ret = FALSE;
GHashTableIter hash_iter;
gpointer key, value;
- gs_unref_hashtable GHashTable *reachable_objects = NULL;
+ g_autoptr(GHashTable) reachable_objects = NULL;
guint i;
guint mod;
guint count;
@@ -244,8 +244,8 @@ ostree_builtin_fsck (int argc, char **argv, GCancellable *cancellable, GError **
gpointer key, value;
gboolean found_corruption = FALSE;
guint n_partial = 0;
- gs_unref_hashtable GHashTable *objects = NULL;
- gs_unref_hashtable GHashTable *commits = NULL;
+ g_autoptr(GHashTable) objects = NULL;
+ g_autoptr(GHashTable) commits = NULL;
context = g_option_context_new ("- Check the repository for consistency");
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
index 993c53e..ec0c004 100644
--- a/src/ostree/ot-builtin-pull-local.c
+++ b/src/ostree/ot-builtin-pull-local.c
@@ -51,7 +51,7 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
g_autofree char *src_repo_uri = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
- gs_unref_hashtable GHashTable *source_objects = NULL;
+ g_autoptr(GHashTable) source_objects = NULL;
context = g_option_context_new ("SRC_REPO [REFS...] - Copy data from SRC_REPO");
@@ -88,7 +88,7 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
{
g_autoptr(GFile) src_repo_path = g_file_new_for_path (src_repo_arg);
glnx_unref_object OstreeRepo *src_repo = ostree_repo_new (src_repo_path);
- gs_unref_hashtable GHashTable *refs_to_clone = NULL;
+ g_autoptr(GHashTable) refs_to_clone = NULL;
refs_to_fetch = g_ptr_array_new_with_free_func (g_free);
diff --git a/src/ostree/ot-builtin-refs.c b/src/ostree/ot-builtin-refs.c
index 9587990..d5d6f49 100644
--- a/src/ostree/ot-builtin-refs.c
+++ b/src/ostree/ot-builtin-refs.c
@@ -41,7 +41,7 @@ ostree_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **
GOptionContext *context;
glnx_unref_object OstreeRepo *repo = NULL;
const char *refspec_prefix = NULL;
- gs_unref_hashtable GHashTable *refs = NULL;
+ g_autoptr(GHashTable) refs = NULL;
GHashTableIter hashiter;
gpointer hashkey, hashvalue;
diff --git a/src/ostree/ot-builtin-reset.c b/src/ostree/ot-builtin-reset.c
index eed44c0..61f233f 100644
--- a/src/ostree/ot-builtin-reset.c
+++ b/src/ostree/ot-builtin-reset.c
@@ -37,7 +37,7 @@ find_current_ref (OstreeRepo *repo,
GCancellable *cancellable,
GError **error)
{
- gs_unref_hashtable GHashTable *refs = NULL;
+ g_autoptr(GHashTable) refs = NULL;
gchar *ret;
if (!ostree_repo_list_refs (repo, NULL, &refs, cancellable, error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]