From f4010694b3b16453e5e6298c208910264e326978 Mon Sep 17 00:00:00 2001 From: Sven-Haegar Koch Date: Sat, 28 May 2011 03:57:20 +0200 Subject: [PATCH] sparse fixup: warning: non-ANSI function declaration of function '...' --- src/conf.c | 2 +- src/control.c | 4 ++-- src/graph.c | 2 +- src/net_setup.c | 2 +- src/openssl/crypto.c | 4 ++-- src/protocol_key.c | 2 +- src/subnet.c | 2 +- src/tincd.c | 4 ++-- src/top.c | 2 +- src/xmalloc.c | 10 +++------- 10 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/conf.c b/src/conf.c index bf8183f7..30ac5852 100644 --- a/src/conf.c +++ b/src/conf.c @@ -368,7 +368,7 @@ void read_config_options(splay_tree_t *config_tree, const char *prefix) { } } -bool read_server_config() { +bool read_server_config(void) { char *fname; bool x; diff --git a/src/control.c b/src/control.c index e03e67da..277f7cb5 100644 --- a/src/control.c +++ b/src/control.c @@ -130,7 +130,7 @@ bool control_h(connection_t *c, char *request) { } } -bool init_control() { +bool init_control(void) { randomize(controlcookie, sizeof controlcookie / 2); bin2hex(controlcookie, controlcookie, sizeof controlcookie / 2); controlcookie[sizeof controlcookie - 1] = 0; @@ -153,6 +153,6 @@ bool init_control() { return true; } -void exit_control() { +void exit_control(void) { unlink(controlcookiename); } diff --git a/src/graph.c b/src/graph.c index 8cc793ec..28be9d5f 100644 --- a/src/graph.c +++ b/src/graph.c @@ -316,7 +316,7 @@ void sssp_bfs(void) { list_free(todo_list); } -static void check_reachability() { +static void check_reachability(void) { splay_node_t *node, *next; node_t *n; char *name; diff --git a/src/net_setup.c b/src/net_setup.c index 9d20fd57..543dad30 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -143,7 +143,7 @@ static void keyexpire_handler(int fd, short events, void *data) { regenerate_key(); } -void regenerate_key() { +void regenerate_key(void) { if(timeout_initialized(&keyexpire_event)) { ifdebug(STATUS) logger(LOG_INFO, "Expiring symmetric keys"); event_del(&keyexpire_event); diff --git a/src/openssl/crypto.c b/src/openssl/crypto.c index 835e8087..db921d6f 100644 --- a/src/openssl/crypto.c +++ b/src/openssl/crypto.c @@ -25,7 +25,7 @@ #include "crypto.h" -void crypto_init() { +void crypto_init(void) { RAND_load_file("/dev/urandom", 1024); ENGINE_load_builtin_engines(); @@ -34,7 +34,7 @@ void crypto_init() { OpenSSL_add_all_algorithms(); } -void crypto_exit() { +void crypto_exit(void) { EVP_cleanup(); } diff --git a/src/protocol_key.c b/src/protocol_key.c index 99861287..63fcd976 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -34,7 +34,7 @@ static bool mykeyused = false; -void send_key_changed() { +void send_key_changed(void) { splay_node_t *node; connection_t *c; diff --git a/src/subnet.c b/src/subnet.c index 2d1f43a3..b96abfb5 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -53,7 +53,7 @@ static subnet_t *cache_mac_subnet[2]; static bool cache_mac_valid[2]; static int cache_mac_slot; -void subnet_cache_flush() { +void subnet_cache_flush(void) { cache_ipv4_valid[0] = cache_ipv4_valid[1] = false; cache_ipv6_valid[0] = cache_ipv6_valid[1] = false; cache_mac_valid[0] = cache_mac_valid[1] = false; diff --git a/src/tincd.c b/src/tincd.c index 25db1552..17d50085 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -282,7 +282,7 @@ static void make_names(void) { } } -static void free_names() { +static void free_names(void) { if (identname) free(identname); if (netname) free(netname); if (controlcookiename) free(controlcookiename); @@ -290,7 +290,7 @@ static void free_names() { if (confbase) free(confbase); } -static bool drop_privs() { +static bool drop_privs(void) { #ifdef HAVE_MINGW if (switchuser) { logger(LOG_ERR, "%s not supported on this platform", "-U"); diff --git a/src/top.c b/src/top.c index 5ca97495..5207500d 100644 --- a/src/top.c +++ b/src/top.c @@ -128,7 +128,7 @@ static void update(int fd) { } } -static void redraw() { +static void redraw(void) { erase(); mvprintw(0, 0, "Tinc %-16s Nodes: %4d Sort: %-8s %s", netname, node_list.count, sortname[sortmode], cumulative ? "Cumulative" : "Current"); diff --git a/src/xmalloc.c b/src/xmalloc.c index 4e79aff9..131b41f1 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -70,8 +70,7 @@ xalloc_fail (int size) /* Allocate N bytes of memory dynamically, with error checking. */ void * -xmalloc (n) - size_t n; +xmalloc (size_t n) { void *p; @@ -84,8 +83,7 @@ xmalloc (n) /* Allocate N bytes of memory dynamically, and set it all to zero. */ void * -xmalloc_and_zero (n) - size_t n; +xmalloc_and_zero (size_t n) { void *p; @@ -101,9 +99,7 @@ xmalloc_and_zero (n) If P is NULL, run xmalloc. */ void * -xrealloc (p, n) - void *p; - size_t n; +xrealloc (void *p, size_t n) { p = realloc (p, n); if (p == 0) -- 2.39.5