瀏覽代碼

fix missing casts, avoid using -Werror

Samuel Thibault 7 年之前
父節點
當前提交
3a76e44aad
共有 2 個文件被更改,包括 14 次插入14 次删除
  1. 3 3
      tests/main/combined_workers/bfs/Makefile
  2. 11 11
      tests/main/combined_workers/bfs/bfs.cpp

+ 3 - 3
tests/main/combined_workers/bfs/Makefile

@@ -2,7 +2,7 @@
 #
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2014 Université de Bordeaux
+# Copyright (C) 2014, 2017 Université de Bordeaux
 # Copyright (C) 2012 Inria
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -16,8 +16,8 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-CFLAGS += $(shell pkg-config --cflags starpu-1.0) -g -O0 -Wall -Werror
-LDFLAGS += $(shell pkg-config --libs starpu-1.0) -g -O0 -Wall -Werror
+CFLAGS += $(shell pkg-config --cflags starpu-1.0) -g -O0 -Wall
+LDFLAGS += $(shell pkg-config --libs starpu-1.0) -g -O0 -Wall
  
 all: bfs
  

+ 11 - 11
tests/main/combined_workers/bfs/bfs.cpp

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2014 Université de Bordeaux
+ * Copyright (C) 2014, 2017 Université de Bordeaux
  * Copyright (C) 2012 Inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -55,10 +55,10 @@ void read_file(char *input_f, unsigned int *nb_nodes, unsigned int *nb_edges,
 	fscanf(fp, "%u", nb_nodes);
 
 	// allocate host memory
-	*origin_graph_nodes = malloc(sizeof(Node) * (*nb_nodes));
-	*origin_graph_mask = malloc(sizeof(bool) * (*nb_nodes));
-	*origin_updating_graph_mask = malloc(sizeof(bool) * (*nb_nodes));
-	*origin_graph_visited = malloc(sizeof(bool) * (*nb_nodes));
+	*origin_graph_nodes = (Node *) malloc(sizeof(Node) * (*nb_nodes));
+	*origin_graph_mask = (bool *) malloc(sizeof(bool) * (*nb_nodes));
+	*origin_updating_graph_mask = (bool *) malloc(sizeof(bool) * (*nb_nodes));
+	*origin_graph_visited = (bool *) malloc(sizeof(bool) * (*nb_nodes));
 
 	int start, edgeno;
 	// initalize the memory
@@ -158,12 +158,12 @@ int main( int argc, char** argv)
 		  &origin_graph_mask, &origin_updating_graph_mask,
 		  &origin_graph_visited, &origin_graph_edges, &origin_cost);
 
-	graph_nodes = calloc(nb_nodes, sizeof(Node));
-	graph_mask = calloc(nb_nodes, sizeof(bool));
-	updating_graph_mask = calloc(nb_nodes, sizeof(bool));
-	graph_visited = calloc(nb_nodes, sizeof(bool));
-	graph_edges = calloc(nb_edges, sizeof(int));
-	cost = calloc(nb_nodes, sizeof(int));
+	graph_nodes = (Node *) calloc(nb_nodes, sizeof(Node));
+	graph_mask = (bool *) calloc(nb_nodes, sizeof(bool));
+	updating_graph_mask = (bool *) calloc(nb_nodes, sizeof(bool));
+	graph_visited = (bool *) calloc(nb_nodes, sizeof(bool));
+	graph_edges = (int *) calloc(nb_edges, sizeof(int));
+	cost = (int *) calloc(nb_nodes, sizeof(int));
 
 	memcpy(graph_nodes, origin_graph_nodes, nb_nodes*sizeof(Node));
 	memcpy(graph_edges, origin_graph_edges, nb_edges*sizeof(int));