[cairo-commit] 2 commits - src/cairo.c src/cairo-gstate.c src/cairo-misc.c src/cairo-scaled-font.c
Jeff Muizelaar
jrmuizel at kemper.freedesktop.org
Wed Dec 17 14:48:13 PST 2008
src/cairo-gstate.c | 2 +-
src/cairo-misc.c | 4 ++--
src/cairo-scaled-font.c | 14 +++++++-------
src/cairo.c | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit 32c66109059398e88f50335bef75fa8c0e51c4c8
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date: Wed Dec 17 17:43:37 2008 -0500
Call _cairo_error when propagating error status from the font_face.
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index e76d72a..9ebc5d1 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1556,7 +1556,7 @@ _cairo_gstate_set_font_face (cairo_gstate_t *gstate,
cairo_font_face_t *font_face)
{
if (font_face && font_face->status)
- return font_face->status;
+ return _cairo_error (font_face->status);
if (font_face == gstate->font_face)
return CAIRO_STATUS_SUCCESS;
commit 1d72e53c3e99f93aa59967c76f1b1b4c035b9130
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date: Wed Dec 17 17:42:18 2008 -0500
Add a missing _cairo_error() to a bunch of status returns.
diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index 6f707a6..708ba52 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -288,7 +288,7 @@ _cairo_validate_text_clusters (const char *utf8,
/* Make sure we've got valid UTF-8 for the cluster */
status = _cairo_utf8_to_ucs4 (utf8+n_bytes, cluster_bytes, NULL, NULL);
if (unlikely (status))
- return CAIRO_STATUS_INVALID_CLUSTERS;
+ return _cairo_error (CAIRO_STATUS_INVALID_CLUSTERS);
n_bytes += cluster_bytes ;
n_glyphs += cluster_glyphs;
@@ -296,7 +296,7 @@ _cairo_validate_text_clusters (const char *utf8,
if (n_bytes != (unsigned int) utf8_len || n_glyphs != (unsigned int) num_glyphs) {
BAD:
- return CAIRO_STATUS_INVALID_CLUSTERS;
+ return _cairo_error (CAIRO_STATUS_INVALID_CLUSTERS);
}
return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 5758388..ffae4d6 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1529,7 +1529,7 @@ cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
/* glyphs and num_glyphs can't be NULL */
if (glyphs == NULL ||
num_glyphs == NULL) {
- status = CAIRO_STATUS_NULL_POINTER;
+ status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
goto BAIL;
}
@@ -1541,7 +1541,7 @@ cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
if ((utf8_len && utf8 == NULL) ||
(clusters && num_clusters == NULL) ||
(clusters && cluster_flags == NULL)) {
- status = CAIRO_STATUS_NULL_POINTER;
+ status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
goto BAIL;
}
@@ -1573,7 +1573,7 @@ cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
if (utf8_len < 0 ||
*num_glyphs < 0 ||
(num_clusters && *num_clusters < 0)) {
- status = CAIRO_STATUS_NEGATIVE_COUNT;
+ status = _cairo_error (CAIRO_STATUS_NEGATIVE_COUNT);
goto BAIL;
}
@@ -1609,22 +1609,22 @@ cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
* can be hard to get right. */
if (*num_glyphs < 0) {
- status = CAIRO_STATUS_NEGATIVE_COUNT;
+ status = _cairo_error (CAIRO_STATUS_NEGATIVE_COUNT);
goto DONE;
}
if (num_glyphs && *glyphs == NULL) {
- status = CAIRO_STATUS_NULL_POINTER;
+ status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
goto DONE;
}
if (clusters) {
if (*num_clusters < 0) {
- status = CAIRO_STATUS_NEGATIVE_COUNT;
+ status = _cairo_error (CAIRO_STATUS_NEGATIVE_COUNT);
goto DONE;
}
if (num_clusters && *clusters == NULL) {
- status = CAIRO_STATUS_NULL_POINTER;
+ status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
goto DONE;
}
diff --git a/src/cairo.c b/src/cairo.c
index e1f7e91..d7ed78e 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -2868,7 +2868,7 @@ cairo_set_scaled_font (cairo_t *cr,
return;
if (scaled_font == NULL) {
- status = CAIRO_STATUS_NULL_POINTER;
+ status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
goto BAIL;
}
More information about the cairo-commit
mailing list