[ostree] Use g_autoptr(GPtrArray) instead of gs_unref_ptrarray



commit bb231fdf74ff81a39f82c0ccda058b2779e18e99
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue May 5 11:44:40 2015 -0400

    Use g_autoptr(GPtrArray) instead of gs_unref_ptrarray

 src/libostree/ostree-bootloader-grub2.c            |    4 ++--
 src/libostree/ostree-bootloader-syslinux.c         |    6 +++---
 src/libostree/ostree-bootloader-uboot.c            |    4 ++--
 src/libostree/ostree-core.c                        |    2 +-
 src/libostree/ostree-repo-commit.c                 |    2 +-
 src/libostree/ostree-repo-libarchive.c             |    4 ++--
 src/libostree/ostree-repo-prune.c                  |    2 +-
 ...ostree-repo-static-delta-compilation-analysis.c |    6 +++---
 .../ostree-repo-static-delta-compilation.c         |    2 +-
 src/libostree/ostree-repo-static-delta-core.c      |    2 +-
 src/libostree/ostree-rollsum.c                     |    2 +-
 src/libostree/ostree-sysroot-cleanup.c             |    8 ++++----
 src/libostree/ostree-sysroot-deploy.c              |   14 +++++++-------
 src/libostree/ostree-sysroot.c                     |   10 +++++-----
 src/libotutil/ot-gio-utils.c                       |    4 ++--
 src/libotutil/ot-unix-utils.c                      |    2 +-
 src/ostree/ot-admin-builtin-deploy.c               |    2 +-
 src/ostree/ot-admin-builtin-diff.c                 |    6 +++---
 src/ostree/ot-admin-builtin-status.c               |    2 +-
 src/ostree/ot-admin-builtin-undeploy.c             |    2 +-
 src/ostree/ot-admin-functions.c                    |    2 +-
 .../ot-admin-instutil-builtin-grub2-generate.c     |    2 +-
 ...admin-instutil-builtin-selinux-ensure-labeled.c |    4 ++--
 src/ostree/ot-admin-instutil-builtin-set-kargs.c   |    2 +-
 src/ostree/ot-builtin-diff.c                       |    6 +++---
 src/ostree/ot-builtin-pull-local.c                 |    2 +-
 src/ostree/ot-builtin-pull.c                       |    2 +-
 src/ostree/ot-builtin-static-delta.c               |    2 +-
 src/ostree/ot-main.c                               |    2 +-
 tests/test-mutable-tree.c                          |    8 ++++----
 tests/test-ot-unix-utils.c                         |    3 +--
 31 files changed, 60 insertions(+), 61 deletions(-)
---
diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
index d002995..a2d8237 100644
--- a/src/libostree/ostree-bootloader-grub2.c
+++ b/src/libostree/ostree-bootloader-grub2.c
@@ -138,7 +138,7 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot                 *sysroot
   gboolean ret = FALSE;
   GString *output = g_string_new ("");
   g_autoptr(GOutputStream) out_stream = NULL;
-  gs_unref_ptrarray GPtrArray *loader_configs = NULL;
+  g_autoptr(GPtrArray) loader_configs = NULL;
   guint i;
   gsize bytes_written;
   gboolean is_efi;
