Cleanup _set_error functions a bit

This commit is contained in:
Behdad Esfahbod 2008-06-24 15:07:07 -04:00
parent ace3a98a53
commit 74789a702b
5 changed files with 17 additions and 8 deletions

View file

@ -63,6 +63,8 @@ _cairo_font_face_set_error (cairo_font_face_t *font_face,
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 (&font_face->status, status);
return _cairo_error (status);

View file

@ -63,10 +63,10 @@ const cairo_solid_pattern_t _cairo_pattern_none = {
/**
* _cairo_pattern_set_error:
* @pattern: a pattern
* @status: a status value indicating an error, (eg. not
* %CAIRO_STATUS_SUCCESS)
* @status: a status value indicating an error
*
* Atomically sets pattern->status to @status and calls _cairo_error;
* Does nothing if status is %CAIRO_STATUS_SUCCESS.
*
* All assignments of an error status to pattern->status should happen
* through _cairo_pattern_set_error(). Note that due to the nature of
@ -81,6 +81,9 @@ static cairo_status_t
_cairo_pattern_set_error (cairo_pattern_t *pattern,
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 (&pattern->status, status);

View file

@ -208,10 +208,10 @@ static const cairo_scaled_font_t _cairo_scaled_font_nil = {
/**
* _cairo_scaled_font_set_error:
* @scaled_font: a scaled_font
* @status: a status value indicating an error, (eg. not
* %CAIRO_STATUS_SUCCESS)
* @status: a status value indicating an error
*
* Atomically sets scaled_font->status to @status and calls _cairo_error;
* Does nothing if status is %CAIRO_STATUS_SUCCESS.
*
* All assignments of an error status to scaled_font->status should happen
* through _cairo_scaled_font_set_error(). Note that due to the nature of

View file

@ -96,10 +96,11 @@ _cairo_surface_copy_pattern_for_destination (const cairo_pattern_t *pattern,
/**
* _cairo_surface_set_error:
* @surface: a surface
* @status: a status value indicating an error, (eg. not
* %CAIRO_STATUS_SUCCESS)
* @status: a status value indicating an error
*
* Atomically sets surface->status to @status and calls _cairo_error;
* Does nothing if status is %CAIRO_STATUS_SUCCESS or any of the internal
* status values.
*
* All assignments of an error status to surface->status should happen
* through _cairo_surface_set_error(). Note that due to the nature of

View file

@ -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);