diff options
author | Pablo Barciela <[email protected]> | 2019-04-12 22:17:28 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-19 23:38:58 +0200 |
commit | edbd40542ac7c81df388d37e3cf2fcd2d5c6cbd0 (patch) | |
tree | 75fb27ea3346cd1de863722fd5ffbfd5fabd0961 /eel/eel-gdk-pixbuf-extensions.c | |
parent | 9b1f0f776121b930380ff991780d00797c5618e6 (diff) | |
download | caja-edbd40542ac7c81df388d37e3cf2fcd2d5c6cbd0.tar.bz2 caja-edbd40542ac7c81df388d37e3cf2fcd2d5c6cbd0.tar.xz |
eel: reduce the scope of some variables
Fixes 'cppcheck' warnings:
[eel/eel-background.c:163]: (style) The scope of the variable 'intensity' can be reduced.
[eel/eel-background.c:163]: (style) The scope of the variable 'saturation' can be reduced.
[eel/eel-background.c:196]: (style) The scope of the variable 'end_color' can be reduced.
[eel/eel-canvas-rect-ellipse.c:600]: (style) The scope of the variable 'tmp' can be reduced.
[eel/eel-canvas-rect-ellipse.c:705]: (style) The scope of the variable 'width_pixels' can be reduced.
[eel/eel-canvas-rect-ellipse.c:706]: (style) The scope of the variable 'width_lt' can be reduced.
[eel/eel-canvas-rect-ellipse.c:706]: (style) The scope of the variable 'width_rb' can be reduced.
[eel/eel-canvas.c:1420]: (style) The scope of the variable 'child' can be reduced.
[eel/eel-canvas.c:1493]: (style) The scope of the variable 'i' can be reduced.
[eel/eel-canvas.c:1518]: (style) The scope of the variable 'i' can be reduced.
[eel/eel-canvas.c:1545]: (style) The scope of the variable 'i' can be reduced.
[eel/eel-canvas.c:1599]: (style) The scope of the variable 'child' can be reduced.
[eel/eel-canvas.c:2598]: (style) The scope of the variable 'cx' can be reduced.
[eel/eel-canvas.c:2598]: (style) The scope of the variable 'cy' can be reduced.
[eel/eel-debug.c:80]: (style) The scope of the variable 'f' can be reduced.
[eel/eel-editable-label.c:1493]: (style) The scope of the variable 'clip' can be reduced.
[eel/eel-editable-label.c:1571]: (style) The scope of the variable 'text' can be reduced.
[eel/eel-editable-label.c:2270]: (style) The scope of the variable 'anchor' can be reduced.
[eel/eel-editable-label.c:2270]: (style) The scope of the variable 'end' can be reduced.
[eel/eel-editable-label.c:3054]: (style) The scope of the variable 'menuitem' can be reduced.
[eel/eel-editable-label.c:3400]: (style) The scope of the variable 'index' can be reduced.
[eel/eel-gdk-pixbuf-extensions.c:85]: (style) The scope of the variable 'scale' can be reduced.
[eel/eel-gdk-pixbuf-extensions.c:283]: (style) The scope of the variable 's_x1' can be reduced.
[eel/eel-gdk-pixbuf-extensions.c:283]: (style) The scope of the variable 's_y2' can be reduced.
[eel/eel-gdk-pixbuf-extensions.c:284]: (style) The scope of the variable 's_xfrac' can be reduced.
[eel/eel-glib-extensions.c:439]: (style) The scope of the variable 'compare_result' can be reduced.
[eel/eel-glib-extensions.c:561]: (style) The scope of the variable 'hash_table_to_free' can be reduced.
[eel/eel-graphic-effects.c:74]: (style) The scope of the variable 'pixsrc' can be reduced.
[eel/eel-graphic-effects.c:74]: (style) The scope of the variable 'pixdest' can be reduced.
[eel/eel-graphic-effects.c:137]: (style) The scope of the variable 'pixsrc' can be reduced.
[eel/eel-graphic-effects.c:137]: (style) The scope of the variable 'pixdest' can be reduced.
[eel/eel-graphic-effects.c:195]: (style) The scope of the variable 'pixsrc' can be reduced.
[eel/eel-graphic-effects.c:196]: (style) The scope of the variable 'pixdest' can be reduced.
[eel/eel-graphic-effects.c:245]: (style) The scope of the variable 'slab_width' can be reduced.
[eel/eel-graphic-effects.c:262]: (style) The scope of the variable 'slab_height' can be reduced.
[eel/eel-graphic-effects.c:282]: (style) The scope of the variable 'y' can be reduced.
[eel/eel-gtk-extensions.c:165]: (style) The scope of the variable 'screen' can be reduced.
[eel/eel-gtk-extensions.c:167]: (style) The scope of the variable 'screen_width' can be reduced.
[eel/eel-gtk-extensions.c:167]: (style) The scope of the variable 'screen_height' can be reduced.
[eel/eel-gtk-extensions.c:168]: (style) The scope of the variable 'scale' can be reduced.
[eel/eel-labeled-image.c:1051]: (style) The scope of the variable 'x_alignment' can be reduced.
[eel/eel-labeled-image.c:1052]: (style) The scope of the variable 'y_alignment' can be reduced.
[eel/eel-labeled-image.c:1100]: (style) The scope of the variable 'x_alignment' can be reduced.
[eel/eel-labeled-image.c:1101]: (style) The scope of the variable 'y_alignment' can be reduced.
[eel/eel-mate-extensions.c:73]: (style) The scope of the variable 'quoted' can be reduced.
[eel/eel-stock-dialogs.c:409]: (style) The scope of the variable 'button_title' can be reduced.
[eel/eel-string.c:415]: (style) The scope of the variable 'i' can be reduced.
[eel/eel-string.c:542]: (style) The scope of the variable 'type' can be reduced.
[eel/eel-vfs-extensions.c:65]: (style) The scope of the variable 'valid_bytes' can be reduced.
[eel/eel-wrap-table.c:766]: (style) The scope of the variable 'hadj' can be reduced.
[eel/eel-wrap-table.c:766]: (style) The scope of the variable 'vadj' can be reduced.
Diffstat (limited to 'eel/eel-gdk-pixbuf-extensions.c')
-rw-r--r-- | eel/eel-gdk-pixbuf-extensions.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c index b74b1062..d645c8ed 100644 --- a/eel/eel-gdk-pixbuf-extensions.c +++ b/eel/eel-gdk-pixbuf-extensions.c @@ -82,13 +82,14 @@ pixbuf_loader_size_prepared (GdkPixbufLoader *loader, gpointer desired_size_ptr) { int size, desired_size; - float scale; size = MAX (width, height); desired_size = GPOINTER_TO_INT (desired_size_ptr); if (size != desired_size) { + float scale; + scale = (float) desired_size / size; gdk_pixbuf_loader_set_size (loader, floor (scale * width + 0.5), @@ -280,8 +281,8 @@ eel_gdk_pixbuf_scale_down (GdkPixbuf *pixbuf, int dest_height) { int source_width, source_height; - int s_x1, s_y1, s_x2, s_y2; - int s_xfrac, s_yfrac; + int s_y1, s_x2; + int s_yfrac; int dx, dx_frac, dy, dy_frac; div_t ddx, ddy; int x, y; @@ -327,6 +328,9 @@ eel_gdk_pixbuf_scale_down (GdkPixbuf *pixbuf, s_yfrac = -dest_height/2; while (s_y1 < source_height) { + int s_x1, s_y2; + int s_xfrac; + s_y2 = s_y1 + dy; s_yfrac += dy_frac; if (s_yfrac > 0) |