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
cosmetics
[simgrid.git]
/
src
/
xbt
/
graphxml_parse.c
diff --git
a/src/xbt/graphxml_parse.c
b/src/xbt/graphxml_parse.c
index
6985919
..
3edfa48
100644
(file)
--- a/
src/xbt/graphxml_parse.c
+++ b/
src/xbt/graphxml_parse.c
@@
-48,34
+48,34
@@
void xbt_graph_parse_reset_parser(void)
void STag_graphxml_graph(void)
{
void STag_graphxml_graph(void)
{
-
(*STag_graphxml_graph_fun)
();
+
STag_graphxml_graph_fun
();
}
void ETag_graphxml_graph(void)
{
}
void ETag_graphxml_graph(void)
{
-
(*ETag_graphxml_graph_fun)
();
+
ETag_graphxml_graph_fun
();
}
void STag_graphxml_node(void)
{
}
void STag_graphxml_node(void)
{
-
(*STag_graphxml_node_fun)
();
+
STag_graphxml_node_fun
();
}
void ETag_graphxml_node(void)
{
}
void ETag_graphxml_node(void)
{
-
(*ETag_graphxml_node_fun)
();
+
ETag_graphxml_node_fun
();
}
void STag_graphxml_edge(void)
{
}
void STag_graphxml_edge(void)
{
-
(*STag_graphxml_edge_fun)
();
+
STag_graphxml_edge_fun
();
}
void ETag_graphxml_edge(void)
{
}
void ETag_graphxml_edge(void)
{
-
(*ETag_graphxml_edge_fun)
();
+
ETag_graphxml_edge_fun
();
}
}
@@
-83,7
+83,7
@@
void ETag_graphxml_edge(void)
void xbt_graph_parse_open(const char *file)
{
if (!file) {
void xbt_graph_parse_open(const char *file)
{
if (!file) {
- WARN0
+ XBT_WARN
("I hope you know what you're doing... you just gave me a NULL pointer!");
return;
}
("I hope you know what you're doing... you just gave me a NULL pointer!");
return;
}
@@
-94,7
+94,7
@@
void xbt_graph_parse_open(const char *file)
xbt_graph_file_to_parse_stack = xbt_dynar_new(sizeof(FILE *), NULL);
xbt_graph_file_to_parse = fopen(file, "r"); /* FIXME should use something like surf_fopen */
xbt_graph_file_to_parse_stack = xbt_dynar_new(sizeof(FILE *), NULL);
xbt_graph_file_to_parse = fopen(file, "r"); /* FIXME should use something like surf_fopen */
- xbt_assert
1
((xbt_graph_file_to_parse), "Unable to open \"%s\"\n", file);
+ xbt_assert((xbt_graph_file_to_parse), "Unable to open \"%s\"\n", file);
xbt_graph_input_buffer =
xbt_graph_parse__create_buffer(xbt_graph_file_to_parse, 10);
xbt_graph_parse__switch_to_buffer(xbt_graph_input_buffer);
xbt_graph_input_buffer =
xbt_graph_parse__create_buffer(xbt_graph_file_to_parse, 10);
xbt_graph_parse__switch_to_buffer(xbt_graph_input_buffer);
@@
-103,10
+103,8
@@
void xbt_graph_parse_open(const char *file)
void xbt_graph_parse_close(void)
{
void xbt_graph_parse_close(void)
{
- if (xbt_graph_input_buffer_stack)
- xbt_dynar_free(&xbt_graph_input_buffer_stack);
- if (xbt_graph_file_to_parse_stack)
- xbt_dynar_free(&xbt_graph_file_to_parse_stack);
+ xbt_dynar_free(&xbt_graph_input_buffer_stack);
+ xbt_dynar_free(&xbt_graph_file_to_parse_stack);
if (xbt_graph_file_to_parse) {
xbt_graph_parse__delete_buffer(xbt_graph_input_buffer);
if (xbt_graph_file_to_parse) {
xbt_graph_parse__delete_buffer(xbt_graph_input_buffer);
@@
-122,11
+120,13
@@
static int _xbt_graph_parse(void)
int_f_void_t xbt_graph_parse = _xbt_graph_parse;
int_f_void_t xbt_graph_parse = _xbt_graph_parse;
-
void xbt_graph_parse_get_double(double *value,
const char *string)
+
double xbt_graph_parse_get_double(
const char *string)
{
{
- int ret = 0;
+ double result;
+ _XBT_GNUC_UNUSED int ret = 0;
- ret = sscanf(string, "%lg",
value
);
- xbt_assert
2
((ret == 1), "Parse error line %d : %s not a number",
+ ret = sscanf(string, "%lg",
&result
);
+ xbt_assert((ret == 1), "Parse error line %d : %s not a number",
xbt_graph_parse_lineno, string);
xbt_graph_parse_lineno, string);
+ return result;
}
}