[cairo-commit] 5 commits - pixman/src src/cairo-surface.c src/cairo-type1-subset.c test/cairo-test.c test/clip-operator.c test/Makefile.am test/operator-clear.c test/operator-source.c test/trap-clip.c test/truetype-tables.c test/unbounded-operator.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Sun Aug 13 02:18:43 PDT 2006


 pixman/src/fbmmx.c        |    2 +-
 src/cairo-surface.c       |   30 +++++++++++++++++++++++++++---
 src/cairo-type1-subset.c  |   33 ++++++++++++++++++++-------------
 test/Makefile.am          |    6 +++++-
 test/cairo-test.c         |    2 +-
 test/clip-operator.c      |    4 ++--
 test/operator-clear.c     |    4 ++--
 test/operator-source.c    |    4 ++--
 test/trap-clip.c          |    4 ++--
 test/truetype-tables.c    |    2 +-
 test/unbounded-operator.c |    4 ++--
 11 files changed, 65 insertions(+), 30 deletions(-)

New commits:
diff-tree e5f36a54daf376f34596a285402a3e30ee0a6a64 (from fdd7518b8be1975ae8f804eba7cf4738bd957e4a)
Author: Pavel Roskin <proski at gnu.org>
Date:   Sun Aug 13 05:09:28 2006 -0400

    [Type1] Use NULL instead of 0
    
    Using NULL is encouraged for pointers.  While fixing that, it turned out
    that the comments indicating the current index were wrong, so I'm fixing
    them too.

diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 52f05f8..f9606e0 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -481,8 +481,10 @@ cairo_type1_font_subset_decode_integer (
 }
 
 static const char *ps_standard_encoding[256] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*   0 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/*  16 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,	/*   0 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,	/*  16 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     "space", "exclam", "quotedbl", "numbersign",	/*  32 */
     "dollar", "percent", "ampersand", "quoteright",
     "parenleft", "parenright", "asterisk", "plus",
@@ -500,26 +502,31 @@ static const char *ps_standard_encoding[
     "i", "j", "k", "l", "m", "n", "o", "p",
     "q", "r", "s", "t", "u", "v", "w", "x",		/* 112 */
     "y", "z", "braceleft", "bar",
-    "braceright", "asciitilde", 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 128 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 144 */
-    "exclamdown", "cent", "sterling", "fraction",
+    "braceright", "asciitilde", NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,	/* 128 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,	/* 144 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    "exclamdown", "cent", "sterling", "fraction",	/* 160 */
     "yen", "florin", "section", "currency",
     "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft",
     "guilsinglright", "fi", "fl", NULL,
-    "endash", "dagger", "daggerdbl", "periodcentered",	/* 160 */
+    "endash", "dagger", "daggerdbl", "periodcentered",	/* 176 */
     NULL, "paragraph", "bullet", "quotesinglbase",
     "quotedblbase", "quotedblright", "guillemotright", "ellipsis",
     "perthousand", NULL, "questiondown", NULL,
-    "grave", "acute", "circumflex", "tilde",		/* 176 */
+    "grave", "acute", "circumflex", "tilde",		/* 192 */
     "macron", "breve", "dotaccent", "dieresis",
     NULL, "ring", "cedilla", NULL,
     "hungarumlaut", "ogonek", "caron", "emdash",
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 192 */
-    "AE", 0, "ordfeminine", 0, 0, 0, 0, "Lslash",	/* 208 */
-    "Oslash", "OE", "ordmasculine", 0, 0, 0, 0, 0,
-    "ae", 0, 0, 0, "dotlessi", 0, 0, "lslash",		/* 224 */
-    "oslash", "oe", "germandbls", 0, 0, 0, 0
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,	/* 208 */
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    "AE", NULL, "ordfeminine", NULL,			/* 224 */
+    NULL, NULL, NULL, "Lslash",
+    "Oslash", "OE", "ordmasculine", NULL, NULL, NULL, NULL, NULL,
+    "ae", NULL, NULL, NULL,				/* 240 */
+    "dotlessi", NULL, NULL, "lslash",
+    "oslash", "oe", "germandbls", NULL, NULL, NULL, NULL
 };
 
 static void
