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
Last Changes of CPP version of Msg
[simgrid.git]
/
testsuite
/
xbt
/
graphxml_usage.c
diff --git
a/testsuite/xbt/graphxml_usage.c
b/testsuite/xbt/graphxml_usage.c
index
89255a7
..
f0e63f9
100644
(file)
--- a/
testsuite/xbt/graphxml_usage.c
+++ b/
testsuite/xbt/graphxml_usage.c
@@
-6,6
+6,15
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#ifdef __BORLANDC__
+ #pragma hdrstop
+ #endif
+
+#include <stdio.h>
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
#include "xbt/module.h"
#include "xbt/sysdep.h"
#include "xbt/module.h"
#include "xbt/sysdep.h"
@@
-40,7
+49,7
@@
void test(char *graph_file)
int test_shortest_paths = 1;
int test_topo_sort = 1;
int test_shortest_paths = 1;
int test_topo_sort = 1;
-
int
i, j;
+
unsigned long
i, j;
unsigned long n;
xbt_dynar_t edges = NULL;
unsigned long n;
xbt_dynar_t edges = NULL;
@@
-67,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]);
@@
-85,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])
@@
-106,7
+115,7
@@
void test(char *graph_file)
sorted = xbt_graph_topo_sort(graph);
for (i = 0; i < n; i++) {
if (sorted[i]) {
sorted = xbt_graph_topo_sort(graph);
for (i = 0; i < n; i++) {
if (sorted[i]) {
- INFO3("sorted[%
d
] = %s (%p)", i, node_name(sorted[i]), sorted[i]);
+ INFO3("sorted[%
lu
] = %s (%p)", i, node_name(sorted[i]), sorted[i]);
}
}
free(sorted);
}
}
free(sorted);
@@
-147,6
+156,10
@@
void test(char *graph_file)
xbt_graph_free_graph(graph, free_label, NULL, NULL);
}
xbt_graph_free_graph(graph, free_label, NULL, NULL);
}
+#ifdef __BORLANDC__
+#pragma argsused
+#endif
+
int main(int argc, char **argv) {
xbt_init(&argc, argv);
if (argc == 1) {
int main(int argc, char **argv) {
xbt_init(&argc, argv);
if (argc == 1) {