admin: Fix various compiler warnings

This commit is contained in:
Colin Walters 2013-07-07 14:30:01 -04:00
parent c66148160c
commit f6bca20551
6 changed files with 8 additions and 19 deletions

View File

@ -77,7 +77,7 @@ ot_admin_builtin_diff (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, GE
if (deployment != NULL) if (deployment != NULL)
opt_osname = (char*)ot_deployment_get_osname (deployment); opt_osname = (char*)ot_deployment_get_osname (deployment);
if (deployment == NULL) 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) if (deployment == NULL)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,

View File

@ -41,7 +41,6 @@ ot_admin_builtin_prune (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, G
{ {
GOptionContext *context; GOptionContext *context;
gboolean ret = FALSE; gboolean ret = FALSE;
const char *osname;
gs_unref_object GFile *repo_path = NULL; gs_unref_object GFile *repo_path = NULL;
gs_unref_object GFile *deploy_dir = NULL; gs_unref_object GFile *deploy_dir = NULL;
gs_unref_object GFile *current_deployment = 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; goto out;
} }
osname = argv[1];
if (!ot_admin_cleanup (admin_opts->sysroot, cancellable, error)) if (!ot_admin_cleanup (admin_opts->sysroot, cancellable, error))
goto out; goto out;

View File

@ -89,8 +89,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OtAdminBuiltinOpts *admin_opts,
if (!opt_osname) if (!opt_osname)
opt_osname = (char*)ot_deployment_get_osname (booted_deployment); opt_osname = (char*)ot_deployment_get_osname (booted_deployment);
merge_deployment = ot_admin_get_merge_deployment (current_deployments, opt_osname, merge_deployment = ot_admin_get_merge_deployment (current_deployments, opt_osname,
booted_deployment, booted_deployment);
NULL);
deployment_path = ot_admin_get_deployment_directory (admin_opts->sysroot, merge_deployment); deployment_path = ot_admin_get_deployment_directory (admin_opts->sysroot, merge_deployment);
deployment_origin_path = ot_admin_get_deployment_origin_path (deployment_path); deployment_origin_path = ot_admin_get_deployment_origin_path (deployment_path);

View File

@ -1087,8 +1087,7 @@ ot_admin_deploy (GFile *sysroot,
merge_deployment = g_object_ref (provided_merge_deployment); merge_deployment = g_object_ref (provided_merge_deployment);
else else
merge_deployment = ot_admin_get_merge_deployment (current_deployments, osname, merge_deployment = ot_admin_get_merge_deployment (current_deployments, osname,
booted_deployment, booted_deployment);
new_deployment);
compute_new_deployment_list (current_bootversion, compute_new_deployment_list (current_bootversion,
current_deployments, osname, current_deployments, osname,

View File

@ -290,8 +290,8 @@ parse_deployment (GFile *sysroot,
const char *relative_boot_link; const char *relative_boot_link;
gs_unref_object OtDeployment *ret_deployment = NULL; gs_unref_object OtDeployment *ret_deployment = NULL;
int entry_boot_version; int entry_boot_version;
int treebootserial; int treebootserial = -1;
int deployserial; int deployserial = -1;
gs_free char *osname = NULL; gs_free char *osname = NULL;
gs_free char *bootcsum = NULL; gs_free char *bootcsum = NULL;
gs_free char *treecsum = NULL; gs_free char *treecsum = NULL;
@ -463,8 +463,7 @@ ot_admin_require_deployment_or_osname (GFile *sysroot,
OtDeployment * OtDeployment *
ot_admin_get_merge_deployment (GPtrArray *deployments, ot_admin_get_merge_deployment (GPtrArray *deployments,
const char *osname, const char *osname,
OtDeployment *booted_deployment, OtDeployment *booted_deployment)
OtDeployment *new_deployment)
{ {
g_return_val_if_fail (osname != NULL || booted_deployment != NULL, NULL); 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); osname = ot_deployment_get_osname (booted_deployment);
if (booted_deployment && if (booted_deployment &&
new_deployment && g_strcmp0 (ot_deployment_get_osname (booted_deployment), osname) == 0)
g_strcmp0 (ot_deployment_get_osname (booted_deployment),
ot_deployment_get_osname (new_deployment)) == 0)
{ {
return g_object_ref (booted_deployment); 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) if (strcmp (ot_deployment_get_osname (deployment), osname) != 0)
continue; continue;
if (deployment == new_deployment)
continue;
return g_object_ref (deployment); return g_object_ref (deployment);
} }

View File

@ -96,8 +96,7 @@ gboolean ot_admin_require_deployment_or_osname (GFile *sysroot,
OtDeployment *ot_admin_get_merge_deployment (GPtrArray *deployment_list, OtDeployment *ot_admin_get_merge_deployment (GPtrArray *deployment_list,
const char *osname, const char *osname,
OtDeployment *booted_deployment, OtDeployment *booted_deployment);
OtDeployment *new_deployment);
GFile *ot_admin_get_deployment_origin_path (GFile *deployment_path); GFile *ot_admin_get_deployment_origin_path (GFile *deployment_path);