summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-10-04 13:15:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-10-04 13:31:44 +0100
commitbed8239f03773ad1584c8ba48ceb0b34bbe69453 (patch)
treefb97a0cd4874f4fd4a2b22d6ec882a77f04202da /src/cairo-traps.c
parentd90d4bb6b99e0a912650234e28d097ea76c1cecc (diff)
downloadcairo-bed8239f03773ad1584c8ba48ceb0b34bbe69453.tar.gz
[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-traps.c')
-rw-r--r--src/cairo-traps.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index 32743b4f8..1893fc20a 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -270,8 +270,7 @@ _cairo_traps_grow (cairo_traps_t *traps)
}
if (new_traps == NULL) {
- _cairo_error (CAIRO_STATUS_NO_MEMORY);
- traps->status = CAIRO_STATUS_NO_MEMORY;
+ traps->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
return traps->status;
}
@@ -615,10 +614,8 @@ _cairo_traps_extract_region (cairo_traps_t *traps,
if (traps->num_traps > ARRAY_LENGTH(stack_boxes)) {
boxes = _cairo_malloc_ab (traps->num_traps, sizeof(cairo_box_int_t));
- if (boxes == NULL) {
- _cairo_error (CAIRO_STATUS_NO_MEMORY);
- return CAIRO_STATUS_NO_MEMORY;
- }
+ if (boxes == NULL)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
box_count = 0;