From f6bca20551c994025e33972e29100ac0944cb82c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 7 Jul 2013 14:30:01 -0400 Subject: [PATCH] admin: Fix various compiler warnings --- src/ostree/ot-admin-builtin-diff.c | 2 +- src/ostree/ot-admin-builtin-prune.c | 3 --- src/ostree/ot-admin-builtin-upgrade.c | 3 +-- src/ostree/ot-admin-deploy.c | 3 +-- src/ostree/ot-admin-functions.c | 13 ++++--------- src/ostree/ot-admin-functions.h | 3 +-- 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c index fd4cd58a..580692e3 100644 --- a/src/ostree/ot-admin-builtin-diff.c +++ b/src/ostree/ot-admin-builtin-diff.c @@ -77,7 +77,7 @@ ot_admin_builtin_diff (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, GE if (deployment != NULL) opt_osname = (char*)ot_deployment_get_osname (deployment); if (deployment == NULL) - deployment = ot_admin_get_merge_deployment (deployments, opt_osname, deployment, NULL); + deployment = ot_admin_get_merge_deployment (deployments, opt_osname, deployment); if (deployment == NULL) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, diff --git a/src/ostree/ot-admin-builtin-prune.c b/src/ostree/ot-admin-builtin-prune.c index 5ee024d4..fc062fc6 100644 --- a/src/ostree/ot-admin-builtin-prune.c +++ b/src/ostree/ot-admin-builtin-prune.c @@ -41,7 +41,6 @@ ot_admin_builtin_prune (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, G { GOptionContext *context; gboolean ret = FALSE; - const char *osname; gs_unref_object GFile *repo_path = NULL; gs_unref_object GFile *deploy_dir = NULL; gs_unref_object GFile *current_deployment = NULL; @@ -63,8 +62,6 @@ ot_admin_builtin_prune (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, G goto out; } - osname = argv[1]; - if (!ot_admin_cleanup (admin_opts->sysroot, cancellable, error)) goto out; diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index f64837f3..5663c4fe 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -89,8 +89,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, if (!opt_osname) opt_osname = (char*)ot_deployment_get_osname (booted_deployment); merge_deployment = ot_admin_get_merge_deployment (current_deployments, opt_osname, - booted_deployment, - NULL); + booted_deployment); deployment_path = ot_admin_get_deployment_directory (admin_opts->sysroot, merge_deployment); deployment_origin_path = ot_admin_get_deployment_origin_path (deployment_path); diff --git a/src/ostree/ot-admin-deploy.c b/src/ostree/ot-admin-deploy.c index 707c8a1c..5382275b 100644 --- a/src/ostree/ot-admin-deploy.c +++ b/src/ostree/ot-admin-deploy.c @@ -1087,8 +1087,7 @@ ot_admin_deploy (GFile *sysroot, merge_deployment = g_object_ref (provided_merge_deployment); else merge_deployment = ot_admin_get_merge_deployment (current_deployments, osname, - booted_deployment, - new_deployment); + booted_deployment); compute_new_deployment_list (current_bootversion, current_deployments, osname, diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c index 5ebeb9c3..e97250b3 100644 --- a/src/ostree/ot-admin-functions.c +++ b/src/ostree/ot-admin-functions.c @@ -290,8 +290,8 @@ parse_deployment (GFile *sysroot, const char *relative_boot_link; gs_unref_object OtDeployment *ret_deployment = NULL; int entry_boot_version; - int treebootserial; - int deployserial; + int treebootserial = -1; + int deployserial = -1; gs_free char *osname = NULL; gs_free char *bootcsum = NULL; gs_free char *treecsum = NULL; @@ -463,8 +463,7 @@ ot_admin_require_deployment_or_osname (GFile *sysroot, OtDeployment * ot_admin_get_merge_deployment (GPtrArray *deployments, const char *osname, - OtDeployment *booted_deployment, - OtDeployment *new_deployment) + OtDeployment *booted_deployment) { g_return_val_if_fail (osname != NULL || booted_deployment != NULL, NULL); @@ -472,9 +471,7 @@ ot_admin_get_merge_deployment (GPtrArray *deployments, osname = ot_deployment_get_osname (booted_deployment); if (booted_deployment && - new_deployment && - g_strcmp0 (ot_deployment_get_osname (booted_deployment), - ot_deployment_get_osname (new_deployment)) == 0) + g_strcmp0 (ot_deployment_get_osname (booted_deployment), osname) == 0) { return g_object_ref (booted_deployment); } @@ -487,8 +484,6 @@ ot_admin_get_merge_deployment (GPtrArray *deployments, if (strcmp (ot_deployment_get_osname (deployment), osname) != 0) continue; - if (deployment == new_deployment) - continue; return g_object_ref (deployment); } diff --git a/src/ostree/ot-admin-functions.h b/src/ostree/ot-admin-functions.h index 950d11e7..ad2a9324 100644 --- a/src/ostree/ot-admin-functions.h +++ b/src/ostree/ot-admin-functions.h @@ -96,8 +96,7 @@ gboolean ot_admin_require_deployment_or_osname (GFile *sysroot, OtDeployment *ot_admin_get_merge_deployment (GPtrArray *deployment_list, const char *osname, - OtDeployment *booted_deployment, - OtDeployment *new_deployment); + OtDeployment *booted_deployment); GFile *ot_admin_get_deployment_origin_path (GFile *deployment_path);