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)
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,

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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);
}

View File

@ -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);