diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-03-18 16:57:04 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-03-19 12:24:14 +0100 |
commit | ab8c108b88edf49959b95a8d7cc12edb239d361c (patch) | |
tree | 349c331a85c64610f7c60a9f55c100a8c64c0783 /src/cairo-analysis-surface.c | |
parent | 628ef17aca98ea3b0816a7dfa9e990275af6c791 (diff) | |
download | cairo-ab8c108b88edf49959b95a8d7cc12edb239d361c.tar.gz |
Do not warn when ignoring the return value of _cairo_rectangle_intersect()
gcc complains that
cairo-surface-wrapper.c:647: warning: ignoring return value of
‘_cairo_rectangle_intersect’, declared with attribute warn_unused_result
It can be silenced by making _cairo_rectangle_intersect()
cairo_private_no_warn. This makes it possible to avoid unused
temporary variables in other places and reduces the dead assignments
reported by clang static analyzer from 114 to 98.
Diffstat (limited to 'src/cairo-analysis-surface.c')
-rw-r--r-- | src/cairo-analysis-surface.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c index 6bec20511..5468eac0c 100644 --- a/src/cairo-analysis-surface.c +++ b/src/cairo-analysis-surface.c @@ -272,14 +272,13 @@ static void _rectangle_intersect_clip (cairo_rectangle_int_t *extents, cairo_clip_t *clip) { const cairo_rectangle_int_t *clip_extents; - cairo_bool_t is_empty; clip_extents = NULL; if (clip != NULL) clip_extents = _cairo_clip_get_extents (clip); if (clip_extents != NULL) - is_empty = _cairo_rectangle_intersect (extents, clip_extents); + _cairo_rectangle_intersect (extents, clip_extents); } static void @@ -297,7 +296,7 @@ _cairo_analysis_surface_operation_extents (cairo_analysis_surface_t *surface, cairo_rectangle_int_t source_extents; _cairo_pattern_get_extents (source, &source_extents); - is_empty = _cairo_rectangle_intersect (extents, &source_extents); + _cairo_rectangle_intersect (extents, &source_extents); } _rectangle_intersect_clip (extents, clip); @@ -343,7 +342,6 @@ _cairo_analysis_surface_mask (void *abstract_surface, cairo_analysis_surface_t *surface = abstract_surface; cairo_int_status_t backend_status; cairo_rectangle_int_t extents; - cairo_bool_t is_empty; if (surface->target->backend->mask == NULL) { backend_status = CAIRO_INT_STATUS_UNSUPPORTED; @@ -392,8 +390,7 @@ _cairo_analysis_surface_mask (void *abstract_surface, cairo_rectangle_int_t mask_extents; _cairo_pattern_get_extents (mask, &mask_extents); - is_empty = _cairo_rectangle_intersect (&extents, &mask_extents); - + _cairo_rectangle_intersect (&extents, &mask_extents); } return _add_operation (surface, &extents, backend_status); @@ -414,7 +411,6 @@ _cairo_analysis_surface_stroke (void *abstract_surface, cairo_analysis_surface_t *surface = abstract_surface; cairo_status_t backend_status; cairo_rectangle_int_t extents; - cairo_bool_t is_empty; if (surface->target->backend->stroke == NULL) { backend_status = CAIRO_INT_STATUS_UNSUPPORTED; @@ -447,7 +443,7 @@ _cairo_analysis_surface_stroke (void *abstract_surface, if (unlikely (status)) return status; - is_empty = _cairo_rectangle_intersect (&extents, &mask_extents); + _cairo_rectangle_intersect (&extents, &mask_extents); } return _add_operation (surface, &extents, backend_status); @@ -466,7 +462,6 @@ _cairo_analysis_surface_fill (void *abstract_surface, cairo_analysis_surface_t *surface = abstract_surface; cairo_status_t backend_status; cairo_rectangle_int_t extents; - cairo_bool_t is_empty; if (surface->target->backend->fill == NULL) { backend_status = CAIRO_INT_STATUS_UNSUPPORTED; @@ -493,7 +488,7 @@ _cairo_analysis_surface_fill (void *abstract_surface, _cairo_path_fixed_fill_extents (path, fill_rule, tolerance, &mask_extents); - is_empty = _cairo_rectangle_intersect (&extents, &mask_extents); + _cairo_rectangle_intersect (&extents, &mask_extents); } return _add_operation (surface, &extents, backend_status); @@ -512,7 +507,6 @@ _cairo_analysis_surface_show_glyphs (void *abstract_surface, cairo_analysis_surface_t *surface = abstract_surface; cairo_status_t status, backend_status; cairo_rectangle_int_t extents, glyph_extents; - cairo_bool_t is_empty; /* Adapted from _cairo_surface_show_glyphs */ if (surface->target->backend->show_glyphs != NULL) { @@ -561,7 +555,7 @@ _cairo_analysis_surface_show_glyphs (void *abstract_surface, if (unlikely (status)) return status; - is_empty = _cairo_rectangle_intersect (&extents, &glyph_extents); + _cairo_rectangle_intersect (&extents, &glyph_extents); } return _add_operation (surface, &extents, backend_status); @@ -592,7 +586,6 @@ _cairo_analysis_surface_show_text_glyphs (void *abstract_surface, cairo_analysis_surface_t *surface = abstract_surface; cairo_status_t status, backend_status; cairo_rectangle_int_t extents, glyph_extents; - cairo_bool_t is_empty; /* Adapted from _cairo_surface_show_glyphs */ backend_status = CAIRO_INT_STATUS_UNSUPPORTED; @@ -645,7 +638,7 @@ _cairo_analysis_surface_show_text_glyphs (void *abstract_surface, if (unlikely (status)) return status; - is_empty = _cairo_rectangle_intersect (&extents, &glyph_extents); + _cairo_rectangle_intersect (&extents, &glyph_extents); } return _add_operation (surface, &extents, backend_status); |