summaryrefslogtreecommitdiff
path: root/mate-volume-control/gvc-level-bar.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-04-19 01:41:23 +0200
committerlukefromdc <[email protected]>2019-04-20 20:20:07 +0000
commit99932508718630a0746636ed7a7c2d2bb04499f0 (patch)
tree4ac7e3508e0783c3cc671ada67432fb4d7490871 /mate-volume-control/gvc-level-bar.c
parenteef2c6b47b4c48b71f6122a12ac12f08520e5481 (diff)
downloadmate-media-99932508718630a0746636ed7a7c2d2bb04499f0.tar.bz2
mate-media-99932508718630a0746636ed7a7c2d2bb04499f0.tar.xz
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.
Diffstat (limited to 'mate-volume-control/gvc-level-bar.c')
-rw-r--r--mate-volume-control/gvc-level-bar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mate-volume-control/gvc-level-bar.c b/mate-volume-control/gvc-level-bar.c
index f75a884..820ebbf 100644
--- a/mate-volume-control/gvc-level-bar.c
+++ b/mate-volume-control/gvc-level-bar.c
@@ -569,9 +569,10 @@ gvc_level_bar_draw (GtkWidget *widget, cairo_t *cr)
if (bar->priv->orientation == GTK_ORIENTATION_VERTICAL) {
int i;
- int by;
for (i = 0; i < NUM_BOXES; i++) {
+ int by;
+
by = i * bar->priv->layout.delta;
curved_rectangle (cr,
bar->priv->layout.area.x + 0.5,
@@ -608,7 +609,6 @@ gvc_level_bar_draw (GtkWidget *widget, cairo_t *cr)
}
} else {
int i;
- int bx;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
GtkAllocation allocation;
@@ -620,6 +620,8 @@ gvc_level_bar_draw (GtkWidget *widget, cairo_t *cr)
}
for (i = 0; i < NUM_BOXES; i++) {
+ int bx;
+
bx = i * bar->priv->layout.delta;
curved_rectangle (cr,
bx + 0.5,