summaryrefslogtreecommitdiff
path: root/src/cairo-cache.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-cache.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-cache.c')
-rw-r--r--src/cairo-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-cache.c b/src/cairo-cache.c
index a7c27c12..9bb4de59 100644
--- a/src/cairo-cache.c
+++ b/src/cairo-cache.c
@@ -54,7 +54,7 @@ _cairo_cache_init (cairo_cache_t *cache,
{
cache->hash_table = _cairo_hash_table_create (keys_equal);
if (cache->hash_table == NULL)
- return CAIRO_STATUS_NO_MEMORY;
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
cache->entry_destroy = entry_destroy;
@@ -132,7 +132,7 @@ _cairo_cache_create (cairo_cache_keys_equal_func_t keys_equal,
cache = malloc (sizeof (cairo_cache_t));
if (cache == NULL) {
- _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}