xbt_dynar_free(&(node->out));
xbt_dynar_free(&(node->in));
if (node_free_function)
- (*node_free_function) (node->data);
+ node_free_function(node->data);
}
xbt_dynar_foreach(g->edges, cursor, edge) {
if (edge_free_function)
- (*edge_free_function) (edge->data);
+ edge_free_function(edge->data);
}
xbt_dynar_foreach(g->nodes, cursor, node)
free(edge);
xbt_dynar_free(&(g->edges));
if (graph_free_function)
- (*graph_free_function) (g->data);
+ graph_free_function(g->data);
free(g);
xbt_graph_parse_lex_destroy();
return;
}
if ((node_free_function) && (n->data))
- (*node_free_function) (n->data);
+ node_free_function(n->data);
cursor = 0;
xbt_dynar_foreach(g->nodes, cursor, node)
xbt_edge_t edge = NULL;
if ((free_function) && (e->data))
- (*free_function) (e->data);
+ free_function(e->data);
xbt_dynar_foreach(g->edges, cursor, edge) {
if (edge == e) {
else
parsed_graph = xbt_graph_new_graph(0, NULL);
- parsed_nodes = xbt_dict_new();
+ parsed_nodes = xbt_dict_new_homogeneous(NULL);
}
static void __parse_graph_end(void)
if (__parse_node_label_and_data)
node->data = __parse_node_label_and_data(node, A_graphxml_node_label,
A_graphxml_node_data);
- xbt_graph_parse_get_double(&(node->position_x),
- A_graphxml_node_position_x);
- xbt_graph_parse_get_double(&(node->position_y),
- A_graphxml_node_position_y);
+ node->position_x = xbt_graph_parse_get_double(A_graphxml_node_position_x);
+ node->position_y = xbt_graph_parse_get_double(A_graphxml_node_position_y);
xbt_dict_set(parsed_nodes, A_graphxml_node_name, (void *) node, NULL);
}
edge->data = __parse_edge_label_and_data(edge, A_graphxml_edge_label,
A_graphxml_edge_data);
- xbt_graph_parse_get_double(&(edge->length), A_graphxml_edge_length);
+ edge->length = xbt_graph_parse_get_double(A_graphxml_edge_length);
XBT_DEBUG("<edge source=\"%s\" target=\"%s\" length=\"%f\"/>",
(char *) (edge->src)->data,
ETag_graphxml_edge_fun = __parse_edge;
xbt_graph_parse_open(filename);
- int res;
- res = (*xbt_graph_parse) ();
+ _XBT_GNUC_UNUSED int res;
+ res = xbt_graph_parse();
xbt_assert(!res, "Parse error in %s", filename);
xbt_graph_parse_close();
file = fopen (filename, "r");
xbt_assert(file, "Failed to open %s \n", filename);
- xbt_dict_t nodes_dict = xbt_dict_new ();
+ xbt_dict_t nodes_dict = xbt_dict_new_homogeneous(NULL);
xbt_graph_t ret = xbt_graph_new_graph (0, NULL);
//read the number of nodes