Bläddra i källkod

minor fixes (warnings detected by sonarqube)

Nathalie Furmento 7 år sedan
förälder
incheckning
68abc1a1f9

+ 3 - 2
socl/src/cl_createprogramwithsource.c

@@ -1,8 +1,8 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012                                Inria
- * Copyright (C) 2012,2016-2017                           CNRS
- * Copyright (C) 2010-2011,2013, 2018                           Université de Bordeaux
+ * Copyright (C) 2012,2016-2018                           CNRS
+ * Copyright (C) 2010-2011,2013, 2018                     Université de Bordeaux
  *
  * 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
@@ -125,6 +125,7 @@ soclCreateProgramWithSource(cl_context      context,
 	{
 		if (errcode_ret != NULL)
 			*errcode_ret = CL_OUT_OF_HOST_MEMORY;
+		free(p->cl_programs);
 		return NULL;
 	}
 	data->count = count;

+ 2 - 4
src/core/sched_ctx.c

@@ -2525,12 +2525,11 @@ void* starpu_sched_ctx_exec_parallel_code(void* (*func)(void*), void* param, uns
 
 static void _starpu_sched_ctx_update_parallel_workers_with(unsigned sched_ctx_id)
 {
-    struct _starpu_sched_ctx * sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
+	struct _starpu_sched_ctx * sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 
 	if(sched_ctx->sched_policy)
 		return;
 
-
 	_starpu_sched_ctx_put_new_master(sched_ctx_id);
 
 	if(!sched_ctx->awake_workers)
@@ -2541,12 +2540,11 @@ static void _starpu_sched_ctx_update_parallel_workers_with(unsigned sched_ctx_id
 
 static void _starpu_sched_ctx_update_parallel_workers_without(unsigned sched_ctx_id)
 {
-    struct _starpu_sched_ctx * sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
+	struct _starpu_sched_ctx * sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 
 	if(sched_ctx->sched_policy)
 		return;
 
-
 	_starpu_sched_ctx_put_new_master(sched_ctx_id);
 
 	if(!sched_ctx->awake_workers)

+ 2 - 2
src/datawizard/memory_nodes.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011-2013,2017                           Inria
  * Copyright (C) 2009-2017                                Université de Bordeaux
- * Copyright (C) 2010-2015,2017                           CNRS
+ * Copyright (C) 2010-2015,2017,2018                      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
@@ -114,7 +114,7 @@ unsigned _starpu_memory_node_register(enum starpu_node_kind kind, int devid)
 	unsigned node;
 	/* ATOMIC_ADD returns the new value ... */
 	node = STARPU_ATOMIC_ADD(&_starpu_descr.nnodes, 1) - 1;
-	STARPU_ASSERT_MSG(node < STARPU_MAXNODES,"Too many nodes (%u) for maximum %u. Use configure option --enable-maxnodes=xxx to update the maximum number of nodes.", node, STARPU_MAXNODES);
+	STARPU_ASSERT_MSG(node < STARPU_MAXNODES,"Too many nodes (%u) for maximum %d. Use configure option --enable-maxnodes=xxx to update the maximum number of nodes.", node, STARPU_MAXNODES);
 
 	_starpu_descr.nodes[node] = kind;
 	_STARPU_TRACE_NEW_MEM_NODE(node);

+ 2 - 2
tests/datawizard/manual_reduction.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013,2017                           Inria
  * Copyright (C) 2010-2016                                Université de Bordeaux
- * Copyright (C) 2011-2013,2015-2017                      CNRS
+ * Copyright (C) 2011-2013,2015-2018                      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
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
 		ret = EXIT_SUCCESS;
 	else
 	{
-		FPRINTF(stderr, "%u != %u + %u\n", variable, INIT_VALUE, NTASKS);
+		FPRINTF(stderr, "%u != %d + %d\n", variable, INIT_VALUE, NTASKS);
 		ret = EXIT_FAILURE;
 	}
 	STARPU_RETURN(ret);