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-path.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-path.c')
-rw-r--r-- | src/cairo-path.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cairo-path.c b/src/cairo-path.c index b1ef44e2..90b726dc 100644 --- a/src/cairo-path.c +++ b/src/cairo-path.c @@ -353,7 +353,7 @@ _cairo_path_create_in_error (cairo_status_t status) path = malloc (sizeof (cairo_path_t)); if (path == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); + _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } @@ -373,7 +373,7 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed, path = malloc (sizeof (cairo_path_t)); if (path == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); + _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } @@ -390,7 +390,7 @@ _cairo_path_create_internal (cairo_path_fixed_t *path_fixed, sizeof (cairo_path_data_t)); if (path->data == NULL) { free (path); - _cairo_error (CAIRO_STATUS_NO_MEMORY); + _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_path_t*) &_cairo_path_nil; } @@ -496,19 +496,19 @@ _cairo_path_append_to_context (const cairo_path_t *path, switch (p->header.type) { case CAIRO_PATH_MOVE_TO: if (p->header.length < 2) - return CAIRO_STATUS_INVALID_PATH_DATA; + return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA); cairo_move_to (cr, p[1].point.x, p[1].point.y); break; case CAIRO_PATH_LINE_TO: if (p->header.length < 2) - return CAIRO_STATUS_INVALID_PATH_DATA; + return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA); cairo_line_to (cr, p[1].point.x, p[1].point.y); break; case CAIRO_PATH_CURVE_TO: if (p->header.length < 4) - return CAIRO_STATUS_INVALID_PATH_DATA; + return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA); cairo_curve_to (cr, p[1].point.x, p[1].point.y, p[2].point.x, p[2].point.y, @@ -516,11 +516,11 @@ _cairo_path_append_to_context (const cairo_path_t *path, break; case CAIRO_PATH_CLOSE_PATH: if (p->header.length < 1) - return CAIRO_STATUS_INVALID_PATH_DATA; + return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA); cairo_close_path (cr); break; default: - return CAIRO_STATUS_INVALID_PATH_DATA; + return _cairo_error (CAIRO_STATUS_INVALID_PATH_DATA); } status = cairo_status (cr); |