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/test-paginated-surface.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/test-paginated-surface.c')
-rw-r--r-- | src/test-paginated-surface.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test-paginated-surface.c b/src/test-paginated-surface.c index 1e08c2d8..3e9bad8c 100644 --- a/src/test-paginated-surface.c +++ b/src/test-paginated-surface.c @@ -75,14 +75,12 @@ _cairo_test_paginated_surface_create_for_data (unsigned char *data, width, height, stride); status = cairo_surface_status (target); - if (status) { - _cairo_error (status); + if (status) return (cairo_surface_t *) &_cairo_surface_nil; - } surface = malloc (sizeof (test_paginated_surface_t)); if (surface == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); + _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_surface_t *) &_cairo_surface_nil; } |