diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-03 22:05:27 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-03 22:05:27 +0100 |
commit | 2c3450a380342ed1f63314e2d0e732415902484f (patch) | |
tree | 7cc8778f6f2a71a5d4745b6fabace79810c83169 /src/lib/eina_graph_dfs.c | |
parent | 1cdad817aeac33568efebc5656908373330f7b34 (diff) | |
download | eina_graph-2c3450a380342ed1f63314e2d0e732415902484f.zip eina_graph-2c3450a380342ed1f63314e2d0e732415902484f.tar.gz |
add macros CAST_V() and CAST_D() to support Eina_List(data)<->vertex number conversion
Diffstat (limited to 'src/lib/eina_graph_dfs.c')
-rw-r--r-- | src/lib/eina_graph_dfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/eina_graph_dfs.c b/src/lib/eina_graph_dfs.c index 263be74..df272b4 100644 --- a/src/lib/eina_graph_dfs.c +++ b/src/lib/eina_graph_dfs.c @@ -41,12 +41,12 @@ _eina_graph_dfs_swalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, unsigned int v) unsigned int p, w, n, i; p = v; - stack = eina_list_prepend(stack, (void *) v); + stack = eina_list_prepend(stack, CAST_V(v)); while (eina_list_count(stack) > 0) { - w = (unsigned int) eina_list_data_get(stack); - stack = eina_list_remove(stack, (void *) w); + w = CAST_D(eina_list_data_get(stack)); + stack = eina_list_remove(stack, CAST_V(w)); if(_dfs->marked[w]) continue; _dfs->marked[w] = EINA_TRUE; @@ -60,7 +60,7 @@ _eina_graph_dfs_swalk(_Eina_Graph *_g, _Eina_Graph_DFS *_dfs, unsigned int v) w = adjs->data[i]; if (!_dfs->marked[w]) { - stack = eina_list_prepend(stack, (void *) w); + stack = eina_list_prepend(stack, CAST_V(w)); } } } @@ -174,10 +174,10 @@ eina_graph_dfs_path_to(Eina_Graph_DFS *dfs, unsigned int v) while (w != _dfs->s) { - path = eina_list_prepend(path, (void *) w); + path = eina_list_prepend(path, CAST_V(w)); w = _dfs->edge_to[w]; } - path = eina_list_prepend(path, (void *) _dfs->s); + path = eina_list_prepend(path, CAST_V(_dfs->s)); return path; } |