@@ -304,7 +304,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader      *bootloader,
   if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL
       && g_file_has_parent (self->sysroot->path, NULL))
     {
-      gs_unref_ptrarray GPtrArray *deployments = NULL;
+      g_autoptr(GPtrArray) deployments = NULL;
       OstreeDeployment *tool_deployment;
       g_autoptr(GFile) tool_deployment_root = NULL;
 
diff --git a/src/libostree/ostree-bootloader-syslinux.c b/src/libostree/ostree-bootloader-syslinux.c
index 72d9d1f..3ed431a 100644
--- a/src/libostree/ostree-bootloader-syslinux.c
+++ b/src/libostree/ostree-bootloader-syslinux.c
@@ -68,7 +68,7 @@ append_config_from_boostree_loader_entries (OstreeBootloaderSyslinux  *self,
                                         GError               **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *boostree_loader_configs = NULL;
+  g_autoptr(GPtrArray) boostree_loader_configs = NULL;
   guint i;
 
   if (!_ostree_sysroot_read_boot_loader_configs (self->sysroot, bootversion, &boostree_loader_configs,
@@ -125,8 +125,8 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
   g_autoptr(GFile) new_config_path = NULL;
   g_autofree char *config_contents = NULL;
   g_autofree char *new_config_contents = NULL;
-  gs_unref_ptrarray GPtrArray *new_lines = NULL;
-  gs_unref_ptrarray GPtrArray *tmp_lines = NULL;
+  g_autoptr(GPtrArray) new_lines = NULL;
+  g_autoptr(GPtrArray) tmp_lines = NULL;
   g_autofree char *kernel_arg = NULL;
   gboolean saw_default = FALSE;
   gboolean regenerate_default = FALSE;
diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c
index 00ec2d6..6cdeec8 100644
--- a/src/libostree/ostree-bootloader-uboot.c
+++ b/src/libostree/ostree-bootloader-uboot.c
@@ -70,7 +70,7 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot     *self,
                                         GCancellable          *cancellable,
                                         GError               **error)
 {
-  gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
+  g_autoptr(GPtrArray) boot_loader_configs = NULL;
   OstreeBootconfigParser *config;
   const char *val;
 
@@ -111,7 +111,7 @@ _ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
   g_autoptr(GFile) new_config_path = NULL;
   g_autofree char *config_contents = NULL;
   g_autofree char *new_config_contents = NULL;
-  gs_unref_ptrarray GPtrArray *new_lines = NULL;
+  g_autoptr(GPtrArray) new_lines = NULL;
 
   /* This should follow the symbolic link to the current bootversion. */
   config_contents = gs_file_load_contents_utf8 (self->config_path, cancellable, error);
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index 09d3d58..84924c6 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -428,7 +428,7 @@ ostree_raw_file_to_content_stream (GInputStream       *input,
   gsize header_size;
   g_autoptr(GInputStream) ret_input = NULL;
   gs_unref_variant GVariant *file_header = NULL;
-  gs_unref_ptrarray GPtrArray *streams = NULL;
+  g_autoptr(GPtrArray) streams = NULL;
   g_autoptr(GOutputStream) header_out_stream = NULL;
   g_autoptr(GInputStream) header_in_stream = NULL;
 
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
index 62e3f78..afd854e 100644
--- a/src/libostree/ostree-repo-commit.c
+++ b/src/libostree/ostree-repo-commit.c
@@ -380,7 +380,7 @@ add_size_index_to_metadata (OstreeRepo        *self,
       OstreeContentSizeCacheEntry *e_size = NULL;
       GVariantBuilder index_builder;
       guint i;
-      gs_unref_ptrarray GPtrArray *sorted_keys = NULL;
+      g_autoptr(GPtrArray) sorted_keys = NULL;
       
       g_hash_table_iter_init (&entries, self->object_sizes);
       g_variant_builder_init (&index_builder,
diff --git a/src/libostree/ostree-repo-libarchive.c b/src/libostree/ostree-repo-libarchive.c
index e55e6f4..e86e402 100644
--- a/src/libostree/ostree-repo-libarchive.c
+++ b/src/libostree/ostree-repo-libarchive.c
@@ -123,8 +123,8 @@ write_libarchive_entry_to_mtree (OstreeRepo           *self,
   const char *hardlink;
   const char *basename;
   g_autoptr(GFileInfo) file_info = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
-  gs_unref_ptrarray GPtrArray *hardlink_split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
+  g_autoptr(GPtrArray) hardlink_split_path = NULL;
   glnx_unref_object OstreeMutableTree *subdir = NULL;
   glnx_unref_object OstreeMutableTree *parent = NULL;
   glnx_unref_object OstreeMutableTree *hardlink_source_parent = NULL;
diff --git a/src/libostree/ostree-repo-prune.c b/src/libostree/ostree-repo-prune.c
index b0dc8a6..d9d0b52 100644
--- a/src/libostree/ostree-repo-prune.c
+++ b/src/libostree/ostree-repo-prune.c
@@ -220,7 +220,7 @@ ostree_repo_prune (OstreeRepo        *self,
         goto out;
     }
 
-  { gs_unref_ptrarray GPtrArray *deltas = NULL;
+  { g_autoptr(GPtrArray) deltas = NULL;
     guint i;
 
     if (!ostree_repo_list_static_delta_names (self, &deltas,
diff --git a/src/libostree/ostree-repo-static-delta-compilation-analysis.c 
b/src/libostree/ostree-repo-static-delta-compilation-analysis.c
index a1344e3..a8f24b4 100644
--- a/src/libostree/ostree-repo-static-delta-compilation-analysis.c
+++ b/src/libostree/ostree-repo-static-delta-compilation-analysis.c
@@ -153,7 +153,7 @@ build_content_sizenames_filtered (OstreeRepo              *repo,
                                   GError                 **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *ret_sizenames =
+  g_autoptr(GPtrArray) ret_sizenames =
     g_ptr_array_new_with_free_func (_ostree_delta_content_sizenames_free);
   g_autoptr(GHashTable) sizenames_map =
     g_hash_table_new_full (g_str_hash, g_str_equal, NULL, _ostree_delta_content_sizenames_free);
@@ -233,8 +233,8 @@ _ostree_delta_compute_similar_objects (OstreeRepo                 *repo,
   gboolean ret = FALSE;
   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;
+  g_autoptr(GPtrArray) from_sizes = NULL;
+  g_autoptr(GPtrArray) to_sizes = NULL;
   guint i, j;
   guint lower;
   guint upper;
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c 
b/src/libostree/ostree-repo-static-delta-compilation.c
index 9f988c6..d56440c 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -1249,7 +1249,7 @@ ostree_repo_static_delta_generate (OstreeRepo                   *self,
   guint64 total_compressed_size = 0;
   guint64 total_uncompressed_size = 0;
   gs_unref_variant_builder GVariantBuilder *part_headers = NULL;
-  gs_unref_ptrarray GPtrArray *part_tempfiles = NULL;
+  g_autoptr(GPtrArray) part_tempfiles = NULL;
   gs_unref_variant GVariant *delta_descriptor = NULL;
   gs_unref_variant GVariant *to_commit = NULL;
   g_autofree char *descriptor_relpath = NULL;
diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c
index 63e4d7f..9129544 100644
--- a/src/libostree/ostree-repo-static-delta-core.c
+++ b/src/libostree/ostree-repo-static-delta-core.c
@@ -68,7 +68,7 @@ ostree_repo_list_static_delta_names (OstreeRepo                  *self,
                                      GError                     **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *ret_deltas = NULL;
+  g_autoptr(GPtrArray) ret_deltas = NULL;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
 
   ret_deltas = g_ptr_array_new_with_free_func (g_free);
diff --git a/src/libostree/ostree-rollsum.c b/src/libostree/ostree-rollsum.c
index 17830f5..5efb193 100644
--- a/src/libostree/ostree-rollsum.c
+++ b/src/libostree/ostree-rollsum.c
@@ -114,7 +114,7 @@ _ostree_compute_rollsum_matches (GBytes                           *from,
   OstreeRollsumMatches *ret_rollsum = NULL;
   g_autoptr(GHashTable) from_rollsum = NULL;
   g_autoptr(GHashTable) to_rollsum = NULL;
-  gs_unref_ptrarray GPtrArray *matches = NULL;
+  g_autoptr(GPtrArray) matches = NULL;
   const guint8 *from_buf;
   gsize from_len;
   const guint8 *to_buf;
diff --git a/src/libostree/ostree-sysroot-cleanup.c b/src/libostree/ostree-sysroot-cleanup.c
index 5b8062a..3d322b2 100644
--- a/src/libostree/ostree-sysroot-cleanup.c
+++ b/src/libostree/ostree-sysroot-cleanup.c
@@ -99,7 +99,7 @@ list_all_deployment_directories (OstreeSysroot       *self,
   gboolean ret = FALSE;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
   g_autoptr(GFile) deploydir = NULL;
-  gs_unref_ptrarray GPtrArray *ret_deployments = NULL;
+  g_autoptr(GPtrArray) ret_deployments = NULL;
   GError *temp_error = NULL;
 
   deploydir = g_file_resolve_relative_path (self->path, "ostree/deploy");
@@ -186,7 +186,7 @@ list_all_boot_directories (OstreeSysroot       *self,
   gboolean ret = FALSE;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
   g_autoptr(GFile) boot_ostree = NULL;
-  gs_unref_ptrarray GPtrArray *ret_bootdirs = NULL;
+  g_autoptr(GPtrArray) ret_bootdirs = NULL;
   GError *temp_error = NULL;
 
   boot_ostree = g_file_resolve_relative_path (self->path, "boot/ostree");
@@ -296,8 +296,8 @@ cleanup_old_deployments (OstreeSysroot       *self,
   guint i;
   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;
+  g_autoptr(GPtrArray) all_deployment_dirs = NULL;
+  g_autoptr(GPtrArray) all_boot_dirs = NULL;
 
   if (stat ("/", &root_stbuf) != 0)
     {
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 662ef13..b409a53 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -369,9 +369,9 @@ merge_etc_changes (GFile          *orig_etc,
                    GError        **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
   guint i;
   int orig_etc_fd = -1;
   int modified_etc_fd = -1;
@@ -620,7 +620,7 @@ selinux_relabel_dir (OstreeSysroot                 *sysroot,
                      GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) root_info = NULL;
 
   root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
@@ -651,7 +651,7 @@ selinux_relabel_file (OstreeSysroot                 *sysroot,
                       GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) file_info = g_file_query_info (path, OSTREE_GIO_FAST_QUERYINFO,
                                                             G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                                             cancellable, error);
@@ -1710,7 +1710,7 @@ allocate_deployserial (OstreeSysroot           *self,
   guint i;
   int new_deployserial = 0;
   g_autoptr(GFile) osdir = NULL;
-  gs_unref_ptrarray GPtrArray *tmp_current_deployments =
+  g_autoptr(GPtrArray) tmp_current_deployments =
     g_ptr_array_new_with_free_func (g_object_unref);
 
   osdir = ot_gfile_get_child_build_path (self->path, "ostree/deploy", osname, NULL);
@@ -1922,7 +1922,7 @@ ostree_sysroot_deployment_set_kargs (OstreeSysroot     *self,
 {
   gboolean ret = FALSE;
   guint i;
-  gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+  g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
   glnx_unref_object OstreeDeployment *new_deployment = NULL;
   __attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
   g_autofree char *new_options = NULL;
diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c
index 20573f8..2970d9e 100644
--- a/src/libostree/ostree-sysroot.c
+++ b/src/libostree/ostree-sysroot.c
@@ -372,7 +372,7 @@ _ostree_sysroot_read_boot_loader_configs (OstreeSysroot *self,
   gboolean ret = FALSE;
   int fd; /* Temporary owned by iterator */
   g_autofree char *entries_path = g_strdup_printf ("boot/loader.%d/entries", bootversion);
-  gs_unref_ptrarray GPtrArray *ret_loader_configs = NULL;
+  g_autoptr(GPtrArray) ret_loader_configs = NULL;
   g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
 
   if (!ensure_sysroot_fd (self, error))
@@ -740,8 +740,8 @@ ostree_sysroot_load (OstreeSysroot  *self,
   guint i;
   int bootversion = 0;
   int subbootversion = 0;
-  gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) boot_loader_configs = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
 
   g_clear_pointer (&self->deployments, g_ptr_array_unref);
   g_clear_pointer (&self->booted_deployment, g_object_unref);
@@ -1215,8 +1215,8 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot      *sysroot,
   gboolean ret = FALSE;
   guint i;
   OstreeDeployment *booted_deployment = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
-  gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+  g_autoptr(GPtrArray) deployments = NULL;
+  g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
   gboolean retain = (flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN) > 0;
 
   deployments = ostree_sysroot_get_deployments (sysroot);
diff --git a/src/libotutil/ot-gio-utils.c b/src/libotutil/ot-gio-utils.c
index 2693eec..1143ca9 100644
--- a/src/libotutil/ot-gio-utils.c
+++ b/src/libotutil/ot-gio-utils.c
@@ -57,7 +57,7 @@ ot_gfile_from_build_path (const char *first, ...)
   va_list args;
   const char *arg;
   g_autofree char *path = NULL;
-  gs_unref_ptrarray GPtrArray *components = NULL;  
+  g_autoptr(GPtrArray) components = NULL;  
 
   va_start (args, first);
 
@@ -114,7 +114,7 @@ ot_gfile_get_child_build_path (GFile      *parent,
   va_list args;
   const char *arg;
   g_autofree char *path = NULL;
-  gs_unref_ptrarray GPtrArray *components = NULL;  
+  g_autoptr(GPtrArray) components = NULL;  
 
   va_start (args, first);
 
diff --git a/src/libotutil/ot-unix-utils.c b/src/libotutil/ot-unix-utils.c
index 9ba0dc3..4f659a2 100644
--- a/src/libotutil/ot-unix-utils.c
+++ b/src/libotutil/ot-unix-utils.c
@@ -91,7 +91,7 @@ ot_util_path_split_validate (const char *path,
 {
   gboolean ret = FALSE;
   int i;
-  gs_unref_ptrarray GPtrArray *ret_components = NULL;
+  g_autoptr(GPtrArray) ret_components = NULL;
 
   if (strlen (path) > PATH_MAX)
     {
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index 6fc0deb..2770598 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -58,7 +58,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   GKeyFile *origin = NULL;
   glnx_unref_object OstreeRepo *repo = NULL;
-  gs_unref_ptrarray GPtrArray *new_deployments = NULL;
+  g_autoptr(GPtrArray) new_deployments = NULL;
   glnx_unref_object OstreeDeployment *new_deployment = NULL;
   glnx_unref_object OstreeDeployment *merge_deployment = NULL;
   g_autofree char *revision = NULL;
diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c
index cb45c80..58d771a 100644
--- a/src/ostree/ot-admin-builtin-diff.c
+++ b/src/ostree/ot-admin-builtin-diff.c
@@ -45,9 +45,9 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError
   gboolean ret = FALSE;
   glnx_unref_object OstreeDeployment *deployment = NULL;
   g_autoptr(GFile) deployment_dir = NULL;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
   g_autoptr(GFile) orig_etc_path = NULL;
   g_autoptr(GFile) new_etc_path = NULL;
 
diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c
index 9dac4da..ce9263b 100644
--- a/src/ostree/ot-admin-builtin-status.c
+++ b/src/ostree/ot-admin-builtin-status.c
@@ -89,7 +89,7 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro
   gboolean ret = FALSE;
   glnx_unref_object OstreeRepo *repo = NULL;
   OstreeDeployment *booted_deployment = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   guint i;
 
   context = g_option_context_new ("List deployments");
diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c
index 39ae073..e048729 100644
--- a/src/ostree/ot-admin-builtin-undeploy.c
+++ b/src/ostree/ot-admin-builtin-undeploy.c
@@ -40,7 +40,7 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   const char *deploy_index_str;
   int deploy_index;
-  gs_unref_ptrarray GPtrArray *current_deployments = NULL;
+  g_autoptr(GPtrArray) current_deployments = NULL;
   glnx_unref_object OstreeDeployment *booted_deployment = NULL;
   glnx_unref_object OstreeDeployment *target_deployment = NULL;
 
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index 78ef8b1..22c25e5 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -78,7 +78,7 @@ ot_admin_get_indexed_deployment (OstreeSysroot  *sysroot,
                                  GError        **error)
 
 {
-  gs_unref_ptrarray GPtrArray *current_deployments =
+  g_autoptr(GPtrArray) current_deployments =
     ostree_sysroot_get_deployments (sysroot);
 
   if (index < 0)
diff --git a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c 
b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
index 832ac06..5e82d37 100644
--- a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
+++ b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c
@@ -40,7 +40,7 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
   guint bootversion;
   g_autoptr(GFile) subpath = NULL;
   glnx_unref_object OstreeSePolicy *sepolicy = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   g_autoptr(GFile) deployment_path = NULL;
diff --git a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c 
b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
index 471410c..457e615 100644
--- a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
+++ b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
@@ -152,7 +152,7 @@ selinux_relabel_dir (OstreeSePolicy                *sepolicy,
                      GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) root_info = NULL;
 
   root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
@@ -186,7 +186,7 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel
   g_autoptr(GFile) subpath = NULL;
   const char *prefix = NULL;
   glnx_unref_object OstreeSePolicy *sepolicy = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   OstreeDeployment *first_deployment;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c 
b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
index a985979..bb10e8e 100644
--- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c
+++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
@@ -48,7 +48,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
 {
   gboolean ret = FALSE;
   guint i;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   OstreeDeployment *first_deployment = NULL;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c
index 8e2d237..fb74423 100644
--- a/src/ostree/ot-builtin-diff.c
+++ b/src/ostree/ot-builtin-diff.c
@@ -126,9 +126,9 @@ ostree_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **
   g_autofree char *src_prev = NULL;
   g_autoptr(GFile) srcf = NULL;
   g_autoptr(GFile) targetf = NULL;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
 
   context = g_option_context_new ("REV TARGETDIR - Compare directory TARGETDIR against revision REV");
   g_option_context_add_main_entries (context, options, NULL);
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
index ec0c004..94db691 100644
--- a/src/ostree/ot-builtin-pull-local.c
+++ b/src/ostree/ot-builtin-pull-local.c
@@ -50,7 +50,7 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
   GSConsole *console = NULL;
   g_autofree char *src_repo_uri = NULL;
   glnx_unref_object OstreeAsyncProgress *progress = NULL;
-  gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+  g_autoptr(GPtrArray) refs_to_fetch = NULL;
   g_autoptr(GHashTable) source_objects = NULL;
 
   context = g_option_context_new ("SRC_REPO [REFS...] -  Copy data from SRC_REPO");
diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c
index e19ef3c..424ba41 100644
--- a/src/ostree/ot-builtin-pull.c
+++ b/src/ostree/ot-builtin-pull.c
@@ -63,7 +63,7 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError **
   g_autofree char *remote = NULL;
   OstreeRepoPullFlags pullflags = 0;
   GSConsole *console = NULL;
-  gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+  g_autoptr(GPtrArray) refs_to_fetch = NULL;
   glnx_unref_object OstreeAsyncProgress *progress = NULL;
   gulong signal_handler_id = 0;
 
diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c
index ad884e9..f4fa26f 100644
--- a/src/ostree/ot-builtin-static-delta.c
+++ b/src/ostree/ot-builtin-static-delta.c
@@ -97,7 +97,7 @@ static gboolean
 ot_static_delta_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *delta_names = NULL;
+  g_autoptr(GPtrArray) delta_names = NULL;
   guint i;
   GOptionContext *context;
   glnx_unref_object OstreeRepo *repo = NULL;
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index f0fcace..80af211 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -339,7 +339,7 @@ ostree_admin_option_context_parse (GOptionContext *context,
 
   if (opt_print_current_dir)
     {
-      gs_unref_ptrarray GPtrArray *deployments = NULL;
+      g_autoptr(GPtrArray) deployments = NULL;
       OstreeDeployment *first_deployment;
       g_autoptr(GFile) deployment_file = NULL;
       g_autofree char *deployment_path = NULL;
diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c
index 64d8d30..475430f 100644
--- a/tests/test-mutable-tree.c
+++ b/tests/test-mutable-tree.c
@@ -46,7 +46,7 @@ test_mutable_tree_walk (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *pathname = "a/b/c/d/e/f/g/i";
   const char *checksum = "01234567890123456789012345678901";
@@ -84,7 +84,7 @@ test_ensure_parent_dirs (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *pathname = "/foo/bar/baz";
   const char *checksum = "01234567890123456789012345678901";
@@ -111,7 +111,7 @@ test_ensure_dir (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *dirname = "foo";
   const char *filename = "bar";
@@ -131,7 +131,7 @@ test_replace_file (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *filename = "bar";
   const char *checksum = "01234567890123456789012345678901";
diff --git a/tests/test-ot-unix-utils.c b/tests/test-ot-unix-utils.c
index e212514..42b14ec 100644
--- a/tests/test-ot-unix-utils.c
+++ b/tests/test-ot-unix-utils.c
@@ -34,7 +34,7 @@ test_ot_util_path_split_validate (void)
   for (i = 0; paths[i]; i++)
     {
       GError *error = NULL;
-      GPtrArray *components = NULL;
+      g_autoptr(GPtrArray) components = NULL;
       if (! ot_util_path_split_validate (paths[i], &components, &error))
         {
           int j;
@@ -45,7 +45,6 @@ test_ot_util_path_split_validate (void)
               g_assert_null (strchr (components->pdata[i], '/'));
             }
         }
-      gs_local_ptrarray_unref (components);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]