[gnome-software: 3/6] contrib: Improve code style in example plugin




commit 8bd7fdd1aad62dabbe46713d16988cd4ad0e25a0
Author: Philip Withnall <pwithnall endlessos org>
Date:   Sun Mar 14 16:09:51 2021 +0000

    contrib: Improve code style in example plugin
    
    This introduces no functional changes, but modernises the code style in
    the example plugin a little.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1168

 contrib/gs-plugin-example.c     | 3 +--
 doc/api/gnome-software-docs.xml | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/contrib/gs-plugin-example.c b/contrib/gs-plugin-example.c
index 453c7f625..7a366f04b 100644
--- a/contrib/gs-plugin-example.c
+++ b/contrib/gs-plugin-example.c
@@ -47,8 +47,7 @@ gs_plugin_add_search (GsPlugin *plugin,
                      GCancellable *cancellable,
                      GError **error)
 {
-       guint i;
-       for (i = 0; values[i] != NULL; i++) {
+       for (gsize i = 0; values[i] != NULL; i++) {
                if (g_strcmp0 (values[i], "fotoshop") == 0) {
                        g_autoptr(GsApp) app = gs_app_new ("gimp.desktop");
                        gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
diff --git a/doc/api/gnome-software-docs.xml b/doc/api/gnome-software-docs.xml
index 0cd42ce3f..830565216 100644
--- a/doc/api/gnome-software-docs.xml
+++ b/doc/api/gnome-software-docs.xml
@@ -92,8 +92,7 @@ gs_plugin_add_search (GsPlugin *plugin,
                       GCancellable *cancellable,
                       GError **error)
 {
-  guint i;
-  for (i = 0; values[i] != NULL; i++) {
+  for (gsize i = 0; values[i] != NULL; i++) {
     if (g_strcmp0 (values[i], "fotoshop") == 0) {
       g_autoptr(GsApp) app = gs_app_new ("gimp.desktop");
       gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);


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