[ostree] Use g_auto(GStrv) instead of gs_strfreev



commit 302ac4dd890742d0a599d1cd1ae883346410bf6a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue May 5 12:13:09 2015 -0400

    Use g_auto(GStrv) instead of gs_strfreev

 src/libostree/ostree-bootloader-grub2.c          |    2 +-
 src/libostree/ostree-kernel-args.c               |    2 +-
 src/libostree/ostree-repo.c                      |    4 ++--
 src/libotutil/ot-keyfile-utils.c                 |    2 +-
 src/ostree/ot-admin-builtin-deploy.c             |    4 ++--
 src/ostree/ot-admin-instutil-builtin-set-kargs.c |    4 ++--
 tests/test-keyfile-utils.c                       |    4 ++--
 7 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
index a2d8237..b16e01b 100644
--- a/src/libostree/ostree-bootloader-grub2.c
+++ b/src/libostree/ostree-bootloader-grub2.c
@@ -296,7 +296,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader      *bootloader,
   g_autoptr(GFile) new_config_path = NULL;
   glnx_unref_object GSSubprocessContext *procctx = NULL;
   glnx_unref_object GSSubprocess *proc = NULL;
-  gs_strfreev char **child_env = g_get_environ ();
+  g_auto(GStrv) child_env = g_get_environ ();
   g_autofree char *bootversion_str = g_strdup_printf ("%u", (guint)bootversion);
   g_autoptr(GFile) config_path_efi_dir = NULL;
   g_autofree char *grub2_mkconfig_chroot = NULL;
diff --git a/src/libostree/ostree-kernel-args.c b/src/libostree/ostree-kernel-args.c
index 907e8b5..bd5e874 100644
--- a/src/libostree/ostree-kernel-args.c
+++ b/src/libostree/ostree-kernel-args.c
@@ -166,7 +166,7 @@ _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs,
   g_autoptr(GFile) proc_cmdline_path = g_file_new_for_path ("/proc/cmdline");
   g_autofree char *proc_cmdline = NULL;
   gsize proc_cmdline_len = 0;
-  gs_strfreev char **proc_cmdline_args = NULL;
+  g_auto(GStrv) proc_cmdline_args = NULL;
 
   if (!g_file_load_contents (proc_cmdline_path, cancellable,
                              &proc_cmdline, &proc_cmdline_len,
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 309a476..09f7668 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -298,7 +298,7 @@ _ostree_repo_get_remote_list_option (OstreeRepo   *self,
 
   if (remote != NULL)
     {
-      gs_strfreev char **value = NULL;
+      g_auto(GStrv) value = NULL;
       GError *local_error = NULL;
 
       value = g_key_file_get_string_list (remote->options,
@@ -1272,7 +1272,7 @@ add_remotes_from_keyfile (OstreeRepo *self,
                           GError    **error)
 {
   GQueue queue = G_QUEUE_INIT;
-  gs_strfreev char **groups = NULL;
+  g_auto(GStrv) groups = NULL;
   gsize length, ii;
   gboolean ret = FALSE;
 
diff --git a/src/libotutil/ot-keyfile-utils.c b/src/libotutil/ot-keyfile-utils.c
index 7a12e5f..6087a96 100644
--- a/src/libotutil/ot-keyfile-utils.c
+++ b/src/libotutil/ot-keyfile-utils.c
@@ -105,7 +105,7 @@ ot_keyfile_copy_group (GKeyFile   *source_keyfile,
                        GKeyFile   *target_keyfile,
                        const char *group_name)
 {
-  gs_strfreev char **keys = NULL;
+  g_auto(GStrv) keys = NULL;
   gsize length, ii;
   gboolean ret = FALSE;
 
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index 2770598..b18b3fd 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -141,7 +141,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
   else if (merge_deployment)
     {
       OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
-      gs_strfreev char **previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " 
", -1);
+      g_auto(GStrv) previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", 
-1);
 
       _ostree_kernel_args_append_argv (kargs, previous_args);
     }
@@ -157,7 +157,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
     }
 
   {
-    gs_strfreev char **kargs_strv = _ostree_kernel_args_to_strv (kargs);
+    g_auto(GStrv) kargs_strv = _ostree_kernel_args_to_strv (kargs);
 
     if (!ostree_sysroot_deploy_tree (sysroot,
                                      opt_osname, revision, origin,
diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c 
b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
index bb10e8e..c3c4968 100644
--- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c
+++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c
@@ -86,7 +86,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
   else if (opt_merge)
     {
       OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (first_deployment);
-      gs_strfreev char **previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " 
", -1);
+      g_auto(GStrv) previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", 
-1);
 
       _ostree_kernel_args_append_argv (kargs, previous_args);
     }
@@ -105,7 +105,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
     _ostree_kernel_args_append (kargs, argv[i]);
 
   {
-    gs_strfreev char **kargs_strv = _ostree_kernel_args_to_strv (kargs);
+    g_auto(GStrv) kargs_strv = _ostree_kernel_args_to_strv (kargs);
 
     if (!ostree_sysroot_deployment_set_kargs (sysroot, first_deployment,
                                               kargs_strv,
diff --git a/tests/test-keyfile-utils.c b/tests/test-keyfile-utils.c
index 551b508..2aae3cb 100644
--- a/tests/test-keyfile-utils.c
+++ b/tests/test-keyfile-utils.c
@@ -156,8 +156,8 @@ test_get_value_with_default (void)
 static void
 test_copy_group (void)
 {
-  gs_strfreev char **keys = NULL;
-  gs_strfreev char **keys2 = NULL;
+  g_auto(GStrv) keys = NULL;
+  g_auto(GStrv) keys2 = NULL;
   gsize length, length2, ii;
   GKeyFile *tmp = g_key_file_new ();
   const char *section = "section";


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