tree-wide: Remove unused variables detected by CLang

CLang finds these, whereas GCC treats having
`__attribute__((cleanup))` as a use.

This obsoletes https://github.com/ostreedev/ostree/pull/411

Closes: #548
Approved by: jlebon
This commit is contained in:
Colin Walters 2016-10-25 13:06:36 -04:00 committed by Atomic Bot
parent 82a4f56593
commit b77edf24a3
24 changed files with 0 additions and 65 deletions

View File

@ -54,7 +54,6 @@ _ostree_bootloader_grub2_query (OstreeBootloader *bootloader,
gboolean ret = FALSE;
OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader);
g_autoptr(GFile) efi_basedir = NULL;
g_autoptr(GFileInfo) file_info = NULL;
if (g_file_query_exists (self->config_path_bios, NULL))
{
@ -290,8 +289,6 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
{
OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader);
gboolean ret = FALSE;
g_autoptr(GFile) efi_new_config_temp = NULL;
g_autoptr(GFile) efi_orig_config = NULL;
g_autoptr(GFile) new_config_path = NULL;
GSubprocessFlags subp_flags = 0;
glnx_unref_object GSubprocessLauncher *launcher = NULL;

View File

@ -1282,7 +1282,6 @@ _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher,
{
gboolean ret = FALSE;
const guint8 nulchar = 0;
g_autofree char *ret_contents = NULL;
g_autoptr(GMemoryOutputStream) buf = NULL;
g_autoptr(GMainContext) mainctx = NULL;
FetchUriSyncData data;

View File

@ -592,7 +592,6 @@ write_object (OstreeRepo *self,
gboolean do_commit;
OstreeRepoMode repo_mode;
g_autofree char *temp_filename = NULL;
g_autoptr(GFile) stored_path = NULL;
g_autofree guchar *ret_csum = NULL;
glnx_unref_object OstreeChecksumInputStream *checksum_input = NULL;
g_autoptr(GInputStream) file_input = NULL;
@ -1093,9 +1092,6 @@ ostree_repo_prepare_transaction (OstreeRepo *self,
{
gboolean ret = FALSE;
gboolean ret_transaction_resume = FALSE;
g_autofree char *stagedir_name = NULL;
glnx_fd_close int stagedir_fd = -1;
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
g_return_val_if_fail (self->in_transaction == FALSE, FALSE);
@ -2529,7 +2525,6 @@ write_directory_to_mtree_internal (OstreeRepo *self,
gboolean ret = FALSE;
OstreeRepoCommitFilterResult filter_result;
OstreeRepoFile *repo_dir = NULL;
g_autoptr(GFileEnumerator) dir_enum = NULL;
g_autoptr(GFileInfo) child_info = NULL;
if (dir)

View File

@ -300,7 +300,6 @@ aic_apply_modifier_filter (OstreeRepoArchiveImportContext *ctx,
const char *relpath,
GFileInfo **out_file_info)
{
g_autofree char *hardlink = aic_get_final_entry_hardlink (ctx);
g_autoptr(GFileInfo) file_info = NULL;
g_autofree char *abspath = NULL;
const char *cb_path = NULL;
@ -915,7 +914,6 @@ ostree_repo_write_archive_to_mtree (OstreeRepo *self,
#ifdef HAVE_LIBARCHIVE
gboolean ret = FALSE;
struct archive *a = NULL;
g_autoptr(GFileInfo) tmp_dir_info = NULL;
OstreeRepoImportArchiveOptions opts = { 0, };
a = archive_read_new ();

View File

@ -608,10 +608,8 @@ lookup_commit_checksum_from_summary (OtPullData *pull_data,
g_autoptr(GVariant) refs = g_variant_get_child_value (pull_data->summary, 0);
g_autoptr(GVariant) refdata = NULL;
g_autoptr(GVariant) reftargetdata = NULL;
g_autoptr(GVariant) commit_data = NULL;
guint64 commit_size;
g_autoptr(GVariant) commit_csum_v = NULL;
g_autoptr(GBytes) commit_bytes = NULL;
int i;
if (!ot_variant_bsearch_str (refs, ref, &i))
@ -973,7 +971,6 @@ static_deltapart_fetch_on_complete (GObject *object,
OstreeFetcher *fetcher = (OstreeFetcher *)object;
FetchStaticDeltaData *fetch_data = user_data;
OtPullData *pull_data = fetch_data->pull_data;
g_autoptr(GVariant) metadata = NULL;
g_autofree char *temp_path = NULL;
g_autoptr(GInputStream) in = NULL;
g_autoptr(GVariant) part = NULL;
@ -1430,8 +1427,6 @@ request_static_delta_superblock_sync (OtPullData *pull_data,
g_autofree char *delta_name =
_ostree_get_relative_static_delta_superblock_path (from_revision, to_revision);
g_autoptr(GBytes) delta_superblock_data = NULL;
g_autoptr(GBytes) delta_meta_data = NULL;
g_autoptr(GVariant) delta_superblock = NULL;
if (!_ostree_fetcher_mirrored_request_to_membuf (pull_data->fetcher,
pull_data->content_mirrorlist,
@ -2335,8 +2330,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
gboolean opt_gpg_verify_set = FALSE;
gboolean opt_gpg_verify_summary_set = FALSE;
const char *url_override = NULL;
g_autofree char *base_meta_url = NULL;
g_autofree char *base_content_url = NULL;
gboolean mirroring_into_archive;
gboolean inherit_transaction = FALSE;
int i;
@ -2641,7 +2634,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
{
g_autoptr(GBytes) bytes_sig = NULL;
g_autofree char *ret_contents = NULL;
gsize i, n;
g_autoptr(GVariant) refs = NULL;
g_autoptr(GVariant) deltas = NULL;

View File

@ -506,8 +506,6 @@ try_content_bsdiff (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
g_autoptr(GHashTable) from_bsdiff = NULL;
g_autoptr(GHashTable) to_bsdiff = NULL;
g_autoptr(GBytes) tmp_from = NULL;
g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
@ -551,8 +549,6 @@ try_content_rollsum (OstreeRepo *repo,
GError **error)
{
gboolean ret = FALSE;
g_autoptr(GHashTable) from_rollsum = NULL;
g_autoptr(GHashTable) to_rollsum = NULL;
g_autoptr(GBytes) tmp_from = NULL;
g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
@ -884,14 +880,12 @@ generate_delta_lowlatency (OstreeRepo *repo,
g_autoptr(GVariant) to_commit = NULL;
g_autoptr(GHashTable) to_reachable_objects = NULL;
g_autoptr(GHashTable) from_reachable_objects = NULL;
g_autoptr(GHashTable) from_regfile_content = NULL;
g_autoptr(GHashTable) new_reachable_metadata = NULL;
g_autoptr(GHashTable) new_reachable_regfile_content = NULL;
g_autoptr(GHashTable) new_reachable_symlink_content = NULL;
g_autoptr(GHashTable) modified_regfile_content = NULL;
g_autoptr(GHashTable) rollsum_optimized_content_objects = NULL;
g_autoptr(GHashTable) bsdiff_optimized_content_objects = NULL;
g_autoptr(GHashTable) content_object_to_size = NULL;
if (from != NULL)
{
@ -1273,7 +1267,6 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
const char *opt_filename;
g_autofree char *descriptor_name = NULL;
glnx_fd_close int descriptor_dfd = -1;
g_autoptr(GVariant) tmp_metadata = NULL;
g_autoptr(GVariant) fallback_headers = NULL;
g_autoptr(GVariant) detached = NULL;
gboolean inline_parts;
@ -1387,7 +1380,6 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
GBytes *payload_b;
GBytes *operations_b;
g_autofree guchar *part_checksum = NULL;
g_autoptr(GChecksum) checksum = NULL;
g_autoptr(GBytes) objtype_checksum_array = NULL;
g_autoptr(GBytes) checksum_bytes = NULL;
g_autoptr(GOutputStream) part_temp_outstream = NULL;

View File

@ -356,7 +356,6 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self,
char checksum[OSTREE_SHA256_STRING_LEN+1];
gboolean have_all;
g_autoptr(GInputStream) part_in = NULL;
g_autoptr(GBytes) delta_data = NULL;
g_autoptr(GVariant) inline_part_data = NULL;
g_autoptr(GVariant) header = NULL;
g_autoptr(GVariant) csum_v = NULL;
@ -864,7 +863,6 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
g_autofree char *from = NULL;
g_autofree char *to = NULL;
g_autofree char *superblock_path = NULL;
glnx_fd_close int superblock_fd = -1;
g_autoptr(GVariant) delta_superblock = NULL;
guint64 total_size = 0, total_usize = 0;
guint64 total_fallback_size = 0, total_fallback_usize = 0;

View File

@ -188,7 +188,6 @@ _ostree_static_delta_part_execute (OstreeRepo *repo,
{
gboolean ret = FALSE;
guint8 *checksums_data;
g_autoptr(GVariant) checksums = NULL;
g_autoptr(GVariant) mode_dict = NULL;
g_autoptr(GVariant) xattr_dict = NULL;
g_autoptr(GVariant) payload = NULL;
@ -471,7 +470,6 @@ dispatch_bspatch (OstreeRepo *repo,
{
gboolean ret = FALSE;
guint64 offset, length;
g_autoptr(GInputStream) in_stream = NULL;
g_autoptr(GMappedFile) input_mfile = NULL;
g_autofree guchar *buf = NULL;
struct bspatch_stream stream;

View File

@ -4687,7 +4687,6 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
guint i;
g_autoptr(GPtrArray) delta_names = NULL;
g_auto(GVariantDict) deltas_builder = {{0,}};
g_autoptr(GVariant) deltas = NULL;
if (!ostree_repo_list_static_delta_names (self, &delta_names, cancellable, error))
goto out;
@ -4890,7 +4889,6 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
{
g_autofree char *tmpdir_name_template = g_strconcat (tmpdir_prefix, "XXXXXX", NULL);
glnx_fd_close int new_tmpdir_fd = -1;
g_autoptr(GError) local_error = NULL;
/* No existing tmpdir found, create a new */

View File

@ -534,7 +534,6 @@ checkout_deployment_tree (OstreeSysroot *sysroot,
const char *csum = ostree_deployment_get_csum (deployment);
g_autofree char *checkout_target_name = NULL;
g_autofree char *osdeploy_path = NULL;
g_autoptr(GFile) ret_deploy_target_path = NULL;
glnx_fd_close int osdeploy_dfd = -1;
int ret_fd;
@ -1199,7 +1198,6 @@ swap_bootlinks (OstreeSysroot *self,
gboolean ret = FALSE;
int old_subbootversion, new_subbootversion;
glnx_fd_close int ostree_dfd = -1;
glnx_fd_close int ostree_subbootdir_dfd = -1;
g_autofree char *ostree_bootdir_name = NULL;
g_autofree char *ostree_subbootdir_name = NULL;

View File

@ -530,7 +530,6 @@ ostree_sysroot_upgrader_pull_one_dir (OstreeSysrootUpgrader *self,
glnx_unref_object OstreeRepo *repo = NULL;
char *refs_to_fetch[] = { NULL, NULL };
const char *from_revision = NULL;
g_autofree char *new_revision = NULL;
g_autofree char *origin_refspec = NULL;
if (self->override_csum != NULL)

View File

@ -689,7 +689,6 @@ parse_deployment (OstreeSysroot *self,
glnx_fd_close int deployment_dfd = -1;
const char *deploy_basename;
g_autofree char *treebootserial_target = NULL;
g_autofree char *deploy_dir = NULL;
GKeyFile *origin = NULL;
g_autofree char *unlocked_development_path = NULL;
struct stat stbuf;

View File

@ -73,9 +73,6 @@ ot_gpgme_ctx_tmp_home_dir (gpgme_ctx_t gpgme_ctx,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GFile) pubring_file = NULL;
g_autoptr(GOutputStream) target_stream = NULL;
g_autofree char *pubring_path = NULL;
g_autofree char *tmp_home_dir = NULL;
gpgme_error_t gpg_error;
gboolean ret = FALSE;

View File

@ -58,7 +58,6 @@ 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;
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;

View File

@ -120,7 +120,6 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
{ GKeyFile *old_origin = ostree_deployment_get_origin (target_deployment);
g_autofree char *origin_refspec = g_key_file_get_string (old_origin, "origin", "refspec", NULL);
g_autofree char *new_refspec = NULL;
g_autofree char *origin_remote = NULL;
g_autofree char *origin_ref = NULL;
@ -129,7 +128,6 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
{ g_autofree char *new_refspec = g_strconcat (remotename, ":", branch ? branch : origin_ref, NULL);
g_autoptr(GKeyFile) new_origin = NULL;
g_autoptr(GFile) origin_path = NULL;
new_origin = ostree_sysroot_origin_new_from_refspec (sysroot, new_refspec);

View File

@ -53,11 +53,6 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro
g_autofree char *new_remote = NULL;
g_autofree char *new_ref = NULL;
g_autofree char *new_refspec = NULL;
g_autofree char *new_revision = NULL;
g_autoptr(GFile) deployment_path = NULL;
g_autoptr(GFile) deployment_origin_path = NULL;
glnx_unref_object OstreeDeployment *merge_deployment = NULL;
glnx_unref_object OstreeDeployment *new_deployment = NULL;
glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
gboolean changed;

View File

@ -41,7 +41,6 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr
const char *deploy_index_str;
int deploy_index;
g_autoptr(GPtrArray) current_deployments = NULL;
glnx_unref_object OstreeDeployment *booted_deployment = NULL;
glnx_unref_object OstreeDeployment *target_deployment = NULL;
context = g_option_context_new ("INDEX - Delete deployment INDEX");

View File

@ -44,9 +44,6 @@ ot_admin_builtin_unlock (int argc, char **argv, GCancellable *cancellable, GErro
gboolean ret = FALSE;
GOptionContext *context;
glnx_unref_object OstreeSysroot *sysroot = NULL;
glnx_unref_object OstreeRepo *repo = NULL;
g_autoptr(GPtrArray) new_deployments = NULL;
glnx_unref_object OstreeDeployment *merge_deployment = NULL;
OstreeDeployment *booted_deployment = NULL;
OstreeDeploymentUnlockedState target_state;

View File

@ -52,8 +52,6 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr
GOptionContext *context;
glnx_unref_object OstreeSysroot *sysroot = NULL;
glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL;
g_autoptr(GFile) deployment_path = NULL;
g_autoptr(GFile) deployment_origin_path = NULL;
g_autoptr(GKeyFile) origin = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
gboolean changed;

View File

@ -38,12 +38,8 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
{
gboolean ret = FALSE;
guint bootversion;
g_autoptr(GFile) subpath = NULL;
glnx_unref_object OstreeSePolicy *sepolicy = NULL;
g_autoptr(GPtrArray) deployments = NULL;
GOptionContext *context = NULL;
glnx_unref_object OstreeSysroot *sysroot = NULL;
g_autoptr(GFile) deployment_path = NULL;
context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries");

View File

@ -60,7 +60,6 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
g_autofree char *src_repo_uri = NULL;
glnx_unref_object OstreeAsyncProgress *progress = NULL;
g_autoptr(GPtrArray) refs_to_fetch = NULL;
g_autoptr(GHashTable) source_objects = NULL;
OstreeRepoPullFlags pullflags = 0;
context = g_option_context_new ("SRC_REPO [REFS...] - Copy data from SRC_REPO");

View File

@ -399,7 +399,6 @@ ostree_builtin_static_delta (int argc, char **argv, GCancellable *cancellable, G
gboolean ret = FALSE;
OstreeCommand *command = NULL;
const char *cmdname = NULL;
glnx_unref_object OstreeRepo *repo = NULL;
int i;
gboolean want_help = FALSE;

View File

@ -49,8 +49,6 @@ ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError
const char *remote_name;
const char *remote_url;
char **iter;
g_autofree char *target_name = NULL;
g_autoptr(GFile) target_conf = NULL;
g_autoptr(GVariantBuilder) optbuilder = NULL;
gboolean ret = FALSE;

View File

@ -110,7 +110,6 @@ test_ensure_dir (void)
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *dirname = "foo";
const char *filename = "bar";
@ -129,8 +128,6 @@ static void
test_replace_file (void)
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
g_autoptr(GPtrArray) split_path = NULL;
GError *error = NULL;
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";