A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usage of xbt_new0 instead calloc
[simgrid.git]
/
testsuite
/
xbt
/
graphxml_usage.c
diff --git
a/testsuite/xbt/graphxml_usage.c
b/testsuite/xbt/graphxml_usage.c
index
3930ca7
..
f0e63f9
100644
(file)
--- a/
testsuite/xbt/graphxml_usage.c
+++ b/
testsuite/xbt/graphxml_usage.c
@@
-76,7
+76,7
@@
void test(char *graph_file)
INFO0("---- Dumping Edge lengths ----");
adj = xbt_graph_get_length_matrix(graph);
INFO0("---- Dumping Edge lengths ----");
adj = xbt_graph_get_length_matrix(graph);
- buf =
calloc(n * 20, sizeof(char)
);
+ buf =
xbt_new0(char,n * 20
);
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]);
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]);
@@
-94,7
+94,7
@@
void test(char *graph_file)
INFO0("---- Testing Shortest Paths ----");
route = xbt_graph_shortest_paths(graph);
INFO0("---- Testing Shortest Paths ----");
route = xbt_graph_shortest_paths(graph);
- buf =
calloc(n * 40, sizeof(char)
);
+ buf =
xbt_new0(char,n * 40
);
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (route[i * n + j])
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (route[i * n + j])