[cairo-commit] 3 commits - boilerplate/cairo-boilerplate.c
boilerplate/cairo-boilerplate.h perf/cairo-perf.c
test/bitmap-font.c test/cairo-test.c
Carl Worth
cworth at kemper.freedesktop.org
Sat Sep 9 16:06:03 PDT 2006
boilerplate/cairo-boilerplate.c | 4 ++--
boilerplate/cairo-boilerplate.h | 20 ++++++++++----------
perf/cairo-perf.c | 12 ++++++------
test/bitmap-font.c | 4 ++--
test/cairo-test.c | 28 ++++++++++++++--------------
5 files changed, 34 insertions(+), 34 deletions(-)
New commits:
diff-tree 416e94532b1584b2ff23dd270c70ab900d55c326 (from a37e6675333da8f0c5ebe4b8d199f74b8ec30b43)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Sep 9 16:04:19 2006 -0700
test/bitmap-font: Fix arguments to FcFreeTypeQuery to avoid warnings.
diff --git a/test/bitmap-font.c b/test/bitmap-font.c
index 7e3c79e..d38243a 100644
--- a/test/bitmap-font.c
+++ b/test/bitmap-font.c
@@ -53,7 +53,7 @@ draw (cairo_t *cr, int width, int height
cairo_status_t status;
const char *srcdir = getenv ("srcdir");
char *filename;
- int *face_count;
+ int face_count;
struct stat stat_buf;
if (! srcdir)
@@ -66,7 +66,7 @@ draw (cairo_t *cr, int width, int height
return CAIRO_TEST_FAILURE;
}
- pattern = FcFreeTypeQuery (filename, 0, NULL, &face_count);
+ pattern = FcFreeTypeQuery ((unsigned char *)filename, 0, NULL, &face_count);
free (filename);
if (! pattern) {
cairo_test_log ("FcFreeTypeQuery failed.\n");
diff-tree a37e6675333da8f0c5ebe4b8d199f74b8ec30b43 (from 195fd5cde610377ffb34c98fed308b2e4d881cbc)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Sep 9 16:03:41 2006 -0700
Use unsigned consistently to avoid compiler warning.
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 53fb8dc..b40825f 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -106,7 +106,7 @@ typedef struct _cairo_boilerplate_target
const char *name;
cairo_surface_type_t expected_type;
cairo_content_t content;
- int error_tolerance;
+ unsigned int error_tolerance;
cairo_boilerplate_create_surface_t create_surface;
cairo_boilerplate_write_to_png_t write_to_png;
cairo_boilerplate_cleanup_t cleanup;
diff-tree 195fd5cde610377ffb34c98fed308b2e4d881cbc (from 99360bd35d77e1a3f536e72f5729455580c980c2)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Sep 9 14:55:57 2006 -0700
boilerplate: Rename cairo_test_target_t to cairo_boilerplate_target_t
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 8f2df72..0137f6e 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -968,7 +968,7 @@ create_xlib_surface (const char *name,
* step better would be to always test the non-Render fallbacks
* for each test even if the server does have the Render
* extension. That would probably be through another
- * cairo_test_target which would use an extended version of
+ * cairo_boilerplate_target which would use an extended version of
* cairo_test_xlib_disable_render. */
switch (content) {
case CAIRO_CONTENT_COLOR_ALPHA:
@@ -1340,7 +1340,7 @@ cleanup_svg (void *closure)
}
#endif /* CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE */
-cairo_test_target_t targets[] =
+cairo_boilerplate_target_t targets[] =
{
/* I'm uncompromising about leaving the image backend as 0
* for tolerance. There shouldn't ever be anything that is out of
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index f774909..53fb8dc 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -89,31 +89,31 @@ _cairo_test_content_name (cairo_content_
#endif
typedef cairo_surface_t *
-(*cairo_test_create_target_surface_t) (const char *name,
+(*cairo_boilerplate_create_surface_t) (const char *name,
cairo_content_t content,
int width,
int height,
void **closure);
typedef cairo_status_t
-(*cairo_test_write_to_png_t) (cairo_surface_t *surface, const char *filename);
+(*cairo_boilerplate_write_to_png_t) (cairo_surface_t *surface, const char *filename);
typedef void
-(*cairo_test_cleanup_target_t) (void *closure);
+(*cairo_boilerplate_cleanup_t) (void *closure);
-typedef struct _cairo_test_target
+typedef struct _cairo_boilerplate_target
{
const char *name;
cairo_surface_type_t expected_type;
cairo_content_t content;
int error_tolerance;
- cairo_test_create_target_surface_t create_target_surface;
- cairo_test_write_to_png_t write_to_png;
- cairo_test_cleanup_target_t cleanup_target;
+ cairo_boilerplate_create_surface_t create_surface;
+ cairo_boilerplate_write_to_png_t write_to_png;
+ cairo_boilerplate_cleanup_t cleanup;
void *closure;
-} cairo_test_target_t;
+} cairo_boilerplate_target_t;
-extern cairo_test_target_t targets[];
+extern cairo_boilerplate_target_t targets[];
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index) \
diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c
index 7b927b3..4a2147a 100644
--- a/perf/cairo-perf.c
+++ b/perf/cairo-perf.c
@@ -44,7 +44,7 @@ cairo_perf_t perfs[];
* loops wouldn't count the real work, just the recording by the
* meta-surface. */
static cairo_bool_t
-target_is_measurable (cairo_test_target_t *target)
+target_is_measurable (cairo_boilerplate_target_t *target)
{
switch (target->expected_type) {
case CAIRO_SURFACE_TYPE_IMAGE:
@@ -134,7 +134,7 @@ int
main (int argc, char *argv[])
{
int i, j, k;
- cairo_test_target_t *target;
+ cairo_boilerplate_target_t *target;
cairo_perf_t *perf;
cairo_surface_t *surface;
cairo_t *cr;
@@ -159,10 +159,10 @@ main (int argc, char *argv[])
for (j = 0; perfs[j].name; j++) {
perf = &perfs[j];
for (size = perf->min_size; size <= perf->max_size; size *= 2) {
- surface = (target->create_target_surface) (perf->name,
- target->content,
- size, size,
- &target->closure);
+ surface = (target->create_surface) (perf->name,
+ target->content,
+ size, size,
+ &target->closure);
cr = cairo_create (surface);
for (k =0; k < cairo_perf_iterations; k++) {
cairo_perf_yield ();
diff --git a/test/cairo-test.c b/test/cairo-test.c
index a43551f..36a40cf 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -178,9 +178,9 @@ done:
}
static cairo_test_status_t
-cairo_test_for_target (cairo_test_t *test,
- cairo_test_target_t *target,
- int dev_offset)
+cairo_test_for_target (cairo_test_t *test,
+ cairo_boilerplate_target_t *target,
+ int dev_offset)
{
cairo_test_status_t status;
cairo_surface_t *surface;
@@ -216,11 +216,11 @@ cairo_test_for_target (cairo_test_t *t
test->height += dev_offset;
}
- surface = (target->create_target_surface) (test->name,
- target->content,
- test->width,
- test->height,
- &target->closure);
+ surface = (target->create_surface) (test->name,
+ target->content,
+ test->width,
+ test->height,
+ &target->closure);
if (test->width && test->height) {
test->width -= dev_offset;
@@ -343,8 +343,8 @@ UNWIND_SURFACE:
cairo_debug_reset_static_data ();
- if (target->cleanup_target)
- target->cleanup_target (target->closure);
+ if (target->cleanup)
+ target->cleanup (target->closure);
UNWIND_STRINGS:
if (png_name)
@@ -380,7 +380,7 @@ cairo_test_expecting (cairo_test_t *test
void (*old_segfault_handler)(int);
#endif
volatile cairo_test_status_t status, ret;
- cairo_test_target_t ** volatile targets_to_test;
+ cairo_boilerplate_target_t ** volatile targets_to_test;
#ifdef HAVE_UNISTD_H
if (isatty (2)) {
@@ -418,7 +418,7 @@ cairo_test_expecting (cairo_test_t *test
if (0 == strncmp (targets[i].name, tname, end - tname) &&
!isalnum (targets[i].name[end - tname])) {
/* realloc isn't exactly the best thing here, but meh. */
- targets_to_test = realloc (targets_to_test, sizeof(cairo_test_target_t *) * (num_targets+1));
+ targets_to_test = realloc (targets_to_test, sizeof(cairo_boilerplate_target_t *) * (num_targets+1));
targets_to_test[num_targets++] = &targets[i];
found = 1;
}
@@ -437,7 +437,7 @@ cairo_test_expecting (cairo_test_t *test
num_targets = 0;
for (i = 0; targets[i].name != NULL; i++)
num_targets++;
- targets_to_test = malloc (sizeof(cairo_test_target_t*) * num_targets);
+ targets_to_test = malloc (sizeof(cairo_boilerplate_target_t*) * num_targets);
for (i = 0; i < num_targets; i++) {
targets_to_test[i] = &targets[i];
}
@@ -460,7 +460,7 @@ cairo_test_expecting (cairo_test_t *test
ret = CAIRO_TEST_UNTESTED;
for (i = 0; i < num_targets; i++) {
for (j = 0; j < NUM_DEVICE_OFFSETS; j++) {
- cairo_test_target_t * volatile target = targets_to_test[i];
+ cairo_boilerplate_target_t * volatile target = targets_to_test[i];
volatile int dev_offset = j * 25;
cairo_test_log ("Testing %s with %s target (dev offset %d)\n", test->name, target->name, dev_offset);
More information about the cairo-commit
mailing list