diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 13:15:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 13:31:44 +0100 |
commit | bed8239f03773ad1584c8ba48ceb0b34bbe69453 (patch) | |
tree | fb97a0cd4874f4fd4a2b22d6ec882a77f04202da /src/cairo-bentley-ottmann.c | |
parent | d90d4bb6b99e0a912650234e28d097ea76c1cecc (diff) |
[cairo-error] Clean up all the warnings and missing _cairo_error() calls.
Every time we assign or return a hard-coded error status wrap that value
with a call to _cairo_error(). So the idiom becomes:
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
or
return _cairo_error (CAIRO_STATUS_INVALID_DASH);
This ensures that a breakpoint placed on _cairo_error() will trigger
immediately cairo detects the error.
Diffstat (limited to 'src/cairo-bentley-ottmann.c')
-rw-r--r-- | src/cairo-bentley-ottmann.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c index 679b532b3..b8a5f813a 100644 --- a/src/cairo-bentley-ottmann.c +++ b/src/cairo-bentley-ottmann.c @@ -701,7 +701,7 @@ _cairo_bo_event_queue_insert (cairo_bo_event_queue_t *queue, /* Don't insert if there's already an equivalent intersection event in the queue. */ if (_cairo_skip_list_insert (&queue->intersection_queue, event, event->type == CAIRO_BO_EVENT_TYPE_INTERSECTION) == NULL) - status = CAIRO_STATUS_NO_MEMORY; + status = _cairo_error (CAIRO_STATUS_NO_MEMORY); return status; } @@ -755,10 +755,8 @@ _cairo_bo_event_queue_init (cairo_bo_event_queue_t *event_queue, * event type a union so it doesn't always contain the skip * elt? */ events = _cairo_malloc_ab (num_events, sizeof (cairo_bo_event_t) + sizeof(cairo_bo_event_t*)); - if (events == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); - return CAIRO_STATUS_NO_MEMORY; - } + if (events == NULL) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); sorted_event_ptrs = (cairo_bo_event_t **) (events + num_events); event_queue->startstop_events = events; @@ -861,7 +859,7 @@ _cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line, sweep_line_elt = _cairo_skip_list_insert (&sweep_line->active_edges, &edge, 1 /* unique inserts*/); if (sweep_line_elt == NULL) - return CAIRO_STATUS_NO_MEMORY; + return _cairo_error (CAIRO_STATUS_NO_MEMORY); next_elt = sweep_line_elt->elt.next[0]; if (next_elt) @@ -1148,10 +1146,8 @@ _cairo_bo_edge_start_or_continue_trap (cairo_bo_edge_t *edge, if (edge->next) { trap = edge->deferred_trap = _cairo_freelist_alloc (&bo_traps->freelist); - if (!edge->deferred_trap) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); - return CAIRO_STATUS_NO_MEMORY; - } + if (!edge->deferred_trap) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); trap->right = edge->next; trap->top = top; @@ -1441,10 +1437,8 @@ _cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps, edges = stack_edges; } else { edges = _cairo_malloc_ab (polygon->num_edges, sizeof (cairo_bo_edge_t)); - if (edges == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); - return CAIRO_STATUS_NO_MEMORY; - } + if (edges == NULL) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); } /* Figure out the bounding box of the input coordinates and |