0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

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 8bd5767b95
commit 365d91a86f
2 changed files with 6 additions and 7 deletions

View file

@ -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);

View file

@ -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);