瀏覽代碼

tests: fix type and shadow declarations

Nathalie Furmento 12 年之前
父節點
當前提交
b7f742398e

+ 2 - 2
tests/datawizard/acquire_release.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -77,7 +77,7 @@ struct starpu_opencl_program opencl_program;
 #endif
 int main(int argc, char **argv)
 {
-	int i;
+	unsigned i;
 	int ret;
 
         ret = starpu_init(NULL);

+ 2 - 2
tests/datawizard/acquire_release2.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -79,7 +79,7 @@ struct starpu_opencl_program opencl_program;
 #endif
 int main(int argc, char **argv)
 {
-	int i;
+	unsigned i;
 	int ret;
 
         ret = starpu_init(NULL);

+ 2 - 1
tests/datawizard/copy.c

@@ -52,7 +52,8 @@ int main(int argc, char **argv)
 {
         float foo;
 	starpu_data_handle_t float_array_handle;
-        int i, ret;
+        unsigned i;
+	int ret;
 
         ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;

+ 1 - 1
tests/datawizard/gpu_register.c

@@ -66,7 +66,7 @@ static int
 check_result(unsigned *t, size_t size)
 {
 	int i;
-	for (i = 0; i < size; i++)
+	for (i = 0; i < (int)size; i++)
 	{
 		if (t[i] != i*2)
 		{

+ 2 - 2
tests/datawizard/handle_to_pointer.c

@@ -30,7 +30,7 @@ static void cpu_task(void **buffers, void *args)
 	numbers = (int *) STARPU_VECTOR_GET_PTR(buffers[0]);
 	starpu_codelet_unpack_args (args, &size);
 
-	for(i = 0; i < size; i++)
+	for(i = 0; i < (int)size; i++)
 	{
 		numbers[i] = i;
 	}
@@ -46,7 +46,7 @@ static void cuda_task(void **buffers, void *args)
 	numbers = (int *)STARPU_VECTOR_GET_PTR(buffers[0]);
 	starpu_codelet_unpack_args (args, &size);
 
-	for(i = 0; i < size; i++)
+	for(i = 0; i < (int)size; i++)
 	{
 		cudaMemcpyAsync(&numbers[i], &i, sizeof(int), cudaMemcpyHostToDevice, starpu_cuda_get_local_stream());
 	}

+ 4 - 3
tests/datawizard/in_place_partition.c

@@ -24,6 +24,7 @@ int main(int argc, char **argv)
 	starpu_data_handle_t handle;
 	int ret;
 	int n, i, size;
+	unsigned j;
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
@@ -61,14 +62,14 @@ int main(int argc, char **argv)
 
 	starpu_data_partition(handle, &f);
 
-	for (i = 0; i < f.nchildren; i++)
+	for (j = 0; j < f.nchildren; j++)
 	{
 		struct starpu_task *task = starpu_task_create();
 
-		task->handles[0] = starpu_data_get_sub_data(handle, 1, i);
+		task->handles[0] = starpu_data_get_sub_data(handle, 1, j);
 		task->cl = &scal_codelet;
 		task->execute_on_a_specific_worker = 1;
-		task->workerid = i;
+		task->workerid = j;
 
 		ret = starpu_task_submit(task);
 		if (ret == -ENODEV) goto enodev;

+ 2 - 2
tests/datawizard/interfaces/bcsr/bcsr_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2012  inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -144,7 +144,7 @@ test_bcsr_cpu_func(void *buffers[], void *args)
 	val = (int *) STARPU_BCSR_GET_NZVAL(buffers[0]);
 	factor = *(int *) args;
 
-	for (i = 0; i < nnz; i++)
+	for (i = 0; i < (int)nnz; i++)
 	{
 		if (val[i] != i * factor)
 		{

+ 1 - 1
tests/datawizard/interfaces/block/block_interface.c

@@ -105,7 +105,7 @@ static void test_block_cpu_func(void *buffers[], void *args)
         unsigned ldy = STARPU_BLOCK_GET_LDY(buffers[0]);
         unsigned ldz = STARPU_BLOCK_GET_LDZ(buffers[0]);
 	int *block = (int *) STARPU_BLOCK_GET_PTR(buffers[0]);
-	unsigned int i, j, k;
+	int i, j, k;
 	int val = 0;
 	block_config.copy_failed = SUCCESS;
 	for (k = 0; k < nz; k++)

+ 2 - 2
tests/datawizard/interfaces/coo/coo_interface.c

@@ -56,8 +56,8 @@ test_coo_cpu_func(void *buffers[], void *args)
 	int *values = (int *) STARPU_COO_GET_VALUES(buffers[0]);
 	unsigned size = STARPU_COO_GET_NVALUES(buffers[0]);
 
-	unsigned i;
-	for (i = 0; i < size; i++)
+	int i;
+	for (i = 0; i < (int)size; i++)
 	{
 		if (values[i] != i * factor)
 		{

+ 1 - 1
tests/datawizard/interfaces/csr/csr_interface.c

@@ -126,7 +126,7 @@ test_csr_cpu_func(void *buffers[], void *args)
 	val = (int *) STARPU_CSR_GET_NZVAL(buffers[0]);
 	factor = *(int *) args;
 
-	for (i = 0; i < nnz; i++)
+	for (i = 0; i < (int)nnz; i++)
 	{
 		if (val[i] != (i+1) * factor)
 		{

+ 1 - 1
tests/datawizard/interfaces/matrix/matrix_interface.c

@@ -94,7 +94,7 @@ test_matrix_cpu_func(void *buffers[], void *args)
 	int *val;
 	int factor;
 	int i;
-	unsigned int nx, ny;
+	int nx, ny;
 
 	nx = STARPU_MATRIX_GET_NX(buffers[0]);
 	ny = STARPU_MATRIX_GET_NY(buffers[0]);

+ 2 - 2
tests/datawizard/interfaces/multiformat/multiformat_interface.c

@@ -54,7 +54,7 @@ test_multiformat_cpu_func(void *buffers[], void *args)
 	STARPU_SKIP_IF_VALGRIND;
 
 	struct point *aos;
-	unsigned int n, i;
+	int n, i;
 	int factor;
 
 	aos = (struct point *) STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
@@ -63,7 +63,7 @@ test_multiformat_cpu_func(void *buffers[], void *args)
 
 	for (i = 0; i < n; i++)
 	{
-			FPRINTF(stderr, "(%d %d) [%d]", aos[i].x, aos[i].y, factor);
+		FPRINTF(stderr, "(%d %d) [%d]", aos[i].x, aos[i].y, factor);
 		if (aos[i].x != i * factor || aos[i].y != i * factor)
 		{
 			multiformat_config.copy_failed = FAILURE;

+ 1 - 1
tests/datawizard/interfaces/vector/test_vector_interface.c

@@ -90,7 +90,7 @@ static void test_vector_cpu_func(void *buffers[], void *args)
 	unsigned int i;
 	for (i = 0; i < n; i++)
 	{
-		if (val[i] != i*factor)
+		if (val[i] != (int)i*factor)
 		{
 			vector_config.copy_failed = FAILURE;
 			return;

+ 3 - 3
tests/datawizard/mpi_like_async.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -28,8 +28,8 @@
 #  define NITER_DEFAULT		128
 #endif
 
-static int nthreads = NTHREADS_DEFAULT;
-static int niter = NITER_DEFAULT;
+static unsigned nthreads = NTHREADS_DEFAULT;
+static unsigned niter = NITER_DEFAULT;
 
 //#define DEBUG_MESSAGES	1
 

+ 2 - 1
tests/datawizard/partition_lazy.c

@@ -45,7 +45,8 @@ int main(int argc, char **argv)
 	unsigned *foo;
 	starpu_data_handle_t handle;
 	int ret;
-	int n, i, size;
+	int n, size;
+	unsigned i;
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;

+ 2 - 2
tests/datawizard/sync_and_notify_data.c

@@ -27,8 +27,8 @@
 #define N_DEF	100
 #define K_DEF	256
 
-static int n=N_DEF;
-static int k=K_DEF;
+static unsigned n=N_DEF;
+static unsigned k=K_DEF;
 
 /*
  * In this test, we maintain a vector v = (a,b,c).

+ 2 - 2
tests/datawizard/sync_and_notify_data_implicit.c

@@ -26,8 +26,8 @@
 #define N_DEF	100
 #define K_DEF	256
 
-static int n=N_DEF;
-static int k=K_DEF;
+static unsigned n=N_DEF;
+static unsigned k=K_DEF;
 
 /*
  * In this test, we maintain a vector v = (a,b,c).

+ 3 - 3
tests/datawizard/sync_with_data_with_mem.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Allocate all buffers and register them to StarPU */
-	unsigned b;
+	int b;
 	for (b = 0; b < nbuffers; b++)
 	{
 		ret = starpu_malloc((void **)&buffer[b], vectorsize);
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
 				(uintptr_t)buffer[b], vectorsize, sizeof(char));
 	}
 
-	unsigned iter;
+	int iter;
 	for (iter = 0; iter < niter; iter++)
 	{
 		/* Use the buffers on the different workers so that it may not

+ 4 - 4
tests/datawizard/sync_with_data_with_mem_non_blocking.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -27,9 +27,9 @@
 #define NITER_DEF	128
 #define VECTORSIZE_DEF	1024
 
-static int nbuffers = NBUFFERS_DEF;
-static int niter = NITER_DEF;
-static int vectorsize = VECTORSIZE_DEF;
+static unsigned nbuffers = NBUFFERS_DEF;
+static unsigned niter = NITER_DEF;
+static unsigned vectorsize = VECTORSIZE_DEF;
 
 float *buffer[NBUFFERS_DEF];
 

+ 4 - 4
tests/datawizard/sync_with_data_with_mem_non_blocking_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -27,9 +27,9 @@
 #define NITER_DEF	128
 #define VECTORSIZE_DEF	1024
 
-static int nbuffers = NBUFFERS_DEF;
-static int niter = NITER_DEF;
-static int vectorsize = VECTORSIZE_DEF;
+static unsigned nbuffers = NBUFFERS_DEF;
+static unsigned niter = NITER_DEF;
+static unsigned vectorsize = VECTORSIZE_DEF;
 
 float *buffer[NBUFFERS_DEF];
 

+ 3 - 2
tests/main/deprecated_func.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -112,7 +112,8 @@ int submit_codelet(struct starpu_codelet cl, int where)
 
 int main(int argc, char **argv)
 {
-	int ret, where;
+	int ret;
+	unsigned where;
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;

+ 2 - 2
tests/main/driver_api/init_run_deinit.c

@@ -189,10 +189,10 @@ test_opencl(void)
 {
         cl_int err;
         cl_platform_id platform;
-        cl_uint dummy;
+        cl_uint pdummy;
 	int nopencl;
 
-        err = clGetPlatformIDs(1, &platform, &dummy);
+        err = clGetPlatformIDs(1, &platform, &pdummy);
         if (err != CL_SUCCESS)
         {
 		FPRINTF(stderr, "WARNING: No OpenCL platform found\n");

+ 2 - 2
tests/main/driver_api/run_driver.c

@@ -181,9 +181,9 @@ test_opencl(void)
 	struct starpu_conf conf;
 
 	cl_int err;
-        cl_uint dummy;
+        cl_uint pdummy;
         cl_platform_id platform;
-        err = clGetPlatformIDs(1, &platform, &dummy);
+        err = clGetPlatformIDs(1, &platform, &pdummy);
         if (err != CL_SUCCESS)
 	{
 		FPRINTF(stderr, "WARNING: No OpenCL platform found\n");

+ 2 - 2
tests/main/empty_task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
 
 	gettimeofday(&start, NULL);
 
-	int i;
+	unsigned i;
 	for (i = 0; i < ntasks; i++)
 	{
 		struct starpu_task *task = starpu_task_create();

+ 2 - 2
tests/main/get_current_task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
 
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);
 
-	int i;
+	unsigned i;
 	for (i = 0; i < ntasks; i++)
 	{
 		struct starpu_task *task = starpu_task_create();

+ 3 - 2
tests/main/multithreaded.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -50,7 +50,8 @@ static struct starpu_codelet dummy_codelet =
 
 void *thread_func(void *arg __attribute__((unused)))
 {
-	int i, ret;
+	int ret;
+	unsigned i;
 
 	for (i = 0; i < ntasks; i++)
 	{

+ 2 - 2
tests/main/starpu_task_wait.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
 
 	gettimeofday(&start, NULL);
 
-	int i;
+	unsigned i;
 	for (i = 0; i < ntasks; i++)
 	{
 		struct starpu_task *task = starpu_task_create();

+ 5 - 5
tests/perfmodels/valid_model.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -42,7 +42,7 @@ static struct starpu_perfmodel hb_model =
 };
 #endif
 
-static struct starpu_codelet codelet =
+static struct starpu_codelet mycodelet =
 {
 	.cuda_funcs = {func, NULL},
 	.opencl_funcs = {func, NULL},
@@ -116,11 +116,11 @@ int main(int argc, char **argv)
 	int ret;
 
 	/* Use a linear regression model */
-	ret = submit(&codelet, &rb_model);
+	ret = submit(&mycodelet, &rb_model);
 	if (ret) return ret;
 
 	/* Use a non-linear regression model */
-	ret = submit(&codelet, &nlrb_model);
+	ret = submit(&mycodelet, &nlrb_model);
 	if (ret) return ret;
 
 #ifdef STARPU_DEVEL
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
 #endif
 #if 0
 	/* Use a history model */
-	ret = submit(&codelet, &hb_model);
+	ret = submit(&mycodelet, &hb_model);
 	if (ret) return ret;
 #endif