-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2011, 2013-2014. The SimGrid Team.
if (!xbt_graph_file_to_parse_stack)
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 */
if (!xbt_graph_file_to_parse_stack)
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_parse__switch_to_buffer(xbt_graph_input_buffer);
xbt_graph_parse_lineno = 1;
}
void xbt_graph_parse_close(void)
{
xbt_graph_parse__switch_to_buffer(xbt_graph_input_buffer);
xbt_graph_parse_lineno = 1;
}
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);
- ret = sscanf(string, "%lg", value);
- xbt_assert2((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",