diff-tree fdd7518b8be1975ae8f804eba7cf4738bd957e4a (from a06af40c35ba8b5d9a0688cefc7eb8bd2e31e92d)
Author: Pavel Roskin <proski at gnu.org>
Date:   Sun Aug 13 05:02:46 2006 -0400

    Update nil surface structs to the surface struct
    
    Quite a few fields were missing, but all zero, so didn't matter
    practically, but comments were out of synch.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 3fd9176..0468ca2 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -63,8 +63,16 @@ const cairo_surface_t _cairo_surface_nil
     },					/* device_transform_inverse */
     0.0,				/* x_fallback_resolution */
     0.0,				/* y_fallback_resolution */
+    NULL,				/* clip */
     0,					/* next_clip_serial */
-    0					/* current_clip_serial */
+    0,					/* current_clip_serial */
+    FALSE,				/* is_snapshot */
+    FALSE,				/* has_font_options */
+    { CAIRO_ANTIALIAS_DEFAULT,
+      CAIRO_SUBPIXEL_ORDER_DEFAULT,
+      CAIRO_HINT_STYLE_DEFAULT,
+      CAIRO_HINT_METRICS_DEFAULT
+    }					/* font_options */
 };
 
 const cairo_surface_t _cairo_surface_nil_file_not_found = {
@@ -89,8 +97,16 @@ const cairo_surface_t _cairo_surface_nil
     },					/* device_transform_inverse */
     0.0,				/* x_fallback_resolution */
     0.0,				/* y_fallback_resolution */
+    NULL,				/* clip */
     0,					/* next_clip_serial */
-    0					/* current_clip_serial */
+    0,					/* current_clip_serial */
+    FALSE,				/* is_snapshot */
+    FALSE,				/* has_font_options */
+    { CAIRO_ANTIALIAS_DEFAULT,
+      CAIRO_SUBPIXEL_ORDER_DEFAULT,
+      CAIRO_HINT_STYLE_DEFAULT,
+      CAIRO_HINT_METRICS_DEFAULT
+    }					/* font_options */
 };
 
 const cairo_surface_t _cairo_surface_nil_read_error = {
@@ -115,8 +131,16 @@ const cairo_surface_t _cairo_surface_nil
     },					/* device_transform_inverse */
     0.0,				/* x_fallback_resolution */
     0.0,				/* y_fallback_resolution */
+    NULL,				/* clip */
     0,					/* next_clip_serial */
-    0					/* current_clip_serial */
+    0,					/* current_clip_serial */
+    FALSE,				/* is_snapshot */
+    FALSE,				/* has_font_options */
+    { CAIRO_ANTIALIAS_DEFAULT,
+      CAIRO_SUBPIXEL_ORDER_DEFAULT,
+      CAIRO_HINT_STYLE_DEFAULT,
+      CAIRO_HINT_METRICS_DEFAULT
+    }					/* font_options */
 };
 
 static void
diff-tree a06af40c35ba8b5d9a0688cefc7eb8bd2e31e92d (from 58963a2bf962559d579a84edde9af13d9f51d014)
Author: Pavel Roskin <proski at gnu.org>
Date:   Sun Aug 13 04:47:11 2006 -0400

    [test] Fix warnings in tests on 64-bit systems
    
    Cast argiments from size_t to int.  size_t is 64-bit on 64-bit systems,
    which causes a warning.  The actual data should fit 32 bit comfortably.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 69a667d..2fd6508 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1890,7 +1890,7 @@ cairo_test_expecting (cairo_test_t *test
 	    }
 
 	    if (!found) {
-		fprintf (stderr, "Cannot test target '%.*s'\n", end - tname, tname);
+		fprintf (stderr, "Cannot test target '%.*s'\n", (int)(end - tname), tname);
 		exit(-1);
 	    }
 
