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 authored and Atomic Bot committed 2016-10-27 17:02:01 +00:00
1 parent 82a4f56593
commit b77edf24a3
24 files changed
-65

No files matched your search

-3
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;
-1
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;
-5
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)
-2
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 ();
-8
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;
@@ -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;
@@ -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;
@@ -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;
-2
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 */
-2
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;
-1
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)
-1
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;