[cairo] 1.4.2 release planned for today, 1.4.4 in a few weeks
Chris Wilson
chris at chris-wilson.co.uk
Sun Mar 18 16:41:00 PDT 2007
Behdad Esfahbod (behdad at behdad.org) said:
> Should we use some gcc attribute to get warnings about ignoring
> cairo_status_t and cairo_int_status_t return values?
Tested this out and the results are in favour of the compiler versus the
programmer. The attached patches add a CAIRO_WARN_UNUSED_RESULT to all
cairo_[int_]_status_t functions and fixes up the majority by simplying
propagating the status. The 'few' that are left were either marked as
being ignored or looked a bit too complex for me to touch.
Please review and check that this is sane - it passes make check, but
these changes should have only affected error paths...
--
Chris Wilson
-------------- next part --------------
>From 1bca6e4ed407c570595c65501cfbcdbe10e95591 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun, 18 Mar 2007 21:45:46 +0000
Subject: [PATCH] Add the warn-if-result-unused attribute to all private functions
returning a status.
---
src/cairoint.h | 260 +++++++++++++++++++++++++++++---------------------------
1 files changed, 134 insertions(+), 126 deletions(-)
diff --git a/src/cairoint.h b/src/cairoint.h
index 357a8b1..d67ea93 100755
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -101,6 +101,14 @@ CAIRO_BEGIN_DECLS
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index)
#endif
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define CAIRO_WARN_UNUSED_RESULT \
+ __attribute__((warn_unused_result))
+#else
+#define CAIRO_WARN_UNUSED_RESULT
+#endif /* __GNUC__ */
+
+
/* slim_internal.h */
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
#define cairo_private __attribute__((__visibility__("hidden")))
@@ -491,21 +499,21 @@ _cairo_array_init_snapshot (cairo_array_t *array,
cairo_private void
_cairo_array_fini (cairo_array_t *array);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_array_grow_by (cairo_array_t *array, int additional);
cairo_private void
_cairo_array_truncate (cairo_array_t *array, unsigned int num_elements);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_array_append (cairo_array_t *array, const void *element);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_array_append_multiple (cairo_array_t *array,
const void *elements,
int num_elements);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_array_allocate (cairo_array_t *array,
unsigned int num_elements,
void **elements);
@@ -534,7 +542,7 @@ cairo_private void *
_cairo_user_data_array_get_data (cairo_user_data_array_t *array,
const cairo_user_data_key_t *key);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_user_data_array_set_data (cairo_user_data_array_t *array,
const cairo_user_data_key_t *key,
void *user_data,
@@ -1312,7 +1320,7 @@ cairo_private int
_cairo_fixed_integer_ceil (cairo_fixed_t f);
/* cairo_gstate.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_init (cairo_gstate_t *gstate,
cairo_surface_t *target);
@@ -1343,52 +1351,52 @@ _cairo_gstate_get_original_target (cairo_gstate_t *gstate);
cairo_private cairo_clip_t *
_cairo_gstate_get_clip (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_source (cairo_gstate_t *gstate, cairo_pattern_t *source);
cairo_private cairo_pattern_t *
_cairo_gstate_get_source (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_operator (cairo_gstate_t *gstate, cairo_operator_t op);
cairo_private cairo_operator_t
_cairo_gstate_get_operator (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_tolerance (cairo_gstate_t *gstate, double tolerance);
cairo_private double
_cairo_gstate_get_tolerance (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_fill_rule (cairo_gstate_t *gstate, cairo_fill_rule_t fill_rule);
cairo_private cairo_fill_rule_t
_cairo_gstate_get_fill_rule (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_line_width (cairo_gstate_t *gstate, double width);
cairo_private double
_cairo_gstate_get_line_width (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_line_cap (cairo_gstate_t *gstate, cairo_line_cap_t line_cap);
cairo_private cairo_line_cap_t
_cairo_gstate_get_line_cap (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_line_join (cairo_gstate_t *gstate, cairo_line_join_t line_join);
cairo_private cairo_line_join_t
_cairo_gstate_get_line_join (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_dash (cairo_gstate_t *gstate, const double *dash, int num_dashes, double offset);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_miter_limit (cairo_gstate_t *gstate, double limit);
cairo_private double
@@ -1397,36 +1405,36 @@ _cairo_gstate_get_miter_limit (cairo_gstate_t *gstate);
cairo_private void
_cairo_gstate_get_matrix (cairo_gstate_t *gstate, cairo_matrix_t *matrix);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_translate (cairo_gstate_t *gstate, double tx, double ty);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_scale (cairo_gstate_t *gstate, double sx, double sy);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_rotate (cairo_gstate_t *gstate, double angle);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_transform (cairo_gstate_t *gstate,
const cairo_matrix_t *matrix);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_matrix (cairo_gstate_t *gstate,
const cairo_matrix_t *matrix);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_identity_matrix (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_user_to_device (cairo_gstate_t *gstate, double *x, double *y);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_user_to_device_distance (cairo_gstate_t *gstate, double *dx, double *dy);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_device_to_user (cairo_gstate_t *gstate, double *x, double *y);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_device_to_user_distance (cairo_gstate_t *gstate, double *dx, double *dy);
cairo_private void
@@ -1441,58 +1449,58 @@ _cairo_gstate_backend_to_user_rectangle (cairo_gstate_t *gstate,
double *x2, double *y2,
cairo_bool_t *is_tight);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_paint (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_mask (cairo_gstate_t *gstate,
cairo_pattern_t *mask);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_stroke (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_fill (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_copy_page (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_show_page (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_stroke_extents (cairo_gstate_t *gstate,
cairo_path_fixed_t *path,
double *x1, double *y1,
double *x2, double *y2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_fill_extents (cairo_gstate_t *gstate,
cairo_path_fixed_t *path,
double *x1, double *y1,
double *x2, double *y2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_in_stroke (cairo_gstate_t *gstate,
cairo_path_fixed_t *path,
double x,
double y,
cairo_bool_t *inside_ret);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_in_fill (cairo_gstate_t *gstate,
cairo_path_fixed_t *path,
double x,
double y,
cairo_bool_t *inside_ret);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_clip (cairo_gstate_t *gstate, cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_reset_clip (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_clip_extents (cairo_gstate_t *gstate,
double *x1,
double *y1,
@@ -1502,7 +1510,7 @@ _cairo_gstate_clip_extents (cairo_gstate_t *gstate,
cairo_private cairo_rectangle_list_t*
_cairo_gstate_copy_clip_rectangle_list (cairo_gstate_t *gstate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_show_surface (cairo_gstate_t *gstate,
cairo_surface_t *surface,
double x,
@@ -1510,13 +1518,13 @@ _cairo_gstate_show_surface (cairo_gstate_t *gstate,
double width,
double height);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_select_font_face (cairo_gstate_t *gstate,
const char *family,
cairo_font_slant_t slant,
cairo_font_weight_t weight);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_font_size (cairo_gstate_t *gstate,
double size);
@@ -1524,7 +1532,7 @@ cairo_private void
_cairo_gstate_get_font_matrix (cairo_gstate_t *gstate,
cairo_matrix_t *matrix);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
const cairo_matrix_t *matrix);
@@ -1532,27 +1540,27 @@ cairo_private void
_cairo_gstate_get_font_options (cairo_gstate_t *gstate,
cairo_font_options_t *options);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_font_options (cairo_gstate_t *gstate,
const cairo_font_options_t *options);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_get_font_face (cairo_gstate_t *gstate,
cairo_font_face_t **font_face);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_get_scaled_font (cairo_gstate_t *gstate,
cairo_scaled_font_t **scaled_font);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_get_font_extents (cairo_gstate_t *gstate,
cairo_font_extents_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_font_face (cairo_gstate_t *gstate,
cairo_font_face_t *font_face);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_text_to_glyphs (cairo_gstate_t *font,
const char *utf8,
double x,
@@ -1560,18 +1568,18 @@ _cairo_gstate_text_to_glyphs (cairo_gstate_t *font,
cairo_glyph_t **glyphs,
int *num_glyphs);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
const cairo_glyph_t *glyphs,
int num_glyphs,
cairo_text_extents_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
const cairo_glyph_t *glyphs,
int num_glyphs);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_glyph_path (cairo_gstate_t *gstate,
const cairo_glyph_t *glyphs,
int num_glyphs,
@@ -1671,7 +1679,7 @@ _cairo_font_options_init_copy (cairo_font_options_t *options,
const cairo_font_options_t *other);
/* cairo_hull.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices);
/* cairo-lzw.c */
@@ -1689,7 +1697,7 @@ _cairo_operator_always_translucent (cairo_operator_t op);
cairo_private void
_cairo_path_fixed_init (cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_init_copy (cairo_path_fixed_t *path,
cairo_path_fixed_t *other);
@@ -1702,7 +1710,7 @@ _cairo_path_fixed_fini (cairo_path_fixed_t *path);
cairo_private void
_cairo_path_fixed_destroy (cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_move_to (cairo_path_fixed_t *path,
cairo_fixed_t x,
cairo_fixed_t y);
@@ -1710,37 +1718,37 @@ _cairo_path_fixed_move_to (cairo_path_fixed_t *path,
cairo_private void
_cairo_path_fixed_new_sub_path (cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_rel_move_to (cairo_path_fixed_t *path,
cairo_fixed_t dx,
cairo_fixed_t dy);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_line_to (cairo_path_fixed_t *path,
cairo_fixed_t x,
cairo_fixed_t y);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_rel_line_to (cairo_path_fixed_t *path,
cairo_fixed_t dx,
cairo_fixed_t dy);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_curve_to (cairo_path_fixed_t *path,
cairo_fixed_t x0, cairo_fixed_t y0,
cairo_fixed_t x1, cairo_fixed_t y1,
cairo_fixed_t x2, cairo_fixed_t y2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path,
cairo_fixed_t dx0, cairo_fixed_t dy0,
cairo_fixed_t dx1, cairo_fixed_t dy1,
cairo_fixed_t dx2, cairo_fixed_t dy2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_close_path (cairo_path_fixed_t *path);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_get_current_point (cairo_path_fixed_t *path,
cairo_fixed_t *x,
cairo_fixed_t *y);
@@ -1762,7 +1770,7 @@ typedef cairo_status_t
typedef cairo_status_t
(cairo_path_fixed_close_path_func_t) (void *closure);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_interpret (cairo_path_fixed_t *path,
cairo_direction_t dir,
cairo_path_fixed_move_to_func_t *move_to,
@@ -1771,7 +1779,7 @@ _cairo_path_fixed_interpret (cairo_path_fixed_t *path,
cairo_path_fixed_close_path_func_t *close_path,
void *closure);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_bounds (cairo_path_fixed_t *path,
double *x1, double *y1,
double *x2, double *y2);
@@ -1781,14 +1789,14 @@ _cairo_path_fixed_device_transform (cairo_path_fixed_t *path,
cairo_matrix_t *device_transform);
/* cairo_path_fill.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_fill_to_traps (cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
double tolerance,
cairo_traps_t *traps);
/* cairo_path_stroke.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -1798,7 +1806,7 @@ _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
/* cairo-scaled-font.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
cairo_font_face_t *font_face,
const cairo_matrix_t *font_matrix,
@@ -1813,11 +1821,11 @@ _cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font,
cairo_private void
_cairo_scaled_font_fini (cairo_scaled_font_t *scaled_font);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_font_extents (cairo_scaled_font_t *scaled_font,
cairo_font_extents_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
double x,
double y,
@@ -1825,13 +1833,13 @@ _cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
cairo_glyph_t **glyphs,
int *num_glyphs);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
const cairo_glyph_t *glyphs,
int num_glyphs,
cairo_rectangle_int16_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1845,7 +1853,7 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
cairo_glyph_t *glyphs,
int num_glyphs);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font,
const cairo_glyph_t *glyphs,
int num_glyphs,
@@ -1866,7 +1874,7 @@ _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph,
cairo_scaled_font_t *scaled_font,
cairo_path_fixed_t *path);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
unsigned long index,
cairo_scaled_glyph_info_t info,
@@ -1880,7 +1888,7 @@ _cairo_scaled_font_map_destroy (void);
cairo_private void
_cairo_stroke_style_init (cairo_stroke_style_t *style);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroke_style_init_copy (cairo_stroke_style_t *style,
cairo_stroke_style_t *other);
@@ -1923,7 +1931,7 @@ _cairo_surface_set_font_options (cairo_surface_t *surface,
cairo_private cairo_clip_mode_t
_cairo_surface_get_clip_mode (cairo_surface_t *surface);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_composite (cairo_operator_t op,
cairo_pattern_t *src,
cairo_pattern_t *mask,
@@ -1937,7 +1945,7 @@ _cairo_surface_composite (cairo_operator_t op,
unsigned int width,
unsigned int height);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fill_rectangle (cairo_surface_t *surface,
cairo_operator_t op,
const cairo_color_t *color,
@@ -1946,31 +1954,31 @@ _cairo_surface_fill_rectangle (cairo_surface_t *surface,
int width,
int height);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fill_region (cairo_surface_t *surface,
cairo_operator_t op,
const cairo_color_t *color,
pixman_region16_t *region);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fill_rectangles (cairo_surface_t *surface,
cairo_operator_t op,
const cairo_color_t *color,
cairo_rectangle_int16_t *rects,
int num_rects);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_paint (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_mask (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
cairo_pattern_t *mask);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_stroke (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1981,7 +1989,7 @@ _cairo_surface_stroke (cairo_surface_t *surface,
double tolerance,
cairo_antialias_t antialias);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fill (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1990,7 +1998,7 @@ _cairo_surface_fill (cairo_surface_t *surface,
double tolerance,
cairo_antialias_t antialias);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_show_glyphs (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1998,7 +2006,7 @@ _cairo_surface_show_glyphs (cairo_surface_t *surface,
int num_glyphs,
cairo_scaled_font_t *scaled_font);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
cairo_surface_t *dst,
@@ -2012,13 +2020,13 @@ _cairo_surface_composite_trapezoids (cairo_operator_t op,
cairo_trapezoid_t *traps,
int ntraps);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_surface_copy_page (cairo_surface_t *surface);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_surface_show_page (cairo_surface_t *surface);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_acquire_source_image (cairo_surface_t *surface,
cairo_image_surface_t **image_out,
void **image_extra);
@@ -2028,7 +2036,7 @@ _cairo_surface_release_source_image (cairo_surface_t *surface,
cairo_image_surface_t *image,
void *image_extra);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_acquire_dest_image (cairo_surface_t *surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -2042,7 +2050,7 @@ _cairo_surface_release_dest_image (cairo_surface_t *surface,
cairo_rectangle_int16_t *image_rect,
void *image_extra);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_clone_similar (cairo_surface_t *surface,
cairo_surface_t *src,
int src_x,
@@ -2060,29 +2068,29 @@ _cairo_surface_get_current_clip_serial (cairo_surface_t *surface);
cairo_private unsigned int
_cairo_surface_allocate_clip_serial (cairo_surface_t *surface);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_reset_clip (cairo_surface_t *surface);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_set_clip_region (cairo_surface_t *surface,
pixman_region16_t *region,
unsigned int serial);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_surface_intersect_clip_path (cairo_surface_t *surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
double tolerance,
cairo_antialias_t antialias);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_set_clip (cairo_surface_t *surface, cairo_clip_t *clip);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_get_extents (cairo_surface_t *surface,
cairo_rectangle_int16_t *rectangle);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
cairo_operator_t op,
cairo_pattern_t *pattern,
@@ -2096,7 +2104,7 @@ _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
cairo_glyph_t *glyphs,
int num_glyphs);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_composite_fixup_unbounded (cairo_surface_t *dst,
cairo_surface_attributes_t *src_attr,
int src_width,
@@ -2113,7 +2121,7 @@ _cairo_surface_composite_fixup_unbounded (cairo_surface_t *dst,
unsigned int width,
unsigned int height);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst,
cairo_surface_attributes_t *src_attr,
int src_width,
@@ -2221,7 +2229,7 @@ _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface);
* backends, so doing that will require synchronizing several backend
* maintainers.
*/
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region);
@@ -2236,42 +2244,42 @@ cairo_private cairo_bool_t
_cairo_surface_is_meta (const cairo_surface_t *surface);
/* cairo_pen.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_init (cairo_pen_t *pen,
double radius,
double tolerance,
cairo_matrix_t *ctm);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_init_empty (cairo_pen_t *pen);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_init_copy (cairo_pen_t *pen, cairo_pen_t *other);
cairo_private void
_cairo_pen_fini (cairo_pen_t *pen);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_add_points_for_slopes (cairo_pen_t *pen,
cairo_point_t *a,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen,
cairo_slope_t *slope,
int *active);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
cairo_slope_t *slope,
int *active);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_stroke_spline (cairo_pen_t *pen,
cairo_spline_t *spline,
double tolerance,
@@ -2284,27 +2292,27 @@ _cairo_polygon_init (cairo_polygon_t *polygon);
cairo_private void
_cairo_polygon_fini (cairo_polygon_t *polygon);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_add_edge (cairo_polygon_t *polygon, cairo_point_t *p1, cairo_point_t *p2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_move_to (cairo_polygon_t *polygon, cairo_point_t *point);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_line_to (cairo_polygon_t *polygon, cairo_point_t *point);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_close (cairo_polygon_t *polygon);
/* cairo_spline.c */
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_spline_init (cairo_spline_t *spline,
cairo_point_t *a,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_decompose (cairo_spline_t *spline, double tolerance);
cairo_private void
@@ -2326,7 +2334,7 @@ _cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix,
cairo_private void
_cairo_matrix_compute_determinant (const cairo_matrix_t *matrix, double *det);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_matrix_compute_scale_factors (const cairo_matrix_t *matrix,
double *sx, double *sy, int x_major);
@@ -2351,7 +2359,7 @@ _cairo_matrix_to_pixman_matrix (const cairo_matrix_t *matrix,
cairo_private void
_cairo_traps_init (cairo_traps_t *traps);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_init_box (cairo_traps_t *traps,
cairo_box_t *box);
@@ -2361,23 +2369,23 @@ _cairo_traps_fini (cairo_traps_t *traps);
cairo_private void
_cairo_traps_translate (cairo_traps_t *traps, int x, int y);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_tessellate_triangle (cairo_traps_t *traps, cairo_point_t t[3]);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_tessellate_convex_quad (cairo_traps_t *traps, cairo_point_t q[4]);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_tessellate_polygon (cairo_traps_t *traps,
cairo_polygon_t *poly,
cairo_fill_rule_t fill_rule);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_add_trap_from_points (cairo_traps_t *traps, cairo_fixed_t top, cairo_fixed_t bottom,
cairo_point_t left_p1, cairo_point_t left_p2,
cairo_point_t right_p1, cairo_point_t right_p2);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps,
cairo_polygon_t *polygon,
cairo_fill_rule_t fill_rule);
@@ -2388,7 +2396,7 @@ _cairo_traps_contain (cairo_traps_t *traps, double x, double y);
cairo_private void
_cairo_traps_extents (cairo_traps_t *traps, cairo_box_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_extract_region (cairo_traps_t *tr,
pixman_region16_t **region);
@@ -2414,7 +2422,7 @@ _cairo_slope_counter_clockwise (cairo_slope_t *a, cairo_slope_t *b);
/* cairo_pattern.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pattern_init_copy (cairo_pattern_t *pattern,
const cairo_pattern_t *other);
@@ -2451,7 +2459,7 @@ _cairo_pattern_is_opaque_solid (const cairo_pattern_t *pattern);
cairo_private cairo_bool_t
_cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pattern_acquire_surface (cairo_pattern_t *pattern,
cairo_surface_t *dst,
int x,
@@ -2466,7 +2474,7 @@ _cairo_pattern_release_surface (cairo_pattern_t *pattern,
cairo_surface_t *surface,
cairo_surface_attributes_t *attributes);
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pattern_acquire_surfaces (cairo_pattern_t *src,
cairo_pattern_t *mask,
cairo_surface_t *dst,
@@ -2481,11 +2489,11 @@ _cairo_pattern_acquire_surfaces (cairo_pattern_t *src,
cairo_surface_attributes_t *src_attributes,
cairo_surface_attributes_t *mask_attributes);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pattern_get_extents (cairo_pattern_t *pattern,
cairo_rectangle_int16_t *extents);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_set_antialias (cairo_gstate_t *gstate,
cairo_antialias_t antialias);
@@ -2503,13 +2511,13 @@ _cairo_region_extents_rectangle (pixman_region16_t *region,
/* cairo_unicode.c */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_utf8_to_ucs4 (const unsigned char *str,
int len,
uint32_t **result,
int *items_written);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_utf8_to_utf16 (const unsigned char *str,
int len,
uint16_t **result,
--
1.4.4.2
-------------- next part --------------
>From 6b9b0c1e7def3d06d626d1f6e75c813e7cf9d68c Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun, 18 Mar 2007 22:42:17 +0000
Subject: [PATCH] Fixup the majority of warn-if-unused-results.
Propagate status returns for all the simple cases.
---
pixman/src/icimage.c | 2 +-
src/cairo-clip-private.h | 12 +++---
src/cairo-clip.c | 19 +++++++++--
src/cairo-ft-font.c | 31 ++++++++++++++----
src/cairo-gstate.c | 24 ++++++++++++--
src/cairo-meta-surface.c | 9 ++++-
src/cairo-paginated-surface.c | 17 +++++++---
src/cairo-path-fill.c | 2 +-
src/cairo-path-stroke.c | 65 ++++++++++++++++++++++++++++----------
src/cairo-path.c | 5 ++-
src/cairo-pattern.c | 23 +++++++------
src/cairo-pdf-surface.c | 20 +++++------
src/cairo-pen.c | 28 ++++++++++------
src/cairo-polygon.c | 8 ++---
src/cairo-ps-surface.c | 30 ++++++++++-------
src/cairo-scaled-font.c | 33 ++++++++++++++-----
src/cairo-surface-fallback.c | 11 +++++--
src/cairo-surface.c | 12 +++++--
src/cairo-svg-surface.c | 10 +++++-
src/cairo.c | 70 ++++++++++++++++++++++++++++-------------
src/cairoint.h | 6 ++--
21 files changed, 299 insertions(+), 138 deletions(-)
diff --git a/pixman/src/icimage.c b/pixman/src/icimage.c
index c9b525d..8be3d00 100644
--- a/pixman/src/icimage.c
+++ b/pixman/src/icimage.c
@@ -188,7 +188,7 @@ _pixman_create_source_image (void)
image = (pixman_image_t *) malloc (sizeof (pixman_image_t));
if (!image)
- return;
+ return NULL;
image->pDrawable = NULL;
image->pixels = NULL;
image->format_code = PICT_a8r8g8b8;
diff --git a/src/cairo-clip-private.h b/src/cairo-clip-private.h
index 3c4ff0d..bfd8d77 100644
--- a/src/cairo-clip-private.h
+++ b/src/cairo-clip-private.h
@@ -89,15 +89,15 @@ _cairo_clip_fini (cairo_clip_t *clip);
cairo_private void
_cairo_clip_init_copy (cairo_clip_t *clip, cairo_clip_t *other);
-cairo_private void
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_init_deep_copy (cairo_clip_t *clip,
cairo_clip_t *other,
cairo_surface_t *target);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_reset (cairo_clip_t *clip);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_clip (cairo_clip_t *clip,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -105,15 +105,15 @@ _cairo_clip_clip (cairo_clip_t *clip,
cairo_antialias_t antialias,
cairo_surface_t *target);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_intersect_to_rectangle (cairo_clip_t *clip,
cairo_rectangle_int16_t *rectangle);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_intersect_to_region (cairo_clip_t *clip,
pixman_region16_t *region);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_combine_to_surface (cairo_clip_t *clip,
cairo_operator_t op,
cairo_surface_t *dst,
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index efecd89..966cf74 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -549,11 +549,12 @@ _cairo_clip_path_reapply_clip_path (cairo_clip_t *clip,
clip_path->antialias);
}
-void
+cairo_status_t
_cairo_clip_init_deep_copy (cairo_clip_t *clip,
cairo_clip_t *other,
cairo_surface_t *target)
{
+ cairo_status_t status;
_cairo_clip_init (clip, target);
if (other->mode != clip->mode) {
@@ -562,16 +563,23 @@ _cairo_clip_init_deep_copy (cairo_clip_t *clip,
} else {
if (other->region) {
clip->region = pixman_region_create ();
+ if (!clip->region)
+ return CAIRO_STATUS_NO_MEMORY;
pixman_region_copy (clip->region, other->region);
}
if (other->surface) {
- _cairo_surface_clone_similar (target, other->surface,
+ status = _cairo_surface_clone_similar (target, other->surface,
other->surface_rect.x,
other->surface_rect.y,
other->surface_rect.width,
other->surface_rect.height,
&clip->surface);
+ if (status) {
+ if (clip->region)
+ pixman_region_destroy (clip->region);
+ return status;
+ }
clip->surface_rect = other->surface_rect;
}
@@ -579,6 +587,8 @@ _cairo_clip_init_deep_copy (cairo_clip_t *clip,
_cairo_clip_path_reapply_clip_path (clip, other->path);
}
}
+
+ return CAIRO_STATUS_SUCCESS;
}
const cairo_rectangle_list_t _cairo_rectangles_nil =
@@ -635,8 +645,9 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate)
}
} else {
cairo_rectangle_int16_t extents;
- _cairo_surface_get_extents (_cairo_gstate_get_target (gstate), &extents);
- if (!_cairo_clip_rect_to_user(gstate, extents.x, extents.y,
+ cairo_status_t status;
+ status = _cairo_surface_get_extents (_cairo_gstate_get_target (gstate), &extents);
+ if (status || !_cairo_clip_rect_to_user(gstate, extents.x, extents.y,
extents.width, extents.height,
rectangles)) {
free (rectangles);
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 04095c2..c174275 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -574,12 +574,13 @@ _cairo_ft_unscaled_font_unlock_face (cairo_ft_unscaled_font_t *unscaled)
}
slim_hidden_def (cairo_ft_scaled_font_unlock_face);
-static void
+static cairo_status_t
_compute_transform (cairo_ft_font_transform_t *sf,
cairo_matrix_t *scale)
{
cairo_matrix_t normalized = *scale;
double tx, ty;
+ cairo_status_t status;
/* The font matrix has x and y "scale" components which we extract and
* use as character scale values. These influence the way freetype
@@ -588,9 +589,11 @@ _compute_transform (cairo_ft_font_transform_t *sf,
* freetype's transformation.
*/
- _cairo_matrix_compute_scale_factors (&normalized,
+ status = _cairo_matrix_compute_scale_factors (&normalized,
&sf->x_scale, &sf->y_scale,
/* XXX */ 1);
+ if (status)
+ return status;
if (sf->x_scale != 0 && sf->y_scale != 0) {
cairo_matrix_scale (&normalized, 1.0 / sf->x_scale, 1.0 / sf->y_scale);
@@ -603,6 +606,8 @@ _compute_transform (cairo_ft_font_transform_t *sf,
sf->shape[0][0] = sf->shape[1][1] = 1.0;
sf->shape[0][1] = sf->shape[1][0] = 0.0;
}
+
+ return CAIRO_STATUS_SUCCESS;
}
/* Temporarily scales an unscaled font to the give scale. We catch
@@ -613,6 +618,7 @@ _cairo_ft_unscaled_font_set_scale (cairo_ft_unscaled_font_t *unscaled,
cairo_matrix_t *scale)
{
cairo_ft_font_transform_t sf;
+ cairo_status_t status;
FT_Matrix mat;
FT_Error error;
@@ -628,7 +634,8 @@ _cairo_ft_unscaled_font_set_scale (cairo_ft_unscaled_font_t *unscaled,
unscaled->have_scale = TRUE;
unscaled->current_scale = *scale;
- _compute_transform (&sf, scale);
+ status = _compute_transform (&sf, scale);
+ assert (status == CAIRO_STATUS_SUCCESS);
unscaled->x_scale = sf.x_scale;
unscaled->y_scale = sf.y_scale;
@@ -1156,23 +1163,27 @@ _transform_glyph_bitmap (cairo_matrix_t * shape,
/* Initialize it to empty
*/
- _cairo_surface_fill_rectangle (image, CAIRO_OPERATOR_CLEAR,
+ status = _cairo_surface_fill_rectangle (image, CAIRO_OPERATOR_CLEAR,
CAIRO_COLOR_TRANSPARENT,
0, 0,
width, height);
+ if (status)
+ return status;
/* Draw the original bitmap transformed into the new bitmap
*/
_cairo_pattern_init_for_surface (&pattern, &(*surface)->base);
cairo_pattern_set_matrix (&pattern.base, &transformed_to_original);
- _cairo_surface_composite (CAIRO_OPERATOR_OVER,
+ status = _cairo_surface_composite (CAIRO_OPERATOR_OVER,
&pattern.base, NULL, image,
0, 0, 0, 0, 0, 0,
width,
height);
_cairo_pattern_fini (&pattern.base);
+ if (status)
+ return status;
/* Now update the cache entry for the new bitmap, recomputing
* the origin based on the final transform.
@@ -1527,6 +1538,7 @@ _cairo_ft_scaled_font_create_toy (cairo_toy_font_face_t *toy_face,
int fcweight;
cairo_matrix_t scale;
cairo_ft_font_transform_t sf;
+ cairo_status_t status;
cairo_ft_options_t ft_options;
unsigned char *family = (unsigned char*) toy_face->family;
@@ -1567,7 +1579,9 @@ _cairo_ft_scaled_font_create_toy (cairo_toy_font_face_t *toy_face,
goto FREE_PATTERN;
cairo_matrix_multiply (&scale, font_matrix, ctm);
- _compute_transform (&sf, &scale);
+ status = _compute_transform (&sf, &scale);
+ if (status)
+ return status;
FcPatternAddInteger (pattern, FC_PIXEL_SIZE, sf.y_scale);
@@ -1725,6 +1739,7 @@ _decompose_glyph_outline (FT_Face face,
FT_GlyphSlot glyph;
cairo_path_fixed_t *path;
+ cairo_status_t status;
path = _cairo_path_fixed_create ();
if (!path)
@@ -1736,7 +1751,9 @@ _decompose_glyph_outline (FT_Face face,
FT_Outline_Transform (&glyph->outline, &invert_y);
FT_Outline_Decompose (&glyph->outline, &outline_funcs, path);
- _cairo_path_fixed_close_path (path);
+ status = _cairo_path_fixed_close_path (path);
+ if (status)
+ return status;
*pathp = path;
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index d109e3e..7a57494 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -64,6 +64,8 @@ cairo_status_t
_cairo_gstate_init (cairo_gstate_t *gstate,
cairo_surface_t *target)
{
+ cairo_status_t status;
+
gstate->op = CAIRO_GSTATE_OPERATOR_DEFAULT;
gstate->tolerance = CAIRO_GSTATE_TOLERANCE_DEFAULT;
@@ -88,7 +90,9 @@ _cairo_gstate_init (cairo_gstate_t *gstate,
gstate->parent_target = NULL;
gstate->original_target = cairo_surface_reference (target);
- _cairo_gstate_identity_matrix (gstate);
+ status = _cairo_gstate_identity_matrix (gstate);
+ if (status)
+ return status;
gstate->source_ctm_inverse = gstate->ctm_inverse;
gstate->source = _cairo_pattern_create_solid (CAIRO_COLOR_BLACK);
@@ -252,9 +256,11 @@ _cairo_gstate_recursive_apply_clip_path (cairo_gstate_t *gstate,
* original #cairo_t target, the clip will be INVALID after this call,
* and the caller should either recreate or reset the clip.
**/
-void
+cairo_status_t
_cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child)
{
+ cairo_status_t status;
+
/* If this gstate is already redirected, this is an error; we need a
* new gstate to be able to redirect */
assert (gstate->parent_target == NULL);
@@ -270,13 +276,20 @@ _cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child)
gstate->target = cairo_surface_reference (child);
_cairo_clip_fini (&gstate->clip);
- _cairo_clip_init_deep_copy (&gstate->clip, &gstate->next->clip, child);
+ status = _cairo_clip_init_deep_copy (&gstate->clip, &gstate->next->clip, child);
+ if (status) {
+ cairo_surface_destroy (gstate->target);
+ gstate->target = NULL;
+ return status;
+ }
/* The clip is in surface backend coordinates for the previous target;
* translate it into the child's backend coordinates. */
_cairo_clip_translate (&gstate->clip,
_cairo_fixed_from_double (child->device_transform.x0 - gstate->parent_target->device_transform.x0),
_cairo_fixed_from_double (child->device_transform.y0 - gstate->parent_target->device_transform.y0));
+
+ return CAIRO_STATUS_SUCCESS;
}
/**
@@ -1209,12 +1222,15 @@ _cairo_gstate_select_font_face (cairo_gstate_t *gstate,
cairo_font_weight_t weight)
{
cairo_font_face_t *font_face;
+ cairo_status_t status;
font_face = _cairo_toy_font_face_create (family, slant, weight);
if (font_face->status)
return font_face->status;
- _cairo_gstate_set_font_face (gstate, font_face);
+ status = _cairo_gstate_set_font_face (gstate, font_face);
+ if (status)
+ return status;
cairo_font_face_destroy (font_face);
return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-meta-surface.c b/src/cairo-meta-surface.c
index e196df2..b6665cb 100644
--- a/src/cairo-meta-surface.c
+++ b/src/cairo-meta-surface.c
@@ -212,7 +212,10 @@ static cairo_status_t
_init_pattern_with_snapshot (cairo_pattern_t *pattern,
const cairo_pattern_t *other)
{
- _cairo_pattern_init_copy (pattern, other);
+ cairo_status_t status;
+ status = _cairo_pattern_init_copy (pattern, other);
+ if (status)
+ return status;
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
cairo_surface_pattern_t *surface_pattern =
@@ -668,7 +671,9 @@ _cairo_meta_surface_replay (cairo_surface_t *surface,
dev_path = _cairo_command_get_path (command);
if (dev_path && has_device_transform) {
- _cairo_path_fixed_init_copy (&path_copy, dev_path);
+ status = _cairo_path_fixed_init_copy (&path_copy, dev_path);
+ if (status)
+ break;
_cairo_path_fixed_device_transform (&path_copy, device_transform);
dev_path = &path_copy;
}
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index c8e4612..023f2a7 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -202,8 +202,11 @@ _cairo_paginated_surface_acquire_source_image (void *abstract_surface,
cairo_paginated_surface_t *surface = abstract_surface;
cairo_surface_t *image;
cairo_rectangle_int16_t extents;
+ cairo_status_t status;
- _cairo_surface_get_extents (surface->target, &extents);
+ status = _cairo_surface_get_extents (surface->target, &extents);
+ if (status)
+ return status;
image = _cairo_paginated_surface_create_image_surface (surface,
extents.width,
@@ -231,7 +234,7 @@ _paint_page (cairo_paginated_surface_t *surface)
cairo_surface_t *analysis;
cairo_surface_t *image;
cairo_pattern_t *pattern;
- cairo_status_t status;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
analysis = _cairo_analysis_surface_create (surface->target,
surface->width, surface->height);
@@ -263,7 +266,9 @@ _paint_page (cairo_paginated_surface_t *surface)
cairo_matrix_init_scale (&matrix, x_scale, y_scale);
cairo_pattern_set_matrix (pattern, &matrix);
- _cairo_surface_paint (surface->target, CAIRO_OPERATOR_SOURCE, pattern);
+ status = _cairo_surface_paint (surface->target,
+ CAIRO_OPERATOR_SOURCE,
+ pattern);
cairo_pattern_destroy (pattern);
@@ -276,7 +281,7 @@ _paint_page (cairo_paginated_surface_t *surface)
cairo_surface_destroy (analysis);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
static cairo_status_t
@@ -325,7 +330,9 @@ _cairo_paginated_surface_show_page (void *abstract_surface)
_paint_page (surface);
- _cairo_surface_show_page (surface->target);
+ status = _cairo_surface_show_page (surface->target);
+ if (status)
+ return status;
cairo_surface_destroy (surface->meta);
diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
index b1b7a12..d2a9118 100644
--- a/src/cairo-path-fill.c
+++ b/src/cairo-path-fill.c
@@ -138,7 +138,7 @@ _cairo_filler_curve_to (void *closure,
if (status == CAIRO_INT_STATUS_DEGENERATE)
return CAIRO_STATUS_SUCCESS;
- _cairo_spline_decompose (&spline, filler->tolerance);
+ status = _cairo_spline_decompose (&spline, filler->tolerance);
if (status)
goto CLEANUP_SPLINE;
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index ebe7c90..d4db605 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -75,7 +75,7 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
double tolerance,
cairo_traps_t *traps);
-static void
+static cairo_status_t
_cairo_stroker_fini (cairo_stroker_t *stroker);
static cairo_status_t
@@ -176,10 +176,10 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
tolerance, ctm);
}
-static void
+static cairo_status_t
_cairo_stroker_fini (cairo_stroker_t *stroker)
{
- _cairo_pen_fini (&stroker->pen);
+ return _cairo_pen_fini (&stroker->pen);
}
static void
@@ -205,6 +205,7 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
{
int clockwise = _cairo_stroker_face_clockwise (out, in);
cairo_point_t *inpt, *outpt;
+ cairo_status_t status;
if (in->cw.x == out->cw.x
&& in->cw.y == out->cw.y
@@ -231,13 +232,21 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
tri[0] = in->point;
if (clockwise) {
- _cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start);
+ status = _cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start);
+ if (status)
+ return status;
step = -1;
- _cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop);
+ status = _cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop);
+ if (status)
+ return status;
} else {
- _cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start);
+ status = _cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start);
+ if (status)
+ return status;
step = +1;
- _cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop);
+ status = _cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop);
+ if (status)
+ return status;
}
i = start;
@@ -245,7 +254,9 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
while (i != stop) {
tri[2] = in->point;
_translate_point (&tri[2], &pen->vertices[i].point);
- _cairo_traps_tessellate_triangle (stroker->traps, tri);
+ status = _cairo_traps_tessellate_triangle (stroker->traps, tri);
+ if (status)
+ return status;
tri[1] = tri[2];
i += step;
if (i < 0)
@@ -378,17 +389,23 @@ _cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
cairo_pen_t *pen = &stroker->pen;
slope = f->dev_vector;
- _cairo_pen_find_active_cw_vertex_index (pen, &slope, &start);
+ status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &start);
+ if (status)
+ return status;
slope.dx = -slope.dx;
slope.dy = -slope.dy;
- _cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop);
+ status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop);
+ if (status)
+ return status;
tri[0] = f->point;
tri[1] = f->cw;
for (i=start; i != stop; i = (i+1) % pen->num_vertices) {
tri[2] = f->point;
_translate_point (&tri[2], &pen->vertices[i].point);
- _cairo_traps_tessellate_triangle (stroker->traps, tri);
+ status = _cairo_traps_tessellate_triangle (stroker->traps, tri);
+ if (status)
+ return status;
tri[1] = tri[2];
}
tri[2] = f->ccw;
@@ -414,13 +431,24 @@ _cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
ocw.y = f->cw.y + fvector.dy;
_cairo_polygon_init (&polygon);
- _cairo_polygon_move_to (&polygon, &f->cw);
- _cairo_polygon_line_to (&polygon, &ocw);
- _cairo_polygon_line_to (&polygon, &occw);
- _cairo_polygon_line_to (&polygon, &f->ccw);
- _cairo_polygon_close (&polygon);
+ status = _cairo_polygon_move_to (&polygon, &f->cw);
+ if (status)
+ goto CLEANUP_LINE_CAP_SQUARE;
+ status = _cairo_polygon_line_to (&polygon, &ocw);
+ if (status)
+ goto CLEANUP_LINE_CAP_SQUARE;
+ status = _cairo_polygon_line_to (&polygon, &occw);
+ if (status)
+ goto CLEANUP_LINE_CAP_SQUARE;
+ status = _cairo_polygon_line_to (&polygon, &f->ccw);
+ if (status)
+ goto CLEANUP_LINE_CAP_SQUARE;
+ status = _cairo_polygon_close (&polygon);
+ if (status)
+ goto CLEANUP_LINE_CAP_SQUARE;
status = _cairo_bentley_ottmann_tessellate_polygon (stroker->traps, &polygon, CAIRO_FILL_RULE_WINDING);
+CLEANUP_LINE_CAP_SQUARE:
_cairo_polygon_fini (&polygon);
return status;
@@ -779,6 +807,7 @@ _cairo_stroker_curve_to (void *closure,
cairo_point_t *d)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
+ cairo_status_t status2;
cairo_stroker_t *stroker = closure;
cairo_spline_t spline;
cairo_pen_t pen;
@@ -830,7 +859,9 @@ _cairo_stroker_curve_to (void *closure,
goto CLEANUP_PEN;
CLEANUP_PEN:
- _cairo_pen_fini (&pen);
+ status2 = _cairo_pen_fini (&pen);
+ if (status == CAIRO_STATUS_SUCCESS)
+ status = status2;
CLEANUP_SPLINE:
_cairo_spline_fini (&spline);
diff --git a/src/cairo-path.c b/src/cairo-path.c
index 7c2374c..a12db36 100644
--- a/src/cairo-path.c
+++ b/src/cairo-path.c
@@ -136,13 +136,14 @@ _cairo_path_count (cairo_path_t *path,
cairo_bool_t flatten)
{
cpc_t cpc;
+ cairo_status_t status;
cpc.count = 0;
cpc.tolerance = tolerance;
cpc.current_point.x = 0;
cpc.current_point.y = 0;
- _cairo_path_fixed_interpret (path_fixed,
+ status = _cairo_path_fixed_interpret (path_fixed,
CAIRO_DIRECTION_FORWARD,
_cpc_move_to,
_cpc_line_to,
@@ -151,6 +152,8 @@ _cairo_path_count (cairo_path_t *path,
_cpc_curve_to,
_cpc_close_path,
&cpc);
+ if (status)
+ return 0;
return cpc.count;
}
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 1f53ae1..e3857ba 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1608,7 +1608,9 @@ _cairo_pattern_acquire_surfaces (cairo_pattern_t *src,
}
else
{
- _cairo_pattern_init_copy (&src_tmp.base, src);
+ status = _cairo_pattern_init_copy (&src_tmp.base, src);
+ if (status)
+ return status;
}
status = _cairo_pattern_acquire_surface (&src_tmp.base, dst,
@@ -1627,16 +1629,17 @@ _cairo_pattern_acquire_surfaces (cairo_pattern_t *src,
return CAIRO_STATUS_SUCCESS;
}
- _cairo_pattern_init_copy (&mask_tmp.base, mask);
-
- status = _cairo_pattern_acquire_surface (&mask_tmp.base, dst,
- mask_x, mask_y,
- width, height,
- mask_out, mask_attributes);
+ status = _cairo_pattern_init_copy (&mask_tmp.base, mask);
- if (status)
- _cairo_pattern_release_surface (&src_tmp.base,
- *src_out, src_attributes);
+ if (status == CAIRO_STATUS_SUCCESS) {
+ status = _cairo_pattern_acquire_surface (&mask_tmp.base, dst,
+ mask_x, mask_y,
+ width, height,
+ mask_out, mask_attributes);
+ if (status)
+ _cairo_pattern_release_surface (&src_tmp.base,
+ *src_out, src_attributes);
+ }
_cairo_pattern_fini (&src_tmp.base);
_cairo_pattern_fini (&mask_tmp.base);
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 924b80c..25e5058 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -900,7 +900,9 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
if (status)
goto BAIL;
- _cairo_surface_get_extents (&surface->base, &surface_extents);
+ status = _cairo_surface_get_extents (&surface->base, &surface_extents);
+ if (status)
+ goto BAIL;
switch (extend) {
/* We implement EXTEND_PAD like EXTEND_NONE for now */
@@ -1822,11 +1824,11 @@ _cairo_pdf_surface_emit_cff_font_subset (cairo_pdf_surface_t *surface,
font.font_id = font_subset->font_id;
font.subset_id = font_subset->subset_id;
font.subset_resource = subset_resource;
- _cairo_array_append (&surface->fonts, &font);
+ status = _cairo_array_append (&surface->fonts, &font);
_cairo_cff_subset_fini (&subset);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
static cairo_status_t
@@ -1931,9 +1933,7 @@ _cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t *surface,
font.font_id = font_subset->font_id;
font.subset_id = font_subset->subset_id;
font.subset_resource = subset_resource;
- _cairo_array_append (&surface->fonts, &font);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_array_append (&surface->fonts, &font);
}
#if CAIRO_HAS_FT_FONT
@@ -2102,11 +2102,11 @@ _cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t *surface,
font.font_id = font_subset->font_id;
font.subset_id = font_subset->subset_id;
font.subset_resource = subset_resource;
- _cairo_array_append (&surface->fonts, &font);
+ status = _cairo_array_append (&surface->fonts, &font);
_cairo_truetype_subset_fini (&subset);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
static cairo_int_status_t
@@ -2387,9 +2387,7 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
font.font_id = font_subset->font_id;
font.subset_id = font_subset->subset_id;
font.subset_resource = subset_resource;
- _cairo_array_append (&surface->fonts, &font);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_array_append (&surface->fonts, &font);
}
static void
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 1af8c36..66984b3 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -106,13 +106,13 @@ _cairo_pen_init (cairo_pen_t *pen,
return CAIRO_STATUS_SUCCESS;
}
-void
+cairo_status_t
_cairo_pen_fini (cairo_pen_t *pen)
{
free (pen->vertices);
pen->vertices = NULL;
- _cairo_pen_init_empty (pen);
+ return _cairo_pen_init_empty (pen);
}
cairo_status_t
@@ -135,6 +135,7 @@ cairo_status_t
_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points)
{
cairo_pen_vertex_t *vertices;
+ cairo_status_t status;
int num_vertices;
int i;
@@ -150,7 +151,9 @@ _cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points)
for (i=0; i < num_points; i++)
pen->vertices[pen->num_vertices-num_points+i].point = point[i];
- _cairo_hull_compute (pen->vertices, &pen->num_vertices);
+ status = _cairo_hull_compute (pen->vertices, &pen->num_vertices);
+ if (status)
+ return status;
_cairo_pen_compute_slopes (pen);
@@ -388,7 +391,9 @@ _cairo_pen_stroke_spline_half (cairo_pen_t *pen,
final_slope.dy = -final_slope.dy;
}
- _cairo_pen_find_active_cw_vertex_index (pen, &initial_slope, &active);
+ status = _cairo_pen_find_active_cw_vertex_index (pen, &initial_slope, &active);
+ if (status)
+ return status;
i = start;
while (i != stop) {
@@ -437,19 +442,22 @@ _cairo_pen_stroke_spline (cairo_pen_t *pen,
status = _cairo_spline_decompose (spline, tolerance);
if (status)
- return status;
+ goto BAIL;
status = _cairo_pen_stroke_spline_half (pen, spline, CAIRO_DIRECTION_FORWARD, &polygon);
if (status)
- return status;
+ goto BAIL;
status = _cairo_pen_stroke_spline_half (pen, spline, CAIRO_DIRECTION_REVERSE, &polygon);
if (status)
- return status;
+ goto BAIL;
- _cairo_polygon_close (&polygon);
- _cairo_bentley_ottmann_tessellate_polygon (traps, &polygon, CAIRO_FILL_RULE_WINDING);
+ status = _cairo_polygon_close (&polygon);
+ if (status)
+ goto BAIL;
+ status = _cairo_bentley_ottmann_tessellate_polygon (traps, &polygon, CAIRO_FILL_RULE_WINDING);
+BAIL:
_cairo_polygon_fini (&polygon);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c
index 52c72b7..86191ca 100644
--- a/src/cairo-polygon.c
+++ b/src/cairo-polygon.c
@@ -135,9 +135,7 @@ _cairo_polygon_add_edge (cairo_polygon_t *polygon, cairo_point_t *p1, cairo_poin
polygon->num_edges++;
DONE:
- _cairo_polygon_move_to (polygon, p2);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_polygon_move_to (polygon, p2);
}
cairo_status_t
@@ -154,12 +152,12 @@ _cairo_polygon_move_to (cairo_polygon_t *polygon, cairo_point_t *point)
cairo_status_t
_cairo_polygon_line_to (cairo_polygon_t *polygon, cairo_point_t *point)
{
- cairo_status_t status = CAIRO_STATUS_SUCCESS;
+ cairo_status_t status;
if (polygon->has_current_point) {
status = _cairo_polygon_add_edge (polygon, &polygon->current_point, point);
} else {
- _cairo_polygon_move_to (polygon, point);
+ status = _cairo_polygon_move_to (polygon, point);
}
return status;
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 5f43e98..612865d 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1588,20 +1588,21 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t *surface,
_cairo_pattern_init_for_surface (&pattern.surface, &image->base);
- _cairo_surface_fill_rectangle (opaque,
+ status = _cairo_surface_fill_rectangle (opaque,
CAIRO_OPERATOR_SOURCE,
CAIRO_COLOR_WHITE,
0, 0, image->width, image->height);
- _cairo_surface_composite (CAIRO_OPERATOR_OVER,
- &pattern.base,
- NULL,
- opaque,
- 0, 0,
- 0, 0,
- 0, 0,
- image->width,
- image->height);
+ if (status == CAIRO_STATUS_SUCCESS)
+ status = _cairo_surface_composite (CAIRO_OPERATOR_OVER,
+ &pattern.base,
+ NULL,
+ opaque,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ image->width,
+ image->height);
_cairo_pattern_fini (&pattern.base);
opaque_image = (cairo_image_surface_t *) opaque;
@@ -1930,6 +1931,7 @@ _cairo_ps_surface_paint (void *abstract_surface,
cairo_ps_surface_t *surface = abstract_surface;
cairo_output_stream_t *stream = surface->stream;
cairo_rectangle_int16_t extents, pattern_extents;
+ cairo_status_t status;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _cairo_ps_surface_analyze_operation (surface, op, source);
@@ -1947,8 +1949,12 @@ _cairo_ps_surface_paint (void *abstract_surface,
_cairo_output_stream_printf (stream,
"%% _cairo_ps_surface_paint\n");
- _cairo_surface_get_extents (&surface->base, &extents);
- _cairo_pattern_get_extents (source, &pattern_extents);
+ status = _cairo_surface_get_extents (&surface->base, &extents);
+ if (status)
+ return status;
+ status = _cairo_pattern_get_extents (source, &pattern_extents);
+ if (status)
+ return status;
_cairo_rectangle_intersect (&extents, &pattern_extents);
_cairo_ps_surface_emit_pattern (surface, source);
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 3497323..870ca9c 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -403,15 +403,18 @@ _cairo_scaled_font_reset_cache (cairo_scaled_font_t *scaled_font)
max_glyphs_cached_per_font);
}
-void
+cairo_status_t
_cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font,
cairo_font_extents_t *fs_metrics)
{
double font_scale_x, font_scale_y;
+ cairo_status_t status;
- _cairo_matrix_compute_scale_factors (&scaled_font->font_matrix,
+ status = _cairo_matrix_compute_scale_factors (&scaled_font->font_matrix,
&font_scale_x, &font_scale_y,
/* XXX */ 1);
+ if (status)
+ return status;
/*
* The font responded in unscaled units, scale by the font
@@ -423,6 +426,8 @@ _cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font,
scaled_font->extents.height = fs_metrics->height * font_scale_y;
scaled_font->extents.max_x_advance = fs_metrics->max_x_advance * font_scale_x;
scaled_font->extents.max_y_advance = fs_metrics->max_y_advance * font_scale_y;
+
+ return CAIRO_STATUS_SUCCESS;
}
void
@@ -1207,6 +1212,7 @@ _trace_mask_to_path (cairo_image_surface_t *mask,
int rows, cols, bytes_per_row;
int x, y, bit;
double xoff, yoff;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
if (mask->format == CAIRO_FORMAT_A1)
a1_mask = mask;
@@ -1224,28 +1230,39 @@ _trace_mask_to_path (cairo_image_surface_t *mask,
byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte_ptr);
for (bit = 7; bit >= 0 && x < a1_mask->width; bit--, x++) {
if (byte & (1 << bit)) {
- _cairo_path_fixed_move_to (path,
+ status = _cairo_path_fixed_move_to (path,
_cairo_fixed_from_int (x + xoff),
_cairo_fixed_from_int (y + yoff));
- _cairo_path_fixed_rel_line_to (path,
+ if (status)
+ goto BAIL;
+ status = _cairo_path_fixed_rel_line_to (path,
_cairo_fixed_from_int (1),
_cairo_fixed_from_int (0));
- _cairo_path_fixed_rel_line_to (path,
+ if (status)
+ goto BAIL;
+ status = _cairo_path_fixed_rel_line_to (path,
_cairo_fixed_from_int (0),
_cairo_fixed_from_int (1));
- _cairo_path_fixed_rel_line_to (path,
+ if (status)
+ goto BAIL;
+ status = _cairo_path_fixed_rel_line_to (path,
_cairo_fixed_from_int (-1),
_cairo_fixed_from_int (0));
- _cairo_path_fixed_close_path (path);
+ if (status)
+ goto BAIL;
+ status = _cairo_path_fixed_close_path (path);
+ if (status)
+ goto BAIL;
}
}
}
}
+BAIL:
if (a1_mask != mask)
cairo_surface_destroy (&a1_mask->base);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
cairo_status_t
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 1a7d666..581c3ad 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -453,7 +453,7 @@ _composite_trap_region (cairo_clip_t *clip,
/* Restore the original clip if we modified it temporarily. */
if (num_rects >1)
- _cairo_surface_set_clip (dst, clip);
+ status = _cairo_surface_set_clip (dst, clip);
if (clip_surface)
_cairo_pattern_fini (&mask.base);
@@ -979,7 +979,7 @@ _cairo_surface_fallback_snapshot (cairo_surface_t *surface)
_cairo_pattern_init_for_surface (&pattern.surface, &image->base);
- _cairo_surface_composite (CAIRO_OPERATOR_SOURCE,
+ status = _cairo_surface_composite (CAIRO_OPERATOR_SOURCE,
&pattern.base,
NULL,
snapshot,
@@ -993,6 +993,11 @@ _cairo_surface_fallback_snapshot (cairo_surface_t *surface)
_cairo_surface_release_source_image (surface,
image, &image_extra);
+ if (status != CAIRO_STATUS_SUCCESS) {
+ cairo_surface_destroy (snapshot);
+ return (cairo_surface_t *) &_cairo_surface_nil;
+ }
+
snapshot->device_transform = surface->device_transform;
snapshot->device_transform_inverse = surface->device_transform_inverse;
@@ -1158,7 +1163,7 @@ _cairo_surface_fallback_composite_trapezoids (cairo_operator_t op,
traps = offset_traps;
}
- _cairo_surface_composite_trapezoids (op, pattern,
+ status = _cairo_surface_composite_trapezoids (op, pattern,
&state.image->base,
antialias,
src_x, src_y,
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 740d7fd..9552c20 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -81,7 +81,7 @@ DEFINE_NIL_SURFACE(CAIRO_STATUS_FILE_NOT_FOUND, _cairo_surface_nil_file_not_foun
DEFINE_NIL_SURFACE(CAIRO_STATUS_READ_ERROR, _cairo_surface_nil_read_error);
DEFINE_NIL_SURFACE(CAIRO_STATUS_WRITE_ERROR, _cairo_surface_nil_write_error);
-static void
+static cairo_status_t
_cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
cairo_surface_t *destination,
cairo_pattern_t *pattern_out);
@@ -2069,16 +2069,18 @@ _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst,
* Copies the given pattern, taking into account device scale and offsets
* of the destination surface.
*/
-void
+static cairo_status_t
_cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
cairo_surface_t *destination,
cairo_pattern_t *pattern_out)
{
- _cairo_pattern_init_copy (pattern_out, pattern);
+ cairo_status_t status;
+ status = _cairo_pattern_init_copy (pattern_out, pattern);
+ if (status)
+ return status;
if (_cairo_surface_has_device_transform (destination)) {
cairo_matrix_t device_to_surface = destination->device_transform;
- cairo_status_t status;
status = cairo_matrix_invert (&device_to_surface);
/* We only ever allow for scaling (under the implementation's
@@ -2088,6 +2090,8 @@ _cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
_cairo_pattern_transform (pattern_out, &device_to_surface);
}
+
+ return CAIRO_STATUS_SUCCESS;
}
/* LocalWords: rasterized
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 5cb9ce0..a58c8cb 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -435,6 +435,7 @@ _cairo_svg_surface_store_page (cairo_svg_surface_t *surface)
{
unsigned int i;
cairo_svg_page_t page;
+ cairo_status_t status;
page.surface_id = surface->id;
page.clip_id = surface->base_clip;
@@ -447,7 +448,9 @@ _cairo_svg_surface_store_page (cairo_svg_surface_t *surface)
for (i = 0; i < page.clip_level; i++)
_cairo_output_stream_printf (page.xml_node, "</g>\n");
- _cairo_array_append (&surface->page_set, &page);
+ status = _cairo_array_append (&surface->page_set, &page);
+ if (status)
+ return NULL;
return _cairo_array_index (&surface->page_set, surface->page_set.num_elements - 1);
}
@@ -459,6 +462,8 @@ _cairo_svg_surface_copy_page (void *abstract_surface)
cairo_svg_page_t *page;
page = _cairo_svg_surface_store_page (surface);
+ if (page == NULL)
+ return CAIRO_STATUS_NO_MEMORY;
_cairo_memory_stream_copy (page->xml_node, surface->xml_node);
surface->clip_level = page->clip_level;
@@ -471,7 +476,8 @@ _cairo_svg_surface_show_page (void *abstract_surface)
{
cairo_svg_surface_t *surface = abstract_surface;
- _cairo_svg_surface_store_page (surface);
+ if (_cairo_svg_surface_store_page (surface) == NULL)
+ return CAIRO_STATUS_NO_MEMORY;
return CAIRO_STATUS_SUCCESS;
}
diff --git a/src/cairo.c b/src/cairo.c
index 21303de..2f720c7 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -189,6 +189,7 @@ cairo_t *
cairo_create (cairo_surface_t *target)
{
cairo_t *cr;
+ cairo_status_t status;
cr = malloc (sizeof (cairo_t));
if (cr == NULL)
@@ -201,7 +202,10 @@ cairo_create (cairo_surface_t *target)
_cairo_user_data_array_init (&cr->user_data);
cr->gstate = cr->gstate_tail;
- _cairo_gstate_init (cr->gstate, target);
+ status = _cairo_gstate_init (cr->gstate, target);
+ if (status) {
+ _cairo_set_error (cr, status);
+ }
_cairo_path_fixed_init (cr->path);
@@ -491,9 +495,12 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content)
cairo_surface_t *group_surface = NULL;
/* Get the extents that we'll use in creating our new group surface */
- _cairo_surface_get_extents (_cairo_gstate_get_target (cr->gstate), &extents);
+ status = _cairo_surface_get_extents (_cairo_gstate_get_target (cr->gstate), &extents);
+ if (status)
+ goto bail;
+
status = _cairo_clip_intersect_to_rectangle (_cairo_gstate_get_clip (cr->gstate), &extents);
- if (status != CAIRO_STATUS_SUCCESS)
+ if (status)
goto bail;
group_surface = cairo_surface_create_similar (_cairo_gstate_get_target (cr->gstate),
@@ -518,7 +525,7 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content)
if (cr->status)
goto bail;
- _cairo_gstate_redirect_target (cr->gstate, group_surface);
+ status = _cairo_gstate_redirect_target (cr->gstate, group_surface);
bail:
cairo_surface_destroy (group_surface);
@@ -1623,18 +1630,21 @@ cairo_arc_to (cairo_t *cr,
void
cairo_rel_move_to (cairo_t *cr, double dx, double dy)
{
+ cairo_status_t status;
cairo_fixed_t dx_fixed, dy_fixed;
if (cr->status)
return;
- _cairo_gstate_user_to_device_distance (cr->gstate, &dx, &dy);
- dx_fixed = _cairo_fixed_from_double (dx);
- dy_fixed = _cairo_fixed_from_double (dy);
+ status = _cairo_gstate_user_to_device_distance (cr->gstate, &dx, &dy);
+ if (status == CAIRO_STATUS_SUCCESS) {
+ dx_fixed = _cairo_fixed_from_double (dx);
+ dy_fixed = _cairo_fixed_from_double (dy);
- cr->status = _cairo_path_fixed_rel_move_to (cr->path, dx_fixed, dy_fixed);
- if (cr->status)
- _cairo_set_error (cr, cr->status);
+ status = _cairo_path_fixed_rel_move_to (cr->path, dx_fixed, dy_fixed);
+ }
+ if (status)
+ _cairo_set_error (cr, status);
}
/**
@@ -1659,17 +1669,20 @@ void
cairo_rel_line_to (cairo_t *cr, double dx, double dy)
{
cairo_fixed_t dx_fixed, dy_fixed;
+ cairo_status_t status;
if (cr->status)
return;
- _cairo_gstate_user_to_device_distance (cr->gstate, &dx, &dy);
- dx_fixed = _cairo_fixed_from_double (dx);
- dy_fixed = _cairo_fixed_from_double (dy);
+ status = _cairo_gstate_user_to_device_distance (cr->gstate, &dx, &dy);
+ if (status == CAIRO_STATUS_SUCCESS) {
+ dx_fixed = _cairo_fixed_from_double (dx);
+ dy_fixed = _cairo_fixed_from_double (dy);
- cr->status = _cairo_path_fixed_rel_line_to (cr->path, dx_fixed, dy_fixed);
- if (cr->status)
- _cairo_set_error (cr, cr->status);
+ status = _cairo_path_fixed_rel_line_to (cr->path, dx_fixed, dy_fixed);
+ }
+ if (status)
+ _cairo_set_error (cr, status);
}
slim_hidden_def(cairo_rel_line_to);
@@ -1708,13 +1721,26 @@ cairo_rel_curve_to (cairo_t *cr,
cairo_fixed_t dx1_fixed, dy1_fixed;
cairo_fixed_t dx2_fixed, dy2_fixed;
cairo_fixed_t dx3_fixed, dy3_fixed;
+ cairo_status_t status;
if (cr->status)
return;
- _cairo_gstate_user_to_device_distance (cr->gstate, &dx1, &dy1);
- _cairo_gstate_user_to_device_distance (cr->gstate, &dx2, &dy2);
- _cairo_gstate_user_to_device_distance (cr->gstate, &dx3, &dy3);
+ status = _cairo_gstate_user_to_device_distance (cr->gstate, &dx1, &dy1);
+ if (status) {
+ _cairo_set_error (cr, status);
+ return;
+ }
+ status = _cairo_gstate_user_to_device_distance (cr->gstate, &dx2, &dy2);
+ if (status) {
+ _cairo_set_error (cr, status);
+ return;
+ }
+ status = _cairo_gstate_user_to_device_distance (cr->gstate, &dx3, &dy3);
+ if (status) {
+ _cairo_set_error (cr, status);
+ return;
+ }
dx1_fixed = _cairo_fixed_from_double (dx1);
dy1_fixed = _cairo_fixed_from_double (dy1);
@@ -1725,12 +1751,12 @@ cairo_rel_curve_to (cairo_t *cr,
dx3_fixed = _cairo_fixed_from_double (dx3);
dy3_fixed = _cairo_fixed_from_double (dy3);
- cr->status = _cairo_path_fixed_rel_curve_to (cr->path,
+ status = _cairo_path_fixed_rel_curve_to (cr->path,
dx1_fixed, dy1_fixed,
dx2_fixed, dy2_fixed,
dx3_fixed, dy3_fixed);
- if (cr->status)
- _cairo_set_error (cr, cr->status);
+ if (status)
+ _cairo_set_error (cr, status);
}
/**
diff --git a/src/cairoint.h b/src/cairoint.h
index d67ea93..f9889d2 100755
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1336,7 +1336,7 @@ _cairo_gstate_destroy (cairo_gstate_t *gstate);
cairo_private cairo_bool_t
_cairo_gstate_is_redirected (cairo_gstate_t *gstate);
-cairo_private void
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child);
cairo_private cairo_surface_t *
@@ -1814,7 +1814,7 @@ _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
const cairo_font_options_t *options,
const cairo_scaled_font_backend_t *backend);
-cairo_private void
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font,
cairo_font_extents_t *fs_metrics);
@@ -2256,7 +2256,7 @@ _cairo_pen_init_empty (cairo_pen_t *pen);
cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_init_copy (cairo_pen_t *pen, cairo_pen_t *other);
-cairo_private void
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_fini (cairo_pen_t *pen);
cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
--
1.4.4.2
-------------- next part --------------
>From 6e6d0b0d1cbcb79547f00c6c7161832cb25d5bd0 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun, 18 Mar 2007 22:55:22 +0000
Subject: [PATCH] Add warn-unused-result to *private.h
---
src/cairo-cache-private.h | 2 +-
src/cairo-hash-private.h | 2 +-
src/cairo-meta-surface-private.h | 2 +-
src/cairo-output-stream-private.h | 8 ++++----
src/cairo-path-private.h | 2 +-
src/cairo-ps-surface.c | 5 ++++-
src/cairo-scaled-font-subsets-private.h | 18 +++++++++---------
src/cairo-surface-fallback-private.h | 16 ++++++++--------
8 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/src/cairo-cache-private.h b/src/cairo-cache-private.h
index 566dbe2..89adf1e 100644
--- a/src/cairo-cache-private.h
+++ b/src/cairo-cache-private.h
@@ -113,7 +113,7 @@ _cairo_cache_lookup (cairo_cache_t *cache,
cairo_cache_entry_t *key,
cairo_cache_entry_t **entry_return);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_cache_insert (cairo_cache_t *cache,
cairo_cache_entry_t *entry);
diff --git a/src/cairo-hash-private.h b/src/cairo-hash-private.h
index 617b841..92ce6f8 100644
--- a/src/cairo-hash-private.h
+++ b/src/cairo-hash-private.h
@@ -109,7 +109,7 @@ cairo_private void *
_cairo_hash_table_random_entry (cairo_hash_table_t *hash_table,
cairo_hash_predicate_func_t predicate);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_hash_table_insert (cairo_hash_table_t *hash_table,
cairo_hash_entry_t *entry);
diff --git a/src/cairo-meta-surface-private.h b/src/cairo-meta-surface-private.h
index 3f2d390..0f827c1 100644
--- a/src/cairo-meta-surface-private.h
+++ b/src/cairo-meta-surface-private.h
@@ -147,7 +147,7 @@ _cairo_meta_surface_create (cairo_content_t content,
int width_pixels,
int height_pixels);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_meta_surface_replay (cairo_surface_t *surface,
cairo_surface_t *target);
diff --git a/src/cairo-output-stream-private.h b/src/cairo-output-stream-private.h
index d68fbb4..5629c45 100644
--- a/src/cairo-output-stream-private.h
+++ b/src/cairo-output-stream-private.h
@@ -60,7 +60,7 @@ _cairo_output_stream_init (cairo_output_stream_t *stream,
cairo_output_stream_write_func_t write_func,
cairo_output_stream_close_func_t close_func);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_output_stream_fini (cairo_output_stream_t *stream);
@@ -89,13 +89,13 @@ _cairo_output_stream_create (cairo_write_func_t write_func,
/* Returns the final status value associated with this object, just
* before its last gasp. This final status value will capture any
* status failure returned by the stream's close_func as well. */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_output_stream_close (cairo_output_stream_t *stream);
/* Returns the final status value associated with this object, just
* before its last gasp. This final status value will capture any
* status failure returned by the stream's close_func as well. */
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_output_stream_destroy (cairo_output_stream_t *stream);
cairo_private void
@@ -121,7 +121,7 @@ _cairo_output_stream_printf (cairo_output_stream_t *stream,
cairo_private long
_cairo_output_stream_get_position (cairo_output_stream_t *stream);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_output_stream_get_status (cairo_output_stream_t *stream);
/* This function never returns NULL. If an error occurs (NO_MEMORY or
diff --git a/src/cairo-path-private.h b/src/cairo-path-private.h
index d855c19..e6e1d6c 100644
--- a/src/cairo-path-private.h
+++ b/src/cairo-path-private.h
@@ -52,7 +52,7 @@ _cairo_path_create_flat (cairo_path_fixed_t *path,
cairo_private cairo_path_t *
_cairo_path_create_in_error (cairo_status_t status);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_append_to_context (const cairo_path_t *path,
cairo_t *cr);
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 612865d..a5dfd8e 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -298,6 +298,7 @@ _cairo_ps_surface_emit_path (cairo_ps_surface_t *surface,
{
cairo_output_stream_t *word_wrap;
cairo_status_t status;
+ cairo_status_t status2;
ps_path_info_t path_info;
word_wrap = _word_wrap_stream_create (stream, 79);
@@ -315,7 +316,9 @@ _cairo_ps_surface_emit_path (cairo_ps_surface_t *surface,
if (status == CAIRO_STATUS_SUCCESS)
status = _cairo_output_stream_get_status (word_wrap);
- _cairo_output_stream_destroy (word_wrap);
+ status2 = _cairo_output_stream_destroy (word_wrap);
+ if (status == CAIRO_STATUS_SUCCESS)
+ status = status2;
return status;
}
diff --git a/src/cairo-scaled-font-subsets-private.h b/src/cairo-scaled-font-subsets-private.h
index 5104340..ae40e4c 100644
--- a/src/cairo-scaled-font-subsets-private.h
+++ b/src/cairo-scaled-font-subsets-private.h
@@ -130,7 +130,7 @@ _cairo_scaled_font_subsets_destroy (cairo_scaled_font_subsets_t *font_subsets);
* value indicating an error. Possible errors include
* CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *font_subsets,
cairo_scaled_font_t *scaled_font,
unsigned long scaled_font_glyph_index,
@@ -172,7 +172,7 @@ typedef void
* value indicating an error. Possible errors include
* CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_subsets_foreach_scaled (cairo_scaled_font_subsets_t *font_subsets,
cairo_scaled_font_subset_callback_func_t font_subset_callback,
void *closure);
@@ -207,7 +207,7 @@ _cairo_scaled_font_subsets_foreach_scaled (cairo_scaled_font_subsets_t *fon
* value indicating an error. Possible errors include
* CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_subsets_foreach_unscaled (cairo_scaled_font_subsets_t *font_subsets,
cairo_scaled_font_subset_callback_func_t font_subset_callback,
void *closure);
@@ -237,7 +237,7 @@ typedef struct _cairo_cff_subset {
* cff file, or an non-zero value indicating an error. Possible
* errors include CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_cff_subset_init (cairo_cff_subset_t *cff_subset,
const char *name,
cairo_scaled_font_subset_t *font_subset);
@@ -280,7 +280,7 @@ typedef struct _cairo_truetype_subset {
* truetype file, or an non-zero value indicating an error. Possible
* errors include CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_truetype_subset_init (cairo_truetype_subset_t *truetype_subset,
cairo_scaled_font_subset_t *font_subset);
@@ -324,7 +324,7 @@ typedef struct _cairo_type1_subset {
* file, or an non-zero value indicating an error. Possible errors
* include CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_type1_subset_init (cairo_type1_subset_t *type_subset,
const char *name,
cairo_scaled_font_subset_t *font_subset,
@@ -357,7 +357,7 @@ _cairo_type1_subset_fini (cairo_type1_subset_t *subset);
* file, or an non-zero value indicating an error. Possible errors
* include CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_type1_fallback_init_binary (cairo_type1_subset_t *type_subset,
const char *name,
cairo_scaled_font_subset_t *font_subset);
@@ -378,7 +378,7 @@ _cairo_type1_fallback_init_binary (cairo_type1_subset_t *type_subset,
* file, or an non-zero value indicating an error. Possible errors
* include CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_type1_fallback_init_hex (cairo_type1_subset_t *type_subset,
const char *name,
cairo_scaled_font_subset_t *font_subset);
@@ -408,7 +408,7 @@ _cairo_type1_fallback_fini (cairo_type1_subset_t *subset);
* the glyphs is not available. Possible errors include
* CAIRO_STATUS_NO_MEMORY.
**/
-cairo_private cairo_int_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_truetype_create_glyph_to_unicode_map (cairo_scaled_font_subset_t *font_subset);
#endif /* CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H */
diff --git a/src/cairo-surface-fallback-private.h b/src/cairo-surface-fallback-private.h
index e0f83c4..e3a379c 100644
--- a/src/cairo-surface-fallback-private.h
+++ b/src/cairo-surface-fallback-private.h
@@ -40,17 +40,17 @@
#include "cairoint.h"
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_paint (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_mask (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
cairo_pattern_t *mask);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_stroke (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -61,7 +61,7 @@ _cairo_surface_fallback_stroke (cairo_surface_t *surface,
double tolerance,
cairo_antialias_t antialias);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_fill (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -70,7 +70,7 @@ _cairo_surface_fallback_fill (cairo_surface_t *surface,
double tolerance,
cairo_antialias_t antialias);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_show_glyphs (cairo_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -81,7 +81,7 @@ _cairo_surface_fallback_show_glyphs (cairo_surface_t *surface,
cairo_private cairo_surface_t *
_cairo_surface_fallback_snapshot (cairo_surface_t *surface);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_composite (cairo_operator_t op,
cairo_pattern_t *src,
cairo_pattern_t *mask,
@@ -95,14 +95,14 @@ _cairo_surface_fallback_composite (cairo_operator_t op,
unsigned int width,
unsigned int height);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_fill_rectangles (cairo_surface_t *surface,
cairo_operator_t op,
const cairo_color_t *color,
cairo_rectangle_int16_t *rects,
int num_rects);
-cairo_private cairo_status_t
+cairo_private CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_fallback_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
cairo_surface_t *dst,
--
1.4.4.2
-------------- next part --------------
>From c8ef752398cd948efc79d46ed9e58ce71ecf1448 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun, 18 Mar 2007 23:23:44 +0000
Subject: [PATCH] Add warn-if-unused to static functions.
And propagate the status for the simple cases.
---
src/cairo-analysis-surface.c | 12 +++---
src/cairo-atsui-font.c | 16 ++++----
src/cairo-base85-stream.c | 4 +-
src/cairo-bentley-ottmann.c | 16 ++++---
src/cairo-cache.c | 4 +-
src/cairo-cff-subset.c | 83 ++++++++++++++++++++-------------------
src/cairo-clip.c | 40 ++++++++++++-------
src/cairo-deflate-stream.c | 4 +-
src/cairo-directfb-surface.c | 32 +++++++-------
src/cairo-font.c | 4 +-
src/cairo-ft-font.c | 22 +++++-----
src/cairo-glitz-surface.c | 42 ++++++++++----------
src/cairo-gstate.c | 20 +++++-----
src/cairo-hash.c | 2 +-
src/cairo-hull.c | 14 ++++--
src/cairo-image-surface.c | 22 +++++-----
src/cairo-lzw.c | 2 +-
src/cairo-meta-surface.c | 20 +++++-----
src/cairo-os2-surface.c | 2 +-
src/cairo-output-stream.c | 14 +++---
src/cairo-paginated-surface.c | 42 ++++++++++++--------
src/cairo-path-bounds.c | 43 +++++++++++---------
src/cairo-path-fill.c | 20 +++++-----
src/cairo-path-fixed.c | 4 +-
src/cairo-path-stroke.c | 67 ++++++++++++++++---------------
src/cairo-path.c | 34 +++++++++-------
src/cairo-pattern.c | 8 ++--
src/cairo-pdf-surface.c | 76 ++++++++++++++++++------------------
src/cairo-pen.c | 4 +-
src/cairo-png.c | 2 +-
src/cairo-polygon.c | 4 +-
src/cairo-ps-surface.c | 60 ++++++++++++++--------------
src/cairo-quartz-surface.c | 46 +++++++++++-----------
src/cairo-scaled-font-subsets.c | 6 +-
src/cairo-scaled-font.c | 10 ++--
src/cairo-spline.c | 12 +++---
src/cairo-surface-fallback.c | 30 +++++++-------
src/cairo-surface.c | 35 +++++++++++-----
src/cairo-svg-surface.c | 56 +++++++++++++-------------
src/cairo-traps.c | 8 ++--
src/cairo-truetype-subset.c | 12 +++---
src/cairo-type1-fallback.c | 28 +++++++-------
src/cairo-type1-subset.c | 18 ++++----
src/cairo-win32-font.c | 38 +++++++++---------
src/cairo-win32-surface.c | 26 ++++++------
src/cairo-xcb-surface.c | 44 ++++++++++----------
src/cairo-xlib-surface.c | 67 ++++++++++++++++++-------------
src/test-fallback-surface.c | 8 ++--
src/test-meta-surface.c | 22 +++++-----
src/test-paginated-surface.c | 16 ++++----
50 files changed, 643 insertions(+), 578 deletions(-)
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index a89636e..2f44836 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -47,7 +47,7 @@ typedef struct {
cairo_bool_t fallback;
} cairo_analysis_surface_t;
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -56,7 +56,7 @@ _cairo_analysis_surface_get_extents (void *abstract_surface,
return _cairo_surface_get_extents (surface->target, rectangle);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -76,7 +76,7 @@ _cairo_analysis_surface_paint (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -97,7 +97,7 @@ _cairo_analysis_surface_mask (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -125,7 +125,7 @@ _cairo_analysis_surface_stroke (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -150,7 +150,7 @@ _cairo_analysis_surface_fill (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_analysis_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index d9fbde3..3182351 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -68,7 +68,7 @@ typedef struct _cairo_atsui_font_face cairo_atsui_font_face_t;
typedef struct _cairo_atsui_font cairo_atsui_font_t;
typedef struct _cairo_atsui_scaled_path cairo_atsui_scaled_path_t;
-static cairo_status_t _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
ATSUFontID font_id,
ATSUStyle style,
const cairo_matrix_t *font_matrix,
@@ -99,7 +99,7 @@ _cairo_atsui_font_face_destroy (void *abstract_face)
{
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_font_face_scaled_font_create (void *abstract_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
@@ -225,7 +225,7 @@ CreateSizedCopyOfStyle(ATSUStyle inStyle, const cairo_matrix_t *scale)
return style;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_font_set_metrics (cairo_atsui_font_t *font)
{
ATSFontRef atsFont;
@@ -257,7 +257,7 @@ _cairo_atsui_font_set_metrics (cairo_atsui_font_t *font)
return CAIRO_STATUS_NULL_POINTER;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
ATSUFontID font_id,
ATSUStyle style,
@@ -311,7 +311,7 @@ _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_font_create_toy(cairo_toy_font_face_t *toy_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
@@ -484,7 +484,7 @@ _cairo_atsui_scaled_glyph_index (cairo_scaled_glyph_t *scaled_glyph) {
return index;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_font_init_glyph_metrics (cairo_atsui_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
{
@@ -636,7 +636,7 @@ _close_path (void *callback_data)
return noErr;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_scaled_font_init_glyph_path (cairo_atsui_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
{
@@ -694,7 +694,7 @@ _cairo_atsui_scaled_font_init_glyph_path (cairo_atsui_font_t *scaled_font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_atsui_scaled_font_init_glyph_surface (cairo_atsui_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
{
diff --git a/src/cairo-base85-stream.c b/src/cairo-base85-stream.c
index 7163d00..216e824 100644
--- a/src/cairo-base85-stream.c
+++ b/src/cairo-base85-stream.c
@@ -64,7 +64,7 @@ _expand_four_tuple_to_five (unsigned char four_tuple[4],
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_base85_stream_write (cairo_output_stream_t *base,
const unsigned char *data,
unsigned int length)
@@ -90,7 +90,7 @@ _cairo_base85_stream_write (cairo_output_stream_t *base,
return _cairo_output_stream_get_status (stream->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_base85_stream_close (cairo_output_stream_t *base)
{
cairo_base85_stream_t *stream = (cairo_base85_stream_t *) base;
diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c
index e0dac0e..52711a4 100644
--- a/src/cairo-bentley-ottmann.c
+++ b/src/cairo-bentley-ottmann.c
@@ -729,7 +729,7 @@ _cairo_bo_event_dequeue (cairo_bo_event_queue_t *event_queue)
return intersection;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bo_event_queue_init (cairo_bo_event_queue_t *event_queue,
cairo_bo_edge_t *edges,
int num_edges)
@@ -848,7 +848,7 @@ _cairo_bo_sweep_line_fini (cairo_bo_sweep_line_t *sweep_line)
_cairo_skip_list_fini (&sweep_line->active_edges);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line,
cairo_bo_edge_t *edge)
{
@@ -1054,7 +1054,7 @@ print_state (const char *msg,
/* Adds the trapezoid, if any, of the left edge to the cairo_traps_t
* of bo_traps. */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bo_edge_end_trap (cairo_bo_edge_t *left,
int32_t bot,
cairo_bo_traps_t *bo_traps)
@@ -1128,7 +1128,7 @@ _cairo_bo_edge_end_trap (cairo_bo_edge_t *left,
* then either add it to the traps in `bo_traps', if the trapezoid's
* right edge differs from `edge->next', or do nothing if the new
* trapezoid would be a continuation of the existing one. */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bo_edge_start_or_continue_trap (cairo_bo_edge_t *edge,
int32_t top,
cairo_bo_traps_t *bo_traps)
@@ -1203,7 +1203,7 @@ _cairo_bo_sweep_line_validate (cairo_bo_sweep_line_t *sweep_line)
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_active_edges_to_traps (cairo_bo_edge_t *head,
int32_t top,
cairo_fill_rule_t fill_rule,
@@ -1246,7 +1246,7 @@ _active_edges_to_traps (cairo_bo_edge_t *head,
/* Execute a single pass of the Bentley-Ottmann algorithm on edges,
* generating trapezoids according to the fill_rule and appending them
* to traps. */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_bentley_ottmann_tessellate_bo_edges (cairo_bo_edge_t *edges,
int num_edges,
cairo_fill_rule_t fill_rule,
@@ -1267,7 +1267,9 @@ _cairo_bentley_ottmann_tessellate_bo_edges (cairo_bo_edge_t *edges,
cairo_bo_edge_t *left, *right;
cairo_bo_edge_t *edge1, *edge2;
- _cairo_bo_event_queue_init (&event_queue, edges, num_edges);
+ status = _cairo_bo_event_queue_init (&event_queue, edges, num_edges);
+ if (status)
+ return status;
_cairo_bo_sweep_line_init (&sweep_line);
_cairo_bo_traps_init (&bo_traps, traps, xmin, ymin, xmax, ymax);
diff --git a/src/cairo-cache.c b/src/cairo-cache.c
index fa1f003..6bca3c3 100644
--- a/src/cairo-cache.c
+++ b/src/cairo-cache.c
@@ -57,7 +57,7 @@ static void
_cairo_cache_shrink_to_accommodate (cairo_cache_t *cache,
unsigned long additional);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_cache_init (cairo_cache_t *cache,
cairo_cache_keys_equal_func_t keys_equal,
cairo_destroy_func_t entry_destroy,
@@ -252,7 +252,7 @@ _cairo_cache_lookup (cairo_cache_t *cache,
* removed. CAIRO_INT_STATUS_CACHE_EMPTY if there are no entries that
* can be removed.
**/
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_cache_remove_random (cairo_cache_t *cache)
{
cairo_cache_entry_t *entry;
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index b354989..1788a8c 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -252,7 +252,7 @@ cff_index_init (cairo_array_t *index)
_cairo_array_init (index, sizeof (cff_index_element_t));
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cff_index_read (cairo_array_t *index, unsigned char **ptr, unsigned char *end_ptr)
{
cff_index_element_t element;
@@ -293,7 +293,7 @@ cff_index_read (cairo_array_t *index, unsigned char **ptr, unsigned char *end_pt
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_index_write (cairo_array_t *index, cairo_array_t *output)
{
int offset_size;
@@ -361,7 +361,7 @@ cff_index_write (cairo_array_t *index, cairo_array_t *output)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_index_append (cairo_array_t *index, unsigned char *object , int length)
{
cff_index_element_t element;
@@ -373,7 +373,7 @@ cff_index_append (cairo_array_t *index, unsigned char *object , int length)
return _cairo_array_append (index, &element);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_index_append_copy (cairo_array_t *index, unsigned char *object , int length)
{
cff_index_element_t element;
@@ -447,7 +447,7 @@ cff_dict_create_operator (int operator,
return op;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_dict_read (cairo_hash_table_t *dict, unsigned char *p, int dict_size)
{
unsigned char *end;
@@ -506,7 +506,7 @@ cff_dict_get_operands (cairo_hash_table_t *dict,
return NULL;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_dict_set_operands (cairo_hash_table_t *dict,
unsigned short operator,
unsigned char *operand,
@@ -589,7 +589,7 @@ _cairo_dict_collect (void *entry, void *closure)
write_info->status = _cairo_array_append (write_info->output, &data);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cff_dict_write (cairo_hash_table_t *dict, cairo_array_t *output)
{
dict_write_info_t write_info;
@@ -617,7 +617,7 @@ cff_dict_fini (cairo_hash_table_t *dict)
_cairo_hash_table_destroy (dict);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_header (cairo_cff_font_t *font)
{
if (font->data_length < sizeof (cff_header_t))
@@ -629,7 +629,7 @@ cairo_cff_font_read_header (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_name (cairo_cff_font_t *font)
{
cairo_array_t index;
@@ -644,11 +644,12 @@ cairo_cff_font_read_name (cairo_cff_font_t *font)
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_private_dict (cairo_cff_font_t *font,
unsigned char *ptr,
int size)
{
+ cairo_status_t status;
unsigned char buf[10];
unsigned char *end_buf;
int offset;
@@ -656,7 +657,9 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t *font,
unsigned char *operand;
unsigned char *p;
- cff_dict_read (font->private_dict, ptr, size);
+ status = cff_dict_read (font->private_dict, ptr, size);
+ if (status)
+ return status;
operand = cff_dict_get_operands (font->private_dict, LOCAL_SUB_OP, &i);
if (operand) {
decode_integer (operand, &offset);
@@ -671,7 +674,7 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_top_dict (cairo_cff_font_t *font)
{
cairo_array_t index;
@@ -690,7 +693,9 @@ cairo_cff_font_read_top_dict (cairo_cff_font_t *font)
goto fail;
element = _cairo_array_index (&index, 0);
- cff_dict_read (font->top_dict, element->data, element->length);
+ status = cff_dict_read (font->top_dict, element->data, element->length);
+ if (status)
+ goto fail;
/* CID fonts are NYI */
if (cff_dict_get_operands (font->top_dict, ROS_OP, &size) != NULL) {
@@ -734,19 +739,19 @@ fail:
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_strings (cairo_cff_font_t *font)
{
return cff_index_read (&font->strings_index, &font->current_ptr, font->data_end);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_global_subroutines (cairo_cff_font_t *font)
{
return cff_index_read (&font->global_sub_index, &font->current_ptr, font->data_end);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cff_charset_read_data (cff_charset_t *charset, const unsigned char *data,
const unsigned char *data_end, int num_glyphs)
{
@@ -849,7 +854,7 @@ static const uint16_t ExpertSubset_charset[] = {
341, 342, 343, 344, 345, 346,
};
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_charset (cairo_cff_font_t *font)
{
switch (font->charset_offset) {
@@ -891,7 +896,7 @@ static const font_read_t font_read_funcs[] = {
cairo_cff_font_read_charset,
};
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_read_font (cairo_cff_font_t *font)
{
cairo_int_status_t status;
@@ -906,7 +911,7 @@ cairo_cff_font_read_font (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_dict_string(cairo_cff_font_t *font,
cairo_hash_table_t *dict,
int operator)
@@ -933,9 +938,7 @@ cairo_cff_font_subset_dict_string(cairo_cff_font_t *font,
return status;
p = encode_integer (buf, sid);
- cff_dict_set_operands (dict, operator, buf, p - buf);
-
- return CAIRO_STATUS_SUCCESS;
+ return cff_dict_set_operands (dict, operator, buf, p - buf);
}
static const int dict_strings[] = {
@@ -950,7 +953,7 @@ static const int dict_strings[] = {
FONTNAME_OP,
};
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_dict_strings (cairo_cff_font_t *font,
cairo_hash_table_t *dict)
{
@@ -966,7 +969,7 @@ cairo_cff_font_subset_dict_strings (cairo_cff_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_strings (cairo_cff_font_t *font)
{
cairo_status_t status;
@@ -980,7 +983,7 @@ cairo_cff_font_subset_strings (cairo_cff_font_t *font)
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_charstrings (cairo_cff_font_t *font)
{
cff_index_element_t *element;
@@ -1053,7 +1056,7 @@ cff_sid_from_gid (const cff_charset_t *charset, int gid)
return 0;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_charset (cairo_cff_font_t *font)
{
unsigned int i;
@@ -1082,7 +1085,7 @@ cairo_cff_font_subset_charset (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_subset_font (cairo_cff_font_t *font)
{
cairo_status_t status;
@@ -1125,7 +1128,7 @@ cairo_cff_font_set_topdict_operator_to_cur_pos (cairo_cff_font_t *font,
memcpy (op_ptr, buf, buf_end - buf);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_header (cairo_cff_font_t *font)
{
return _cairo_array_append_multiple (&font->output,
@@ -1133,7 +1136,7 @@ cairo_cff_font_write_header (cairo_cff_font_t *font)
font->header->header_size);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_name (cairo_cff_font_t *font)
{
cairo_array_t index;
@@ -1153,7 +1156,7 @@ cairo_cff_font_write_name (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_top_dict (cairo_cff_font_t *font)
{
uint16_t count;
@@ -1199,19 +1202,19 @@ cairo_cff_font_write_top_dict (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_strings (cairo_cff_font_t *font)
{
return cff_index_write (&font->strings_subset_index, &font->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_global_subrs (cairo_cff_font_t *font)
{
return cff_index_write (&font->global_sub_index, &font->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_encoding (cairo_cff_font_t *font)
{
unsigned char buf[10];
@@ -1226,7 +1229,7 @@ cairo_cff_font_write_encoding (cairo_cff_font_t *font)
return _cairo_array_append_multiple (&font->output, buf, 4);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_charset (cairo_cff_font_t *font)
{
unsigned char format = 0;
@@ -1247,7 +1250,7 @@ cairo_cff_font_write_charset (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_charstrings (cairo_cff_font_t *font)
{
cairo_cff_font_set_topdict_operator_to_cur_pos (font, CHARSTRINGS_OP);
@@ -1255,7 +1258,7 @@ cairo_cff_font_write_charstrings (cairo_cff_font_t *font)
return cff_index_write (&font->charstrings_subset_index, &font->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_private_dict_and_local_sub (cairo_cff_font_t *font)
{
int offset, private_dict_offset;
@@ -1312,7 +1315,7 @@ static const font_write_t font_write_funcs[] = {
cairo_cff_font_write_private_dict_and_local_sub,
};
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_cff_font_write_subset (cairo_cff_font_t *font)
{
cairo_int_status_t status;
@@ -1327,7 +1330,7 @@ cairo_cff_font_write_subset (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_generate (cairo_cff_font_t *font,
const char **data,
unsigned long *length)
@@ -1352,7 +1355,7 @@ cairo_cff_font_generate (cairo_cff_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_cff_font_create_set_widths (cairo_cff_font_t *font)
{
unsigned long size;
@@ -1400,7 +1403,7 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_cff_font_create (cairo_scaled_font_subset_t *scaled_font_subset,
cairo_cff_font_t **font_return,
const char *subset_name)
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 966cf74..46b40cc 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -121,7 +121,7 @@ _cairo_clip_reset (cairo_clip_t *clip)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_path_intersect_to_rectangle (cairo_clip_path_t *clip_path,
cairo_rectangle_int16_t *rectangle)
{
@@ -270,7 +270,7 @@ _cairo_clip_combine_to_surface (cairo_clip_t *clip,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_intersect_path (cairo_clip_t *clip,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -329,7 +329,7 @@ _cairo_clip_path_destroy (cairo_clip_path_t *clip_path)
free (clip_path);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_intersect_region (cairo_clip_t *clip,
cairo_traps_t *traps,
cairo_surface_t *target)
@@ -369,7 +369,7 @@ _cairo_clip_intersect_region (cairo_clip_t *clip,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_intersect_mask (cairo_clip_t *clip,
cairo_traps_t *traps,
cairo_antialias_t antialias,
@@ -535,14 +535,19 @@ _cairo_clip_translate (cairo_clip_t *clip,
}
}
-static void
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_clip_path_reapply_clip_path (cairo_clip_t *clip,
cairo_clip_path_t *clip_path)
{
- if (clip_path->prev)
- _cairo_clip_path_reapply_clip_path (clip, clip_path->prev);
+ cairo_status_t status;
+
+ if (clip_path->prev) {
+ status = _cairo_clip_path_reapply_clip_path (clip, clip_path->prev);
+ if (status)
+ return status;
+ }
- _cairo_clip_intersect_path (clip,
+ return _cairo_clip_intersect_path (clip,
&clip_path->path,
clip_path->fill_rule,
clip_path->tolerance,
@@ -575,20 +580,27 @@ _cairo_clip_init_deep_copy (cairo_clip_t *clip,
other->surface_rect.width,
other->surface_rect.height,
&clip->surface);
- if (status) {
- if (clip->region)
- pixman_region_destroy (clip->region);
- return status;
- }
+ if (status)
+ goto CLEANUP_REGION;
clip->surface_rect = other->surface_rect;
}
if (other->path) {
- _cairo_clip_path_reapply_clip_path (clip, other->path);
+ status = _cairo_clip_path_reapply_clip_path (clip, other->path);
+ if (status)
+ goto CLEANUP_SURFACE;
}
}
return CAIRO_STATUS_SUCCESS;
+
+CLEANUP_SURFACE:
+ if (clip->surface)
+ cairo_surface_destroy (clip->surface);
+CLEANUP_REGION:
+ if (clip->region)
+ pixman_region_destroy (clip->region);
+ return status;
}
const cairo_rectangle_list_t _cairo_rectangles_nil =
diff --git a/src/cairo-deflate-stream.c b/src/cairo-deflate-stream.c
index 816f5c5..71aea0a 100644
--- a/src/cairo-deflate-stream.c
+++ b/src/cairo-deflate-stream.c
@@ -76,7 +76,7 @@ cairo_deflate_stream_deflate (cairo_deflate_stream_t *stream, cairo_bool_t flush
stream->zlib_stream.next_in = stream->input_buf;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_deflate_stream_write (cairo_output_stream_t *base,
const unsigned char *data,
unsigned int length)
@@ -101,7 +101,7 @@ _cairo_deflate_stream_write (cairo_output_stream_t *base,
return _cairo_output_stream_get_status (stream->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_deflate_stream_close (cairo_output_stream_t *base)
{
cairo_deflate_stream_t *stream = (cairo_deflate_stream_t *) base;
diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
index 686510d..0aec1c0 100644
--- a/src/cairo-directfb-surface.c
+++ b/src/cairo-directfb-surface.c
@@ -213,7 +213,7 @@ directfb_to_cairo_format (DFBSurfacePixelFormat format)
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_directfb_get_operator (cairo_operator_t operator,
DFBSurfaceDrawingFlags *ret_drawing,
DFBSurfaceBlittingFlags *ret_blitting,
@@ -322,7 +322,7 @@ _directfb_buffer_surface_create (IDirectFB *dfb,
return buffer;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_directfb_acquire_surface (cairo_directfb_surface_t *surface,
cairo_rectangle_int16_t *intrest_rec,
cairo_image_surface_t **image_out,
@@ -440,7 +440,7 @@ _cairo_directfb_surface_create_similar (void *abstract_src,
return &surface->base;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_finish (void *data)
{
cairo_directfb_surface_t *surface = (cairo_directfb_surface_t *)data;
@@ -472,7 +472,7 @@ _cairo_directfb_surface_finish (void *data)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -501,7 +501,7 @@ _cairo_directfb_surface_release_source_image (void *abstract_su
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -545,7 +545,7 @@ _cairo_directfb_surface_release_dest_image (void *abstract_surf
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -620,7 +620,7 @@ _cairo_directfb_surface_clone_similar (void *abstract_surface,
}
#if DFB_COMPOSITE || DFB_COMPOSITE_TRAPEZOIDS
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_directfb_prepare_composite (cairo_directfb_surface_t *dst,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -748,7 +748,7 @@ _directfb_finish_composite (cairo_directfb_surface_t *dst,
#endif /* DFB_COMPOSITE || DFB_COMPOSITE_TRAPEZOIDS */
#if DFB_COMPOSITE
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_surface_composite (cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -911,7 +911,7 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
#endif /* DFB_COMPOSITE */
#if DFB_RECTANGLES
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_surface_fill_rectangles (void *abstract_surface,
cairo_operator_t op,
const cairo_color_t *color,
@@ -958,7 +958,7 @@ _cairo_directfb_surface_fill_rectangles (void *abstract_surface,
#endif
#if DFB_COMPOSITE_TRAPEZOIDS
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
void *abstract_dst,
@@ -1098,7 +1098,7 @@ _cairo_directfb_surface_composite_trapezoids (cairo_operator_t op,
}
#endif /* DFB_COMPOSITE_TRAPEZOIDS */
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -1144,7 +1144,7 @@ _cairo_directfb_surface_set_clip_region (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_abstract_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1164,7 +1164,7 @@ _cairo_directfb_abstract_surface_get_extents (void *abstract_surfac
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_mark_dirty_rectangle (void *abstract_surface,
int x,
int y,
@@ -1185,7 +1185,7 @@ _cairo_directfb_surface_mark_dirty_rectangle (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_directfb_surface_flush (void *abstract_surface)
{
#if 0
@@ -1235,7 +1235,7 @@ _directfb_destroy_font_cache (cairo_directfb_font_cache_t *cache)
free (cache);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
cairo_scaled_font_t *scaled_font,
const cairo_glyph_t *glyphs,
@@ -1446,7 +1446,7 @@ _cairo_directfb_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_directfb_surface_show_glyphs ( void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *pattern,
diff --git a/src/cairo-font.c b/src/cairo-font.c
index cacc589..ad04e04 100644
--- a/src/cairo-font.c
+++ b/src/cairo-font.c
@@ -320,7 +320,7 @@ _cairo_toy_font_face_init_key (cairo_toy_font_face_t *key,
key->base.hash_entry.hash = hash;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_toy_font_face_init (cairo_toy_font_face_t *font_face,
const char *family,
cairo_font_slant_t slant,
@@ -448,7 +448,7 @@ _cairo_toy_font_face_destroy (void *abstract_face)
_cairo_toy_font_face_fini (font_face);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_toy_font_face_scaled_font_create (void *abstract_font_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index c174275..ec7a8cb 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -306,7 +306,7 @@ _cairo_ft_unscaled_font_init_key (cairo_ft_unscaled_font_t *key,
* parallel in the from_face case, (where the calling code would have
* to do its own mapping to ensure similar sharing).
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ft_unscaled_font_init (cairo_ft_unscaled_font_t *unscaled,
const char *filename,
int id,
@@ -574,7 +574,7 @@ _cairo_ft_unscaled_font_unlock_face (cairo_ft_unscaled_font_t *unscaled)
}
slim_hidden_def (cairo_ft_scaled_font_unlock_face);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_compute_transform (cairo_ft_font_transform_t *sf,
cairo_matrix_t *scale)
{
@@ -716,7 +716,7 @@ static const int filters[3][3] = {
/* Fills in val->image with an image surface created from @bitmap
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_get_bitmap_surface (FT_Bitmap *bitmap,
cairo_bool_t own_buffer,
cairo_font_options_t *font_options,
@@ -925,7 +925,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
* when we add subpixel support. If so, we may want to eliminate
* this version of the code path entirely.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_render_glyph_outline (FT_Face face,
cairo_font_options_t *font_options,
cairo_image_surface_t **surface)
@@ -1047,7 +1047,7 @@ _render_glyph_outline (FT_Face face,
}
/* Converts a bitmap (or other) FT_GlyphSlot into an image */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_render_glyph_bitmap (FT_Face face,
cairo_font_options_t *font_options,
cairo_image_surface_t **surface)
@@ -1082,7 +1082,7 @@ _render_glyph_bitmap (FT_Face face,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_transform_glyph_bitmap (cairo_matrix_t * shape,
cairo_image_surface_t ** surface)
{
@@ -1523,7 +1523,7 @@ _cairo_scaled_font_is_ft (cairo_scaled_font_t *scaled_font)
return scaled_font->backend == &cairo_ft_scaled_font_backend;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ft_scaled_font_create_toy (cairo_toy_font_face_t *toy_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
@@ -1719,7 +1719,7 @@ _cubic_to (FT_Vector *control1, FT_Vector *control2,
return 0;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_decompose_glyph_outline (FT_Face face,
cairo_font_options_t *options,
cairo_path_fixed_t **pathp)
@@ -1782,7 +1782,7 @@ _cairo_ft_scaled_glyph_vertical_layout_bearing_fix (void *abstract_font,
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ft_scaled_glyph_init (void *abstract_font,
cairo_scaled_glyph_t *scaled_glyph,
cairo_scaled_glyph_info_t info)
@@ -2025,7 +2025,7 @@ _cairo_ft_ucs4_to_index (void *abstract_font,
return index;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ft_load_truetype_table (void *abstract_font,
unsigned long tag,
long offset,
@@ -2159,7 +2159,7 @@ _cairo_ft_font_face_destroy (void *abstract_face)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ft_font_face_scaled_font_create (void *abstract_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index b9e4f72..3d48739 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -39,7 +39,7 @@ typedef struct _cairo_glitz_surface {
static const cairo_surface_backend_t *
_cairo_glitz_surface_get_backend (void);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_finish (void *abstract_surface)
{
cairo_glitz_surface_t *surface = abstract_surface;
@@ -110,7 +110,7 @@ _cairo_glitz_surface_create_similar (void *abstract_src,
return crsurface;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_get_image (cairo_glitz_surface_t *surface,
cairo_rectangle_int16_t *interest,
cairo_image_surface_t **image_out,
@@ -248,7 +248,7 @@ _cairo_glitz_surface_get_image (cairo_glitz_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_set_image (void *abstract_surface,
cairo_image_surface_t *image,
int src_x,
@@ -309,7 +309,7 @@ _cairo_glitz_surface_set_image (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -329,7 +329,7 @@ _cairo_glitz_surface_release_source_image (void *abstract_surface,
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -367,7 +367,7 @@ _cairo_glitz_surface_release_dest_image (void *abstract_surfa
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -569,7 +569,7 @@ typedef struct _cairo_glitz_surface_attributes {
cairo_bool_t acquired;
} cairo_glitz_surface_attributes_t;
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_pattern_acquire_surface (cairo_pattern_t *pattern,
cairo_glitz_surface_t *dst,
int x,
@@ -787,7 +787,7 @@ _cairo_glitz_pattern_release_surface (cairo_pattern_t *pattern,
cairo_surface_destroy (&surface->base);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_pattern_acquire_surfaces (cairo_pattern_t *src,
cairo_pattern_t *mask,
cairo_glitz_surface_t *dst,
@@ -873,7 +873,7 @@ _cairo_glitz_surface_set_attributes (cairo_glitz_surface_t *surface,
a->params, a->n_params);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_composite (cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -953,7 +953,7 @@ _cairo_glitz_surface_composite (cairo_operator_t op,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_fill_rectangles (void *abstract_dst,
cairo_operator_t op,
const cairo_color_t *color,
@@ -1031,7 +1031,7 @@ _cairo_glitz_surface_fill_rectangles (void *abstract_dst,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
void *abstract_dst,
@@ -1272,7 +1272,7 @@ _cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -1308,7 +1308,7 @@ _cairo_glitz_surface_set_clip_region (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1364,7 +1364,7 @@ struct _cairo_glitz_root_area {
const cairo_glitz_area_funcs_t *funcs;
};
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_area_move_in (cairo_glitz_area_t *area,
void *closure)
{
@@ -1474,7 +1474,7 @@ _cairo_glitz_area_get_top_scored_sub_area (cairo_glitz_area_t *area)
return NULL;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_area_find (cairo_glitz_area_t *area,
int width,
int height,
@@ -1609,7 +1609,7 @@ _cairo_glitz_area_find (cairo_glitz_area_t *area,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_root_area_init (cairo_glitz_root_area_t *root,
int max_level,
int width,
@@ -1643,7 +1643,7 @@ typedef struct _cairo_glitz_surface_glyph_private {
cairo_point_double_t p1, p2;
} cairo_glitz_surface_glyph_private_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_glyph_move_in (cairo_glitz_area_t *area,
void *closure)
{
@@ -1701,7 +1701,7 @@ static const cairo_glitz_area_funcs_t _cairo_glitz_area_funcs = {
WRITE_VEC2 (ptr, _vx1, _vy2); \
WRITE_VEC2 (ptr, (p1)->x, (p1)->y)
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_font_init (cairo_glitz_surface_t *surface,
cairo_scaled_font_t *scaled_font,
cairo_format_t format)
@@ -1801,7 +1801,7 @@ _cairo_glitz_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
#define FIXED_TO_FLOAT(f) (((glitz_float_t) (f)) / 65536)
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_add_glyph (cairo_glitz_surface_t *surface,
cairo_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
@@ -1913,7 +1913,7 @@ _cairo_glitz_surface_add_glyph (cairo_glitz_surface_t *surface,
#define N_STACK_BUF 256
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
cairo_operator_t op,
cairo_pattern_t *pattern,
@@ -2162,7 +2162,7 @@ UNLOCK:
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_glitz_surface_flush (void *abstract_surface)
{
cairo_glitz_surface_t *surface = abstract_surface;
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 7a57494..a008dad 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -42,13 +42,13 @@
#include "cairo-clip-private.h"
#include "cairo-gstate-private.h"
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_ensure_font_face (cairo_gstate_t *gstate);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_ensure_scaled_font (cairo_gstate_t *gstate);
static void
@@ -111,7 +111,7 @@ _cairo_gstate_init (cairo_gstate_t *gstate,
* @other. Note that gstate->next is not copied but is set to NULL by
* this function.
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other)
{
cairo_status_t status;
@@ -222,7 +222,7 @@ _cairo_gstate_clone (cairo_gstate_t *other)
return gstate;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_recursive_apply_clip_path (cairo_gstate_t *gstate,
cairo_clip_path_t *cpath)
{
@@ -710,7 +710,7 @@ _cairo_gstate_stroke_to_path (cairo_gstate_t *gstate)
}
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_copy_transformed_pattern (cairo_gstate_t *gstate,
cairo_pattern_t *pattern,
cairo_pattern_t *original,
@@ -735,7 +735,7 @@ _cairo_gstate_copy_transformed_pattern (cairo_gstate_t *gstate,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_copy_transformed_source (cairo_gstate_t *gstate,
cairo_pattern_t *pattern)
{
@@ -744,7 +744,7 @@ _cairo_gstate_copy_transformed_source (cairo_gstate_t *gstate,
&gstate->source_ctm_inverse);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_copy_transformed_mask (cairo_gstate_t *gstate,
cairo_pattern_t *pattern,
cairo_pattern_t *mask)
@@ -1389,7 +1389,7 @@ _cairo_gstate_get_scaled_font (cairo_gstate_t *gstate,
*
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_ensure_font_face (cairo_gstate_t *gstate)
{
if (!gstate->font_face) {
@@ -1407,7 +1407,7 @@ _cairo_gstate_ensure_font_face (cairo_gstate_t *gstate)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_gstate_ensure_scaled_font (cairo_gstate_t *gstate)
{
cairo_status_t status;
diff --git a/src/cairo-hash.c b/src/cairo-hash.c
index 948cd23..83e9f93 100644
--- a/src/cairo-hash.c
+++ b/src/cairo-hash.c
@@ -295,7 +295,7 @@ _cairo_hash_table_lookup_internal (cairo_hash_table_t *hash_table,
* Return value: CAIRO_STATUS_SUCCESS if successful or
* CAIRO_STATUS_NO_MEMORY if out of memory.
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_hash_table_resize (cairo_hash_table_t *hash_table)
{
cairo_hash_table_t tmp;
diff --git a/src/cairo-hull.c b/src/cairo-hull.c
index e9d0a15..fe29b47 100644
--- a/src/cairo-hull.c
+++ b/src/cairo-hull.c
@@ -140,7 +140,7 @@ _cairo_hull_next_valid (cairo_hull_t *hull, int num_hull, int index)
return index;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_hull_eliminate_concave (cairo_hull_t *hull, int num_hull)
{
int i, j, k;
@@ -171,7 +171,7 @@ _cairo_hull_eliminate_concave (cairo_hull_t *hull, int num_hull)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_hull_to_pen (cairo_hull_t *hull, cairo_pen_vertex_t *vertices, int *num_vertices)
{
int i, j = 0;
@@ -194,6 +194,7 @@ _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices)
{
cairo_hull_t *hull;
int num_hull = *num_vertices;
+ cairo_status_t status;
hull = _cairo_hull_create (vertices, num_hull);
if (hull == NULL)
@@ -202,11 +203,14 @@ _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices)
qsort (hull + 1, num_hull - 1,
sizeof (cairo_hull_t), _cairo_hull_vertex_compare);
- _cairo_hull_eliminate_concave (hull, num_hull);
+ status = _cairo_hull_eliminate_concave (hull, num_hull);
+ if (status)
+ goto BAIL;
- _cairo_hull_to_pen (hull, vertices, num_vertices);
+ status = _cairo_hull_to_pen (hull, vertices, num_vertices);
+BAIL:
free (hull);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 6279012..fa0ca07 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -591,7 +591,7 @@ _cairo_image_surface_create_similar (void *abstract_src,
width, height);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_finish (void *abstract_surface)
{
cairo_image_surface_t *surface = abstract_surface;
@@ -615,7 +615,7 @@ _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface)
surface->owns_data = 1;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -633,7 +633,7 @@ _cairo_image_surface_release_source_image (void *abstract_surf
{
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -662,7 +662,7 @@ _cairo_image_surface_release_dest_image (void *abstract_surfa
{
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -682,7 +682,7 @@ _cairo_image_surface_clone_similar (void *abstract_surface,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
const cairo_matrix_t *matrix)
{
@@ -695,7 +695,7 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
{
pixman_filter_t pixman_filter;
@@ -731,7 +731,7 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_set_attributes (cairo_image_surface_t *surface,
cairo_surface_attributes_t *attributes)
{
@@ -806,7 +806,7 @@ _pixman_operator (cairo_operator_t op)
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_composite (cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -890,7 +890,7 @@ _cairo_image_surface_composite (cairo_operator_t op,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_fill_rectangles (void *abstract_surface,
cairo_operator_t op,
const cairo_color_t *color,
@@ -913,7 +913,7 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
void *abstract_dst,
@@ -1054,7 +1054,7 @@ _cairo_image_surface_set_clip_region (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_image_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c
index 370d258..4e4fd95 100644
--- a/src/cairo-lzw.c
+++ b/src/cairo-lzw.c
@@ -84,7 +84,7 @@ _lzw_buf_init (lzw_buf_t *buf, int size)
*
* Returns CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_lzw_buf_grow (lzw_buf_t *buf)
{
int new_size = buf->data_size * 2;
diff --git a/src/cairo-meta-surface.c b/src/cairo-meta-surface.c
index b6665cb..cdd3e4e 100644
--- a/src/cairo-meta-surface.c
+++ b/src/cairo-meta-surface.c
@@ -106,7 +106,7 @@ _cairo_meta_surface_create_similar (void *abstract_surface,
return _cairo_meta_surface_create (content, width, height);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_meta_surface_finish (void *abstract_surface)
{
cairo_meta_surface_t *meta = abstract_surface;
@@ -175,7 +175,7 @@ _cairo_meta_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_meta_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -208,7 +208,7 @@ _cairo_meta_surface_release_source_image (void *abstract_surface,
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_init_pattern_with_snapshot (cairo_pattern_t *pattern,
const cairo_pattern_t *other)
{
@@ -233,7 +233,7 @@ _init_pattern_with_snapshot (cairo_pattern_t *pattern,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -272,7 +272,7 @@ _cairo_meta_surface_paint (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -312,7 +312,7 @@ _cairo_meta_surface_mask (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -368,7 +368,7 @@ _cairo_meta_surface_stroke (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -415,7 +415,7 @@ _cairo_meta_surface_fill (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -505,7 +505,7 @@ _cairo_meta_surface_snapshot (void *abstract_other)
return &meta->base;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_intersect_clip_path (void *dst,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -553,7 +553,7 @@ _cairo_meta_surface_intersect_clip_path (void *dst,
* surface size against which the meta-surface is expected to be
* replayed, (as passed in to _cairo_meta_surface_create).
*/
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_meta_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
diff --git a/src/cairo-os2-surface.c b/src/cairo-os2-surface.c
index f6ec8f6..330dafd 100644
--- a/src/cairo-os2-surface.c
+++ b/src/cairo-os2-surface.c
@@ -663,7 +663,7 @@ _cairo_os2_surface_release_dest_image (void *abstract_surface
DosReleaseMutexSem (local_os2_surface->hmtx_use_private_fields);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_os2_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index df3ae4d..acd5c21 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -87,7 +87,7 @@ typedef struct _cairo_output_stream_with_closure {
} cairo_output_stream_with_closure_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
closure_write (cairo_output_stream_t *stream,
const unsigned char *data, unsigned int length)
{
@@ -98,7 +98,7 @@ closure_write (cairo_output_stream_t *stream,
data, length);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
closure_close (cairo_output_stream_t *stream)
{
cairo_output_stream_with_closure_t *stream_with_closure =
@@ -402,7 +402,7 @@ typedef struct _stdio_stream {
FILE *file;
} stdio_stream_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
stdio_write (cairo_output_stream_t *base,
const unsigned char *data, unsigned int length)
{
@@ -414,7 +414,7 @@ stdio_write (cairo_output_stream_t *base,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
stdio_flush (cairo_output_stream_t *base)
{
stdio_stream_t *stream = (stdio_stream_t *) base;
@@ -427,7 +427,7 @@ stdio_flush (cairo_output_stream_t *base)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
stdio_close (cairo_output_stream_t *base)
{
cairo_status_t status;
@@ -486,7 +486,7 @@ typedef struct _memory_stream {
cairo_array_t array;
} memory_stream_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
memory_write (cairo_output_stream_t *base,
const unsigned char *data, unsigned int length)
{
@@ -495,7 +495,7 @@ memory_write (cairo_output_stream_t *base,
return _cairo_array_append_multiple (&stream->array, data, length);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
memory_close (cairo_output_stream_t *base)
{
memory_stream_t *stream = (memory_stream_t *) base;
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 023f2a7..cb254cd 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -77,7 +77,7 @@ typedef struct _cairo_paginated_surface {
const cairo_private cairo_surface_backend_t cairo_paginated_surface_backend;
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_show_page (void *abstract_surface);
static cairo_surface_t *
@@ -153,7 +153,7 @@ _cairo_paginated_surface_get_target (cairo_surface_t *surface)
return paginated_surface->target;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_paginated_surface_finish (void *abstract_surface)
{
cairo_paginated_surface_t *surface = abstract_surface;
@@ -194,7 +194,7 @@ _cairo_paginated_surface_create_image_surface (void *abstract_surface,
return image;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_paginated_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -212,7 +212,11 @@ _cairo_paginated_surface_acquire_source_image (void *abstract_surface,
extents.width,
extents.height);
- _cairo_meta_surface_replay (surface->meta, image);
+ status = _cairo_meta_surface_replay (surface->meta, image);
+ if (status) {
+ cairo_surface_destroy (image);
+ return status;
+ }
*image_out = (cairo_image_surface_t*) image;
*image_extra = NULL;
@@ -228,7 +232,7 @@ _cairo_paginated_surface_release_source_image (void *abstract_surface,
cairo_surface_destroy (&image->base);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_paint_page (cairo_paginated_surface_t *surface)
{
cairo_surface_t *analysis;
@@ -284,7 +288,7 @@ _paint_page (cairo_paginated_surface_t *surface)
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_start_page (cairo_paginated_surface_t *surface)
{
if (! surface->backend->start_page)
@@ -293,7 +297,7 @@ _start_page (cairo_paginated_surface_t *surface)
return (surface->backend->start_page) (surface->target);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_copy_page (void *abstract_surface)
{
cairo_status_t status;
@@ -303,7 +307,9 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
if (status)
return status;
- _paint_page (surface);
+ status = _paint_page (surface);
+ if (status)
+ return status;
surface->page_num++;
@@ -318,7 +324,7 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
return _cairo_surface_show_page (surface->target);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_show_page (void *abstract_surface)
{
cairo_status_t status;
@@ -328,7 +334,9 @@ _cairo_paginated_surface_show_page (void *abstract_surface)
if (status)
return status;
- _paint_page (surface);
+ status = _paint_page (surface);
+ if (status)
+ return status;
status = _cairo_surface_show_page (surface->target);
if (status)
@@ -347,7 +355,7 @@ _cairo_paginated_surface_show_page (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_intersect_clip_path (void *abstract_surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -361,7 +369,7 @@ _cairo_paginated_surface_intersect_clip_path (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -379,7 +387,7 @@ _cairo_paginated_surface_get_font_options (void *abstract_surfa
cairo_surface_get_font_options (surface->target, options);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -395,7 +403,7 @@ _cairo_paginated_surface_paint (void *abstract_surface,
return _cairo_surface_paint (surface->meta, op, source);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -406,7 +414,7 @@ _cairo_paginated_surface_mask (void *abstract_surface,
return _cairo_surface_mask (surface->meta, op, source, mask);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -431,7 +439,7 @@ _cairo_paginated_surface_stroke (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -453,7 +461,7 @@ _cairo_paginated_surface_fill (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_paginated_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index 48b4393..24eeca9 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -51,22 +51,22 @@ _cairo_path_bounder_init (cairo_path_bounder_t *bounder);
static void
_cairo_path_bounder_fini (cairo_path_bounder_t *bounder);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_move_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_line_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_close_path (void *closure);
static void
@@ -81,7 +81,7 @@ _cairo_path_bounder_fini (cairo_path_bounder_t *bounder)
bounder->has_point = 0;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *point)
{
if (bounder->has_point) {
@@ -108,42 +108,45 @@ _cairo_path_bounder_add_point (cairo_path_bounder_t *bounder, cairo_point_t *poi
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_move_to (void *closure, cairo_point_t *point)
{
cairo_path_bounder_t *bounder = closure;
- _cairo_path_bounder_add_point (bounder, point);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_path_bounder_add_point (bounder, point);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_line_to (void *closure, cairo_point_t *point)
{
cairo_path_bounder_t *bounder = closure;
- _cairo_path_bounder_add_point (bounder, point);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_path_bounder_add_point (bounder, point);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d)
{
cairo_path_bounder_t *bounder = closure;
-
- _cairo_path_bounder_add_point (bounder, b);
- _cairo_path_bounder_add_point (bounder, c);
- _cairo_path_bounder_add_point (bounder, d);
+ cairo_status_t status;
+
+ status = _cairo_path_bounder_add_point (bounder, b);
+ if (status)
+ return status;
+ status = _cairo_path_bounder_add_point (bounder, c);
+ if (status)
+ return status;
+ status = _cairo_path_bounder_add_point (bounder, d);
+ if (status)
+ return status;
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_bounder_close_path (void *closure)
{
return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
index d2a9118..f35fcd6 100644
--- a/src/cairo-path-fill.c
+++ b/src/cairo-path-fill.c
@@ -52,19 +52,19 @@ _cairo_filler_init (cairo_filler_t *filler, double tolerance, cairo_traps_t *tra
static void
_cairo_filler_fini (cairo_filler_t *filler);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_move_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_line_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_close_path (void *closure);
static void
@@ -85,7 +85,7 @@ _cairo_filler_fini (cairo_filler_t *filler)
_cairo_polygon_fini (&filler->polygon);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_move_to (void *closure, cairo_point_t *point)
{
cairo_status_t status;
@@ -105,7 +105,7 @@ _cairo_filler_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_line_to (void *closure, cairo_point_t *point)
{
cairo_status_t status;
@@ -121,7 +121,7 @@ _cairo_filler_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -156,7 +156,7 @@ _cairo_filler_curve_to (void *closure,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_filler_close_path (void *closure)
{
cairo_status_t status;
@@ -170,7 +170,7 @@ _cairo_filler_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_path_fixed_fill_rectangle (cairo_path_fixed_t *path,
cairo_traps_t *traps);
@@ -224,7 +224,7 @@ BAIL:
* If the path described anything but a device-axis aligned rectangle,
* this function will return CAIRO_INT_STATUS_UNSUPPORTED.
*/
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_path_fixed_fill_rectangle (cairo_path_fixed_t *path,
cairo_traps_t *traps)
{
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 4845ada..d443777 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -41,7 +41,7 @@
#include "cairo-path-fixed-private.h"
/* private functions */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_add (cairo_path_fixed_t *path,
cairo_path_op_t op,
cairo_point_t *points,
@@ -350,7 +350,7 @@ _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_fixed_add (cairo_path_fixed_t *path,
cairo_path_op_t op,
cairo_point_t *points,
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index d4db605..c8fd590 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -67,7 +67,7 @@ typedef struct cairo_stroker {
} cairo_stroker_t;
/* private functions */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_init (cairo_stroker_t *stroker,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -75,31 +75,31 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
double tolerance,
cairo_traps_t *traps);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_fini (cairo_stroker_t *stroker);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_move_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_line_to (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_curve_to_dashed (void *closure,
cairo_point_t *b,
cairo_point_t *c,
cairo_point_t *d);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_close_path (void *closure);
static void
@@ -108,7 +108,7 @@ _translate_point (cairo_point_t *point, cairo_point_t *offset);
static int
_cairo_stroker_face_clockwise (cairo_stroke_face_t *in, cairo_stroke_face_t *out);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_stroke_face_t *out);
static void
@@ -148,7 +148,7 @@ _cairo_stroker_step_dash (cairo_stroker_t *stroker, double step)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_init (cairo_stroker_t *stroker,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -176,7 +176,7 @@ _cairo_stroker_init (cairo_stroker_t *stroker,
tolerance, ctm);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_fini (cairo_stroker_t *stroker)
{
return _cairo_pen_fini (&stroker->pen);
@@ -200,7 +200,7 @@ _cairo_stroker_face_clockwise (cairo_stroke_face_t *in, cairo_stroke_face_t *out
return _cairo_slope_clockwise (&in_slope, &out_slope);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_stroke_face_t *out)
{
int clockwise = _cairo_stroker_face_clockwise (out, in);
@@ -372,7 +372,7 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f)
{
cairo_status_t status;
@@ -459,7 +459,7 @@ CLEANUP_LINE_CAP_SQUARE:
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_add_leading_cap (cairo_stroker_t *stroker,
cairo_stroke_face_t *face)
{
@@ -480,7 +480,7 @@ _cairo_stroker_add_leading_cap (cairo_stroker_t *stroker,
return _cairo_stroker_add_cap (stroker, &reversed);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_add_trailing_cap (cairo_stroker_t *stroker,
cairo_stroke_face_t *face)
{
@@ -490,7 +490,7 @@ _cairo_stroker_add_trailing_cap (cairo_stroker_t *stroker,
static void
_compute_face (cairo_point_t *point, cairo_slope_t *slope, cairo_stroker_t *stroker, cairo_stroke_face_t *face);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_add_caps (cairo_stroker_t *stroker)
{
cairo_status_t status;
@@ -600,7 +600,7 @@ _compute_face (cairo_point_t *point, cairo_slope_t *slope, cairo_stroker_t *stro
face->dev_vector = *slope;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_point_t *p2,
cairo_slope_t *slope, cairo_stroke_face_t *start,
cairo_stroke_face_t *end)
@@ -625,7 +625,7 @@ _cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_
return _cairo_traps_tessellate_convex_quad (stroker->traps, rectangle);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_move_to (void *closure, cairo_point_t *point)
{
cairo_status_t status;
@@ -646,7 +646,7 @@ _cairo_stroker_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_move_to_dashed (void *closure, cairo_point_t *point)
{
/* reset the dash pattern for new sub paths */
@@ -656,7 +656,7 @@ _cairo_stroker_move_to_dashed (void *closure, cairo_point_t *point)
return _cairo_stroker_move_to (closure, point);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_line_to (void *closure, cairo_point_t *point)
{
cairo_status_t status;
@@ -698,7 +698,7 @@ _cairo_stroker_line_to (void *closure, cairo_point_t *point)
/*
* Dashed lines. Cap each dash end, join around turns when on
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
@@ -800,7 +800,7 @@ _cairo_stroker_line_to_dashed (void *closure, cairo_point_t *point)
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -888,7 +888,7 @@ _cairo_stroker_curve_to (void *closure,
* problem. It will also increase the importance of implementing
* an efficient and more robust tessellator.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_curve_to_dashed (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -937,7 +937,7 @@ _cairo_stroker_curve_to_dashed (void *closure,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_stroker_close_path (void *closure)
{
cairo_status_t status;
@@ -969,7 +969,7 @@ _cairo_stroker_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_path_fixed_stroke_rectilinear (cairo_path_fixed_t *path,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
@@ -984,6 +984,7 @@ _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
cairo_traps_t *traps)
{
cairo_status_t status;
+ cairo_status_t status2;
cairo_stroker_t stroker;
/* Before we do anything else, we attempt the rectilinear
@@ -1027,7 +1028,9 @@ _cairo_path_fixed_stroke_to_traps (cairo_path_fixed_t *path,
status = _cairo_stroker_add_caps (&stroker);
BAIL:
- _cairo_stroker_fini (&stroker);
+ status2 = _cairo_stroker_fini (&stroker);
+ if (status == CAIRO_STATUS_SUCCESS)
+ status = status2;
return status;
}
@@ -1066,7 +1069,7 @@ _cairo_rectilinear_stroker_fini (cairo_rectilinear_stroker_t *stroker)
free (stroker->segments);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_rectilinear_stroker_add_segment (cairo_rectilinear_stroker_t *stroker,
cairo_point_t *p1,
cairo_point_t *p2)
@@ -1093,7 +1096,7 @@ _cairo_rectilinear_stroker_add_segment (cairo_rectilinear_stroker_t *stroker,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_rectilinear_stroker_emit_segments (cairo_rectilinear_stroker_t *stroker)
{
cairo_status_t status;
@@ -1203,7 +1206,7 @@ _cairo_rectilinear_stroker_emit_segments (cairo_rectilinear_stroker_t *stroker)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_rectilinear_stroker_move_to (void *closure,
cairo_point_t *point)
{
@@ -1220,7 +1223,7 @@ _cairo_rectilinear_stroker_move_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_rectilinear_stroker_line_to (void *closure,
cairo_point_t *point)
{
@@ -1246,7 +1249,7 @@ _cairo_rectilinear_stroker_line_to (void *closure,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_rectilinear_stroker_close_path (void *closure)
{
cairo_rectilinear_stroker_t *stroker = closure;
@@ -1270,7 +1273,7 @@ _cairo_rectilinear_stroker_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_path_fixed_stroke_rectilinear (cairo_path_fixed_t *path,
cairo_stroke_style_t *stroke_style,
cairo_matrix_t *ctm,
diff --git a/src/cairo-path.c b/src/cairo-path.c
index a12db36..77ae774 100644
--- a/src/cairo-path.c
+++ b/src/cairo-path.c
@@ -47,7 +47,7 @@ typedef struct cairo_path_count {
cairo_point_t current_point;
} cpc_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpc_move_to (void *closure, cairo_point_t *point)
{
cpc_t *cpc = closure;
@@ -59,7 +59,7 @@ _cpc_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpc_line_to (void *closure, cairo_point_t *point)
{
cpc_t *cpc = closure;
@@ -71,7 +71,7 @@ _cpc_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpc_curve_to (void *closure,
cairo_point_t *p1,
cairo_point_t *p2,
@@ -86,7 +86,7 @@ _cpc_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpc_curve_to_flatten (void *closure,
cairo_point_t *p1,
cairo_point_t *p2,
@@ -107,8 +107,11 @@ _cpc_curve_to_flatten (void *closure,
if (status)
goto out;
- for (i=1; i < spline.num_points; i++)
- _cpc_line_to (cpc, &spline.points[i]);
+ for (i=1; i < spline.num_points; i++) {
+ status = _cpc_line_to (cpc, &spline.points[i]);
+ if (status)
+ goto out;
+ }
cpc->current_point = *p3;
@@ -119,7 +122,7 @@ _cpc_curve_to_flatten (void *closure,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpc_close_path (void *closure)
{
cpc_t *cpc = closure;
@@ -165,7 +168,7 @@ typedef struct cairo_path_populate {
cairo_point_t current_point;
} cpp_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpp_move_to (void *closure, cairo_point_t *point)
{
cpp_t *cpp = closure;
@@ -191,7 +194,7 @@ _cpp_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpp_line_to (void *closure, cairo_point_t *point)
{
cpp_t *cpp = closure;
@@ -217,7 +220,7 @@ _cpp_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpp_curve_to (void *closure,
cairo_point_t *p1,
cairo_point_t *p2,
@@ -261,7 +264,7 @@ _cpp_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpp_curve_to_flatten (void *closure,
cairo_point_t *p1,
cairo_point_t *p2,
@@ -282,8 +285,11 @@ _cpp_curve_to_flatten (void *closure,
if (status)
goto out;
- for (i=1; i < spline.num_points; i++)
- _cpp_line_to (cpp, &spline.points[i]);
+ for (i=1; i < spline.num_points; i++) {
+ status = _cpp_line_to (cpp, &spline.points[i]);
+ if (status)
+ goto out;
+ }
cpp->current_point = *p3;
@@ -294,7 +300,7 @@ _cpp_curve_to_flatten (void *closure,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cpp_close_path (void *closure)
{
cpp_t *cpp = closure;
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index e3857ba..9d5dd8e 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -658,7 +658,7 @@ cairo_pattern_set_user_data (cairo_pattern_t *pattern,
}
/* make room for at least one more color stop */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pattern_gradient_grow (cairo_gradient_pattern_t *pattern)
{
pixman_gradient_stop_t *new_stops;
@@ -1025,7 +1025,7 @@ _cairo_linear_pattern_classify (cairo_linear_pattern_t *pattern,
*is_horizontal = factors[2] == factors[0];
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
cairo_surface_t *dst,
int x,
@@ -1160,7 +1160,7 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
cairo_surface_t *dst,
int x,
@@ -1251,7 +1251,7 @@ _cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern)
return FALSE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
cairo_surface_t *dst,
int x,
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 25e5058..5b62d64 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -170,10 +170,10 @@ _cairo_pdf_surface_write_catalog (cairo_pdf_surface_t *surface);
static long
_cairo_pdf_surface_write_xref (cairo_pdf_surface_t *surface);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_font_subsets (cairo_pdf_surface_t *surface);
static const cairo_surface_backend_t cairo_pdf_surface_backend;
@@ -400,7 +400,7 @@ _cairo_surface_is_pdf (cairo_surface_t *surface)
* surface's target is a pdf_surface, then set pdf_surface to that
* target. Otherwise return CAIRO_STATUS_SURFACE_TYPE_MISMATCH.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_extract_pdf_surface (cairo_surface_t *surface,
cairo_pdf_surface_t **pdf_surface)
{
@@ -535,7 +535,7 @@ _cairo_pdf_surface_close_stream (cairo_pdf_surface_t *surface)
surface->current_stream.active = FALSE;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_finish (void *abstract_surface)
{
cairo_status_t status;
@@ -610,7 +610,7 @@ _cairo_pdf_surface_resume_content_stream (cairo_pdf_surface_t *surface)
_cairo_pdf_surface_add_stream (surface, stream);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_start_page (void *abstract_surface)
{
cairo_pdf_surface_t *surface = abstract_surface;
@@ -656,7 +656,7 @@ compress_dup (const void *data, unsigned long data_size,
* In the case that the alpha channel happens to be all opaque, then
* no SMask object will be emitted and *id_ret will be set to 0.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_smask (cairo_pdf_surface_t *surface,
cairo_image_surface_t *image,
cairo_pdf_resource_t *stream_ret)
@@ -727,7 +727,7 @@ _cairo_pdf_surface_emit_smask (cairo_pdf_surface_t *surface,
/* Emit image data into the given surface, providing a resource that
* can be used to reference the data in image_ret. */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_image (cairo_pdf_surface_t *surface,
cairo_image_surface_t *image,
cairo_pdf_resource_t *image_ret)
@@ -840,7 +840,7 @@ _cairo_pdf_surface_emit_image (cairo_pdf_surface_t *surface,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_solid_pattern (cairo_pdf_surface_t *surface,
cairo_solid_pattern_t *pattern)
{
@@ -865,7 +865,7 @@ _cairo_pdf_surface_emit_solid_pattern (cairo_pdf_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
cairo_surface_pattern_t *pattern)
{
@@ -1186,7 +1186,7 @@ _cairo_pdf_surface_emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradi
return function;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *pattern)
{
cairo_pdf_resource_t function, pattern_resource, alpha;
@@ -1249,7 +1249,7 @@ _cairo_pdf_surface_emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_line
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *pattern)
{
cairo_pdf_resource_t function, pattern_resource, alpha;
@@ -1325,7 +1325,7 @@ _cairo_pdf_surface_emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radi
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_pattern (cairo_pdf_surface_t *surface, cairo_pattern_t *pattern)
{
switch (pattern->type) {
@@ -1347,7 +1347,7 @@ _cairo_pdf_surface_emit_pattern (cairo_pdf_surface_t *surface, cairo_pattern_t *
return CAIRO_STATUS_PATTERN_TYPE_MISMATCH;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_copy_page (void *abstract_surface)
{
cairo_pdf_surface_t *surface = abstract_surface;
@@ -1355,7 +1355,7 @@ _cairo_pdf_surface_copy_page (void *abstract_surface)
return _cairo_pdf_surface_write_page (surface);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_show_page (void *abstract_surface)
{
cairo_pdf_surface_t *surface = abstract_surface;
@@ -1370,7 +1370,7 @@ _cairo_pdf_surface_show_page (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1394,7 +1394,7 @@ typedef struct _pdf_path_info {
cairo_matrix_t *ctm_inverse;
} pdf_path_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_path_move_to (void *closure, cairo_point_t *point)
{
pdf_path_info_t *info = closure;
@@ -1410,7 +1410,7 @@ _cairo_pdf_path_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_path_line_to (void *closure, cairo_point_t *point)
{
pdf_path_info_t *info = closure;
@@ -1425,7 +1425,7 @@ _cairo_pdf_path_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_path_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -1451,7 +1451,7 @@ _cairo_pdf_path_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_path_close_path (void *closure)
{
pdf_path_info_t *info = closure;
@@ -1462,7 +1462,7 @@ _cairo_pdf_path_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_intersect_clip_path (void *abstract_surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -1719,7 +1719,7 @@ _cairo_pdf_surface_emit_toUnicode_stream (cairo_pdf_surface_t *surface,
return stream;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_cff_font_subset (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -1831,7 +1831,7 @@ _cairo_pdf_surface_emit_cff_font_subset (cairo_pdf_surface_t *surface,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset,
cairo_type1_subset_t *subset)
@@ -1937,7 +1937,7 @@ _cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t *surface,
}
#if CAIRO_HAS_FT_FONT
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_type1_font_subset (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -1958,7 +1958,7 @@ _cairo_pdf_surface_emit_type1_font_subset (cairo_pdf_surface_t *surface,
}
#endif
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_type1_fallback_font (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -1980,7 +1980,7 @@ _cairo_pdf_surface_emit_type1_fallback_font (cairo_pdf_surface_t *surface,
#define PDF_UNITS_PER_EM 1000
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -2109,7 +2109,7 @@ _cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t *surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_emit_outline_glyph (cairo_pdf_surface_t *surface,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index,
@@ -2155,7 +2155,7 @@ _cairo_pdf_surface_emit_outline_glyph (cairo_pdf_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_emit_bitmap_glyph (cairo_pdf_surface_t *surface,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index,
@@ -2263,7 +2263,7 @@ _cairo_pdf_surface_emit_glyph (cairo_pdf_surface_t *surface,
_cairo_surface_set_error (&surface->base, status);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -2428,7 +2428,7 @@ _cairo_pdf_surface_emit_scaled_font_subset (cairo_scaled_font_subset_t *font_sub
return;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_font_subsets (cairo_pdf_surface_t *surface)
{
cairo_status_t status;
@@ -2494,7 +2494,7 @@ _cairo_pdf_surface_write_xref (cairo_pdf_surface_t *surface)
return offset;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface)
{
cairo_status_t status;
@@ -2612,7 +2612,7 @@ _cairo_pdf_test_force_fallbacks (void)
cairo_pdf_force_fallbacks = TRUE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
__cairo_pdf_surface_operation_supported (cairo_pdf_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *pattern)
@@ -2631,7 +2631,7 @@ __cairo_pdf_surface_operation_supported (cairo_pdf_surface_t *surface,
return FALSE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *pattern)
@@ -2642,7 +2642,7 @@ _cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t *surface,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -2674,7 +2674,7 @@ _cairo_pdf_surface_paint (void *abstract_surface,
return _cairo_output_stream_get_status (surface->output);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -2722,7 +2722,7 @@ _cairo_pdf_line_join (cairo_line_join_t join)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pdf_surface_emit_stroke_style (cairo_pdf_surface_t *surface,
cairo_stroke_style_t *style)
{
@@ -2756,7 +2756,7 @@ _cairo_pdf_surface_emit_stroke_style (cairo_pdf_surface_t *surface,
return _cairo_output_stream_get_status (surface->output);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -2806,7 +2806,7 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -2858,7 +2858,7 @@ _cairo_pdf_surface_fill (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_pdf_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 66984b3..cf6c704 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -42,7 +42,7 @@ _cairo_pen_vertices_needed (double tolerance, double radius, cairo_matrix_t *mat
static void
_cairo_pen_compute_slopes (cairo_pen_t *pen);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_stroke_spline_half (cairo_pen_t *pen, cairo_spline_t *spline, cairo_direction_t dir, cairo_polygon_t *polygon);
cairo_status_t
@@ -358,7 +358,7 @@ _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_pen_stroke_spline_half (cairo_pen_t *pen,
cairo_spline_t *spline,
cairo_direction_t dir,
diff --git a/src/cairo-png.c b/src/cairo-png.c
index 006cae3..9123151 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -82,7 +82,7 @@ convert_data_to_bytes (png_structp png, png_row_infop row_info, png_bytep data)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
write_png (cairo_surface_t *surface,
png_rw_ptr write_func,
void *closure)
diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c
index 86191ca..059ec30 100644
--- a/src/cairo-polygon.c
+++ b/src/cairo-polygon.c
@@ -39,7 +39,7 @@
/* private functions */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_grow (cairo_polygon_t *polygon);
void
@@ -67,7 +67,7 @@ _cairo_polygon_fini (cairo_polygon_t *polygon)
}
/* make room for at least one more edge */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_polygon_grow (cairo_polygon_t *polygon)
{
cairo_edge_t *new_edges;
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index a5dfd8e..ec3d8d7 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -122,7 +122,7 @@ _count_word_up_to (const unsigned char *s, int length)
return word;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_word_wrap_stream_write (cairo_output_stream_t *base,
const unsigned char *data,
unsigned int length)
@@ -167,7 +167,7 @@ _word_wrap_stream_write (cairo_output_stream_t *base,
return _cairo_output_stream_get_status (stream->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_word_wrap_stream_close (cairo_output_stream_t *base)
{
word_wrap_stream_t *stream = (word_wrap_stream_t *) base;
@@ -203,7 +203,7 @@ typedef struct _ps_path_info {
cairo_bool_t has_sub_path;
} ps_path_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_path_move_to (void *closure, cairo_point_t *point)
{
ps_path_info_t *path_info = closure;
@@ -219,7 +219,7 @@ _cairo_ps_surface_path_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_path_line_to (void *closure, cairo_point_t *point)
{
ps_path_info_t *path_info = closure;
@@ -242,7 +242,7 @@ _cairo_ps_surface_path_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_path_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -264,7 +264,7 @@ _cairo_ps_surface_path_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_path_close_path (void *closure)
{
ps_path_info_t *path_info = closure;
@@ -290,7 +290,7 @@ _cairo_ps_surface_path_close_path (void *closure)
* stroked, simply pass CAIRO_LINE_CAP_ROUND which will guarantee that
* the stroke workaround will not modify the path being emitted.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_path (cairo_ps_surface_t *surface,
cairo_output_stream_t *stream,
cairo_path_fixed_t *path,
@@ -395,7 +395,7 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface)
}
#if CAIRO_HAS_FT_FONT
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_type1_font_subset (cairo_ps_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
@@ -426,7 +426,7 @@ _cairo_ps_surface_emit_type1_font_subset (cairo_ps_surface_t *surface,
}
#endif
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_type1_font_fallback (cairo_ps_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
{
@@ -454,7 +454,7 @@ _cairo_ps_surface_emit_type1_font_fallback (cairo_ps_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_truetype_font_subset (cairo_ps_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
@@ -531,7 +531,7 @@ _cairo_ps_surface_emit_truetype_font_subset (cairo_ps_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_emit_outline_glyph_data (cairo_ps_surface_t *surface,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index)
@@ -566,7 +566,7 @@ _cairo_ps_surface_emit_outline_glyph_data (cairo_ps_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_emit_bitmap_glyph_data (cairo_ps_surface_t *surface,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index)
@@ -663,7 +663,7 @@ _cairo_ps_surface_emit_glyph (cairo_ps_surface_t *surface,
_cairo_surface_set_error (&surface->base, status);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t *surface,
cairo_scaled_font_subset_t *font_subset)
@@ -745,7 +745,7 @@ _cairo_ps_surface_emit_scaled_font_subset (cairo_scaled_font_subset_t *font_subs
return;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_font_subsets (cairo_ps_surface_t *surface)
{
cairo_status_t status;
@@ -949,7 +949,7 @@ _cairo_surface_is_ps (cairo_surface_t *surface)
* surface's target is a ps_surface, then set ps_surface to that
* target. Otherwise return CAIRO_STATUS_SURFACE_TYPE_MISMATCH.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_extract_ps_surface (cairo_surface_t *surface,
cairo_ps_surface_t **ps_surface)
{
@@ -1201,7 +1201,7 @@ cairo_ps_surface_dsc_begin_page_setup (cairo_surface_t *surface)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_finish (void *abstract_surface)
{
cairo_status_t status;
@@ -1249,7 +1249,7 @@ _cairo_ps_surface_finish (void *abstract_surface)
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_start_page (void *abstract_surface)
{
cairo_ps_surface_t *surface = abstract_surface;
@@ -1304,7 +1304,7 @@ _cairo_ps_surface_end_page (cairo_ps_surface_t *surface)
"grestore\n");
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_copy_page (void *abstract_surface)
{
cairo_ps_surface_t *surface = abstract_surface;
@@ -1316,7 +1316,7 @@ _cairo_ps_surface_copy_page (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_show_page (void *abstract_surface)
{
cairo_ps_surface_t *surface = abstract_surface;
@@ -1406,7 +1406,7 @@ _cairo_ps_test_force_fallbacks (void)
cairo_ps_force_fallbacks = TRUE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_operation_supported (cairo_ps_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
@@ -1426,7 +1426,7 @@ _cairo_ps_surface_operation_supported (cairo_ps_surface_t *surface,
return _cairo_pattern_is_opaque (pattern);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_analyze_operation (cairo_ps_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
@@ -1456,7 +1456,7 @@ typedef struct _string_array_stream {
int string_size;
} string_array_stream_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_string_array_stream_write (cairo_output_stream_t *base,
const unsigned char *data,
unsigned int length)
@@ -1511,7 +1511,7 @@ _string_array_stream_write (cairo_output_stream_t *base,
return _cairo_output_stream_get_status (stream->output);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_string_array_stream_close (cairo_output_stream_t *base)
{
cairo_status_t status;
@@ -1560,7 +1560,7 @@ _string_array_stream_create (cairo_output_stream_t *output)
/* PS Output - this section handles output of the parts of the meta
* surface we can render natively in PS. */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_ps_surface_emit_image (cairo_ps_surface_t *surface,
cairo_image_surface_t *image,
const char *name)
@@ -1851,7 +1851,7 @@ _cairo_ps_surface_emit_pattern (cairo_ps_surface_t *surface, cairo_pattern_t *pa
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_intersect_clip_path (void *abstract_surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -1896,7 +1896,7 @@ _cairo_ps_surface_intersect_clip_path (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1926,7 +1926,7 @@ _cairo_ps_surface_get_font_options (void *abstract_surface,
cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -2009,7 +2009,7 @@ _cairo_ps_line_join (cairo_line_join_t join)
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -2144,7 +2144,7 @@ _cairo_ps_surface_stroke (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -2198,7 +2198,7 @@ typedef struct _cairo_ps_glyph_id {
unsigned int glyph_id;
} cairo_ps_glyph_id_t;
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_ps_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 1ac4c7b..a88c2fb 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -102,7 +102,7 @@ static void quartz_image_to_png (CGImageRef, char *dest);
*/
/* cairo path -> mutable path */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_path_move_to (void *closure, cairo_point_t *point)
{
CGPathMoveToPoint ((CGMutablePathRef) closure, NULL,
@@ -110,7 +110,7 @@ _cairo_path_to_quartz_path_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_path_line_to (void *closure, cairo_point_t *point)
{
CGPathAddLineToPoint ((CGMutablePathRef) closure, NULL,
@@ -118,7 +118,7 @@ _cairo_path_to_quartz_path_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_path_curve_to (void *closure, cairo_point_t *p0, cairo_point_t *p1, cairo_point_t *p2)
{
CGPathAddCurveToPoint ((CGMutablePathRef) closure, NULL,
@@ -128,7 +128,7 @@ _cairo_path_to_quartz_path_curve_to (void *closure, cairo_point_t *p0, cairo_poi
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_path_close_path (void *closure)
{
CGPathCloseSubpath ((CGMutablePathRef) closure);
@@ -136,7 +136,7 @@ _cairo_path_to_quartz_path_close_path (void *closure)
}
/* cairo path -> execute in context */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_context_move_to (void *closure, cairo_point_t *point)
{
//ND((stderr, "moveto: %f %f\n", _cairo_fixed_to_double(point->x), _cairo_fixed_to_double(point->y)));
@@ -145,7 +145,7 @@ _cairo_path_to_quartz_context_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_context_line_to (void *closure, cairo_point_t *point)
{
//ND((stderr, "lineto: %f %f\n", _cairo_fixed_to_double(point->x), _cairo_fixed_to_double(point->y)));
@@ -158,7 +158,7 @@ _cairo_path_to_quartz_context_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_context_curve_to (void *closure, cairo_point_t *p0, cairo_point_t *p1, cairo_point_t *p2)
{
//ND( (stderr, "curveto: %f,%f %f,%f %f,%f\n",
@@ -173,7 +173,7 @@ _cairo_path_to_quartz_context_curve_to (void *closure, cairo_point_t *p0, cairo_
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_path_to_quartz_context_close_path (void *closure)
{
//ND((stderr, "closepath\n"));
@@ -181,7 +181,7 @@ _cairo_path_to_quartz_context_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_cairo_path_to_quartz_path (cairo_path_fixed_t *path,
CGMutablePathRef cgPath)
{
@@ -194,7 +194,7 @@ _cairo_quartz_cairo_path_to_quartz_path (cairo_path_fixed_t *path,
cgPath);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_cairo_path_to_quartz_context (cairo_path_fixed_t *path,
CGContextRef cgc)
{
@@ -511,7 +511,7 @@ SurfacePatternDrawFunc (void *info, CGContextRef context)
}
/* Borrowed from cairo-meta-surface */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_init_pattern_with_snapshot (cairo_pattern_t *pattern,
const cairo_pattern_t *other)
{
@@ -746,7 +746,7 @@ ImageDataReleaseFunc(void *info, const void *data, size_t size)
}
/* Read the image from the surface's front buffer */
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_get_image (cairo_quartz_surface_t *surface,
cairo_image_surface_t **image_out,
unsigned char **data_out)
@@ -829,7 +829,7 @@ _cairo_quartz_get_image (cairo_quartz_surface_t *surface,
* Cairo surface backend implementations
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_surface_finish (void *abstract_surface)
{
cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface;
@@ -851,7 +851,7 @@ _cairo_quartz_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -865,7 +865,7 @@ _cairo_quartz_surface_acquire_source_image (void *abstract_surface,
return _cairo_quartz_get_image (surface, image_out, NULL);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -956,7 +956,7 @@ _cairo_quartz_surface_create_similar (void *abstract_surface,
return cairo_quartz_surface_create (format, width, height);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_quartz_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -1050,7 +1050,7 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *extents)
{
@@ -1061,7 +1061,7 @@ _cairo_quartz_surface_get_extents (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -1096,7 +1096,7 @@ _cairo_quartz_surface_paint (void *abstract_surface,
return rv;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1155,7 +1155,7 @@ _cairo_quartz_surface_fill (void *abstract_surface,
return rv;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1235,7 +1235,7 @@ _cairo_quartz_surface_stroke (void *abstract_surface,
}
#if CAIRO_HAS_ATSUI_FONT
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1349,7 +1349,7 @@ _cairo_quartz_surface_show_glyphs (void *abstract_surface,
}
#endif /* CAIRO_HAS_ATSUI_FONT */
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1387,7 +1387,7 @@ _cairo_quartz_surface_mask (void *abstract_surface,
return rv;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_quartz_surface_intersect_clip_path (void *abstract_surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index d98cba2..9e4371a 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -244,7 +244,7 @@ _cairo_sub_font_pluck (void *entry, void *closure)
_cairo_sub_font_destroy (sub_font);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_sub_font_lookup_glyph (cairo_sub_font_t *sub_font,
unsigned long scaled_font_glyph_index,
unsigned int *subset_id,
@@ -265,7 +265,7 @@ _cairo_sub_font_lookup_glyph (cairo_sub_font_t *sub_font,
return CAIRO_STATUS_NULL_POINTER;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_sub_font_map_glyph (cairo_sub_font_t *sub_font,
unsigned long scaled_font_glyph_index,
unsigned int *subset_id,
@@ -497,7 +497,7 @@ _cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *subsets,
subset_id, subset_glyph_index);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_scaled_font_subsets_foreach_internal (cairo_scaled_font_subsets_t *font_subsets,
cairo_scaled_font_subset_callback_func_t font_subset_callback,
void *closure,
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 870ca9c..e760e14 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1140,7 +1140,7 @@ typedef struct _cairo_scaled_glyph_path_closure {
cairo_path_fixed_t *path;
} cairo_scaled_glyph_path_closure_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_scaled_glyph_path_move_to (void *abstract_closure, cairo_point_t *point)
{
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
@@ -1150,7 +1150,7 @@ _scaled_glyph_path_move_to (void *abstract_closure, cairo_point_t *point)
point->y + closure->offset.y);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_scaled_glyph_path_line_to (void *abstract_closure, cairo_point_t *point)
{
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
@@ -1160,7 +1160,7 @@ _scaled_glyph_path_line_to (void *abstract_closure, cairo_point_t *point)
point->y + closure->offset.y);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_scaled_glyph_path_curve_to (void *abstract_closure,
cairo_point_t *p0,
cairo_point_t *p1,
@@ -1177,7 +1177,7 @@ _scaled_glyph_path_curve_to (void *abstract_closure,
p2->y + closure->offset.y);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_scaled_glyph_path_close_path (void *abstract_closure)
{
cairo_scaled_glyph_path_closure_t *closure = abstract_closure;
@@ -1203,7 +1203,7 @@ _scaled_glyph_path_close_path (void *abstract_closure)
* who cares enough about getting a better result to implement
* something more sophisticated.
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_trace_mask_to_path (cairo_image_surface_t *mask,
cairo_path_fixed_t *path)
{
diff --git a/src/cairo-spline.c b/src/cairo-spline.c
index 3624bfc..97b4036 100644
--- a/src/cairo-spline.c
+++ b/src/cairo-spline.c
@@ -36,10 +36,10 @@
#include "cairoint.h"
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_grow (cairo_spline_t *spline);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *point);
static void
@@ -51,7 +51,7 @@ _de_casteljau (cairo_spline_t *spline, cairo_spline_t *s1, cairo_spline_t *s2);
static double
_cairo_spline_error_squared (cairo_spline_t *spline);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_decompose_into (cairo_spline_t *spline, double tolerance_squared, cairo_spline_t *result);
cairo_int_status_t
@@ -99,7 +99,7 @@ _cairo_spline_fini (cairo_spline_t *spline)
}
/* make room for at least one more point */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_grow (cairo_spline_t *spline)
{
cairo_point_t *new_points;
@@ -135,7 +135,7 @@ _cairo_spline_grow (cairo_spline_t *spline)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_add_point (cairo_spline_t *spline, cairo_point_t *point)
{
cairo_status_t status;
@@ -256,7 +256,7 @@ _cairo_spline_error_squared (cairo_spline_t *spline)
return cerr;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_spline_decompose_into (cairo_spline_t *spline, double tolerance_squared, cairo_spline_t *result)
{
cairo_status_t status;
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 581c3ad..2be3de3 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -56,7 +56,7 @@ typedef struct {
* visible, CAIRO_STATUS_SUCCESS if some portion is visible and all
* went well, or some error status otherwise.
**/
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_fallback_init (fallback_state_t *state,
cairo_surface_t *dst,
int x,
@@ -106,7 +106,7 @@ typedef cairo_status_t (*cairo_draw_func_t) (void *clos
int dst_y,
const cairo_rectangle_int16_t *extents);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern,
cairo_clip_t *clip,
cairo_draw_func_t draw_func,
@@ -150,7 +150,7 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern,
/* Handles compositing with a clip surface when the operator allows
* us to combine the clip with the mask
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_clip_and_composite_with_mask (cairo_clip_t *clip,
cairo_operator_t op,
cairo_pattern_t *src,
@@ -184,7 +184,7 @@ _clip_and_composite_with_mask (cairo_clip_t *clip,
/* Handles compositing with a clip surface when we have to do the operation
* in two pieces and combine them together.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_clip_and_composite_combine (cairo_clip_t *clip,
cairo_operator_t op,
cairo_pattern_t *src,
@@ -273,7 +273,7 @@ _clip_and_composite_combine (cairo_clip_t *clip,
/* Handles compositing for CAIRO_OPERATOR_SOURCE, which is special; it's
* defined as (src IN mask IN clip) ADD (dst OUT (mask IN clip))
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_clip_and_composite_source (cairo_clip_t *clip,
cairo_pattern_t *src,
cairo_draw_func_t draw_func,
@@ -346,7 +346,7 @@ _cairo_rectangle_empty (const cairo_rectangle_int16_t *rect)
*
* Return value: %CAIRO_STATUS_SUCCESS if the drawing succeeded.
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_clip_and_composite (cairo_clip_t *clip,
cairo_operator_t op,
cairo_pattern_t *src,
@@ -402,7 +402,7 @@ _clip_and_composite (cairo_clip_t *clip,
/* Composites a region representing a set of trapezoids.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_composite_trap_region (cairo_clip_t *clip,
cairo_pattern_t *src,
cairo_operator_t op,
@@ -469,7 +469,7 @@ typedef struct {
cairo_antialias_t antialias;
} cairo_composite_traps_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_composite_traps_draw_func (void *closure,
cairo_operator_t op,
cairo_pattern_t *src,
@@ -502,7 +502,7 @@ _composite_traps_draw_func (void *closure,
}
/* Warning: This call modifies the coordinates of traps */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_clip_and_composite_trapezoids (cairo_pattern_t *src,
cairo_operator_t op,
cairo_surface_t *dst,
@@ -690,7 +690,7 @@ _cairo_surface_fallback_paint (cairo_surface_t *surface,
if (status)
return status;
- _clip_and_composite_trapezoids (source,
+ status = _clip_and_composite_trapezoids (source,
op,
surface,
&traps,
@@ -699,10 +699,10 @@ _cairo_surface_fallback_paint (cairo_surface_t *surface,
_cairo_traps_fini (&traps);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_mask_draw_func (void *closure,
cairo_operator_t op,
cairo_pattern_t *src,
@@ -798,7 +798,7 @@ _cairo_surface_fallback_stroke (cairo_surface_t *surface,
return status;
}
- _clip_and_composite_trapezoids (source,
+ status = _clip_and_composite_trapezoids (source,
op,
surface,
&traps,
@@ -807,7 +807,7 @@ _cairo_surface_fallback_stroke (cairo_surface_t *surface,
_cairo_traps_fini (&traps);
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
cairo_status_t
@@ -851,7 +851,7 @@ typedef struct {
int num_glyphs;
} cairo_show_glyphs_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_old_show_glyphs_draw_func (void *closure,
cairo_operator_t op,
cairo_pattern_t *src,
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 9552c20..a7cb14b 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -81,7 +81,7 @@ DEFINE_NIL_SURFACE(CAIRO_STATUS_FILE_NOT_FOUND, _cairo_surface_nil_file_not_foun
DEFINE_NIL_SURFACE(CAIRO_STATUS_READ_ERROR, _cairo_surface_nil_read_error);
DEFINE_NIL_SURFACE(CAIRO_STATUS_WRITE_ERROR, _cairo_surface_nil_write_error);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
cairo_surface_t *destination,
cairo_pattern_t *pattern_out);
@@ -1256,7 +1256,9 @@ _cairo_surface_paint (cairo_surface_t *surface,
assert (! surface->is_snapshot);
- _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ if (status)
+ return status;
if (surface->backend->paint) {
status = surface->backend->paint (surface, op, &dev_source.base);
@@ -1284,8 +1286,12 @@ _cairo_surface_mask (cairo_surface_t *surface,
assert (! surface->is_snapshot);
- _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
- _cairo_surface_copy_pattern_for_destination (mask, surface, &dev_mask.base);
+ status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ if (status)
+ return status;
+ status = _cairo_surface_copy_pattern_for_destination (mask, surface, &dev_mask.base);
+ if (status)
+ goto CLEANUP_SOURCE;
if (surface->backend->mask) {
status = surface->backend->mask (surface, op, &dev_source.base, &dev_mask.base);
@@ -1297,6 +1303,7 @@ _cairo_surface_mask (cairo_surface_t *surface,
FINISH:
_cairo_pattern_fini (&dev_mask.base);
+CLEANUP_SOURCE:
_cairo_pattern_fini (&dev_source.base);
return status;
@@ -1322,7 +1329,9 @@ _cairo_surface_stroke (cairo_surface_t *surface,
assert (! surface->is_snapshot);
- _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ if (status)
+ return status;
if (surface->backend->stroke) {
status = surface->backend->stroke (surface, op, &dev_source.base,
@@ -1361,7 +1370,9 @@ _cairo_surface_fill (cairo_surface_t *surface,
assert (! surface->is_snapshot);
- _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ status = _cairo_surface_copy_pattern_for_destination (source, surface, &dev_source.base);
+ if (status)
+ return status;
if (surface->backend->fill) {
status = surface->backend->fill (surface, op, &dev_source.base,
@@ -1609,7 +1620,7 @@ _cairo_surface_intersect_clip_path (cairo_surface_t *surface,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_set_clip_path_recursive (cairo_surface_t *surface,
cairo_clip_path_t *clip_path)
{
@@ -1638,7 +1649,7 @@ _cairo_surface_set_clip_path_recursive (cairo_surface_t *surface,
* Sets the given clipping path for the surface and assigns the
* clipping serial to the surface.
**/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_set_clip_path (cairo_surface_t *surface,
cairo_clip_path_t *clip_path,
unsigned int serial)
@@ -1765,9 +1776,11 @@ _cairo_surface_show_glyphs (cairo_surface_t *surface,
if (!num_glyphs)
return CAIRO_STATUS_SUCCESS;
- _cairo_surface_copy_pattern_for_destination (source,
+ status = _cairo_surface_copy_pattern_for_destination (source,
surface,
&dev_source.base);
+ if (status)
+ return status;
cairo_scaled_font_get_font_matrix (scaled_font, &font_matrix);
@@ -1855,7 +1868,7 @@ _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_composite_fixup_unbounded_internal (cairo_surface_t *dst,
cairo_rectangle_int16_t *src_rectangle,
cairo_rectangle_int16_t *mask_rectangle,
@@ -2069,7 +2082,7 @@ _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst,
* Copies the given pattern, taking into account device scale and offsets
* of the destination surface.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
cairo_surface_t *destination,
cairo_pattern_t *pattern_out)
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index a58c8cb..315d7c5 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -150,7 +150,7 @@ _cairo_svg_document_create (cairo_output_stream_t *stream,
static void
_cairo_svg_document_destroy (cairo_svg_document_t *document);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_document_finish (cairo_svg_document_t *document);
static cairo_svg_document_t *
@@ -258,7 +258,7 @@ _cairo_surface_is_svg (cairo_surface_t *surface)
* surface's target is a svg_surface, then set svg_surface to that
* target. Otherwise return CAIRO_STATUS_SURFACE_TYPE_MISMATCH.
*/
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_extract_svg_surface (cairo_surface_t *surface,
cairo_svg_surface_t **svg_surface)
{
@@ -455,7 +455,7 @@ _cairo_svg_surface_store_page (cairo_svg_surface_t *surface)
return _cairo_array_index (&surface->page_set, surface->page_set.num_elements - 1);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_copy_page (void *abstract_surface)
{
cairo_svg_surface_t *surface = abstract_surface;
@@ -471,7 +471,7 @@ _cairo_svg_surface_copy_page (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_show_page (void *abstract_surface)
{
cairo_svg_surface_t *surface = abstract_surface;
@@ -503,7 +503,7 @@ typedef struct
cairo_matrix_t *ctm_inverse;
} svg_path_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_path_move_to (void *closure, cairo_point_t *point)
{
svg_path_info_t *info = closure;
@@ -518,7 +518,7 @@ _cairo_svg_path_move_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_path_line_to (void *closure, cairo_point_t *point)
{
svg_path_info_t *info = closure;
@@ -533,7 +533,7 @@ _cairo_svg_path_line_to (void *closure, cairo_point_t *point)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_path_curve_to (void *closure,
cairo_point_t *b,
cairo_point_t *c,
@@ -560,7 +560,7 @@ _cairo_svg_path_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_path_close_path (void *closure)
{
svg_path_info_t *info = closure;
@@ -570,7 +570,7 @@ _cairo_svg_path_close_path (void *closure)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_emit_path (cairo_output_stream_t *output,
cairo_path_fixed_t *path,
cairo_matrix_t *ctm_inverse)
@@ -595,7 +595,7 @@ _cairo_svg_surface_emit_path (cairo_output_stream_t *output,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_document_emit_outline_glyph_data (cairo_svg_document_t *document,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index)
@@ -622,7 +622,7 @@ _cairo_svg_document_emit_outline_glyph_data (cairo_svg_document_t *document,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_document_emit_bitmap_glyph_data (cairo_svg_document_t *document,
cairo_scaled_font_t *scaled_font,
unsigned long glyph_index)
@@ -742,7 +742,7 @@ _cairo_svg_test_force_fallbacks (void)
cairo_svg_force_fallbacks = TRUE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
__cairo_svg_surface_operation_supported (cairo_svg_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
@@ -759,7 +759,7 @@ __cairo_svg_surface_operation_supported (cairo_svg_surface_t *surface,
return TRUE;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_analyze_operation (cairo_svg_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
@@ -779,7 +779,7 @@ _cairo_svg_surface_create_similar (void *abstract_src,
return _cairo_meta_surface_create (content, width, height);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_finish (void *abstract_surface)
{
cairo_status_t status;
@@ -836,7 +836,7 @@ typedef struct {
static char const *base64_table =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
base64_write_func (void *closure,
const unsigned char *data,
unsigned int length)
@@ -889,7 +889,7 @@ base64_write_func (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_surface_base64_encode (cairo_surface_t *surface,
cairo_output_stream_t *output)
{
@@ -921,7 +921,7 @@ _cairo_surface_base64_encode (cairo_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_emit_composite_image_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *svg_surface,
cairo_surface_pattern_t *pattern,
@@ -1071,7 +1071,7 @@ _cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document,
return id;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_surface_pattern_t *pattern,
@@ -1119,7 +1119,7 @@ _cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_emit_composite_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_surface_pattern_t *pattern,
@@ -1602,7 +1602,7 @@ _cairo_svg_surface_emit_pattern (cairo_svg_surface_t *surface, cairo_pattern_t *
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1635,7 +1635,7 @@ _cairo_svg_surface_fill (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1654,7 +1654,7 @@ _cairo_svg_surface_get_extents (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_surface_emit_paint (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_operator_t op,
@@ -1687,7 +1687,7 @@ _cairo_svg_surface_emit_paint (cairo_output_stream_t *output,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -1740,7 +1740,7 @@ _cairo_svg_surface_paint (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1782,7 +1782,7 @@ _cairo_svg_surface_mask (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_stroke (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -1871,7 +1871,7 @@ _cairo_svg_surface_stroke (void *abstract_dst,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *pattern,
@@ -1942,7 +1942,7 @@ FALLBACK:
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_svg_surface_intersect_clip_path (void *dst,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -2095,7 +2095,7 @@ _cairo_svg_document_destroy (cairo_svg_document_t *document)
free (document);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_svg_document_finish (cairo_svg_document_t *document)
{
cairo_status_t status;
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index dd5837b..7b8bcd3 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -40,10 +40,10 @@
/* private functions */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_grow (cairo_traps_t *traps);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_add_trap (cairo_traps_t *traps, cairo_fixed_t top, cairo_fixed_t bottom,
cairo_line_t *left, cairo_line_t *right);
@@ -109,7 +109,7 @@ _cairo_traps_init_box (cairo_traps_t *traps,
return traps->status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_add_trap (cairo_traps_t *traps, cairo_fixed_t top, cairo_fixed_t bottom,
cairo_line_t *left, cairo_line_t *right)
{
@@ -182,7 +182,7 @@ _cairo_traps_add_trap_from_points (cairo_traps_t *traps, cairo_fixed_t top, cair
}
/* make room for at least one more trap */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_traps_grow (cairo_traps_t *traps)
{
cairo_trapezoid_t *new_traps;
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 7e77bb8..5b60fed 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -80,7 +80,7 @@ cairo_truetype_font_use_glyph (cairo_truetype_font_t *font, int glyph);
#define SFNT_VERSION 0x00010000
#define SFNT_STRING_MAX_LENGTH 65535
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_truetype_font_create (cairo_scaled_font_subset_t *scaled_font_subset,
cairo_truetype_font_t **font_return)
{
@@ -256,7 +256,7 @@ cairo_truetype_font_destroy (cairo_truetype_font_t *font)
free (font);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_truetype_font_allocate_write_buffer (cairo_truetype_font_t *font,
size_t length,
unsigned char **buffer)
@@ -270,7 +270,7 @@ cairo_truetype_font_allocate_write_buffer (cairo_truetype_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_truetype_font_write (cairo_truetype_font_t *font,
const void *data,
size_t length)
@@ -696,7 +696,7 @@ static const table_t truetype_tables[] = {
{ TT_TAG_prep, cairo_truetype_font_write_generic_table, 11 },
};
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_truetype_font_write_offset_table (cairo_truetype_font_t *font)
{
cairo_status_t status;
@@ -769,7 +769,7 @@ cairo_truetype_font_update_entry (cairo_truetype_font_t *font,
entry[3] = cpu_to_be32 ((uint32_t)(end - start));
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_truetype_font_generate (cairo_truetype_font_t *font,
const char **data,
unsigned long *length,
@@ -921,7 +921,7 @@ _cairo_truetype_subset_fini (cairo_truetype_subset_t *subset)
free (subset->string_offsets);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_truetype_map_glyphs_to_unicode (cairo_scaled_font_subset_t *font_subset,
unsigned long table_offset)
{
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index a183b28..26dee6b 100644
--- a/src/cairo-type1-fallback.c
+++ b/src/cairo-type1-fallback.c
@@ -63,7 +63,7 @@ typedef struct _cairo_type1_font {
int hex_column;
} cairo_type1_font_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_create (cairo_scaled_font_subset_t *scaled_font_subset,
cairo_type1_font_t **subset_return,
cairo_bool_t hex_encode)
@@ -195,7 +195,7 @@ typedef struct _ps_path_info {
int current_x, current_y;
} t1_path_info_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_charstring_move_to (void *closure,
cairo_point_t *point)
{
@@ -219,7 +219,7 @@ _charstring_move_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_charstring_line_to (void *closure,
cairo_point_t *point)
{
@@ -243,7 +243,7 @@ _charstring_line_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_charstring_curve_to (void *closure,
cairo_point_t *point1,
cairo_point_t *point2,
@@ -276,7 +276,7 @@ _charstring_curve_to (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_charstring_close_path (void *closure)
{
cairo_status_t status;
@@ -308,7 +308,7 @@ charstring_encrypt (cairo_array_t *data)
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
create_notdef_charstring (cairo_array_t *data)
{
cairo_status_t status;
@@ -333,7 +333,7 @@ create_notdef_charstring (cairo_array_t *data)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_type1_font_create_charstring (cairo_type1_font_t *font,
int subset_index,
int glyph_index,
@@ -402,7 +402,7 @@ cairo_type1_font_create_charstring (cairo_type1_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_type1_font_write_charstrings (cairo_type1_font_t *font,
cairo_output_stream_t *encrypted_output)
{
@@ -514,7 +514,7 @@ cairo_type1_font_write_header (cairo_type1_font_t *font,
"currentfile eexec\n");
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_write_stream_encrypted (void *closure,
const unsigned char *data,
unsigned int length)
@@ -553,7 +553,7 @@ cairo_type1_write_stream_encrypted (void *closure,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_type1_font_write_private_dict (cairo_type1_font_t *font,
const char *name)
{
@@ -618,7 +618,7 @@ cairo_type1_font_write_trailer(cairo_type1_font_t *font)
_cairo_output_stream_printf (font->output, "cleartomark\n");
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_write_stream (void *closure,
const unsigned char *data,
unsigned int length)
@@ -628,7 +628,7 @@ cairo_type1_write_stream (void *closure,
return _cairo_array_append_multiple (&font->contents, data, length);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_type1_font_write (cairo_type1_font_t *font,
const char *name)
{
@@ -652,7 +652,7 @@ cairo_type1_font_write (cairo_type1_font_t *font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
cairo_type1_font_generate (cairo_type1_font_t *font, const char *name)
{
cairo_int_status_t status;
@@ -682,7 +682,7 @@ cairo_type1_font_destroy (cairo_type1_font_t *font)
free (font);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_type1_fallback_init_internal (cairo_type1_subset_t *type1_subset,
const char *name,
cairo_scaled_font_subset_t *scaled_font_subset,
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index e4f5015..b929395 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -102,7 +102,7 @@ typedef struct _cairo_type1_font_subset {
} cairo_type1_font_subset_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_type1_font_subset_create (cairo_unscaled_font_t *unscaled_font,
cairo_type1_font_subset_t **subset_return,
cairo_bool_t hex_encode)
@@ -216,7 +216,7 @@ find_token (const char *buffer, const char *end, const char *token)
return NULL;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_find_segments (cairo_type1_font_subset_t *font)
{
unsigned char *p;
@@ -257,7 +257,7 @@ cairo_type1_font_subset_find_segments (cairo_type1_font_subset_t *font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_write_header (cairo_type1_font_subset_t *font,
const char *name)
{
@@ -354,7 +354,7 @@ cairo_type1_font_subset_write_encrypted (cairo_type1_font_subset_t *font,
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_decrypt_eexec_segment (cairo_type1_font_subset_t *font)
{
unsigned short r = CAIRO_TYPE1_PRIVATE_DICT_KEY;
@@ -421,7 +421,7 @@ cairo_type1_font_subset_lookup_glyph (cairo_type1_font_subset_t *font,
return -1;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_get_glyph_names_and_widths (cairo_type1_font_subset_t *font)
{
unsigned int i;
@@ -954,7 +954,7 @@ cairo_type1_font_subset_write_private_dict (cairo_type1_font_subset_t *font,
return p;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_write_trailer(cairo_type1_font_subset_t *font)
{
const char *cleartomark_token;
@@ -979,7 +979,7 @@ cairo_type1_font_subset_write_trailer(cairo_type1_font_subset_t *font)
return font->status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
type1_font_write (void *closure, const unsigned char *data, unsigned int length)
{
cairo_type1_font_subset_t *font = closure;
@@ -990,7 +990,7 @@ type1_font_write (void *closure, const unsigned char *data, unsigned int length)
return font->status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_write (cairo_type1_font_subset_t *font,
const char *name)
{
@@ -1029,7 +1029,7 @@ cairo_type1_font_subset_write (cairo_type1_font_subset_t *font,
return font->status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
cairo_type1_font_subset_generate (void *abstract_font,
const char *name)
diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index de81c0a..dbace95 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -104,14 +104,14 @@ typedef struct {
cairo_bool_t delete_scaled_hfont;
} cairo_win32_scaled_font_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_set_metrics (cairo_win32_scaled_font_t *scaled_font);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph);
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph);
@@ -299,7 +299,7 @@ _win32_scaled_font_create (LOGFONTW *logfont,
return &f->base;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_win32_scaled_font_set_world_transform (cairo_win32_scaled_font_t *scaled_font,
HDC hdc)
{
@@ -318,7 +318,7 @@ _win32_scaled_font_set_world_transform (cairo_win32_scaled_font_t *scaled_font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_win32_scaled_font_set_identity_transform (HDC hdc)
{
if (!ModifyWorldTransform (hdc, NULL, MWT_IDENTITY))
@@ -425,7 +425,7 @@ _win32_scaled_font_get_unscaled_hfont (cairo_win32_scaled_font_t *scaled_font,
return scaled_font->unscaled_hfont;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_select_unscaled_font (cairo_scaled_font_t *scaled_font,
HDC hdc)
{
@@ -459,7 +459,7 @@ _cairo_win32_scaled_font_done_unscaled_font (cairo_scaled_font_t *scaled_font)
/* implement the font backend interface */
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_create_toy (cairo_toy_font_face_t *toy_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
@@ -553,7 +553,7 @@ _cairo_win32_scaled_font_fini (void *abstract_font)
DeleteObject (scaled_font->unscaled_hfont);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
double x,
double y,
@@ -680,7 +680,7 @@ _cairo_win32_scaled_font_text_to_glyphs (void *abstract_font,
return status;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_set_metrics (cairo_win32_scaled_font_t *scaled_font)
{
cairo_status_t status;
@@ -741,7 +741,7 @@ _cairo_win32_scaled_font_set_metrics (cairo_win32_scaled_font_t *scaled_font)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
{
@@ -836,7 +836,7 @@ _cairo_win32_scaled_font_init_glyph_metrics (cairo_win32_scaled_font_t *scaled_f
* font-space metrics.
*/
#if 0
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_glyph_bbox (void *abstract_font,
const cairo_glyph_t *glyphs,
int num_glyphs,
@@ -918,7 +918,7 @@ _start_glyphs (cairo_glyph_state_t *state,
_cairo_array_init (&state->dx, sizeof (int));
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_flush_glyphs (cairo_glyph_state_t *state)
{
cairo_status_t status;
@@ -954,7 +954,7 @@ _flush_glyphs (cairo_glyph_state_t *state)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_add_glyph (cairo_glyph_state_t *state,
unsigned long index,
double device_x,
@@ -1008,7 +1008,7 @@ _finish_glyphs (cairo_glyph_state_t *state)
_cairo_array_fini (&state->dx);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_draw_glyphs_on_surface (cairo_win32_surface_t *surface,
cairo_win32_scaled_font_t *scaled_font,
COLORREF color,
@@ -1113,7 +1113,7 @@ _compute_a8_mask (cairo_win32_surface_t *mask_surface)
return &image8->base;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_scaled_font_glyph_init (void *abstract_font,
cairo_scaled_glyph_t *scaled_glyph,
cairo_scaled_glyph_info_t info)
@@ -1140,7 +1140,7 @@ _cairo_win32_scaled_font_glyph_init (void *abstract_font,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_scaled_font_show_glyphs (void *abstract_font,
cairo_operator_t op,
cairo_pattern_t *pattern,
@@ -1254,7 +1254,7 @@ _cairo_win32_scaled_font_show_glyphs (void *abstract_font,
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_scaled_font_load_truetype_table (void *abstract_font,
unsigned long tag,
long offset,
@@ -1309,7 +1309,7 @@ _cairo_win32_transform_FIXED_to_fixed (cairo_matrix_t *matrix,
*fy = _cairo_fixed_from_double (y);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
{
@@ -1501,7 +1501,7 @@ _cairo_win32_font_face_destroy (void *abstract_face)
{
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_font_face_scaled_font_create (void *abstract_face,
const cairo_matrix_t *font_matrix,
const cairo_matrix_t *ctm,
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 9123b82..5b3d5c1 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -140,7 +140,7 @@ _cairo_win32_flags_for_dc (HDC dc)
return flags;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_create_dc_and_bitmap (cairo_win32_surface_t *surface,
HDC original_dc,
cairo_format_t format,
@@ -432,7 +432,7 @@ _cairo_win32_surface_create_similar (void *abstract_src,
return _cairo_win32_surface_create_similar_internal (abstract_src, content, width, height, FALSE);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_surface_finish (void *abstract_surface)
{
cairo_win32_surface_t *surface = abstract_surface;
@@ -453,7 +453,7 @@ _cairo_win32_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_surface_get_subimage (cairo_win32_surface_t *surface,
int x,
int y,
@@ -503,7 +503,7 @@ _cairo_win32_surface_get_subimage (cairo_win32_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -542,7 +542,7 @@ _cairo_win32_surface_release_source_image (void *abstract_surf
cairo_surface_destroy ((cairo_surface_t *)local);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -663,7 +663,7 @@ typedef BOOL (WINAPI *cairo_alpha_blend_func_t) (HDC hdcDest,
int nHeightSrc,
BLENDFUNCTION blendFunction);
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_composite_alpha_blend (cairo_win32_surface_t *dst,
cairo_win32_surface_t *src,
int alpha,
@@ -729,7 +729,7 @@ _composite_alpha_blend (cairo_win32_surface_t *dst,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_composite_inner (cairo_win32_surface_t *src,
cairo_image_surface_t *src_image,
cairo_win32_surface_t *dst,
@@ -815,7 +815,7 @@ _cairo_win32_surface_composite_inner (cairo_win32_surface_t *src,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_composite (cairo_operator_t op,
cairo_pattern_t *pattern,
cairo_pattern_t *mask_pattern,
@@ -1305,7 +1305,7 @@ categorize_solid_dest_operator (cairo_operator_t op,
return DO_UNSUPPORTED;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_fill_rectangles (void *abstract_surface,
cairo_operator_t op,
const cairo_color_t *color,
@@ -1370,7 +1370,7 @@ _cairo_win32_surface_fill_rectangles (void *abstract_surface,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -1460,7 +1460,7 @@ _cairo_win32_surface_set_clip_region (void *abstract_surface,
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1471,7 +1471,7 @@ _cairo_win32_surface_get_extents (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_win32_surface_flush (void *abstract_surface)
{
return _cairo_surface_reset_clip (abstract_surface);
@@ -1479,7 +1479,7 @@ _cairo_win32_surface_flush (void *abstract_surface)
#define STACK_GLYPH_SIZE 256
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_win32_surface_show_glyphs (void *surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 0897961..b688caf 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -206,7 +206,7 @@ _cairo_xcb_surface_create_similar (void *abstract_src,
return &surface->base;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_finish (void *abstract_surface)
{
cairo_xcb_surface_t *surface = abstract_surface;
@@ -295,7 +295,7 @@ _CAIRO_MASK_FORMAT (cairo_format_masks_t *masks, cairo_format_t *format)
return FALSE;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_get_image_surface (cairo_xcb_surface_t *surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -541,7 +541,7 @@ _cairo_xcb_surface_ensure_gc (cairo_xcb_surface_t *surface)
_cairo_xcb_surface_set_gc_clip_rects(surface);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_draw_image_surface (cairo_xcb_surface_t *surface,
cairo_image_surface_t *image,
int src_x,
@@ -613,7 +613,7 @@ _draw_image_surface (cairo_xcb_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -640,7 +640,7 @@ _cairo_xcb_surface_release_source_image (void *abstract_surfac
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -689,7 +689,7 @@ _cairo_xcb_surface_same_screen (cairo_xcb_surface_t *dst,
return dst->dpy == src->dpy && dst->screen == src->screen;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -733,7 +733,7 @@ _cairo_xcb_surface_clone_similar (void *abstract_surface,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_set_matrix (cairo_xcb_surface_t *surface,
cairo_matrix_t *matrix)
{
@@ -773,7 +773,7 @@ _cairo_xcb_surface_set_matrix (cairo_xcb_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_set_filter (cairo_xcb_surface_t *surface,
cairo_filter_t filter)
{
@@ -818,7 +818,7 @@ _cairo_xcb_surface_set_filter (cairo_xcb_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_set_repeat (cairo_xcb_surface_t *surface, int repeat)
{
uint32_t mask = XCB_RENDER_CP_REPEAT;
@@ -832,7 +832,7 @@ _cairo_xcb_surface_set_repeat (cairo_xcb_surface_t *surface, int repeat)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_set_attributes (cairo_xcb_surface_t *surface,
cairo_surface_attributes_t *attributes)
{
@@ -1091,7 +1091,7 @@ _render_operator (cairo_operator_t op)
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_composite (cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -1242,7 +1242,7 @@ _cairo_xcb_surface_composite (cairo_operator_t op,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_fill_rectangles (void *abstract_surface,
cairo_operator_t op,
const cairo_color_t * color,
@@ -1357,7 +1357,7 @@ _create_trapezoid_mask (cairo_xcb_surface_t *dst,
return mask_picture;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
void *abstract_dst,
@@ -1486,7 +1486,7 @@ _cairo_xcb_surface_composite_trapezoids (cairo_operator_t op,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -1545,7 +1545,7 @@ _cairo_xcb_surface_set_clip_region (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -1569,7 +1569,7 @@ static void
_cairo_xcb_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
cairo_scaled_font_t *scaled_font);
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_show_glyphs (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *src_pattern,
@@ -1895,7 +1895,7 @@ typedef struct _cairo_xcb_surface_font_private {
xcb_render_pictforminfo_t *xrender_format;
} cairo_xcb_surface_font_private_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_font_init (xcb_connection_t *dpy,
cairo_scaled_font_t *scaled_font,
cairo_format_t format)
@@ -1950,7 +1950,7 @@ _native_byte_order_lsb (void)
return *((char *) &x) == 1;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_add_glyph (xcb_connection_t *dpy,
cairo_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
@@ -2128,7 +2128,7 @@ _cairo_xcb_surface_add_glyph (xcb_connection_t *dpy,
#define N_STACK_BUF 1024
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_show_glyphs_8 (cairo_xcb_surface_t *dst,
cairo_operator_t op,
cairo_xcb_surface_t *src,
@@ -2169,7 +2169,7 @@ _cairo_xcb_surface_show_glyphs_8 (cairo_xcb_surface_t *dst,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_show_glyphs_16 (cairo_xcb_surface_t *dst,
cairo_operator_t op,
cairo_xcb_surface_t *src,
@@ -2210,7 +2210,7 @@ _cairo_xcb_surface_show_glyphs_16 (cairo_xcb_surface_t *dst,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xcb_surface_show_glyphs_32 (cairo_xcb_surface_t *dst,
cairo_operator_t op,
cairo_xcb_surface_t *src,
@@ -2255,7 +2255,7 @@ typedef cairo_status_t (*cairo_xcb_surface_show_glyphs_func_t)
(cairo_xcb_surface_t *, cairo_operator_t, cairo_xcb_surface_t *, int, int,
const cairo_glyph_t *, int, cairo_scaled_font_t *);
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xcb_surface_show_glyphs (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *src_pattern,
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 160cb08..dfd0256 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -51,7 +51,7 @@ typedef int (*cairo_xlib_error_func_t) (Display *display,
typedef struct _cairo_xlib_surface cairo_xlib_surface_t;
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *surface);
static void
@@ -66,7 +66,7 @@ _cairo_surface_is_xlib (cairo_surface_t *surface);
static cairo_bool_t
_native_byte_order_lsb (void);
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_show_glyphs (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *src_pattern,
@@ -322,7 +322,7 @@ _cairo_xlib_surface_create_similar (void *abstract_src,
return &surface->base;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_finish (void *abstract_surface)
{
cairo_xlib_surface_t *surface = abstract_surface;
@@ -503,7 +503,7 @@ _swap_ximage_to_native (XImage *ximage)
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_get_image_surface (cairo_xlib_surface_t *surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -733,7 +733,7 @@ _cairo_xlib_surface_ensure_dst_picture (cairo_xlib_surface_t *surface)
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *surface)
{
XGCValues gcv;
@@ -752,7 +752,7 @@ _cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_draw_image_surface (cairo_xlib_surface_t *surface,
cairo_image_surface_t *image,
int src_x,
@@ -799,7 +799,7 @@ _draw_image_surface (cairo_xlib_surface_t *surface,
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -826,7 +826,7 @@ _cairo_xlib_surface_release_source_image (void *abstract_surfa
cairo_surface_destroy (&image->base);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -875,7 +875,7 @@ _cairo_xlib_surface_same_screen (cairo_xlib_surface_t *dst,
return dst->dpy == src->dpy && dst->screen == src->screen;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
@@ -886,6 +886,7 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
{
cairo_xlib_surface_t *surface = abstract_surface;
cairo_xlib_surface_t *clone;
+ cairo_status_t status;
if (src->backend == surface->base.backend ) {
cairo_xlib_surface_t *xlib_src = (cairo_xlib_surface_t *)src;
@@ -907,8 +908,12 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
if (clone->base.status)
return CAIRO_STATUS_NO_MEMORY;
- _draw_image_surface (clone, image_src, src_x, src_y,
+ status = _draw_image_surface (clone, image_src, src_x, src_y,
width, height, src_x, src_y);
+ if (status) {
+ cairo_surface_destroy (&clone->base);
+ return status;
+ }
*clone_out = &clone->base;
@@ -918,7 +923,7 @@ _cairo_xlib_surface_clone_similar (void *abstract_surface,
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_set_matrix (cairo_xlib_surface_t *surface,
cairo_matrix_t *matrix)
{
@@ -958,7 +963,7 @@ _cairo_xlib_surface_set_matrix (cairo_xlib_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
cairo_filter_t filter)
{
@@ -1008,7 +1013,7 @@ _cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_set_repeat (cairo_xlib_surface_t *surface, int repeat)
{
XRenderPictureAttributes pa;
@@ -1025,7 +1030,7 @@ _cairo_xlib_surface_set_repeat (cairo_xlib_surface_t *surface, int repeat)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_set_attributes (cairo_xlib_surface_t *surface,
cairo_surface_attributes_t *attributes)
{
@@ -1039,10 +1044,14 @@ _cairo_xlib_surface_set_attributes (cairo_xlib_surface_t *surface,
switch (attributes->extend) {
case CAIRO_EXTEND_NONE:
- _cairo_xlib_surface_set_repeat (surface, 0);
+ status = _cairo_xlib_surface_set_repeat (surface, 0);
+ if (status)
+ return status;
break;
case CAIRO_EXTEND_REPEAT:
- _cairo_xlib_surface_set_repeat (surface, 1);
+ status = _cairo_xlib_surface_set_repeat (surface, 1);
+ if (status)
+ return status;
break;
case CAIRO_EXTEND_REFLECT:
case CAIRO_EXTEND_PAD:
@@ -1291,7 +1300,7 @@ _render_operator (cairo_operator_t op)
}
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_composite (cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_pattern_t *mask_pattern,
@@ -1439,7 +1448,7 @@ _cairo_xlib_surface_composite (cairo_operator_t op,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_fill_rectangles (void *abstract_surface,
cairo_operator_t op,
const cairo_color_t *color,
@@ -1558,7 +1567,7 @@ _create_trapezoid_mask (cairo_xlib_surface_t *dst,
return mask_picture;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_composite_trapezoids (cairo_operator_t op,
cairo_pattern_t *pattern,
void *abstract_dst,
@@ -1684,7 +1693,7 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t op,
return status;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -1745,7 +1754,7 @@ _cairo_xlib_surface_set_clip_region (void *abstract_surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -2308,7 +2317,7 @@ _cairo_xlib_surface_remove_scaled_font (Display *dpy,
}
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_font_init (Display *dpy,
cairo_scaled_font_t *scaled_font,
cairo_format_t format)
@@ -2368,7 +2377,7 @@ _native_byte_order_lsb (void)
return *((char *) &x) == 1;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_add_glyph (Display *dpy,
cairo_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph)
@@ -2577,7 +2586,7 @@ typedef struct {
#define GLYPH_INDEX_SKIP ((unsigned long) -1)
#define STACK_ELTS_LEN ((int) (CAIRO_STACK_BUFFER_SIZE / sizeof (XGlyphElt8)))
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_emit_glyphs_chunk (cairo_xlib_surface_t *dst,
cairo_xlib_glyph_t *glyphs,
int num_glyphs,
@@ -2692,7 +2701,7 @@ _cairo_xlib_surface_emit_glyphs_chunk (cairo_xlib_surface_t *dst,
#undef STACK_ELTS_LEN
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
cairo_xlib_glyph_t *glyphs,
int num_glyphs,
@@ -2812,7 +2821,9 @@ _cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
/* Send unsent glyphs to the server */
if (scaled_glyph->surface_private == NULL) {
- _cairo_xlib_surface_add_glyph (dst->dpy, scaled_font, scaled_glyph);
+ status = _cairo_xlib_surface_add_glyph (dst->dpy, scaled_font, scaled_glyph);
+ if (status)
+ return status;
scaled_glyph->surface_private = (void *) 1;
}
@@ -2834,7 +2845,7 @@ _cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
#undef GLYPH_INDEX_SKIP
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_cairo_xlib_surface_show_glyphs (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *src_pattern,
@@ -2947,7 +2958,7 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst,
if (status)
goto BAIL;
- _cairo_xlib_surface_emit_glyphs (dst, (cairo_xlib_glyph_t *) glyphs, num_glyphs,
+ status = _cairo_xlib_surface_emit_glyphs (dst, (cairo_xlib_glyph_t *) glyphs, num_glyphs,
scaled_font, op, src, &attributes);
BAIL:
diff --git a/src/test-fallback-surface.c b/src/test-fallback-surface.c
index 21ee190..8275319 100644
--- a/src/test-fallback-surface.c
+++ b/src/test-fallback-surface.c
@@ -105,7 +105,7 @@ _test_fallback_surface_create_similar (void *abstract_surface,
width, height);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_fallback_surface_finish (void *abstract_surface)
{
test_fallback_surface_t *surface = abstract_surface;
@@ -115,7 +115,7 @@ _test_fallback_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_fallback_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -137,7 +137,7 @@ _test_fallback_surface_release_source_image (void *abstract_surface,
image, image_extra);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_fallback_surface_acquire_dest_image (void *abstract_surface,
cairo_rectangle_int16_t *interest_rect,
cairo_image_surface_t **image_out,
@@ -169,7 +169,7 @@ _test_fallback_surface_release_dest_image (void *abstract_surface,
image_extra);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_fallback_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
diff --git a/src/test-meta-surface.c b/src/test-meta-surface.c
index 6c58779..02ebb58 100644
--- a/src/test-meta-surface.c
+++ b/src/test-meta-surface.c
@@ -64,7 +64,7 @@ typedef struct _test_meta_surface {
const cairo_private cairo_surface_backend_t test_meta_surface_backend;
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_show_page (void *abstract_surface);
cairo_surface_t *
@@ -103,7 +103,7 @@ _cairo_test_meta_surface_create (cairo_content_t content,
return (cairo_surface_t*) &_cairo_surface_nil;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_meta_surface_finish (void *abstract_surface)
{
test_meta_surface_t *surface = abstract_surface;
@@ -114,7 +114,7 @@ _test_meta_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_meta_surface_acquire_source_image (void *abstract_surface,
cairo_image_surface_t **image_out,
void **image_extra)
@@ -139,7 +139,7 @@ _test_meta_surface_release_source_image (void *abstract_surface,
image, image_extra);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_show_page (void *abstract_surface)
{
test_meta_surface_t *surface = abstract_surface;
@@ -154,7 +154,7 @@ _test_meta_surface_show_page (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_intersect_clip_path (void *abstract_surface,
cairo_path_fixed_t *path,
cairo_fill_rule_t fill_rule,
@@ -168,7 +168,7 @@ _test_meta_surface_intersect_clip_path (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -179,7 +179,7 @@ _test_meta_surface_get_extents (void *abstract_surface,
return _cairo_surface_get_extents (surface->image, rectangle);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -191,7 +191,7 @@ _test_meta_surface_paint (void *abstract_surface,
return _cairo_surface_paint (surface->meta, op, source);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -204,7 +204,7 @@ _test_meta_surface_mask (void *abstract_surface,
return _cairo_surface_mask (surface->meta, op, source, mask);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -225,7 +225,7 @@ _test_meta_surface_stroke (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -243,7 +243,7 @@ _test_meta_surface_fill (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_meta_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
diff --git a/src/test-paginated-surface.c b/src/test-paginated-surface.c
index d82749f..0bf69c7 100644
--- a/src/test-paginated-surface.c
+++ b/src/test-paginated-surface.c
@@ -95,7 +95,7 @@ _cairo_test_paginated_surface_create_for_data (unsigned char *data,
&test_paginated_surface_paginated_backend);
}
-static cairo_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_status_t
_test_paginated_surface_finish (void *abstract_surface)
{
test_paginated_surface_t *surface = abstract_surface;
@@ -105,7 +105,7 @@ _test_paginated_surface_finish (void *abstract_surface)
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_set_clip_region (void *abstract_surface,
pixman_region16_t *region)
{
@@ -147,7 +147,7 @@ _test_paginated_surface_set_clip_region (void *abstract_surface,
return _cairo_image_surface_set_clip_region (surface->target, region);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
{
@@ -156,7 +156,7 @@ _test_paginated_surface_get_extents (void *abstract_surface,
return _cairo_surface_get_extents (surface->target, rectangle);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_paint (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source)
@@ -169,7 +169,7 @@ _test_paginated_surface_paint (void *abstract_surface,
return _cairo_surface_paint (surface->target, op, source);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_mask (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -183,7 +183,7 @@ _test_paginated_surface_mask (void *abstract_surface,
return _cairo_surface_mask (surface->target, op, source, mask);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_stroke (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -205,7 +205,7 @@ _test_paginated_surface_stroke (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_fill (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
@@ -224,7 +224,7 @@ _test_paginated_surface_fill (void *abstract_surface,
tolerance, antialias);
}
-static cairo_int_status_t
+static CAIRO_WARN_UNUSED_RESULT cairo_int_status_t
_test_paginated_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
cairo_pattern_t *source,
--
1.4.4.2
More information about the cairo
mailing list