[cairo] [PATCH 2/3] [cairo-scaled-font] Annotate some cairo errors with _cairo_error()

Jeff Muizelaar jeff at infidigm.net
Fri Sep 28 07:49:33 PDT 2007


---

 src/cairo-scaled-font.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index f3808c9..3f2e33c 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -481,7 +481,7 @@ _cairo_scaled_font_init (cairo_scaled_font_t               *scaled_font,
 					       _cairo_scaled_glyph_destroy,
 					       MAX_GLYPHS_CACHED_PER_FONT);
     if (scaled_font->glyphs == NULL)
-	return CAIRO_STATUS_NO_MEMORY;
+	return _cairo_error(CAIRO_STATUS_NO_MEMORY);
 
     CAIRO_REFERENCE_COUNT_INIT (&scaled_font->ref_count, 1);
 
@@ -827,7 +827,7 @@ cairo_scaled_font_set_user_data (cairo_scaled_font_t	     *scaled_font,
 				 cairo_destroy_func_t	      destroy)
 {
     if (CAIRO_REFERENCE_COUNT_IS_INVALID (&scaled_font->ref_count))
-	return CAIRO_STATUS_NO_MEMORY;
+	return _cairo_error(CAIRO_STATUS_NO_MEMORY);
 
     return _cairo_user_data_array_set_data (&scaled_font->user_data,
 					    key, user_data, destroy);
@@ -1035,7 +1035,7 @@ _cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
     *glyphs = (cairo_glyph_t *) _cairo_malloc_ab ((*num_glyphs), sizeof (cairo_glyph_t));
 
     if (*glyphs == NULL) {
-	status = CAIRO_STATUS_NO_MEMORY;
+	status = _cairo_error(CAIRO_STATUS_NO_MEMORY);
 	goto DONE;
     }
 
@@ -1442,7 +1442,7 @@ _cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font,
 
 	    glyph_path = _cairo_path_fixed_create ();
 	    if (glyph_path == NULL)
-		return CAIRO_STATUS_NO_MEMORY;
+		return _cairo_error(CAIRO_STATUS_NO_MEMORY);
 
 	    status = _trace_mask_to_path (scaled_glyph->surface, glyph_path);
 	    if (status) {
@@ -1625,7 +1625,7 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
 	 */
 	scaled_glyph = malloc (sizeof (cairo_scaled_glyph_t));
 	if (scaled_glyph == NULL) {
-	    status = CAIRO_STATUS_NO_MEMORY;
+	    status = _cairo_error(CAIRO_STATUS_NO_MEMORY);
 	    goto CLEANUP;
 	}
 



More information about the cairo mailing list