[cairo-commit] src/cairo-glitz-surface.c src/cairo-gstate.c src/cairo-hash.c src/cairo-hull.c src/cairo-image-surface.c src/cairo-lzw.c src/cairo-meta-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Oct 4 01:31:09 PDT 2007


 src/cairo-glitz-surface.c |   24 ++++++++++++------------
 src/cairo-gstate.c        |    8 ++++----
 src/cairo-hash.c          |    6 +++---
 src/cairo-hull.c          |    2 +-
 src/cairo-image-surface.c |   12 +++++++-----
 src/cairo-lzw.c           |    4 ++--
 src/cairo-meta-surface.c  |   10 +++++-----
 7 files changed, 34 insertions(+), 32 deletions(-)

New commits:
diff-tree f4356efb64a043e7a459fe77616f3b7c92b25c49 (from ef5f460eb1f86a73e016c1150723ae1e70b3b037)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 4 09:30:32 2007 +0100

    [malloc/error] Fixup _cairo_error (CAIRO_STATUS_SUCCESS)!
    
    At some point during the blitz, I accidentally wrote
    _cairo_error (CAIRO_STATUS_SUCCESS) and then proceeded to paste it into
    the next 30 error sites! s/CAIRO_STATUS_SUCCESS/CAIRO_STATUS_NO_MEMORY/

diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index 5e68fc7..4d781cf 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -166,7 +166,7 @@ _cairo_glitz_get_boxes_from_region (cair
 
     gboxes = _cairo_malloc_ab (n, sizeof(glitz_box_t));
     if (gboxes == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
         goto done;
     }
 
@@ -272,14 +272,14 @@ _cairo_glitz_surface_get_image (cairo_gl
 
     pixels = _cairo_malloc_ab (height, pf.bytes_per_line);
     if (!pixels) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
     buffer = glitz_buffer_create_for_data (pixels);
     if (!buffer) {
 	free (pixels);
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -781,7 +781,7 @@ _cairo_glitz_pattern_acquire_surface (ca
         }
 
 	if (!data) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
 
@@ -793,7 +793,7 @@ _cairo_glitz_pattern_acquire_surface (ca
 	if (!buffer)
 	{
 	    free (data);
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
 
@@ -1312,7 +1312,7 @@ _cairo_glitz_surface_composite_trapezoid
 							  &attributes);
 		    if (src_pattern == &tmp_src_pattern.base)
 			_cairo_pattern_fini (&tmp_src_pattern.base);
-		    _cairo_error (CAIRO_STATUS_SUCCESS);
+		    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 		    return CAIRO_STATUS_NO_MEMORY;
 		}
 
@@ -1326,7 +1326,7 @@ _cairo_glitz_surface_composite_trapezoid
 							  &attributes);
 		    if (src_pattern == &tmp_src_pattern.base)
 			_cairo_pattern_fini (&tmp_src_pattern.base);
-		    _cairo_error (CAIRO_STATUS_SUCCESS);
+		    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 		    return CAIRO_STATUS_NO_MEMORY;
 		}
 	    }
@@ -1363,7 +1363,7 @@ _cairo_glitz_surface_composite_trapezoid
 	    _cairo_glitz_pattern_release_surface (src_pattern, src, &attributes);
 	    if (src_pattern == &tmp_src_pattern.base)
 		_cairo_pattern_fini (&tmp_src_pattern.base);
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
 
@@ -1577,7 +1577,7 @@ _cairo_glitz_area_create (cairo_glitz_ro
 
     area = malloc (sizeof (cairo_glitz_area_t));
     if (!area) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return NULL;
     }
 
