diff options
author | rbuj <[email protected]> | 2020-08-04 13:11:42 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-09-07 09:11:05 +0200 |
commit | 8f8b7316cc7504a4618705c562ead1ae65dabbdc (patch) | |
tree | c536e6c8079781851f2456528042e19497ee5315 /mate-panel/panel-background.c | |
parent | 59da25f28bc2678cc38bc1def53ca1c4dbf9cc0b (diff) | |
download | mate-panel-8f8b7316cc7504a4618705c562ead1ae65dabbdc.tar.bz2 mate-panel-8f8b7316cc7504a4618705c562ead1ae65dabbdc.tar.xz |
Remove variableScope warnings reported by cppcheck
cppcheck --enable=all . 2> err.txt
grep variableScope err.txt
Diffstat (limited to 'mate-panel/panel-background.c')
-rw-r--r-- | mate-panel/panel-background.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mate-panel/panel-background.c b/mate-panel/panel-background.c index 9b503209..3ce08a5b 100644 --- a/mate-panel/panel-background.c +++ b/mate-panel/panel-background.c @@ -110,16 +110,14 @@ panel_background_prepare (PanelBackground *background) * backing region is cleared * (gdk_window_clear_backing_region), the correctly * scaled pattern is used */ - cairo_matrix_t m; cairo_surface_t *surface; - double width, height; - surface = NULL; - width = 1.0; - height = 1.0; cairo_pattern_get_surface(background->default_pattern, &surface); /* catch invalid images (e.g. -gtk-gradient) before scaling and rendering */ if (surface != NULL ){ + double width, height; + cairo_matrix_t m; + cairo_surface_reference(surface); width = cairo_image_surface_get_width (surface); height = cairo_image_surface_get_height (surface); |