From 99932508718630a0746636ed7a7c2d2bb04499f0 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Fri, 19 Apr 2019 01:41:23 +0200 Subject: mate-volume-control: reduce the scope of some variables Fixes 'cppcheck' warnings: [mate-volume-control/gvc-level-bar.c:572]: (style) The scope of the variable 'by' can be reduced. [mate-volume-control/gvc-level-bar.c:611]: (style) The scope of the variable 'bx' can be reduced. [mate-volume-control/gvc-mixer-dialog.c:379]: (style) The scope of the variable 'swtch' can be reduced. [mate-volume-control/gvc-mixer-dialog.c:534]: (style) The scope of the variable 'swtch' can be reduced. [mate-volume-control/gvc-mixer-dialog.c:1891]: (style) The scope of the variable 'closure' can be reduced. [mate-volume-control/sound-theme-file-utils.c:47]: (style) The scope of the variable 'data_dir' can be reduced. --- mate-volume-control/gvc-mixer-dialog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mate-volume-control/gvc-mixer-dialog.c') diff --git a/mate-volume-control/gvc-mixer-dialog.c b/mate-volume-control/gvc-mixer-dialog.c index 4acd9bc..3a28a06 100644 --- a/mate-volume-control/gvc-mixer-dialog.c +++ b/mate-volume-control/gvc-mixer-dialog.c @@ -376,13 +376,14 @@ static void set_output_stream (GvcMixerDialog *dialog, MateMixerStream *stream) { GtkTreeModel *model; - MateMixerSwitch *swtch; MateMixerStreamControl *control; control = gvc_channel_bar_get_control (GVC_CHANNEL_BAR (dialog->priv->output_bar)); if (control != NULL) { /* Disconnect port switch of the previous stream */ if (dialog->priv->output_port_combo != NULL) { + MateMixerSwitch *swtch; + swtch = g_object_get_data (G_OBJECT (dialog->priv->output_port_combo), "switch"); if (swtch != NULL) @@ -531,13 +532,14 @@ static void set_input_stream (GvcMixerDialog *dialog, MateMixerStream *stream) { GtkTreeModel *model; - MateMixerSwitch *swtch; MateMixerStreamControl *control; control = gvc_channel_bar_get_control (GVC_CHANNEL_BAR (dialog->priv->input_bar)); if (control != NULL) { /* Disconnect port switch of the previous stream */ if (dialog->priv->input_port_combo != NULL) { + MateMixerSwitch *swtch; + swtch = g_object_get_data (G_OBJECT (dialog->priv->input_port_combo), "switch"); if (swtch != NULL) @@ -1888,10 +1890,10 @@ gvc_mixer_dialog_constructor (GType type, GtkWidget *ebox; GtkTreeSelection *selection; GtkAccelGroup *accel_group; - GClosure *closure; GtkTreeIter iter; gint i; const GList *list; + GClosure *closure = NULL; object = G_OBJECT_CLASS (gvc_mixer_dialog_parent_class)->constructor (type, n_construct_properties, -- cgit v1.2.1