diff --git a/test/clip-operator.c b/test/clip-operator.c
index 631a59d..4e533c6 100644
--- a/test/clip-operator.c
+++ b/test/clip-operator.c
@@ -180,14 +180,14 @@ draw (cairo_t *cr, int width, int height
 
 	    draw_funcs[j] (cr, x, y);
 	    if (cairo_status (cr))
-		cairo_test_log ("%d %d HERE!\n", op, j);
+		cairo_test_log ("%d %d HERE!\n", op, (int)j);
 
 	    cairo_restore (cr);
 	}
     }
 
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	cairo_test_log ("%d %d .HERE!\n", op, j);
+	cairo_test_log ("%d %d .HERE!\n", op, (int)j);
 
     return CAIRO_TEST_SUCCESS;
 }
diff --git a/test/operator-clear.c b/test/operator-clear.c
index 74d767b..f1e1aaa 100644
--- a/test/operator-clear.c
+++ b/test/operator-clear.c
@@ -189,14 +189,14 @@ draw (cairo_t *cr, int width, int height
 	    pattern_funcs[i] (cr, x, y);
 	    draw_funcs[j] (cr, x, y);
 	    if (cairo_status (cr))
-		cairo_test_log ("%d %d HERE!\n", i, j);
+		cairo_test_log ("%d %d HERE!\n", (int)i, (int)j);
 
 	    cairo_restore (cr);
 	}
     }
 
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	cairo_test_log ("%d %d .HERE!\n", i, j);
+	cairo_test_log ("%d %d .HERE!\n", (int)i, (int)j);
 
     return CAIRO_TEST_SUCCESS;
 }
diff --git a/test/operator-source.c b/test/operator-source.c
index 662df5b..bb19d37 100644
--- a/test/operator-source.c
+++ b/test/operator-source.c
@@ -228,14 +228,14 @@ draw (cairo_t *cr, int width, int height
 	    pattern_funcs[i] (cr, x, y);
 	    draw_funcs[j] (cr, x, y);
 	    if (cairo_status (cr))
-		cairo_test_log ("%d %d HERE!\n", i, j);
+		cairo_test_log ("%d %d HERE!\n", (int)i, (int)j);
 
 	    cairo_restore (cr);
 	}
     }
 
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	cairo_test_log ("%d %d .HERE!\n", i, j);
+	cairo_test_log ("%d %d .HERE!\n", (int)i, (int)j);
 
     return CAIRO_TEST_SUCCESS;
 }
diff --git a/test/trap-clip.c b/test/trap-clip.c
index 3737e5a..e98d865 100644
--- a/test/trap-clip.c
+++ b/test/trap-clip.c
@@ -191,7 +191,7 @@ draw (cairo_t *cr, int width, int height
 		pattern_funcs[i] (cr, x, y);
 		draw_funcs[j] (cr, x, y);
 		if (cairo_status (cr))
-		    cairo_test_log ("%d %d HERE!\n", i, j);
+		    cairo_test_log ("%d %d HERE!\n", (int)i, (int)j);
 
 		cairo_restore (cr);
 	    }
@@ -199,7 +199,7 @@ draw (cairo_t *cr, int width, int height
     }
 
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	cairo_test_log ("%d %d .HERE!\n", i, j);
+	cairo_test_log ("%d %d .HERE!\n", (int)i, (int)j);
 
     return CAIRO_TEST_SUCCESS;
 }
