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:
Jilles Tjoelker 2008-04-13 18:20:18 +02:00
parent b717a466d0
commit 79c4d759a9
2 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,6 @@
#endif #endif
/* typedef unsigned int u_int; */ /* typedef unsigned int u_int; */
typedef void (*void_fn_t) ();
#define rb_prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin) #define rb_prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin)
#define MAXLINE 1024 #define MAXLINE 1024
#define BIT_TEST(f, b) ((f) & (b)) #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); void rb_patricia_remove(rb_patricia_tree_t * patricia, rb_patricia_node_t * node);
rb_patricia_tree_t *rb_new_patricia(int maxbits); rb_patricia_tree_t *rb_new_patricia(int maxbits);
void rb_clear_patricia(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_fn_t func); void rb_destroy_patricia(rb_patricia_tree_t * patricia, void (*func)(void *));
void rb_patricia_process(rb_patricia_tree_t * patricia, void_fn_t func); void rb_patricia_process(rb_patricia_tree_t * patricia, void (*func)(rb_prefix_t *, void *));
void rb_init_patricia(void); void rb_init_patricia(void);

View File

@ -287,7 +287,7 @@ rb_new_patricia(int maxbits)
*/ */
void 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); assert(patricia);
if(patricia->head) if(patricia->head)
@ -343,7 +343,7 @@ rb_clear_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
void 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); rb_clear_patricia(patricia, func);
num_active_patricia--; num_active_patricia--;
@ -355,7 +355,7 @@ rb_destroy_patricia(rb_patricia_tree_t * patricia, void_fn_t func)
*/ */
void 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; rb_patricia_node_t *node;
assert(func); assert(func);