From 96c7ebc6dc9e8b8327db04a9570054ee78743353 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 15 Nov 2023 15:10:11 +0100 Subject: Reduce scope of variables Mostly found by cppcheck. --- mate-panel/panel-widget.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mate-panel/panel-widget.c') diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c index dd8f6d11..9a9ce829 100644 --- a/mate-panel/panel-widget.c +++ b/mate-panel/panel-widget.c @@ -1504,7 +1504,6 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) AppletData *ad = list->data; GtkRequisition chreq; const char *id; - AppletInfo *info; int position = ad->pos; PanelObjectEdgeRelativity edge_relativity = PANEL_EDGE_START; gboolean right_stuck = FALSE; @@ -1526,7 +1525,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) id = mate_panel_applet_get_id_by_widget (ad->applet); if (id) { - info = mate_panel_applet_get_by_id (id); + AppletInfo *info = mate_panel_applet_get_by_id (id); position = g_settings_get_int (info->settings, PANEL_OBJECT_POSITION_KEY); edge_relativity = g_settings_get_enum (info->settings, @@ -1672,10 +1671,8 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) if (ad->expand_major) { const char *id; - AppletInfo *info; PanelObjectEdgeRelativity edge_relativity = PANEL_EDGE_START; gboolean right_stuck; - AppletData *pad; int prior_space; int following_space; int additional_space; @@ -1683,7 +1680,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) id = mate_panel_applet_get_id_by_widget (ad->applet); if (id) { - info = mate_panel_applet_get_by_id (id); + AppletInfo *info = mate_panel_applet_get_by_id (id); edge_relativity = g_settings_get_enum (info->settings, PANEL_OBJECT_RELATIVE_TO_EDGE_KEY); right_stuck = g_settings_get_boolean (info->settings, @@ -1693,7 +1690,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) prior_space = ad->constrained; if (list->prev) { - pad = list->prev->data; + AppletData *pad = list->prev->data; prior_space -= pad->constrained + pad->min_cells; } -- cgit v1.2.1