[cairo] missing return values in PS backend

Jason Dorje Short jdorje at users.sf.net
Sat Jul 2 11:32:48 PDT 2005


Jason Dorje Short wrote:
> Jason Dorje Short wrote:
> 
>>Some functions don't have any return values.  I didn't really know what
>>they should return but this patch at least adds something.
> 
> Oops, this one should be slightly better.

And as Carl says this should be an ASSERT_NOT_REACHED.

-jason
-------------- next part --------------
Index: src/cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.38
diff -p -u -r1.38 cairo-ps-surface.c
--- src/cairo-ps-surface.c	1 Jul 2005 19:45:35 -0000	1.38
+++ src/cairo-ps-surface.c	2 Jul 2005 18:31:37 -0000
@@ -1207,7 +1207,10 @@ _pattern_is_translucent (cairo_pattern_t
     case CAIRO_PATTERN_LINEAR:
     case CAIRO_PATTERN_RADIAL:
 	return FALSE;
-    }	
+    }
+
+    ASSERT_NOT_REACHED;
+    return FALSE; /* Shouldn't reach here. */
 }
 
 static cairo_int_status_t
@@ -1224,6 +1227,7 @@ _ps_locate_fallbacks_composite (cairo_op
 				unsigned int	  width,
 				unsigned int	  height)
 {
+    return CAIRO_INT_STATUS_UNSUPPORTED; /* ??? */
 }
 
 static cairo_int_status_t
@@ -1233,6 +1237,7 @@ _ps_locate_fallbacks_fill_rectangles (vo
 				      cairo_rectangle_t	  *rects,
 				      int		   num_rects)
 {
+    return CAIRO_INT_STATUS_UNSUPPORTED; /* ??? */
 }
 
 static cairo_int_status_t
@@ -1252,8 +1257,12 @@ _ps_locate_fallbacks_composite_trapezoid
 
     info = abstract_dst;
 
-    if (_pattern_is_translucent (pattern))
+    if (_pattern_is_translucent (pattern)) {
 	_cairo_ps_fallback_info_add_area (info, x_dst, y_dst, width, height);
+	return CAIRO_STATUS_SUCCESS;
+    }
+
+    return CAIRO_INT_STATUS_UNSUPPORTED; /* ??? */
 }
 
 static cairo_int_status_t


More information about the cairo mailing list