]> rtime.felk.cvut.cz Git - ulut.git/commitdiff
uLUt: corrected function scope of hash table next by iterator.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 31 Dec 2009 11:46:05 +0000 (12:46 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 31 Dec 2009 11:46:05 +0000 (12:46 +0100)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
ulut/ul_hashtab.h

index 95ac2b8d5930a7bcf05829e70187579989ab7d4b..1f2a559f3c0f57fe8bd37d27b1ee59530ada069a 100644 (file)
@@ -115,7 +115,6 @@ cust_scope int cust_prefix##_delete_node(cust_table_t *table, gavl_node_t *node)
 cust_scope cust_item_t *cust_prefix##_delete_key(cust_table_t *table, cust_key_t const *key);\
 cust_scope int cust_prefix##_delete(cust_table_t *table, cust_item_t *item);\
 cust_scope int cust_prefix##_resize_table(cust_table_t *table, ul_hashtab_hashval_t newsize);\
-cust_scope void cust_prefix##_next_it(cust_prefix##_it_t *it);\
 cust_scope int cust_prefix##_find_it(cust_table_t *container, cust_key_t const *key, cust_prefix##_it_t *it);\
 cust_scope void cust_prefix##_delete_it(cust_prefix##_it_t *it);\
 \
@@ -144,20 +143,21 @@ cust_prefix##_is_end_it(cust_prefix##_it_t *it)\
 } \
 \
 static inline void \
-cust_prefix##_first_it(cust_table_t *container, cust_prefix##_it_t *it)\
-{\
-  it->container=container;\
-  it->item=NULL;\
-  cust_prefix##_next_it(it);\
-} \
-\
-void cust_prefix##_next_it(cust_prefix##_it_t *it) \
+cust_prefix##_next_it(cust_prefix##_it_t *it) \
 { \
   gavl_node_t *treenode; \
   treenode=ul_hashtab_next_it_primitive(\
     &it->container->cust_table_field, &it->ptreeroot, \
     it->item!=NULL?&it->item->cust_item_node.treenode: NULL); \
   it->item=treenode!=NULL?UL_CONTAINEROF(treenode, cust_item_t, cust_item_node.treenode):NULL;\
+} \
+\
+static inline void \
+cust_prefix##_first_it(cust_table_t *container, cust_prefix##_it_t *it)\
+{\
+  it->container=container;\
+  it->item=NULL;\
+  cust_prefix##_next_it(it);\
 }
 
 #define UL_HASTAB_CUST_NODE_INT_DEC(cust_prefix, cust_table_t, cust_item_t, cust_key_t,\