[cairo] [PATCH 5/5] fallback: Silence gcc warning

Andrea Canciani ranma42 at gmail.com
Fri Mar 18 10:13:23 PDT 2011


gcc complains that

cairo-surface-wrapper.c:647: warning: ignoring return value of
‘_cairo_rectangle_intersect’, declared with attribute warn_unused_result

Storing the result in a variable (which is otherwise unused) makes gcc
happy.
---
 src/cairo-surface-wrapper.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/cairo-surface-wrapper.c b/src/cairo-surface-wrapper.c
index 9667305..f15a747 100644
--- a/src/cairo-surface-wrapper.c
+++ b/src/cairo-surface-wrapper.c
@@ -643,8 +643,10 @@ _cairo_surface_wrapper_get_extents (cairo_surface_wrapper_t *wrapper,
 				    cairo_rectangle_int_t   *extents)
 {
     if (wrapper->has_extents) {
+	cairo_bool_t not_empty; /* Silence gcc warning */
+
 	if (_cairo_surface_get_extents (wrapper->target, extents))
-	    _cairo_rectangle_intersect (extents, &wrapper->extents);
+	    not_empty = _cairo_rectangle_intersect (extents, &wrapper->extents);
 	else
 	    *extents = wrapper->extents;
 
-- 
1.7.1



More information about the cairo mailing list