Browse Source

examples: fix cppcheck warnings

Nathalie Furmento 8 years ago
parent
commit
c108a816e7

+ 1 - 1
examples/scheduler/heteroprio_test.c

@@ -117,7 +117,7 @@ int main(int argc, char** argv)
 
 	ncpus = starpu_cpu_worker_get_count();
 	nopencls = starpu_opencl_worker_get_count();
-	FPRINTF(stderr, "Worker = %d\n",  starpu_worker_get_count());
+	FPRINTF(stderr, "Worker = %u\n",  starpu_worker_get_count());
 	FPRINTF(stderr, "Worker CPU = %d\n", ncpus);
 	FPRINTF(stderr, "Worker OpenCL = %d\n", nopencls);
 	if (ncpus + nopencls == 0)

+ 1 - 1
examples/stencil/stencil-blocks.c

@@ -283,7 +283,7 @@ static void free_block_on_node(starpu_data_handle_t handleptr, unsigned nx, unsi
 
 void display_memory_consumption(int rank)
 {
-	FPRINTF(stderr, "%lu B of memory were allocated on node %d\n", allocated, rank);
+	FPRINTF(stderr, "%lu B of memory were allocated on node %d\n", (unsigned long) allocated, rank);
 }
 
 void allocate_memory_on_node(int rank)

+ 5 - 5
examples/worker_collections/worker_tree_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2016  Université de Bordeaux
- * Copyright (C) 2010-2015  CNRS
+ * Copyright (C) 2010-2016  CNRS
  *
  * 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
@@ -54,7 +54,7 @@ int main()
 	co->init_iterator = worker_tree.init_iterator;
 	co->type = STARPU_WORKER_TREE;
 
-	FPRINTF(stderr, "ncpus %d \n", ncpus);
+	FPRINTF(stderr, "ncpus %u \n", ncpus);
 
 	double start_time;
 	double end_time;
@@ -81,7 +81,7 @@ int main()
 	while(co->has_next(co, &it))
 	{
 		pu = co->get_next(co, &it);
-		FPRINTF(stderr, "pu = %d out of %d workers \n", pu, co->nworkers);
+		FPRINTF(stderr, "pu = %d out of %u workers \n", pu, co->nworkers);
 	}
 
 	unsigned six = 6;
@@ -90,13 +90,13 @@ int main()
 	for(i = 0; i < six; i++)
 	{
 		co->remove(co, i);
-		FPRINTF(stderr, "remove %d out of %d workers\n", i, co->nworkers);
+		FPRINTF(stderr, "remove %u out of %u workers\n", i, co->nworkers);
 	}
 
 	while(co->has_next(co, &it))
 	{
 		pu = co->get_next(co, &it);
-		FPRINTF(stderr, "pu = %d out of %d workers \n", pu, co->nworkers);
+		FPRINTF(stderr, "pu = %d out of %u workers \n", pu, co->nworkers);
 	}
 
 	FPRINTF(stderr, "timing init = %lf \n", timing);