diff --git a/test/truetype-tables.c b/test/truetype-tables.c
index 32cc5c2..851db90 100644
--- a/test/truetype-tables.c
+++ b/test/truetype-tables.c
@@ -42,7 +42,7 @@ main (void)
 
 #define check(st, sz) \
 	if (sizeof (st) != (sz)) { \
-	    cairo_test_log ("sizeof (%s): got %d, expected %d", #st, sizeof (st), sz); \
+	    cairo_test_log ("sizeof (%s): got %d, expected %d", #st, (int)sizeof (st), sz); \
 	    ret = CAIRO_TEST_FAILURE; \
 	}
 
diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c
index 5e01acd..22ef9a0 100644
--- a/test/unbounded-operator.c
+++ b/test/unbounded-operator.c
@@ -176,14 +176,14 @@ draw (cairo_t *cr, int width, int height
 
 	    draw_funcs[j] (cr, x, y);
 	    if (cairo_status (cr))
-		cairo_test_log ("%d %d HERE!\n", i, j);
+		cairo_test_log ("%d %d HERE!\n", (int)i, (int)j);
 
 	    cairo_restore (cr);
 	}
     }
 
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	cairo_test_log ("%d %d .HERE!\n", i, j);
+	cairo_test_log ("%d %d .HERE!\n", (int)i, (int)j);
 
     return CAIRO_TEST_SUCCESS;
 }
diff-tree 58963a2bf962559d579a84edde9af13d9f51d014 (from b29cc61facbe75ff3afea58308e93b86d25cb03d)
Author: Pavel Roskin <proski at gnu.org>
Date:   Sun Aug 13 04:44:39 2006 -0400

    [test] Allow overriding Valgrind flags on the command line
    
    Don't hardcode Valgrind flags in tests/Makefile.am so that
    tests/Makefile doesn't need to be rebuilt to use different flags.  Not
    everybody is looking for memory leaks.

diff --git a/test/Makefile.am b/test/Makefile.am
index 7342391..cbe1a73 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -432,6 +432,10 @@ TARGETS = $(CAIRO_TEST_TARGET)
 
 TESTS_ENVIRONMENT = CAIRO_XFAIL_TESTS="$(XFAIL_TESTS)" CAIRO_TEST_TARGET="$(TARGETS)"
 
+VALGRIND_FLAGS = \
+	--tool=memcheck --suppressions=./.valgrind-suppressions \
+	--leak-check=yes --show-reachable=yes
+
 CLEANFILES =					\
 	*.ps					\
 	*.pdf					\
@@ -448,7 +452,7 @@ CLEANFILES =					\
 # Check tests under valgrind
 # Saves log to valgrind-log
 check-valgrind:
-	$(MAKE) $(AM_MAKEFLAGS) check TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_srcdir)/libtool --mode=execute valgrind --tool=memcheck --suppressions=./.valgrind-suppressions --leak-check=yes --show-reachable=yes' 2>&1 | tee valgrind-log
+	$(MAKE) $(AM_MAKEFLAGS) check TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_srcdir)/libtool --mode=execute valgrind $(VALGRIND_FLAGS)' 2>&1 | tee valgrind-log
 
 # The following definitions both should work.
 #FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) 2>/dev/null | sed -e 's/[.]log$$//' | xargs echo`
diff-tree b29cc61facbe75ff3afea58308e93b86d25cb03d (from abd16e47d6331bd3811c908e524b4dcb6bd23bf0)
Author: Pavel Roskin <proski at gnu.org>
Date:   Sun Aug 13 04:41:43 2006 -0400

    [pixman] Don't cast pointers to integers
    
    This causes warnings on 64-bit platforms that may indicate very serious
    problems.  Fortunately, not in this case.

diff --git a/pixman/src/fbmmx.c b/pixman/src/fbmmx.c
index bc746cf..4d603bf 100644
--- a/pixman/src/fbmmx.c
+++ b/pixman/src/fbmmx.c
@@ -2401,7 +2401,7 @@ fbCopyAreammx (FbPixels	*pSrc,
 	    d += 2;
 	}
 
-	while (w >= 4 && ((unsigned int)d & 7))
+	while (w >= 4 && ((unsigned long)d & 7))
 	{
 	    *(CARD32 *)d = *(CARD32 *)s;
 


More information about the cairo-commit mailing list