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-font-face.c | |
parent | d90d4bb6b99e0a912650234e28d097ea76c1cecc (diff) | |
download | cairo-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-font-face.c')
-rw-r--r-- | src/cairo-font-face.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index b3bcc843d..0285b52e7 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -231,7 +231,7 @@ cairo_font_face_set_user_data (cairo_font_face_t *font_face, cairo_destroy_func_t destroy) { if (CAIRO_REFERENCE_COUNT_IS_INVALID (&font_face->ref_count)) - return CAIRO_STATUS_NO_MEMORY; + return _cairo_error (CAIRO_STATUS_NO_MEMORY); return _cairo_user_data_array_set_data (&font_face->user_data, key, user_data, destroy); @@ -321,7 +321,7 @@ _cairo_toy_font_face_init (cairo_toy_font_face_t *font_face, family_copy = strdup (family); if (family_copy == NULL) - return CAIRO_STATUS_NO_MEMORY; + return _cairo_error (CAIRO_STATUS_NO_MEMORY); _cairo_toy_font_face_init_key (font_face, family_copy, slant, weight); @@ -396,7 +396,7 @@ _cairo_toy_font_face_create (const char *family, /* Otherwise create it and insert into hash table. */ font_face = malloc (sizeof (cairo_toy_font_face_t)); if (font_face == NULL) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); + status = _cairo_error (CAIRO_STATUS_NO_MEMORY); goto UNWIND_HASH_TABLE_LOCK; } |