[cairo] [PATCH 4/8] Fix warnings in tests on 64-bit systems
Pavel Roskin
proski at gnu.org
Sat Aug 12 22:57:54 PDT 2006
From: Pavel Roskin <proski at gnu.org>
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.
Signed-off-by: Pavel Roskin <proski at gnu.org>
---
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 69a667d..2fd6508 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1890,7 +1890,7 @@ #endif
}
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;
}
More information about the cairo
mailing list