From a06af40c35ba8b5d9a0688cefc7eb8bd2e31e92d Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 13 Aug 2006 04:47:11 -0400 Subject: [PATCH] [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. --- 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 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/cairo-test.c b/test/cairo-test.c index 69a667db3..2fd650866 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 631a59d73..4e533c6ae 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 74d767bb3..f1e1aaa63 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 662df5b5a..bb19d3723 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 3737e5a3d..e98d865d3 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 32cc5c279..851db9023 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 5e01acd19..22ef9a0eb 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; }