[gnome-software: 9/14] plugins: Fix various string array casts for setup()




commit d8a8b150ab5114e2ccce18eca5dec79591207482
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Mar 1 14:36:15 2022 +0000

    plugins: Fix various string array casts for setup()
    
    The new API is more const-correct, but causes cast warnings with some of
    the older types passed into it.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 lib/gs-cmd.c                            | 4 ++--
 plugins/core/gs-self-test.c             | 2 +-
 plugins/dpkg/gs-self-test.c             | 4 ++--
 plugins/dummy/gs-self-test.c            | 2 +-
 plugins/fedora-langpacks/gs-self-test.c | 4 ++--
 plugins/flatpak/gs-self-test.c          | 2 +-
 plugins/fwupd/gs-self-test.c            | 4 ++--
 plugins/modalias/gs-self-test.c         | 4 ++--
 plugins/packagekit/gs-self-test.c       | 4 ++--
 plugins/repos/gs-self-test.c            | 4 ++--
 plugins/snap/gs-self-test.c             | 4 ++--
 11 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 707eefb7f..5df895e1c 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -363,8 +363,8 @@ main (int argc, char **argv)
        if (plugin_blocklist_str != NULL)
                plugin_blocklist = g_strsplit (plugin_blocklist_str, ",", -1);
        ret = gs_plugin_loader_setup (self->plugin_loader,
-                                     plugin_allowlist,
-                                     plugin_blocklist,
+                                     (const gchar * const *) plugin_allowlist,
+                                     (const gchar * const *) plugin_blocklist,
                                      NULL,
                                      &error);
        if (!ret) {
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index b6be1699d..a786e58bb 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -245,7 +245,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/dpkg/gs-self-test.c b/plugins/dpkg/gs-self-test.c
index 0c09b3048..0318e70eb 100644
--- a/plugins/dpkg/gs-self-test.c
+++ b/plugins/dpkg/gs-self-test.c
@@ -55,7 +55,7 @@ main (int argc, char **argv)
        gboolean ret;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "dpkg",
                NULL
        };
@@ -71,7 +71,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index 226965815..4efc28076 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -824,7 +824,7 @@ main (int argc, char **argv)
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR_CORE);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/fedora-langpacks/gs-self-test.c b/plugins/fedora-langpacks/gs-self-test.c
index f9268758b..4e95fa867 100644
--- a/plugins/fedora-langpacks/gs-self-test.c
+++ b/plugins/fedora-langpacks/gs-self-test.c
@@ -62,7 +62,7 @@ main (int argc, char **argv)
        gboolean ret;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "fedora-langpacks",
                NULL
        };
@@ -73,7 +73,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 7d792bfda..493ab0f05 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1938,7 +1938,7 @@ main (int argc, char **argv)
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR_CORE);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/fwupd/gs-self-test.c b/plugins/fwupd/gs-self-test.c
index b965c4d68..34e6ecbcf 100644
--- a/plugins/fwupd/gs-self-test.c
+++ b/plugins/fwupd/gs-self-test.c
@@ -74,7 +74,7 @@ main (int argc, char **argv)
        gboolean ret;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "fwupd",
                NULL
        };
@@ -90,7 +90,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index bf9e7cd96..e7730f77b 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -48,7 +48,7 @@ main (int argc, char **argv)
        g_autofree gchar *xml = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "appstream",
                "dummy",
                "modalias",
@@ -87,7 +87,7 @@ main (int argc, char **argv)
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR_CORE);
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR_DUMMY);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/packagekit/gs-self-test.c b/plugins/packagekit/gs-self-test.c
index 5bea5d0d8..f6a48096f 100644
--- a/plugins/packagekit/gs-self-test.c
+++ b/plugins/packagekit/gs-self-test.c
@@ -239,7 +239,7 @@ main (int argc, char **argv)
        gboolean ret;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "packagekit",
                NULL
        };
@@ -257,7 +257,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/repos/gs-self-test.c b/plugins/repos/gs-self-test.c
index c7b44bbe1..f72241547 100644
--- a/plugins/repos/gs-self-test.c
+++ b/plugins/repos/gs-self-test.c
@@ -39,7 +39,7 @@ main (int argc, char **argv)
        g_autofree gchar *reposdir = NULL;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "repos",
                NULL
        };
@@ -55,7 +55,7 @@ main (int argc, char **argv)
        plugin_loader = gs_plugin_loader_new ();
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);
diff --git a/plugins/snap/gs-self-test.c b/plugins/snap/gs-self-test.c
index 061b57b98..fdafa2c26 100644
--- a/plugins/snap/gs-self-test.c
+++ b/plugins/snap/gs-self-test.c
@@ -349,7 +349,7 @@ main (int argc, char **argv)
        gboolean ret;
        g_autoptr(GError) error = NULL;
        g_autoptr(GsPluginLoader) plugin_loader = NULL;
-       const gchar *allowlist[] = {
+       const gchar * const allowlist[] = {
                "snap",
                NULL
        };
@@ -361,7 +361,7 @@ main (int argc, char **argv)
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR);
        gs_plugin_loader_add_location (plugin_loader, LOCALPLUGINDIR_CORE);
        ret = gs_plugin_loader_setup (plugin_loader,
-                                     (gchar**) allowlist,
+                                     allowlist,
                                      NULL,
                                      NULL,
                                      &error);


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