diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-05 11:24:35 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-01-05 11:24:35 +0100 |
commit | b9cc34a3cc89992ad211bd6e5d6da61c435f46c7 (patch) | |
tree | b57341bd9e1a8a1254a736c5fd476f130f54dd47 /src/lib/eina_graph_private.h | |
parent | b43b4531002dacecd5127ab3acdcef8373052ef7 (diff) | |
download | eina_graph-b9cc34a3cc89992ad211bd6e5d6da61c435f46c7.zip eina_graph-b9cc34a3cc89992ad211bd6e5d6da61c435f46c7.tar.gz |
use enhanced eina_array for DFS stack
Diffstat (limited to 'src/lib/eina_graph_private.h')
-rw-r--r-- | src/lib/eina_graph_private.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/eina_graph_private.h b/src/lib/eina_graph_private.h index 526e4e4..1c4ea86 100644 --- a/src/lib/eina_graph_private.h +++ b/src/lib/eina_graph_private.h @@ -90,6 +90,25 @@ eina_graph_adjacents_push(_Eina_Graph_Adjacents *adjs, unsigned int v, unsigned return EINA_TRUE; } +static inline Eina_Bool +eina_array_push_uint(Eina_Array *array, unsigned int v) +{ + if (EINA_UNLIKELY((array->count + 1) > array->total)) + if (!eina_array_grow(array)) + return EINA_FALSE; + + array->data[array->count++] = (void*) (uintptr_t) v; + + return EINA_TRUE; +} + +static inline unsigned int +eina_array_top_uint_get(const Eina_Array *array) +{ + return (unsigned int) (uintptr_t) + eina_array_data_get(array,eina_array_count_get(array) - 1 ); +} + /*+ * To cast a vertex number into Eina_List data. */ |