[cairo-commit] src/cairo.c test/path-data.c

Vladimir Vukicevic vladimir at kemper.freedesktop.org
Mon Sep 11 12:37:31 PDT 2006


 src/cairo.c      |    3 ++-
 test/path-data.c |   11 -----------
 2 files changed, 2 insertions(+), 12 deletions(-)

New commits:
diff-tree 924bbd06f35f55886f808a7a9d3ee08e479389ad (from bcc13ede9b820dd640748d9dc2ec9d15130427be)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date:   Mon Sep 11 12:36:41 2006 -0700

    Check for valid path status value before calling _cairo_set_error
    
    cairo_status_t is a signed type, so we need to check for invalid codes
    that are < 0 as well.
    
    Also removes the MSVC goop in path-data.c that was attempting to work
    around the assert earlier.

diff --git a/src/cairo.c b/src/cairo.c
index 59844ff..26fe1c1 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -2923,7 +2923,8 @@ cairo_append_path (cairo_t	*cr,
     }
 
     if (path->status) {
-	if (path->status <= CAIRO_STATUS_LAST_STATUS)
+	if (path->status > CAIRO_STATUS_SUCCESS &&
+	    path->status <= CAIRO_STATUS_LAST_STATUS)
 	    _cairo_set_error (cr, path->status);
 	else
 	    _cairo_set_error (cr, CAIRO_STATUS_INVALID_STATUS);
diff --git a/test/path-data.c b/test/path-data.c
old mode 100755
new mode 100644
index 105e807..903e92c
--- a/test/path-data.c
+++ b/test/path-data.c
@@ -143,10 +143,6 @@ draw (cairo_t *cr, int width, int height
     return CAIRO_TEST_SUCCESS;
 }
 
-#ifdef _MSC_VER
-#include <crtdbg.h>
-#endif
-
 int
 main (void)
 {
@@ -155,13 +151,6 @@ main (void)
     cairo_path_t path;
     cairo_surface_t *surface;
 
-#ifdef _MSC_VER
-    /* This test triggers an assert, and we don't want an assert dialog;
-     * have to do this here since the assert happens before cairo_test() */
-    _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
-    _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
-#endif
-
     surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
 
     /* Test a few error cases for cairo_append_path_data */


More information about the cairo-commit mailing list