[cairo-commit] 2 commits - src/cairo-image-surface.c src/cairo-paginated-surface.c

Carl Worth cworth at kemper.freedesktop.org
Fri Jan 18 11:19:45 PST 2008


 src/cairo-image-surface.c     |    5 +----
 src/cairo-paginated-surface.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit c11790fded69ed476e7740ed86e4a66bf878d2d3
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jan 16 16:32:36 2008 -0800

    Quiet a warning about switch without some cairo_surface_type_t enum values

diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 49d488c..953f463 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -327,6 +327,16 @@ _paint_page (cairo_paginated_surface_t *surface)
             has_finegrained_fallback = _cairo_analysis_surface_has_unsupported (analysis);
             break;
 
+	case CAIRO_SURFACE_TYPE_IMAGE:
+	case CAIRO_SURFACE_TYPE_XLIB:
+	case CAIRO_SURFACE_TYPE_XCB:
+	case CAIRO_SURFACE_TYPE_GLITZ:
+	case CAIRO_SURFACE_TYPE_QUARTZ:
+	case CAIRO_SURFACE_TYPE_WIN32:
+	case CAIRO_SURFACE_TYPE_BEOS:
+	case CAIRO_SURFACE_TYPE_DIRECTFB:
+	case CAIRO_SURFACE_TYPE_SVG:
+	case CAIRO_SURFACE_TYPE_OS2:
         default:
             if (_cairo_analysis_surface_has_unsupported (analysis)) {
                 has_supported = FALSE;
commit 1d6c2d578fa717906ba8fd0a897c52033179e938
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jan 16 16:19:40 2008 -0800

    Remove some gratuitous assert statements
    
    Calling assert immediately after assigning a literal value is
    very bad form.

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 8787185..5f31d93 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -302,7 +302,7 @@ _cairo_image_surface_create_with_masks (unsigned char	       *data,
 static pixman_format_code_t 
 _cairo_format_to_pixman_format_code (cairo_format_t format)
 {
-    int ret = 0;
+    pixman_format_code_t ret;
     switch (format) {
     case CAIRO_FORMAT_A1:
 	ret = PIXMAN_a1;
@@ -318,7 +318,6 @@ _cairo_format_to_pixman_format_code (cairo_format_t format)
 	ret = PIXMAN_a8r8g8b8;
 	break;
     }
-    assert (ret);
     return ret;
 }
 
@@ -1083,7 +1082,6 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t	op,
     case CAIRO_ANTIALIAS_NONE:
 	format = PIXMAN_a1;
 	ret = 1;
-	assert (ret);
 	mask_stride = ((width + 31) / 8) & ~0x03;
 	mask_bpp = 1;
  	break;
@@ -1093,7 +1091,6 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t	op,
     default:
 	format = PIXMAN_a8;
 	ret = 1;
-	assert (ret);
 	mask_stride = (width + 3) & ~3;
 	mask_bpp = 8;
  	break;


More information about the cairo-commit mailing list