[cairo-commit] 3 commits - src/cairo-atomic-private.h test/cairo-test-runner.c test/get-path-extents.c test/xcb-stress-cache.c

Benjamin Otte company at kemper.freedesktop.org
Sat Feb 19 01:26:39 PST 2011


 src/cairo-atomic-private.h |    3 ++-
 test/cairo-test-runner.c   |    2 +-
 test/get-path-extents.c    |   14 ++++++++++++++
 test/xcb-stress-cache.c    |    2 +-
 4 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit f847b3c2162029ee0b0ae4906d48a0d7c1312df3
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Feb 19 10:25:22 2011 +0100

    test: Fix gcc complaints about old style definitions

diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 539817e..aebec76 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -126,7 +126,7 @@ _log (cairo_test_context_t *ctx,
 }
 
 static void
-_tests_reverse ()
+_tests_reverse (void)
 {
     cairo_test_t *list, *next;
 
diff --git a/test/xcb-stress-cache.c b/test/xcb-stress-cache.c
index 3c7ee15..3e3d0a2 100644
--- a/test/xcb-stress-cache.c
+++ b/test/xcb-stress-cache.c
@@ -58,7 +58,7 @@
  */
 
 static cairo_surface_t *
-create_image ()
+create_image (void)
 {
     cairo_surface_t *surface;
     cairo_t *cr;
commit 7386960d063e4a3642fb281aaae071404d837bdb
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Feb 19 10:23:46 2011 +0100

    test: Add a test for 0-radius negative arcs
    
    This test checks the behavior of
    e46dc9e17a6f6737d5624dbcdd3c42c2353a72f1

diff --git a/test/get-path-extents.c b/test/get-path-extents.c
index 5bd3eb7..bd54f0e 100644
--- a/test/get-path-extents.c
+++ b/test/get-path-extents.c
@@ -151,12 +151,26 @@ draw (cairo_t *cr, int width, int height)
     errors += !check_extents (ctx, phase, cr2, PATH, EQUALS, 200, 400, 0, 0);
 
     cairo_new_path (cr2);
+    cairo_arc_negative (cr2, 200, 400, 0., 0, 2 * M_PI);
+    phase = "Degenerate negative arc (R=0)";
+    errors += !check_extents (ctx, phase, cr2, FILL, EQUALS, 0, 0, 0, 0);
+    errors += !check_extents (ctx, phase, cr2, STROKE, EQUALS, 0, 0, 0, 0);
+    errors += !check_extents (ctx, phase, cr2, PATH, EQUALS, 200, 400, 0, 0);
+
+    cairo_new_path (cr2);
+    cairo_new_path (cr2);
     cairo_arc (cr2, 200, 400, 10., 0, 0);
     phase = "Degenerate arc (Θ=0)";
     errors += !check_extents (ctx, phase, cr2, FILL, EQUALS, 0, 0, 0, 0);
     errors += !check_extents (ctx, phase, cr2, STROKE, EQUALS, 0, 0, 0, 0);
     errors += !check_extents (ctx, phase, cr2, PATH, EQUALS, 210, 400, 0, 0);
 
+    cairo_arc_negative (cr2, 200, 400, 10., 0, 0);
+    phase = "Degenerate negative arc (Θ=0)";
+    errors += !check_extents (ctx, phase, cr2, FILL, EQUALS, 0, 0, 0, 0);
+    errors += !check_extents (ctx, phase, cr2, STROKE, EQUALS, 0, 0, 0, 0);
+    errors += !check_extents (ctx, phase, cr2, PATH, EQUALS, 210, 400, 0, 0);
+
     cairo_new_path (cr2);
     cairo_restore (cr2);
 
commit b2bda24e42a3a5487177b9cb7354dc33f98da349
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Feb 19 10:22:45 2011 +0100

    Declare variables first so gcc shuts up

diff --git a/src/cairo-atomic-private.h b/src/cairo-atomic-private.h
index eeac68a..9f5888c 100644
--- a/src/cairo-atomic-private.h
+++ b/src/cairo-atomic-private.h
@@ -254,10 +254,11 @@ _cairo_atomic_ptr_cmpxchg_return_old_fallback(void **x, void *oldv, void *newv)
     _cairo_atomic_int_cmpxchg((cairo_atomic_int_t *)x, oldv, newv)
 
 #define _cairo_status_set_error(status, err) do { \
+    int ret__; \
     assert (err < CAIRO_STATUS_LAST_STATUS); \
     /* hide compiler warnings about cairo_status_t != int (gcc treats its as \
      * an unsigned integer instead, and about ignoring the return value. */  \
-    int ret__ = _cairo_atomic_int_cmpxchg ((cairo_atomic_int_t *) status, CAIRO_STATUS_SUCCESS, err); \
+    ret__ = _cairo_atomic_int_cmpxchg ((cairo_atomic_int_t *) status, CAIRO_STATUS_SUCCESS, err); \
     (void) ret__; \
 } while (0)
 


More information about the cairo-commit mailing list