Commits

Anonymous committed 4a39f82

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

Comments (0)

Files changed (2)

libratbox/include/rb_patricia.h

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

libratbox/src/patricia.c

  */
 
 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)
 
 
 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--;
  */
 
 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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.