瀏覽代碼

fix minor warnings

Nathalie Furmento 8 年之前
父節點
當前提交
3659ac09f4

+ 3 - 2
examples/ppm_downscaler/yuv_downscaler.c

@@ -112,6 +112,7 @@ static struct starpu_data_filter filter_uv =
 int main(int argc, char **argv)
 {
 	int ret;
+	size_t sret;
 
 	assert(HEIGHT % (2*BLOCK_HEIGHT) == 0);
 	assert(HEIGHT % FACTOR == 0);
@@ -146,8 +147,8 @@ int main(int argc, char **argv)
 	FILE *f_out = fopen(filename_out, "w+");
 	assert(f_out);
 
-	ret = fread(yuv_in_buffer, FRAMESIZE, nframes, f_in);
-	assert(ret == nframes);
+	sret = fread(yuv_in_buffer, FRAMESIZE, nframes, f_in);
+	assert(sret == nframes);
 
 	starpu_data_handle_t *frame_y_handle = (starpu_data_handle_t *)  calloc(nframes, sizeof(starpu_data_handle_t));
 	starpu_data_handle_t *frame_u_handle = (starpu_data_handle_t *)  calloc(nframes, sizeof(starpu_data_handle_t));

+ 4 - 1
examples/sched_ctx/parallel_tasks_reuse_handle.c

@@ -68,6 +68,8 @@ static struct starpu_codelet init_parallel_worker_cl=
 void parallel_task_init_one_context(unsigned * context_id)
 {
 	struct starpu_task * t;
+	int ret;
+
 	t = starpu_task_build(&init_parallel_worker_cl,
 			      STARPU_SCHED_CTX, *context_id,
 			      0);
@@ -78,7 +80,8 @@ void parallel_task_init_one_context(unsigned * context_id)
 	t->prologue_callback_pop_arg=context_id;
 	t->prologue_callback_pop_arg_free=0;
 
-	starpu_task_submit(t);
+	ret = starpu_task_submit(t);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 }
 
 struct context main_context;

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

@@ -149,6 +149,7 @@ static int data_pack_data(starpu_data_handle_t handle, unsigned node, void **ptr
 	(ptr);
 	(count);
 	STARPU_ASSERT_MSG(0, "The data interface has been registered with starpu_mpi_datatype_register(). Calling the pack_data function should not happen\n");
+	return 0;
 }
 
 static int data_unpack_data(starpu_data_handle_t handle, unsigned node, void *ptr, size_t count)
@@ -158,6 +159,7 @@ static int data_unpack_data(starpu_data_handle_t handle, unsigned node, void *pt
 	(ptr);
 	(count);
 	STARPU_ASSERT_MSG(0, "The data interface has been registered with starpu_mpi_datatype_register(). Calling the unpack_data function should not happen\n");
+	return 0;
 }
 
 static starpu_ssize_t data_describe(void *data_interface, char *buf, size_t size)

+ 1 - 1
mpi/src/starpu_mpi_private.h

@@ -41,7 +41,7 @@ void _starpu_mpi_set_debug_level_max(int level);
 #endif
 
 #ifdef STARPU_NO_ASSERT
-#  define STARPU_MPI_ASSERT_MSG(x, msg, ...)	do { } while(0)
+#  define STARPU_MPI_ASSERT_MSG(x, msg, ...)	do { if (0) { (void) (x); }} while(0)
 #else
 #  if defined(__CUDACC__) && defined(STARPU_HAVE_WINDOWS)
 int _starpu_debug_rank;

+ 1 - 1
src/core/perfmodel/perfmodel_bus.c

@@ -2512,8 +2512,8 @@ double starpu_transfer_predict(unsigned src_node, unsigned dst_node, size_t size
 	double bandwidth = bandwidth_matrix[src_node][dst_node];
 	double latency = latency_matrix[src_node][dst_node];
 	struct _starpu_machine_topology *topology = &_starpu_get_machine_config()->topology;
-	int busid = starpu_bus_get_id(src_node, dst_node);
 #if 0
+	int busid = starpu_bus_get_id(src_node, dst_node);
 	int direct = starpu_bus_get_direct(busid);
 #endif
 	float ngpus = topology->ncudagpus+topology->nopenclgpus;

+ 2 - 0
src/core/workers.c

@@ -1698,6 +1698,8 @@ int starpu_worker_get_id(void)
 #undef _starpu_worker_get_id_check
 unsigned _starpu_worker_get_id_check(const char *f, int l)
 {
+	(void) f;
+	(void) l;
 	int id = _starpu_worker_get_id();
 	STARPU_ASSERT_MSG(id>=0, "%s:%d Cannot be called from outside a worker\n", f, l);
 	return id;

+ 2 - 0
src/core/workers.h

@@ -568,6 +568,8 @@ static inline int _starpu_worker_get_id(void)
 /* Similar behaviour to starpu_worker_get_id() but fails when called from outside a worker */
 static inline unsigned __starpu_worker_get_id_check(const char *f, int l)
 {
+	(void) l;
+	(void) f;
 	int id = starpu_worker_get_id();
 	STARPU_ASSERT_MSG(id>=0, "%s:%d Cannot be called from outside a worker\n", f, l);
 	return id;

+ 1 - 0
tests/microbenchs/parallel_independent_heterogeneous_tasks.c

@@ -65,6 +65,7 @@ double cost_function(struct starpu_task *t, struct starpu_perfmodel_arch *a, uns
 		return TIME/TIME_OPENCL_COEFFICIENT * 1000000;
 	}
 	STARPU_ASSERT(0);
+	return 0.0;
 }
 
 static struct starpu_perfmodel perf_model =

+ 1 - 0
tests/microbenchs/parallel_independent_heterogeneous_tasks_data.c

@@ -66,6 +66,7 @@ double cost_function(struct starpu_task *t, struct starpu_perfmodel_arch *a, uns
 		return TIME/TIME_OPENCL_COEFFICIENT * 1000000;
 	}
 	STARPU_ASSERT(0);
+	return 0.0;
 }
 
 static struct starpu_perfmodel perf_model =