diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-06-24 15:07:07 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-06-24 15:07:07 -0400 |
commit | 74789a702bf5c62bc0d0361f139b2c94f67d5c6e (patch) | |
tree | 83bb0af67825ce8602652455f3a4e6020ccea744 /src/cairo.c | |
parent | ace3a98a53ab596c83df5a163e580770b9771bf2 (diff) |
Cleanup _set_error functions a bit
Diffstat (limited to 'src/cairo.c')
-rw-r--r-- | src/cairo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cairo.c b/src/cairo.c index 2fb5fc17..85cb4cda 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -93,10 +93,10 @@ _cairo_error (cairo_status_t status) /** * _cairo_set_error: * @cr: a cairo context - * @status: a status value indicating an error, (eg. not - * %CAIRO_STATUS_SUCCESS) + * @status: a status value indicating an error * * Atomically sets cr->status to @status and calls _cairo_error; + * Does nothing if status is %CAIRO_STATUS_SUCCESS. * * All assignments of an error status to cr->status should happen * through _cairo_set_error(). Note that due to the nature of the atomic @@ -109,6 +109,9 @@ _cairo_error (cairo_status_t status) static void _cairo_set_error (cairo_t *cr, cairo_status_t status) { + if (status == CAIRO_STATUS_SUCCESS) + return status; + /* Don't overwrite an existing error. This preserves the first * error, which is the most significant. */ _cairo_status_set_error (&cr->status, status); |