[gnome-software/gnome-40: 1/2] snap: Fix warnings using const variables




commit c7abd0cbcd5830f53101251fa16c3cff7e12bfb0
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri May 21 14:33:03 2021 +1200

    snap: Fix warnings using const variables

 plugins/snap/gs-plugin-snap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 532e8348f..d7c223c8c 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -83,7 +83,7 @@ get_auth_data (GsPlugin *plugin)
 
                discharge_array = json_object_get_array_member (object, "discharges");
                for (guint i = 0; i < json_array_get_length (discharge_array); i++)
-                       g_ptr_array_add (discharges, json_array_get_string_element (discharge_array, i));
+                       g_ptr_array_add (discharges, (gpointer) json_array_get_string_element 
(discharge_array, i));
        }
        g_ptr_array_add (discharges, NULL);
 
@@ -1318,7 +1318,7 @@ gs_plugin_update (GsPlugin *plugin,
        for (guint i = 0; i < gs_app_list_length (list); i++) {
                /* Get the name of the snap to refresh */
                GsApp *app = gs_app_list_index (list, i);
-               gchar *name = gs_app_get_metadata_item (app, "snap::name");
+               const gchar *name = gs_app_get_metadata_item (app, "snap::name");
 
                /* Refresh the snap */
                gs_app_set_state (app, GS_APP_STATE_INSTALLING);


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