[gnome-software] trivial: Remove a large number of unused variables



commit 559b9336a6c14df18f357f3eb478758232fb5524
Author: Kalev Lember <klember redhat com>
Date:   Thu Feb 28 14:44:44 2019 +0100

    trivial: Remove a large number of unused variables
    
    These were all detected by clang.

 plugins/core/gs-appstream.c                           | 4 ----
 plugins/core/gs-plugin-appstream.c                    | 1 -
 plugins/core/gs-plugin-key-colors.c                   | 1 -
 plugins/core/gs-self-test.c                           | 1 -
 plugins/dummy/gs-self-test.c                          | 2 --
 plugins/flatpak/gs-flatpak.c                          | 5 -----
 plugins/flatpak/gs-plugin-flatpak.c                   | 2 --
 plugins/flatpak/gs-self-test.c                        | 1 -
 plugins/modalias/gs-self-test.c                       | 1 -
 plugins/packagekit/gs-plugin-packagekit-offline.c     | 1 -
 plugins/packagekit/packagekit-common.c                | 1 -
 plugins/shell-extensions/gs-plugin-shell-extensions.c | 2 --
 src/gs-css.c                                          | 1 -
 src/gs-details-page.c                                 | 1 -
 src/gs-editor.c                                       | 1 -
 src/gs-feature-tile.c                                 | 1 -
 src/gs-shell.c                                        | 2 --
 src/gs-updates-page.c                                 | 2 --
 src/gs-updates-section.c                              | 3 ---
 19 files changed, 33 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index d0768ef7..f1b666f6 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -641,7 +641,6 @@ gs_appstream_refine_app (GsPlugin *plugin,
                         GError **error)
 {
        const gchar *tmp;
-       g_autoptr(GError) error_local = NULL;
        g_autoptr(GPtrArray) bundles = NULL;
        g_autoptr(GPtrArray) launchables = NULL;
        g_autoptr(XbNode) req = NULL;
@@ -1169,9 +1168,6 @@ gs_appstream_add_categories (GsPlugin *plugin,
        for (guint j = 0; j < list->len; j++) {
                GsCategory *parent = GS_CATEGORY (g_ptr_array_index (list, j));
                GPtrArray *children = gs_category_get_children (parent);
-               g_autofree gchar *xpath = NULL;
-               g_autoptr(GError) error_local = NULL;
-               g_autoptr(GPtrArray) array = NULL;
 
                for (guint i = 1; i < children->len; i++) { /* 1 to ignore all */
                        GsCategory *cat = g_ptr_array_index (children, i);
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index b035d080..c4c672da 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -309,7 +309,6 @@ gs_plugin_appstream_load_appstream_fn (GsPlugin *plugin,
                                       GCancellable *cancellable,
                                       GError **error)
 {
-       g_autoptr(GError) error_local = NULL;
        g_autoptr(GFile) file = g_file_new_for_path (filename);
        g_autoptr(XbBuilderNode) info = NULL;
        g_autoptr(XbBuilderFixup) fixup1 = NULL;
diff --git a/plugins/core/gs-plugin-key-colors.c b/plugins/core/gs-plugin-key-colors.c
index 781c0f4d..feedfb1d 100644
--- a/plugins/core/gs-plugin-key-colors.c
+++ b/plugins/core/gs-plugin-key-colors.c
@@ -63,7 +63,6 @@ gs_plugin_key_colors_set_for_pixbuf (GsApp *app, GdkPixbuf *pb, guint number)
        guint bin_size = 200;
        guint i;
        guint number_of_bins;
-       g_autoptr(AsImage) im = NULL;
 
        /* go through each pixel */
        n_channels = gdk_pixbuf_get_n_channels (pb);
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index 95152b70..02a5a98c 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -18,7 +18,6 @@ static void
 gs_plugins_core_search_repo_name_func (GsPluginLoader *plugin_loader)
 {
        GsApp *app;
-       g_autofree gchar *menu_path = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsApp) app_tmp = NULL;
        g_autoptr(GsAppList) list = NULL;
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index 8ecd09a8..3f6b9c8e 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -408,7 +408,6 @@ static void
 gs_plugins_dummy_search_func (GsPluginLoader *plugin_loader)
 {
        GsApp *app;
-       g_autofree gchar *menu_path = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
@@ -598,7 +597,6 @@ gs_plugins_dummy_purchase_func (GsPluginLoader *plugin_loader)
        gboolean ret;
        g_autoptr(GsApp) app = NULL;
        g_autoptr(GError) error = NULL;
-       g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
 
        /* get the updates list */
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 7b7c67ea..cad8ea87 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1570,7 +1570,6 @@ gs_plugin_refine_item_origin (GsFlatpak *self,
                              GError **error)
 {
        g_autofree gchar *ref_display = NULL;
-       g_autoptr(GError) local_error = NULL;
        g_autoptr(GPtrArray) xremotes = NULL;
 
        /* already set */
@@ -1660,7 +1659,6 @@ gs_flatpak_refine_app_state (GsFlatpak *self,
                              GCancellable *cancellable,
                              GError **error)
 {
-       g_autoptr(GPtrArray) xrefs = NULL;
        g_autoptr(FlatpakInstalledRef) ref = NULL;
        g_autoptr(GError) error_local = NULL;
 
@@ -1785,7 +1783,6 @@ gs_flatpak_set_app_metadata (GsFlatpak *self,
        gboolean secure = TRUE;
        g_autofree gchar *name = NULL;
        g_autofree gchar *runtime = NULL;
-       g_autofree gchar *source = NULL;
        g_autoptr(GKeyFile) kf = NULL;
        g_autoptr(GsApp) app_runtime = NULL;
        g_auto(GStrv) shared = NULL;
@@ -2318,7 +2315,6 @@ gs_flatpak_file_to_app_bundle (GsFlatpak *self,
                               GError **error)
 {
        gint size;
-       g_autofree gchar *content_type = NULL;
        g_autoptr(GBytes) appstream_gz = NULL;
        g_autoptr(GBytes) icon_data = NULL;
        g_autoptr(GBytes) metadata = NULL;
@@ -2356,7 +2352,6 @@ gs_flatpak_file_to_app_bundle (GsFlatpak *self,
        if (appstream_gz != NULL) {
                g_autofree gchar *xpath = NULL;
                g_autoptr(GBytes) appstream = NULL;
-               g_autoptr(GError) error_local = NULL;
                g_autoptr(GInputStream) stream_data = NULL;
                g_autoptr(GInputStream) stream_gz = NULL;
                g_autoptr(GZlibDecompressor) decompressor = NULL;
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index 11f1cf20..bf303732 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -620,7 +620,6 @@ gs_plugin_app_install (GsPlugin *plugin,
                }
                if (!flatpak_transaction_add_install_bundle (transaction, file,
                                                             NULL, error)) {
-                       g_autofree gchar *fn = g_file_get_path (file);
                        gs_flatpak_error_convert (error);
                        return FALSE;
                }
@@ -839,7 +838,6 @@ gs_plugin_flatpak_file_to_app_ref (GsPlugin *plugin,
        g_autofree gchar *ref = NULL;
        g_autoptr(GsApp) app = NULL;
        g_autoptr(GsApp) app_tmp = NULL;
-       g_autoptr(GsAppList) list_tmp = NULL;
        g_autoptr(GsFlatpak) flatpak_tmp = NULL;
 
        /* only use the temporary GsFlatpak to avoid the auth dialog */
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 6a529a3c..aafd02c6 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1020,7 +1020,6 @@ gs_plugins_flatpak_ref_func (GsPluginLoader *plugin_loader)
        g_autoptr(GsAppList) search2 = NULL;
        g_autoptr(GsAppList) sources = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
-       g_autoptr(GString) str = g_string_new (NULL);
 
        /* drop all caches */
        g_unlink ("/var/tmp/self-test/flatpak-user/components.xmlb");
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index 6cd2dc81..c1297b6f 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -15,7 +15,6 @@ static void
 gs_plugins_modalias_func (GsPluginLoader *plugin_loader)
 {
        GsApp *app;
-       g_autofree gchar *menu_path = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
diff --git a/plugins/packagekit/gs-plugin-packagekit-offline.c 
b/plugins/packagekit/gs-plugin-packagekit-offline.c
index dc93c7a0..b2b019be 100644
--- a/plugins/packagekit/gs-plugin-packagekit-offline.c
+++ b/plugins/packagekit/gs-plugin-packagekit-offline.c
@@ -157,7 +157,6 @@ gs_plugin_add_updates_historical (GsPlugin *plugin,
        for (i = 0; i < package_array->len; i++) {
                PkPackage *pkg = g_ptr_array_index (package_array, i);
                const gchar *package_id;
-               g_autofree gchar *tmp = NULL;
                g_autoptr(GsApp) app = NULL;
                g_auto(GStrv) split = NULL;
 
diff --git a/plugins/packagekit/packagekit-common.c b/plugins/packagekit/packagekit-common.c
index d0b056e0..074b8d21 100644
--- a/plugins/packagekit/packagekit-common.c
+++ b/plugins/packagekit/packagekit-common.c
@@ -431,7 +431,6 @@ gs_plugin_packagekit_refine_details_app (GsPlugin *plugin,
        for (j = 0; j < source_ids->len; j++) {
                package_id = g_ptr_array_index (source_ids, j);
                for (i = 0; i < array->len; i++) {
-                       g_autofree gchar *desc = NULL;
                        /* right package? */
                        details = g_ptr_array_index (array, i);
                        if (!gs_pk_compare_ids (package_id,
diff --git a/plugins/shell-extensions/gs-plugin-shell-extensions.c 
b/plugins/shell-extensions/gs-plugin-shell-extensions.c
index d427ca73..61a3272f 100644
--- a/plugins/shell-extensions/gs-plugin-shell-extensions.c
+++ b/plugins/shell-extensions/gs-plugin-shell-extensions.c
@@ -524,7 +524,6 @@ gs_plugin_shell_extensions_parse_version (GsPlugin *plugin,
        JsonObject *json_ver = NULL;
        gint64 version;
        g_autofree gchar *shell_version = NULL;
-       g_autoptr(XbBuilderNode) release = NULL;
 
        /* look for version, major.minor.micro */
        if (json_object_has_member (ver_map, priv->shell_version)) {
@@ -666,7 +665,6 @@ gs_plugin_appstream_load_json_cb (XbBuilderSource *self,
        JsonObject *json_item;
        gchar *xml;
        g_autofree gchar *fn = g_file_get_path (file);
-       g_autoptr(AsApp) app = as_app_new ();
        g_autoptr(JsonParser) json_parser = NULL;
        g_autoptr(XbBuilderNode) apps = NULL;
 
diff --git a/src/gs-css.c b/src/gs-css.c
index f89fc085..740d2b77 100644
--- a/src/gs-css.c
+++ b/src/gs-css.c
@@ -53,7 +53,6 @@ _cleanup_string (GString *str)
 gboolean
 gs_css_parse (GsCss *self, const gchar *markup, GError **error)
 {
-       g_autoptr(GHashTable) results = NULL;
        g_auto(GStrv) parts = NULL;
 
        /* no data */
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index d0ca6c7e..3b0490b0 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1047,7 +1047,6 @@ gs_details_page_refresh_all (GsDetailsPage *self)
        guint64 user_integration_bf;
        gboolean show_support_box = FALSE;
        g_autofree gchar *origin = NULL;
-       g_autoptr(GError) error = NULL;
 
        /* change widgets */
        tmp = gs_app_get_name (self->app);
diff --git a/src/gs-editor.c b/src/gs-editor.c
index 51162aff..9bd06294 100644
--- a/src/gs-editor.c
+++ b/src/gs-editor.c
@@ -923,7 +923,6 @@ gs_editor_button_new_feature_clicked_cb (GtkApplication *application, GsEditor *
 static void
 gs_editor_button_new_os_upgrade_clicked_cb (GtkApplication *application, GsEditor *self)
 {
-       g_autofree gchar *id = NULL;
        g_autoptr(AsApp) item = as_app_new ();
        const gchar *css = "border: 1px solid #808080;\nbackground: #fffeee;\ncolor: #000;";
 
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index 43af11cd..b398946b 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -97,7 +97,6 @@ static void
 gs_feature_tile_set_app (GsAppTile *app_tile, GsApp *app)
 {
        GsFeatureTile *tile = GS_FEATURE_TILE (app_tile);
-       g_autoptr(GString) data = NULL;
 
        g_return_if_fail (GS_IS_APP (app) || app == NULL);
 
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 2f9902d0..a23409e7 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -663,7 +663,6 @@ signout_activated_cb (GSimpleAction *action, GVariant *parameter, GsShell *shell
 {
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
        const gchar *action_name, *auth_id;
-       g_autoptr(GsPluginJob) plugin_job = NULL;
        GsAuth *auth;
 
        action_name = g_action_get_name (G_ACTION (action));
@@ -1134,7 +1133,6 @@ gs_shell_show_event_install (GsShell *shell, GsPluginEvent *event)
        GsShellEventButtons buttons = GS_SHELL_EVENT_BUTTON_NONE;
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
        const GError *error = gs_plugin_event_get_error (event);
-       g_autofree gchar *msg = NULL;
        g_autofree gchar *str_app = NULL;
        g_autofree gchar *str_origin = NULL;
        g_autoptr(GString) str = g_string_new (NULL);
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 6a8715f4..e4e5e438 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -958,7 +958,6 @@ upgrade_download_finished_cb (GObject *source,
 {
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
        g_autoptr(GError) error = NULL;
-       g_autoptr(GsPageHelper) helper = (GsPageHelper *) user_data;
 
        if (!gs_plugin_loader_job_action_finish (plugin_loader, res, &error)) {
                if (g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED))
@@ -1165,7 +1164,6 @@ gs_updates_page_upgrade_help_cb (GsUpgradeBanner *upgrade_banner,
 {
        GsApp *app;
        const gchar *uri;
-       g_autoptr(GError) error = NULL;
 
        app = gs_upgrade_banner_get_app (upgrade_banner);
        if (app == NULL) {
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index b0448235..384b5ae2 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -209,7 +209,6 @@ _reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
 {
        GsUpdatesSection *self = GS_UPDATES_SECTION (user_data);
        g_autoptr(GError) error = NULL;
-       g_autoptr(GsAppList) apps = NULL;
        GsApp *app = NULL;
        g_autoptr(GsPluginJob) plugin_job = NULL;
        g_autoptr(GVariant) retval = NULL;
@@ -362,7 +361,6 @@ _download_finished_cb (GObject *object, GAsyncResult *res, gpointer user_data)
 static void
 _button_download_clicked_cb (GtkButton *button, GsUpdatesSection *self)
 {
-       g_autoptr(GError) error = NULL;
        g_autoptr(GCancellable) cancellable = g_cancellable_new ();
        g_autoptr(GsPluginJob) plugin_job = NULL;
 
@@ -382,7 +380,6 @@ _button_download_clicked_cb (GtkButton *button, GsUpdatesSection *self)
 static void
 _button_update_all_clicked_cb (GtkButton *button, GsUpdatesSection *self)
 {
-       g_autoptr(GError) error = NULL;
        g_autoptr(GCancellable) cancellable = g_cancellable_new ();
        g_autoptr(GsPluginJob) plugin_job = NULL;
        GsUpdatesSectionUpdateHelper *helper = g_new0 (GsUpdatesSectionUpdateHelper, 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]