Use g_autoptr(GHashTable) instead of gs_unref_hashtable

This commit is contained in:
Matthew Barnes committed 2015-05-06 22:07:10 -04:00
1 parent e6556dd223
commit 196d983af9
19 files changed
+49 -49

No files matched your search

+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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];
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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, };
+2 -2
View File
@@ -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;
@@ -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;
@@ -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)
{
+1 -1
View File
@@ -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,
+3 -3
View File
@@ -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;
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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;
+2 -2
View File
@@ -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++)