From 4e39e30d83fc1866a44f0b746c406ee2efb3bf6a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 16 Jul 2007 09:25:38 +0100 Subject: [PATCH] [cairo-pen] Remove status from _cairo_pen_find_active_vertex_*() This pair of functions unconditionally return SUCCESS, so remove the status return and supporting tests from their callers. --- src/cairo-path-stroke.c | 24 ++++++------------------ src/cairo-pen.c | 16 +++++----------- src/cairoint.h | 4 ++-- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index d9f7ed2ca..d8d989b02 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -237,21 +237,13 @@ _cairo_stroker_join (cairo_stroker_t *stroker, cairo_stroke_face_t *in, cairo_st tri[0] = in->point; if (clockwise) { - status = _cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start); - if (status) - return status; + _cairo_pen_find_active_ccw_vertex_index (pen, &in->dev_vector, &start); step = -1; - status = _cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop); - if (status) - return status; + _cairo_pen_find_active_ccw_vertex_index (pen, &out->dev_vector, &stop); } else { - status = _cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start); - if (status) - return status; + _cairo_pen_find_active_cw_vertex_index (pen, &in->dev_vector, &start); step = +1; - status = _cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop); - if (status) - return status; + _cairo_pen_find_active_cw_vertex_index (pen, &out->dev_vector, &stop); } i = start; @@ -394,14 +386,10 @@ _cairo_stroker_add_cap (cairo_stroker_t *stroker, cairo_stroke_face_t *f) cairo_pen_t *pen = &stroker->pen; slope = f->dev_vector; - status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &start); - if (status) - return status; + _cairo_pen_find_active_cw_vertex_index (pen, &slope, &start); slope.dx = -slope.dx; slope.dy = -slope.dy; - status = _cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop); - if (status) - return status; + _cairo_pen_find_active_cw_vertex_index (pen, &slope, &stop); tri[0] = f->point; tri[1] = f->cw; diff --git a/src/cairo-pen.c b/src/cairo-pen.c index 9960f0e9b..0ff01f378 100644 --- a/src/cairo-pen.c +++ b/src/cairo-pen.c @@ -308,7 +308,7 @@ _cairo_pen_compute_slopes (cairo_pen_t *pen) * counterclockwise order. However, for this function, we care * strongly about which vertex is returned. */ -cairo_status_t +void _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen, cairo_slope_t *slope, int *active) @@ -324,8 +324,6 @@ _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen, assert (i < pen->num_vertices); *active = i; - - return CAIRO_STATUS_SUCCESS; } /* Find active pen vertex for counterclockwise edge of stroke at the given slope. @@ -333,7 +331,7 @@ _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen, * NOTE: The behavior of this function is sensitive to the sense of * the inequality within _cairo_slope_clockwise/_cairo_slope_counter_clockwise. */ -cairo_status_t +void _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen, cairo_slope_t *slope, int *active) @@ -352,8 +350,6 @@ _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen, } *active = i; - - return CAIRO_STATUS_SUCCESS; } static void @@ -388,11 +384,9 @@ _cairo_pen_stroke_spline_half (cairo_pen_t *pen, final_slope.dy = -final_slope.dy; } - status = _cairo_pen_find_active_cw_vertex_index (pen, - &initial_slope, - &active); - if (status) - return status; + _cairo_pen_find_active_cw_vertex_index (pen, + &initial_slope, + &active); i = start; while (i != stop) { diff --git a/src/cairoint.h b/src/cairoint.h index 788537f9f..dca8e6ab3 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -2112,12 +2112,12 @@ _cairo_pen_add_points_for_slopes (cairo_pen_t *pen, cairo_point_t *c, cairo_point_t *d); -cairo_private cairo_status_t +cairo_private void _cairo_pen_find_active_cw_vertex_index (cairo_pen_t *pen, cairo_slope_t *slope, int *active); -cairo_private cairo_status_t +cairo_private void _cairo_pen_find_active_ccw_vertex_index (cairo_pen_t *pen, cairo_slope_t *slope, int *active);