[cairo] [PATCH 4/5] image: Silence gcc warning

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


gcc does not know thta num_glyph is guaranteed to be strictly
positive, so it complains that:

cairo-image-surface.c:3787: warning: ‘status’ may be used uninitialized in this function
---
 src/cairo-image-surface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 10bd898..2a421b7 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -3785,7 +3785,7 @@ _composite_glyphs_via_mask (void			*closure,
     pixman_image_t *src;
     pixman_image_t *white;
     pixman_format_code_t mask_format = 0; /* silence gcc */
-    cairo_status_t status;
+    cairo_status_t status = CAIRO_STATUS_SUCCESS; /* silence gcc */
     int src_x, src_y;
     int i;
 
-- 
1.7.1



More information about the cairo mailing list