@@ -1914,7 +1914,7 @@ _cairo_glitz_surface_font_init (cairo_gl
 
     font_private = malloc (sizeof (cairo_glitz_surface_font_private_t));
     if (!font_private) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -2002,7 +2002,7 @@ _cairo_glitz_surface_add_glyph (cairo_gl
     {
 	glyph_private = malloc (sizeof (cairo_glitz_surface_glyph_private_t));
 	if (!glyph_private) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
 
@@ -2169,7 +2169,7 @@ _cairo_glitz_surface_old_show_glyphs (ca
 
 	data = malloc (size1 + size2);
 	if (!data) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    goto FAIL1;
 	}
 
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 32d02e5..4097a65 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -208,7 +208,7 @@ _cairo_gstate_clone (cairo_gstate_t *oth
 
     gstate = malloc (sizeof (cairo_gstate_t));
     if (gstate == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return NULL;
     }
 
@@ -535,7 +535,7 @@ _cairo_gstate_set_dash (cairo_gstate_t *
     gstate->stroke_style.dash = _cairo_malloc_ab (gstate->stroke_style.num_dashes, sizeof (double));
     if (gstate->stroke_style.dash == NULL) {
 	gstate->stroke_style.num_dashes = 0;
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -1577,7 +1577,7 @@ _cairo_gstate_show_glyphs (cairo_gstate_
     } else {
 	transformed_glyphs = _cairo_malloc_ab (num_glyphs, sizeof(cairo_glyph_t));
 	if (transformed_glyphs == NULL) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
     }
@@ -1624,7 +1624,7 @@ _cairo_gstate_glyph_path (cairo_gstate_t
     else
       transformed_glyphs = _cairo_malloc_ab (num_glyphs, sizeof(cairo_glyph_t));
     if (transformed_glyphs == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
diff --git a/src/cairo-hash.c b/src/cairo-hash.c
index 09450f7..7051860 100644
--- a/src/cairo-hash.c
+++ b/src/cairo-hash.c
@@ -150,7 +150,7 @@ _cairo_hash_table_create (cairo_hash_key
 
     hash_table = malloc (sizeof (cairo_hash_table_t));
     if (hash_table == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return NULL;
     }
 
@@ -162,7 +162,7 @@ _cairo_hash_table_create (cairo_hash_key
 				  sizeof(cairo_hash_entry_t *));
     if (hash_table->entries == NULL) {
 	free (hash_table);
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return NULL;
     }
 
@@ -332,7 +332,7 @@ _cairo_hash_table_resize  (cairo_hash_ta
     new_size = tmp.arrangement->size;
     tmp.entries = calloc (new_size, sizeof (cairo_hash_entry_t*));
     if (tmp.entries == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
diff --git a/src/cairo-hull.c b/src/cairo-hull.c
index fb4e71c..f5d05e4 100644
--- a/src/cairo-hull.c
+++ b/src/cairo-hull.c
@@ -64,7 +64,7 @@ _cairo_hull_create (cairo_pen_vertex_t *
 
     hull = _cairo_malloc_ab (num_vertices, sizeof (cairo_hull_t));
     if (hull == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return NULL;
     }
 
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 1b80173..091a957 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1063,7 +1063,7 @@ _cairo_image_surface_fill_rectangles (vo
     if (num_rects > ARRAY_LENGTH(stack_rects)) {
 	pixman_rects = _cairo_malloc_ab (num_rects, sizeof(pixman_rectangle16_t));
 	if (pixman_rects == NULL) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
     }		 
@@ -1080,8 +1080,10 @@ _cairo_image_surface_fill_rectangles (vo
 				       surface->pixman_image,
 				       &pixman_color,
 				       num_rects,
-				       pixman_rects))
+				       pixman_rects)) {
 	status = CAIRO_STATUS_NO_MEMORY;
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
 
     if (pixman_rects != stack_rects)
 	free (pixman_rects);
@@ -1127,7 +1129,7 @@ _cairo_image_surface_composite_trapezoid
     if (num_traps > ARRAY_LENGTH(stack_traps)) {
 	pixman_traps = _cairo_malloc_ab (num_traps, sizeof(pixman_trapezoid_t));
 	if (pixman_traps == NULL) {
-	    _cairo_error (CAIRO_STATUS_SUCCESS);
+	    _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	    return CAIRO_STATUS_NO_MEMORY;
 	}
     }
@@ -1205,7 +1207,7 @@ _cairo_image_surface_composite_trapezoid
     mask_data = calloc (mask_stride, height);
     if (mask_data == NULL) {
 	status = CAIRO_STATUS_NO_MEMORY;
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	goto CLEANUP_SOURCE;
     }
 
@@ -1213,7 +1215,7 @@ _cairo_image_surface_composite_trapezoid
 				     mask_data, mask_stride);
     if (mask == NULL) {
 	status = CAIRO_STATUS_NO_MEMORY;
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	goto CLEANUP_IMAGE_DATA;
     }
 
diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c
index 00aa71b..73d82a3 100644
--- a/src/cairo-lzw.c
+++ b/src/cairo-lzw.c
@@ -76,7 +76,7 @@ _lzw_buf_init (lzw_buf_t *buf, int size)
     if (buf->data == NULL) {
 	buf->data_size = 0;
 	buf->status = CAIRO_STATUS_NO_MEMORY;
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return;
     }
 }
@@ -103,7 +103,7 @@ _lzw_buf_grow (lzw_buf_t *buf)
 	free (buf->data);
 	buf->data_size = 0;
 	buf->status = CAIRO_STATUS_NO_MEMORY;
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return buf->status;
     }
 
diff --git a/src/cairo-meta-surface.c b/src/cairo-meta-surface.c
index 3fc61a8..ac43be9 100644
--- a/src/cairo-meta-surface.c
+++ b/src/cairo-meta-surface.c
@@ -253,7 +253,7 @@ _cairo_meta_surface_paint (void			*abstr
 
     command = malloc (sizeof (cairo_command_paint_t));
     if (command == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -296,7 +296,7 @@ _cairo_meta_surface_mask (void			*abstra
 
     command = malloc (sizeof (cairo_command_mask_t));
     if (command == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -344,7 +344,7 @@ _cairo_meta_surface_stroke (void			*abst
 
     command = malloc (sizeof (cairo_command_stroke_t));
     if (command == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -401,7 +401,7 @@ _cairo_meta_surface_fill (void			*abstra
 
     command = malloc (sizeof (cairo_command_fill_t));
     if (command == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 
@@ -450,7 +450,7 @@ _cairo_meta_surface_show_glyphs (void			
 
     command = malloc (sizeof (cairo_command_show_glyphs_t));
     if (command == NULL) {
-	_cairo_error (CAIRO_STATUS_SUCCESS);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return CAIRO_STATUS_NO_MEMORY;
     }
 


More information about the cairo-commit mailing list