summaryrefslogtreecommitdiff
path: root/libmate-panel-applet
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2023-11-15 15:10:11 +0100
committerLuke from DC <[email protected]>2023-11-21 20:19:58 +0000
commit96c7ebc6dc9e8b8327db04a9570054ee78743353 (patch)
tree5d600712c7b3c035dbe78045641cdad9e358b91a /libmate-panel-applet
parent7632b4fe9bb81a440bdde64c8cc45b15e07b1de8 (diff)
downloadmate-panel-96c7ebc6dc9e8b8327db04a9570054ee78743353.tar.bz2
mate-panel-96c7ebc6dc9e8b8327db04a9570054ee78743353.tar.xz
Reduce scope of variables
Mostly found by cppcheck.
Diffstat (limited to 'libmate-panel-applet')
-rw-r--r--libmate-panel-applet/mate-panel-applet-gsettings.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-gsettings.c b/libmate-panel-applet/mate-panel-applet-gsettings.c
index a4bd3db1..82867639 100644
--- a/libmate-panel-applet/mate-panel-applet-gsettings.c
+++ b/libmate-panel-applet/mate-panel-applet-gsettings.c
@@ -149,9 +149,9 @@ void
mate_panel_applet_settings_set_glist (GSettings *settings, gchar *key, GList *list)
{
GArray *array;
- GList *l;
+
array = g_array_new (TRUE, TRUE, sizeof (gchar *));
- for (l = list; l; l = l->next) {
+ for (GList *l = list; l; l = l->next) {
array = g_array_append_val (array, l->data);
}
g_settings_set_strv (settings, key, (const gchar **) array->data);
@@ -178,9 +178,9 @@ void
mate_panel_applet_settings_set_gslist (GSettings *settings, gchar *key, GSList *list)
{
GArray *array;
- GSList *l;
+
array = g_array_new (TRUE, TRUE, sizeof (gchar *));
- for (l = list; l; l = l->next) {
+ for (GSList *l = list; l; l = l->next) {
array = g_array_append_val (array, l->data);
}
g_settings_set_strv (settings, key, (const gchar **) array->data);