Fix all clang warnings

tingping/wmclass
Alexander Larsson 2016-12-13 10:20:28 +01:00
parent c756534b19
commit 1e854ddc11
9 changed files with 9 additions and 35 deletions

View File

@ -211,7 +211,6 @@ flatpak_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE
if (opt_writable_sdk)
{
g_autofree char *full_sdk_ref = g_strconcat ("runtime/", sdk_ref, NULL);
g_autoptr(GError) my_error = NULL;
g_autoptr(GFile) sdk_deploy_files = NULL;
g_autoptr(FlatpakDeploy) sdk_deploy = NULL;
@ -258,7 +257,6 @@ flatpak_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE
{
const char *base_branch;
g_autofree char *base_ref = NULL;
g_autoptr(GError) my_error = NULL;
g_autoptr(GFile) base_deploy_files = NULL;
g_autoptr(FlatpakDeploy) base_deploy = NULL;

View File

@ -150,7 +150,6 @@ static gboolean
handle_runtime_repo_deps (FlatpakDir *dir, GBytes *data, GError **error)
{
g_autoptr(GKeyFile) keyfile = g_key_file_new ();
g_autoptr(GKeyFile) dep_keyfile = g_key_file_new ();
g_autofree char *dep_url = NULL;
g_autoptr(GBytes) dep_data = NULL;
g_autofree char *runtime_url = NULL;
@ -251,11 +250,9 @@ install_from (FlatpakDir *dir,
const char *filename;
g_autofree char *remote = NULL;
g_autofree char *ref = NULL;
g_auto(GStrv) parts = NULL;
const char *slash;
FlatpakDir *clone;
g_autoptr(FlatpakTransaction) transaction = NULL;
g_autoptr(GBytes) bytes = NULL;
if (argc < 2)
return usage_error (context, _("Filename or uri must be specified"), error);
@ -366,8 +363,6 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
g_autofree char *default_branch = NULL;
FlatpakKinds kinds;
g_autoptr(FlatpakTransaction) transaction = NULL;
g_autoptr(GPtrArray) refs = NULL;
g_autoptr(GHashTable) refs_hash = NULL;
context = g_option_context_new (_("REMOTE REF... - Install applications or runtimes"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@ -413,7 +408,6 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
g_autofree char *branch = NULL;
FlatpakKinds kind;
g_autofree char *ref = NULL;
g_autofree char *runtime_ref = NULL;
if (!flatpak_split_partial_ref_arg (pref, kinds, opt_arch, target_branch,
&matched_kinds, &id, &arch, &branch, error))

View File

@ -134,7 +134,6 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
for (i = 0; i < related->len; i++)
{
FlatpakRelated *rel = g_ptr_array_index (related, i);
g_autoptr(GError) local_error = NULL;
g_autoptr(GVariant) deploy_data = NULL;
if (!rel->delete)
@ -171,8 +170,6 @@ flatpak_complete_uninstall (FlatpakCompletion *completion)
{
g_autoptr(GOptionContext) context = NULL;
g_autoptr(FlatpakDir) dir = NULL;
g_autoptr(GError) error = NULL;
g_auto(GStrv) refs = NULL;
FlatpakKinds kinds;
context = g_option_context_new ("");

View File

@ -242,8 +242,6 @@ flatpak_complete_update (FlatpakCompletion *completion)
{
g_autoptr(GOptionContext) context = NULL;
g_autoptr(FlatpakDir) dir = NULL;
g_autoptr(GError) error = NULL;
g_auto(GStrv) refs = NULL;
FlatpakKinds kinds;
context = g_option_context_new ("");

View File

@ -545,7 +545,6 @@ flatpak_transaction_run (FlatpakTransaction *self,
FlatpakTransactionOp *op = l->data;
g_autoptr(GError) local_error = NULL;
gboolean res;
g_autofree char *subpaths_str = subpaths_to_string ((const char **)op->subpaths);
const char *pref;
const char *opname;

View File

@ -915,8 +915,11 @@ flatpak_dir_recreate_repo (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
g_autoptr(OstreeRepo) old_repo = g_steal_pointer (&self->repo);
return flatpak_dir_ensure_repo (self, cancellable, error);
gboolean res;
OstreeRepo *old_repo = g_steal_pointer (&self->repo);
res = flatpak_dir_ensure_repo (self, cancellable, error);
g_clear_object (&old_repo);
return res;
}
gboolean
@ -1395,7 +1398,6 @@ flatpak_dir_pull_extra_data (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GFile) root = NULL;
g_autoptr(GVariant) extra_data_sources = NULL;
g_autoptr(GVariant) detached_metadata = NULL;
g_auto(GVariantDict) new_metadata_dict = FLATPAK_VARIANT_DICT_INITIALIZER;
@ -2292,7 +2294,6 @@ flatpak_dir_read_latest (FlatpakDir *self,
{
g_autoptr(GVariant) commit_data = NULL;
g_autoptr(GVariant) commit_metadata = NULL;
g_autofree char *tmp_dir_path = NULL;
if (!ostree_repo_load_commit (self->repo, res, &commit_data, NULL, error))
return FALSE;
@ -3054,7 +3055,6 @@ extract_extra_data (FlatpakDir *self,
const guchar *extra_data_sha256_bytes;
const char *extra_data_source_name = NULL;
guint64 download_size;
g_autoptr(GBytes) bytes = NULL;
gboolean found;
int j;
@ -5925,7 +5925,6 @@ flatpak_dir_parse_repofile (FlatpakDir *self,
GError **error)
{
g_autoptr(GKeyFile) keyfile = g_key_file_new ();
g_autofree char *remote = NULL;
g_autoptr(GError) local_error = NULL;
g_autoptr(GBytes) gpg_data = NULL;
g_autofree char *uri = NULL;

View File

@ -35,9 +35,6 @@
GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_write_archive, archive_write_free)
#define free_write_archive __attribute__((cleanup (flatpak_local_free_write_archive)))
GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_read_archive, archive_read_free)
#define free_read_archive __attribute__((cleanup (flatpak_local_free_read_archive)))
static void flatpak_oci_registry_initable_iface_init (GInitableIface *iface);
struct FlatpakOciRegistry
@ -612,13 +609,7 @@ flatpak_oci_registry_download_blob (FlatpakOciRegistry *self,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GTask) task = NULL;
g_autofree char *subpath = NULL;
g_autoptr(SoupURI) uri = NULL;
g_autoptr(GPtrArray) mirrorlist = g_ptr_array_new ();
g_autoptr(SoupRequest) req = NULL;
g_autoptr(GInputStream) input = NULL;
g_autoptr(GOutputStream) out = NULL;
glnx_fd_close int fd = -1;
g_assert (self->valid);
@ -641,7 +632,6 @@ flatpak_oci_registry_download_blob (FlatpakOciRegistry *self,
}
else
{
g_autofree char *tmpfile_path = NULL;
g_autoptr(SoupURI) uri = NULL;
g_autofree char *uri_s = NULL;
g_autofree char *checksum = NULL;

View File

@ -2216,7 +2216,7 @@ path_is_visible (const char **keys,
for (i = 0; i < n_keys; i++)
{
const char *mounted_path = keys[i];
FlatpakFilesystemMode mode;
guint mode;
mode = GPOINTER_TO_INT (g_hash_table_lookup (hash_table, mounted_path));
if (flatpak_has_path_prefix (path, mounted_path))
@ -2244,7 +2244,7 @@ add_file_args (GPtrArray *argv_array,
for (i = 0; i < n_keys; i++)
{
const char *path = keys[i];
FlatpakFilesystemMode mode;
guint mode;
mode = GPOINTER_TO_INT (g_hash_table_lookup (hash_table, path));
@ -2278,7 +2278,7 @@ static void
add_hide_path (GHashTable *hash_table,
const char *path)
{
FlatpakFilesystemMode old_mode;
guint old_mode;
old_mode = GPOINTER_TO_INT (g_hash_table_lookup (hash_table, path));
g_hash_table_insert (hash_table, g_strdup (path),
@ -2300,7 +2300,7 @@ add_expose_path (GHashTable *hash_table,
S_ISLNK (st.st_mode) ||
S_ISSOCK (st.st_mode))
{
FlatpakFilesystemMode old_mode;
guint old_mode;
old_mode = GPOINTER_TO_INT (g_hash_table_lookup (hash_table, path));

View File

@ -4022,7 +4022,6 @@ flatpak_pull_from_oci (OstreeRepo *repo,
g_autoptr(OstreeMutableTree) archive_mtree = NULL;
g_autoptr(GFile) archive_root = NULL;
g_autofree char *commit_checksum = NULL;
g_autofree char *dir_uri = NULL;
const char *parent = NULL;
g_autofree char *subject = NULL;
g_autofree char *body = NULL;