patricia: remove ugly abuse of K&R style function declaration
It left the argument types unspecified in a function pointer, then called it using different numbers of arguments. libratbox r25229
This commit is contained in:
parent
b717a466d0
commit
79c4d759a9
|
@ -26,7 +26,6 @@
|
|||
#endif
|
||||
|
||||
/* typedef unsigned int u_int; */
|
||||
typedef void (*void_fn_t) ();
|
||||
#define rb_prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin)
|
||||
#define MAXLINE 1024
|
||||
#define BIT_TEST(f, b) ((f) & (b))
|
||||
|
@ -79,9 +78,9 @@ rb_patricia_node_t *rb_patricia_lookup(rb_patricia_tree_t * patricia, rb_prefix_
|
|||
|
||||
void rb_patricia_remove(rb_patricia_tree_t * patricia, rb_patricia_node_t * node);
|
||||
rb_patricia_tree_t *rb_new_patricia(int maxbits);
|
||||
void rb_clear_patricia(rb_patricia_tree_t * patricia, void_fn_t func);
|
||||
void rb_destroy_patricia(rb_patricia_tree_t * patricia, void_fn_t func);
|
||||
void rb_patricia_process(rb_patricia_tree_t * patricia, void_fn_t func);
|
||||
void rb_clear_patricia(rb_patricia_tree_t * patricia, void (*func)(void *));
|
||||
void rb_destroy_patricia(rb_patricia_tree_t * patricia, void (*func)(void *));
|
||||
void rb_patricia_process(rb_patricia_tree_t * patricia, void (*func)(rb_prefix_t *, void *));
|
||||
void rb_init_patricia(void);
|
||||
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ rb_new_patricia(int maxbits)
|
|||
*/
|
||||
|
||||
void
|
||||
rb_clear_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
|
||||
rb_clear_patricia(rb_patricia_tree_t * patricia, void (*func)(void *))
|
||||
{
|
||||
assert(patricia);
|
||||
if(patricia->head)
|
||||
|
@ -343,7 +343,7 @@ rb_clear_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
|
|||
|
||||
|
||||
void
|
||||
rb_destroy_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
|
||||
rb_destroy_patricia(rb_patricia_tree_t * patricia, void (*func)(void *))
|
||||
{
|
||||
rb_clear_patricia(patricia, func);
|
||||
num_active_patricia--;
|
||||
|
@ -355,7 +355,7 @@ rb_destroy_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
|
|||
*/
|
||||
|
||||
void
|
||||
rb_patricia_process(rb_patricia_tree_t * patricia, void_fn_t func)
|
||||
rb_patricia_process(rb_patricia_tree_t * patricia, void (*func)(rb_prefix_t *, void *))
|
||||
{
|
||||
rb_patricia_node_t *node;
|
||||
assert(func);
|
||||
|
|
Loading…
Reference in New Issue