瀏覽代碼

small fixes for cppcheck warnings

Nathalie Furmento 6 年之前
父節點
當前提交
14dbaa66f7

+ 2 - 2
mpi/examples/user_datatype/my_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2015-2017                                CNRS
+ * Copyright (C) 2015-2017,2019                           CNRS
  * Copyright (C) 2018                                     Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -51,7 +51,7 @@ void _starpu_my_interface_datatype_allocate(MPI_Datatype *mpi_datatype)
 	int blocklengths[2] = {1, 1};
 	MPI_Aint displacements[2];
 	MPI_Datatype types[2] = {MPI_INT, MPI_CHAR};
-	struct starpu_my_interface *myinterface = NULL;
+	struct starpu_my_interface *myinterface;
 	myinterface = malloc(sizeof(struct starpu_my_interface));
 
 	MPI_Address(myinterface, displacements);

+ 3 - 3
mpi/src/load_balancer/policy/data_movements_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2016                                     Inria
- * Copyright (C) 2017,2018                                CNRS
+ * Copyright (C) 2017,2018,2019                           CNRS
  * Copyright (C) 2018                                     Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -131,8 +131,8 @@ static starpu_ssize_t data_movements_allocate_data_on_node(void *data_interface,
 {
 	struct data_movements_interface *dm_interface = (struct data_movements_interface *) data_interface;
 
-	int *addr_tags = NULL;
-	int *addr_ranks = NULL;
+	int *addr_tags;
+	int *addr_ranks;
 	starpu_ssize_t requested_memory = dm_interface->size * sizeof(int);
 
 	addr_tags = (int*) starpu_malloc_on_node(node, requested_memory);

+ 1 - 1
mpi/src/load_balancer/policy/load_heat_propagation.c

@@ -570,7 +570,7 @@ static int deinit_heat()
 		int *ranks = data_movements_get_ranks_table(data_movements_handles[my_rank]);
 
 		int n = 0;
-		struct moved_data_entry *md, *tmp;
+		struct moved_data_entry *md=NULL, *tmp=NULL;
 		HASH_ITER(hh, mdh, md, tmp)
 		{
 			tags[n] = starpu_mpi_data_get_tag(md->handle);

+ 3 - 3
mpi/src/mpi/starpu_mpi_early_data.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2017,2019                           CNRS
  * Copyright (C) 2009-2014,2017                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -46,7 +46,7 @@ void _starpu_mpi_early_data_check_termination(void)
 {
 	if (_starpu_mpi_early_data_handle_hashmap_count != 0)
 	{
-		struct _starpu_mpi_early_data_handle_hashlist *current, *tmp;
+		struct _starpu_mpi_early_data_handle_hashlist *current=NULL, *tmp=NULL;
 		HASH_ITER(hh, _starpu_mpi_early_data_handle_hashmap, current, tmp)
 		{
 			_STARPU_MSG("Unexpected message with comm %ld source %d tag %ld\n", (long int)current->node_tag.comm, current->node_tag.rank, current->node_tag.data_tag);
@@ -57,7 +57,7 @@ void _starpu_mpi_early_data_check_termination(void)
 
 void _starpu_mpi_early_data_shutdown(void)
 {
-	struct _starpu_mpi_early_data_handle_hashlist *current, *tmp;
+	struct _starpu_mpi_early_data_handle_hashlist *current=NULL, *tmp=NULL;
 	HASH_ITER(hh, _starpu_mpi_early_data_handle_hashmap, current, tmp)
 	{
 		STARPU_ASSERT(_starpu_mpi_early_data_handle_list_empty(&current->list));

+ 2 - 2
mpi/src/mpi/starpu_mpi_early_request.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2017,2019                           CNRS
  * Copyright (C) 2009-2014,2016,2017                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@ void _starpu_mpi_early_request_init()
 
 void _starpu_mpi_early_request_shutdown()
 {
-	struct _starpu_mpi_early_request_hashlist *entry, *tmp;
+	struct _starpu_mpi_early_request_hashlist *entry=NULL, *tmp=NULL;
 	HASH_ITER(hh, _starpu_mpi_early_request_hash, entry, tmp)
 	{
 		STARPU_ASSERT(_starpu_mpi_req_list_empty(&entry->list));

+ 2 - 2
mpi/src/mpi/starpu_mpi_mpi.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2018                                CNRS
+ * Copyright (C) 2010-2019                                CNRS
  * Copyright (C) 2009-2018                                Université de Bordeaux
  * Copyright (C) 2012,2013,2016,2017                      Inria
  * Copyright (C) 2017                                     Guillaume Beauchamp
@@ -1055,7 +1055,7 @@ static void _starpu_mpi_receive_early_data(struct _starpu_mpi_envelope *envelope
 	struct _starpu_mpi_early_data_handle* early_data_handle = _starpu_mpi_early_data_create(envelope, status.MPI_SOURCE, comm);
 	_starpu_mpi_early_data_add(early_data_handle);
 
-	starpu_data_handle_t data_handle = NULL;
+	starpu_data_handle_t data_handle;
 	STARPU_PTHREAD_MUTEX_UNLOCK(&progress_mutex);
 	data_handle = _starpu_mpi_tag_get_data_handle_from_tag(envelope->data_tag);
 	STARPU_PTHREAD_MUTEX_LOCK(&progress_mutex);

+ 2 - 2
mpi/src/mpi/starpu_mpi_sync_data.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2015-2017                                CNRS
+ * Copyright (C) 2015-2017,2019                           CNRS
  * Copyright (C) 2015                                     Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@ void _starpu_mpi_sync_data_init(void)
 
 void _starpu_mpi_sync_data_shutdown(void)
 {
-	struct _starpu_mpi_sync_data_handle_hashlist *current, *tmp;
+	struct _starpu_mpi_sync_data_handle_hashlist *current=NULL, *tmp=NULL;
 	HASH_ITER(hh, _starpu_mpi_sync_data_handle_hashmap, current, tmp)
 	{
 		STARPU_ASSERT(_starpu_mpi_req_list_empty(&current->list));

+ 2 - 2
mpi/src/mpi/starpu_mpi_tag.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011-2018                                CNRS
+ * Copyright (C) 2011-2019                                CNRS
  * Copyright (C) 2011-2015,2017,2018                      Université de Bordeaux
  * Copyright (C) 2014                                     Inria
  *
@@ -44,7 +44,7 @@ void _starpu_mpi_tag_init(void)
 
 void _starpu_mpi_tag_shutdown(void)
 {
-     	struct handle_tag_entry *tag_entry, *tag_tmp;
+     	struct handle_tag_entry *tag_entry=NULL, *tag_tmp=NULL;
 
 	_starpu_spin_destroy(&registered_tag_handles_lock);
 

+ 2 - 2
src/core/dependencies/data_concurrency.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2013,2015-2017                           Inria
  * Copyright (C) 2009-2015,2017,2018                      Université de Bordeaux
- * Copyright (C) 2010-2013,2015,2017,2018                 CNRS
+ * Copyright (C) 2010-2013,2015,2017,2018,2019            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
@@ -152,7 +152,7 @@ static unsigned _starpu_attempt_to_submit_data_request(unsigned request_from_cod
 
 	/* If we are currently performing a reduction, we freeze any request
 	 * that is not explicitely a reduction task. */
-	unsigned is_a_reduction_task = (request_from_codelet && j->reduction_task);
+	unsigned is_a_reduction_task = (request_from_codelet && j && j->reduction_task);
 
 	if (pending_reduction && !is_a_reduction_task)
 		frozen = 1;

+ 2 - 2
src/core/dependencies/tags.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2008-2014,2016-2018                      Université de Bordeaux
  * Copyright (C) 2011,2012,2016                           Inria
- * Copyright (C) 2010-2013,2015-2017                      CNRS
+ * Copyright (C) 2010-2013,2015-2017,2019                 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
@@ -163,7 +163,7 @@ void _starpu_tag_clear(void)
 	 * the global rwlock. This contradicts the lock order of
 	 * starpu_tag_wait_array. Should not be a problem in practice since
 	 * _starpu_tag_clear is called at shutdown only. */
-	struct _starpu_tag_table *entry, *tmp;
+	struct _starpu_tag_table *entry=NULL, *tmp=NULL;
 
 	HASH_ITER(hh, tag_htbl, entry, tmp)
 	{

+ 2 - 3
src/core/perfmodel/multiple_regression.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2016,2017                                Inria
  * Copyright (C) 2018                                     Umeà University
- * Copyright (C) 2010,2011,2016,2017                      CNRS
+ * Copyright (C) 2010,2011,2016,2017,2019                 CNRS
  * Copyright (C) 2009-2011,2015-2018                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -70,8 +70,7 @@ static void load_old_calibration(double *mx, double *my, unsigned nparameters, c
 	char *line;
 	int i=0;
 
-	FILE *f=NULL;
-	f = fopen(filepath, "a+");
+	FILE *f = fopen(filepath, "a+");
 	STARPU_ASSERT_MSG(f, "Could not load performance model from file %s\n", filepath);
 
 	line = fgets(buffer,sizeof(buffer),f);//skipping first line

+ 2 - 2
src/core/perfmodel/perfmodel_history.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011-2014,2016,2017                      Inria
  * Copyright (C) 2008-2018                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2017, 2019                          CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
  *
@@ -1113,7 +1113,7 @@ void _starpu_deinitialize_performance_model(struct starpu_perfmodel *model)
 					if (archmodel->history)
 					{
 						struct starpu_perfmodel_history_list *list;
-						struct starpu_perfmodel_history_table *entry, *tmp;
+						struct starpu_perfmodel_history_table *entry=NULL, *tmp=NULL;
 
 						HASH_ITER(hh, archmodel->history, entry, tmp)
 						{

+ 3 - 3
src/core/sched_ctx.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011-2018                                Inria
  * Copyright (C) 2017                                     Arthur Chevalier
- * Copyright (C) 2012-2018                                CNRS
+ * Copyright (C) 2012-2019                                CNRS
  * Copyright (C) 2012-2018                                Université de Bordeaux
  * Copyright (C) 2016                                     Uppsala University
  *
@@ -793,7 +793,7 @@ unsigned starpu_sched_ctx_create(int *workerids, int nworkers, const char *sched
 		}
 	}
 
-	struct _starpu_sched_ctx *sched_ctx = NULL;
+	struct _starpu_sched_ctx *sched_ctx;
 	sched_ctx = _starpu_create_sched_ctx(sched_policy, workerids, nworkers, 0, sched_ctx_name, min_prio_set, min_prio, max_prio_set, max_prio, awake_workers, init_sched, user_data, nsub_ctxs, sub_ctxs, nsms);
 	sched_ctx->hierarchy_level = hierarchy_level;
 	sched_ctx->nesting_sched_ctx = nesting_sched_ctx;
@@ -923,7 +923,7 @@ int fstarpu_sched_ctx_create(int *workerids, int nworkers, const char *sched_ctx
 		}
 	}
 
-	struct _starpu_sched_ctx *sched_ctx = NULL;
+	struct _starpu_sched_ctx *sched_ctx;
 	sched_ctx = _starpu_create_sched_ctx(sched_policy, workerids, nworkers, 0, sched_ctx_name, min_prio_set, min_prio, max_prio_set, max_prio, awake_workers, init_sched, user_data, nsub_ctxs, sub_ctxs, nsms);
 	sched_ctx->hierarchy_level = hierarchy_level;
 	sched_ctx->nesting_sched_ctx = nesting_sched_ctx;

+ 4 - 4
src/core/sched_ctx_list.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011,2013,2015,2017                      Inria
- * Copyright (C) 2016,2017                                CNRS
+ * Copyright (C) 2016,2017,2019                           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
@@ -148,7 +148,7 @@ void _starpu_sched_ctx_elt_remove(struct _starpu_sched_ctx_list *list,
 int _starpu_sched_ctx_elt_exists(struct _starpu_sched_ctx_list *list,
 				 unsigned sched_ctx)
 {
-	struct _starpu_sched_ctx_elt *e = NULL;
+	struct _starpu_sched_ctx_elt *e;
 	e = _starpu_sched_ctx_elt_find(list, sched_ctx);
 	return (e == NULL) ? 0 : 1;
 }
@@ -156,7 +156,7 @@ int _starpu_sched_ctx_elt_exists(struct _starpu_sched_ctx_list *list,
 int _starpu_sched_ctx_elt_get_priority(struct _starpu_sched_ctx_list *list,
 				       unsigned sched_ctx)
 {
-	struct _starpu_sched_ctx_elt *e = NULL;
+	struct _starpu_sched_ctx_elt *e;
 	e = _starpu_sched_ctx_elt_find(list, sched_ctx);
 	return (e == NULL) ? 0 : e->parent->priority;
 }
@@ -300,7 +300,7 @@ int _starpu_sched_ctx_list_move(struct _starpu_sched_ctx_list **list,
 int _starpu_sched_ctx_list_exists(struct _starpu_sched_ctx_list *list,
 					   unsigned prio)
 {
-	struct _starpu_sched_ctx_list *l = NULL;
+	struct _starpu_sched_ctx_list *l;
 	l = _starpu_sched_ctx_list_find(list, prio);
 	return ((l == NULL && list->priority == prio) || l != NULL) ? 1 : 0;
 }

+ 2 - 2
src/core/sched_policy.c

@@ -1066,7 +1066,7 @@ void _starpu_sched_pre_exec_hook(struct starpu_task *task)
 		while (_starpu_sched_ctx_list_iterator_has_next(&list_it))
 		{
 			struct _starpu_sched_ctx *other_sched_ctx;
-			struct _starpu_sched_ctx_elt *e = NULL;
+			struct _starpu_sched_ctx_elt *e;
 
 			e = _starpu_sched_ctx_list_iterator_get_next(&list_it);
 			other_sched_ctx = _starpu_get_sched_ctx_struct(e->sched_ctx);
@@ -1104,7 +1104,7 @@ void _starpu_sched_post_exec_hook(struct starpu_task *task)
 		while (_starpu_sched_ctx_list_iterator_has_next(&list_it))
 		{
 			struct _starpu_sched_ctx *other_sched_ctx;
-			struct _starpu_sched_ctx_elt *e = NULL;
+			struct _starpu_sched_ctx_elt *e;
 
 			e = _starpu_sched_ctx_list_iterator_get_next(&list_it);
 			other_sched_ctx = _starpu_get_sched_ctx_struct(e->sched_ctx);

+ 2 - 2
src/core/topology.c

@@ -570,7 +570,7 @@ static void _starpu_initialize_workers_opencl_gpuid(struct _starpu_machine_confi
                                 nb ++;
                         }
                 }
-		struct handle_entry *entry, *tempo;
+		struct handle_entry *entry=NULL, *tempo=NULL;
 		HASH_ITER(hh, devices_already_used, entry, tempo)
 		{
 			HASH_DEL(devices_already_used, entry);
@@ -1959,7 +1959,7 @@ void _starpu_destroy_machine_config(struct _starpu_machine_config *config)
 
 	topology_is_initialized = 0;
 #ifdef STARPU_USE_CUDA
-	struct handle_entry *entry, *tmp;
+	struct handle_entry *entry=NULL, *tmp=NULL;
 	HASH_ITER(hh, devices_using_cuda, entry, tmp)
 	{
 		HASH_DEL(devices_using_cuda, entry);

+ 4 - 4
src/datawizard/interfaces/coo_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2017                                Inria
- * Copyright (C) 2012-2015,2017                           CNRS
+ * Copyright (C) 2012-2015,2017,2019                      CNRS
  * Copyright (C) 2012-2018                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -103,9 +103,9 @@ register_coo_handle(starpu_data_handle_t handle, unsigned home_node,
 static starpu_ssize_t
 allocate_coo_buffer_on_node(void *data_interface, unsigned dst_node)
 {
-	uint32_t *addr_columns = NULL;
-	uint32_t *addr_rows = NULL;
-	uintptr_t addr_values = 0;
+	uint32_t *addr_columns;
+	uint32_t *addr_rows;
+	uintptr_t addr_values;
 
 	struct starpu_coo_interface *coo_interface =
 		(struct starpu_coo_interface *) data_interface;

+ 4 - 4
src/datawizard/interfaces/data_interface.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011-2017                                Inria
  * Copyright (C) 2009-2019                                Université de Bordeaux
- * Copyright (C) 2010-2018                                CNRS
+ * Copyright (C) 2010-2019                                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
@@ -60,7 +60,7 @@ void _starpu_data_interface_init(void)
 
 void _starpu_data_interface_shutdown()
 {
-	struct handle_entry *entry, *tmp;
+	struct handle_entry *entry=NULL, *tmp=NULL;
 
 	if (registered_handles)
 	{
@@ -87,7 +87,7 @@ void _starpu_data_interface_shutdown()
 void _starpu_omp_unregister_region_handles(struct starpu_omp_region *region)
 {
 	_starpu_spin_lock(&region->registered_handles_lock);
-	struct handle_entry *entry, *tmp;
+	struct handle_entry *entry=NULL, *tmp=NULL;
 	HASH_ITER(hh, (region->registered_handles), entry, tmp)
 	{
 		entry->handle->removed_from_context_hash = 1;
@@ -100,7 +100,7 @@ void _starpu_omp_unregister_region_handles(struct starpu_omp_region *region)
 
 void _starpu_omp_unregister_task_handles(struct starpu_omp_task *task)
 {
-	struct handle_entry *entry, *tmp;
+	struct handle_entry *entry=NULL, *tmp=NULL;
 	HASH_ITER(hh, task->registered_handles, entry, tmp)
 	{
 		entry->handle->removed_from_context_hash = 1;

+ 3 - 3
src/datawizard/memalloc.c

@@ -3,7 +3,7 @@
  * Copyright (C) 2011-2013,2016,2017                      Inria
  * Copyright (C) 2008-2019                                Université de Bordeaux
  * Copyright (C) 2018                                     Federal University of Rio Grande do Sul (UFRGS)
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2017,2019                           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
@@ -152,7 +152,7 @@ void _starpu_deinit_mem_chunk_lists(void)
 	unsigned i;
 	for (i = 0; i < STARPU_MAXNODES; i++)
 	{
-		struct mc_cache_entry *entry, *tmp;
+		struct mc_cache_entry *entry=NULL, *tmp=NULL;
 		STARPU_ASSERT(mc_nb[i] == 0);
 		STARPU_ASSERT(mc_clean_nb[i] == 0);
 		STARPU_ASSERT(mc_dirty_head[i] == NULL);
@@ -855,7 +855,7 @@ restart:
 static size_t flush_memchunk_cache(unsigned node, size_t reclaim)
 {
 	struct _starpu_mem_chunk *mc;
-	struct mc_cache_entry *entry, *tmp;
+	struct mc_cache_entry *entry=NULL, *tmp=NULL;
 
 	size_t freed = 0;
 

+ 2 - 2
src/debug/traces/anim.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2016,2017                                CNRS
+ * Copyright (C) 2016,2017,2019                           CNRS
  * Copyright (C) 2015                                     Université de Bordeaux
  * Copyright (C) 2015                                     Anthony Simonet
  *
@@ -46,7 +46,7 @@ static unsigned nflowing;
 
 static struct component *fxt_component_root(void)
 {
-	struct component *comp, *tmp;
+	struct component *comp=NULL, *tmp=NULL;
 	HASH_ITER(hh, components, comp, tmp)
 	{
 		while (comp->parent)

+ 3 - 4
src/debug/traces/starpu_fxt.c

@@ -4078,7 +4078,7 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 	}
 
 	{
-		struct data_info *data, *tmp;
+		struct data_info *data=NULL, *tmp=NULL;
 		HASH_ITER(hh, data_info, data, tmp)
 		{
 			data_dump(data);
@@ -4086,7 +4086,7 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 	}
 
 	{
-		struct task_info *task, *tmp;
+		struct task_info *task=NULL, *tmp=NULL;
 		HASH_ITER(hh, tasks_info, task, tmp)
 		{
 			task_dump(task, options);
@@ -4627,8 +4627,7 @@ void starpu_fxt_write_data_trace(char *filename_in)
 		exit(-1);
 	}
 
-	struct starpu_data_trace_kernel *kernel, *tmp;
-
+	struct starpu_data_trace_kernel *kernel=NULL, *tmp=NULL;
 	HASH_ITER(hh, kernels, kernel, tmp)
 	{
 		if(fclose(kernel->file))

+ 2 - 2
src/drivers/mic/driver_mic_source.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2016,2017                           Inria
- * Copyright (C) 2013,2015-2017                           CNRS
+ * Copyright (C) 2013,2015-2017,2019                      CNRS
  * Copyright (C) 2013-2017                                Université de Bordeaux
  * Copyright (C) 2013                                     Thibaut Lambert
  *
@@ -106,7 +106,7 @@ static void _starpu_mic_src_free_kernel(void *kernel)
 
 void _starpu_mic_clear_kernels(void)
 {
-	struct _starpu_mic_kernel *kernel, *tmp;
+	struct _starpu_mic_kernel *kernel=NULL, *tmp=NULL;
 	HASH_ITER(hh, kernels, kernel, tmp)
 	{
 		HASH_DEL(kernels, kernel);

+ 15 - 15
src/sched_policies/component_composed.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013                                     Inria
- * Copyright (C) 2014-2017                                CNRS
+ * Copyright (C) 2014-2017,2019                           CNRS
  * Copyright (C) 2014-2018                                Université de Bordeaux
  * Copyright (C) 2013                                     Simon Archipoff
  *
@@ -29,13 +29,11 @@ LIST_TYPE(fun_create_component,
 	  void * arg;
 );
 
-
 struct starpu_sched_component_composed_recipe
 {
 	struct fun_create_component_list list;
 };
 
-
 struct starpu_sched_component_composed_recipe * starpu_sched_component_composed_recipe_create(void)
 {
 	struct starpu_sched_component_composed_recipe *recipe;
@@ -53,13 +51,15 @@ void starpu_sched_component_composed_recipe_add(struct starpu_sched_component_co
 	e->arg = arg;
 	fun_create_component_list_push_back(&recipe->list, e);
 }
-struct starpu_sched_component_composed_recipe * starpu_sched_component_composed_recipe_create_singleton(struct starpu_sched_component *(*create_component)(struct starpu_sched_tree *tree, void * arg),
-										      void * arg)
+
+struct starpu_sched_component_composed_recipe *starpu_sched_component_composed_recipe_create_singleton(struct starpu_sched_component *(*create_component)(struct starpu_sched_tree *tree, void * arg),
+													void * arg)
 {
 	struct starpu_sched_component_composed_recipe * r = starpu_sched_component_composed_recipe_create();
 	starpu_sched_component_composed_recipe_add(r, create_component, arg);
 	return r;
 }
+
 void starpu_sched_component_composed_recipe_destroy(struct starpu_sched_component_composed_recipe * recipe)
 {
 	if(!recipe)
@@ -69,8 +69,6 @@ void starpu_sched_component_composed_recipe_destroy(struct starpu_sched_componen
 	free(recipe);
 }
 
-
-
 struct composed_component
 {
 	struct starpu_sched_component *top,*bottom;
@@ -81,9 +79,9 @@ struct composed_component
  */
 struct composed_component create_composed_component(struct starpu_sched_tree *tree, struct starpu_sched_component_composed_recipe * recipe
 #ifdef STARPU_HAVE_HWLOC
-					  ,hwloc_obj_t obj
+						    ,hwloc_obj_t obj
 #endif
-	)
+						    )
 {
 	struct composed_component c;
 	STARPU_ASSERT(recipe);
@@ -119,17 +117,17 @@ struct composed_component create_composed_component(struct starpu_sched_tree *tr
 	return c;
 }
 
-
 static int composed_component_push_task(struct starpu_sched_component * component, struct starpu_task * task)
 {
 	struct composed_component *c = component->data;
 	return starpu_sched_component_push_task(component,c->top,task);
 }
+
 struct starpu_task * composed_component_pull_task(struct starpu_sched_component *component, struct starpu_sched_component * to STARPU_ATTRIBUTE_UNUSED)
 {
 	struct composed_component *c = component->data;
-	struct starpu_task * task = NULL;
-	
+	struct starpu_task *task;
+
 	task = starpu_sched_component_pull_task(c->bottom,component);
 	if(task)
 		return task;
@@ -161,6 +159,7 @@ static void composed_component_add_child(struct starpu_sched_component * compone
 	component->add_child(component, child);
 	c->bottom->add_child(c->bottom, child);
 }
+
 static void composed_component_remove_child(struct starpu_sched_component * component, struct starpu_sched_component * child)
 {
 	struct composed_component * c = component->data;
@@ -207,19 +206,20 @@ void composed_component_deinit_data(struct starpu_sched_component * _component)
 	_component->data = NULL;
 }
 
-struct starpu_sched_component * starpu_sched_component_composed_component_create(struct starpu_sched_tree *tree, struct starpu_sched_component_composed_recipe * recipe)
+struct starpu_sched_component * starpu_sched_component_composed_component_create(struct starpu_sched_tree *tree,
+										 struct starpu_sched_component_composed_recipe * recipe)
 {
 	STARPU_ASSERT(!fun_create_component_list_empty(&recipe->list));
 	struct fun_create_component_list * l = &recipe->list;
 	if(l->_head == l->_tail)
 		return l->_head->create_component(tree, l->_head->arg);
-	struct starpu_sched_component * component = starpu_sched_component_create(tree, "composed");
 
+	struct starpu_sched_component * component = starpu_sched_component_create(tree, "composed");
 	struct composed_component *c;
 	_STARPU_MALLOC(c, sizeof(struct composed_component));
 	*c = create_composed_component(tree, recipe
 #ifdef STARPU_HAVE_HWLOC
-				  ,component->obj
+				       ,component->obj
 #endif
 );
 	c->bottom->nchildren = component->nchildren;

+ 3 - 3
src/sched_policies/parallel_eager.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2015,2017,2018                 Inria
- * Copyright (C) 2011-2014,2016-2018                      CNRS
+ * Copyright (C) 2011-2014,2016-2019                      CNRS
  * Copyright (C) 2011-2016,2018                           Université de Bordeaux
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -249,7 +249,7 @@ static struct starpu_task *pop_task_peager_policy(unsigned sched_ctx_id)
 	/* If this is not a CPU or a MIC, then the worker simply grabs tasks from the fifo */
 	if (starpu_worker_get_type(workerid) != STARPU_CPU_WORKER && starpu_worker_get_type(workerid) != STARPU_MIC_WORKER)
 	{
-		struct starpu_task *task = NULL;
+		struct starpu_task *task;
 		starpu_worker_relax_on();
 		STARPU_PTHREAD_MUTEX_LOCK(&data->policy_mutex);
 		starpu_worker_relax_off();
@@ -259,7 +259,7 @@ static struct starpu_task *pop_task_peager_policy(unsigned sched_ctx_id)
 		return task;
 	}
 
-	struct starpu_task *task = NULL;
+	struct starpu_task *task;
 	int slave_task = 0;
 	starpu_worker_relax_on();
 	STARPU_PTHREAD_MUTEX_LOCK(&data->policy_mutex);

+ 4 - 4
src/top/starpu_top_message_queue.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011-2013,2016,2017                      CNRS
+ * Copyright (C) 2011-2013,2016,2017,2019                 CNRS
  * Copyright (C) 2015                                     Université de Bordeaux
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2011                                     William Braik, Yann Courtois, Jean-Marie Couteyen, Anthony
@@ -29,7 +29,7 @@ struct _starpu_top_message_queue*  _starpu_top_mt = NULL;
 
 /* Will always return the pointer to starpu_top_message_queue */
 struct _starpu_top_message_queue* _starpu_top_message_add(struct _starpu_top_message_queue* s,
-							char* msg)
+							  char* msg)
 {
 	if( NULL == s )
 	{
@@ -80,8 +80,8 @@ char* _starpu_top_message_remove(struct _starpu_top_message_queue* s)
 	}
 
 	sem_wait(&(s->semaphore));
-	struct _starpu_top_message_queue_item* h = NULL;
-	struct _starpu_top_message_queue_item* p = NULL;
+	struct _starpu_top_message_queue_item *h;
+	struct _starpu_top_message_queue_item *p;
 
 	STARPU_PTHREAD_MUTEX_LOCK(&(s->mutex));
 	h = s->head;

+ 3 - 3
src/util/openmp_runtime_support.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2014-2018                                Inria
- * Copyright (C) 2014-2017                                CNRS
+ * Copyright (C) 2014-2017,2019                           CNRS
  * Copyright (C) 2015,2017                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -981,7 +981,7 @@ void starpu_omp_shutdown(void)
         _global_state.default_arbiter = NULL;
 	_starpu_spin_lock(&_global_state.named_criticals_lock);
 	{
-		struct starpu_omp_critical *critical, *tmp;
+		struct starpu_omp_critical *critical=NULL, *tmp=NULL;
 		HASH_ITER(hh, _global_state.named_criticals, critical, tmp)
 		{
 			STARPU_ASSERT(critical != NULL);
@@ -994,7 +994,7 @@ void starpu_omp_shutdown(void)
 	_starpu_spin_destroy(&_global_state.named_criticals_lock);
 	_starpu_spin_lock(&_global_state.hash_workers_lock);
 	{
-		struct starpu_omp_thread *thread, *tmp;
+		struct starpu_omp_thread *thread=NULL, *tmp=NULL;
 		HASH_ITER(hh, _global_state.hash_workers, thread, tmp)
 		{
 			STARPU_ASSERT(thread != NULL);

+ 2 - 0
tools/dev/cppcheck/suppressions.txt

@@ -80,6 +80,8 @@ unreadVariable:gcc-plugin/tests/*
 //cppcheck complaints it does not find duplicate expressions
 //duplicateExpression:gcc-plugin/src/*
 negativeIndex:gcc-plugin/src/*
+uninitvar:gcc-plugin/src/warn-unregistered.c:126
+uninitvar:gcc-plugin/src/warn-unregistered.c:126
 
 pointerSize:socl/src/cl_getcontextinfo.c:33
 unreadVariable:socl/src/gc.c:193