[Pixman] [PATCH 1/2] test: OpenMP 2.5 requires signed loop iteration variables

Siarhei Siamashka siarhei.siamashka at gmail.com
Wed Jun 6 16:08:53 PDT 2012


Unsigned loop variables are only supported since version 3.0
of OpenMP specification. Changing loop variables to use int32_t
type fixes pixman build problems with path64 compiler.
---
 test/composite.c   |    3 ++-
 test/stress-test.c |   15 ++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/test/composite.c b/test/composite.c
index 94b4825..bdecd75 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -739,7 +739,8 @@ main (int argc, char **argv)
 {
 #define N_TESTS (8 * 1024 * 1024)
     int result = 0;
-    uint32_t i, seed;
+    uint32_t seed;
+    int32_t i;
 
     if (argc > 1)
     {
diff --git a/test/stress-test.c b/test/stress-test.c
index 3174621..0b48da3 100644
--- a/test/stress-test.c
+++ b/test/stress-test.c
@@ -797,10 +797,10 @@ main (int argc, char **argv)
 {
     int verbose = FALSE;
     uint32_t seed = 1;
-    uint32_t n_tests = 0xffffffff;
+    uint32_t n_tests = 8000;
     uint32_t mod = 0;
     pixman_bool_t use_threads = TRUE;
-    uint32_t i;
+    int32_t i;
 
     pixman_disable_out_of_bounds_workaround ();
 
@@ -847,9 +847,6 @@ main (int argc, char **argv)
 	}
     }
 
-    if (n_tests == 0xffffffff)
-	n_tests = 8000;
-
     if (getenv ("PIXMAN_RANDOMIZE_TESTS"))
     {
 	seed = get_random_seed();
@@ -861,13 +858,13 @@ main (int argc, char **argv)
 #ifdef USE_OPENMP
 #   pragma omp parallel for default(none) shared(verbose, n_tests, mod, seed)
 #endif
-	for (i = seed; i < seed + n_tests; ++i)
-	    run_test (i, verbose, mod);
+	for (i = 0; i < (int32_t)n_tests; ++i)
+	    run_test (seed + i, verbose, mod);
     }
     else
     {
-	for (i = seed; i < seed + n_tests; ++i)
-	    run_test (i, verbose, mod);
+	for (i = 0; i < (int32_t)n_tests; ++i)
+	    run_test (seed + i, verbose, mod);
     }
 
     return 0;
-- 
1.7.3.4



More information about the Pixman mailing list