summaryrefslogtreecommitdiff
path: root/src/cairo-paginated-surface.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-paginated-surface.c
parentd90d4bb6b99e0a912650234e28d097ea76c1cecc (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-paginated-surface.c')
-rw-r--r--src/cairo-paginated-surface.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 76eb6616..d7f02f3d 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -76,10 +76,8 @@ _cairo_paginated_surface_create (cairo_surface_t *target,
cairo_paginated_surface_t *surface;
surface = malloc (sizeof (cairo_paginated_surface_t));
- if (surface == NULL) {
- _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ if (surface == NULL)
goto FAIL;
- }
_cairo_surface_init (&surface->base, &cairo_paginated_surface_backend,
content);
@@ -108,7 +106,7 @@ _cairo_paginated_surface_create (cairo_surface_t *target,
FAIL_CLEANUP_SURFACE:
free (surface);
FAIL:
- _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ _cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_surface_t*) &_cairo_surface_nil;
}
@@ -289,7 +287,7 @@ _paint_page (cairo_paginated_surface_t *surface)
analysis = _cairo_analysis_surface_create (surface->target,
surface->width, surface->height);
if (analysis == NULL)
- return CAIRO_STATUS_NO_MEMORY;
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
surface->backend->set_paginated_mode (surface->target, CAIRO_PAGINATED_MODE_ANALYZE);
status = _cairo_meta_surface_replay_and_create_regions (surface->meta, analysis);