From: Sven-Haegar Koch Date: Sat, 28 May 2011 01:56:06 +0000 (+0200) Subject: sparse fixup: warning: symbol '...' was not declared. Should it be static? X-Git-Tag: release-1.1pre1~40 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=d772289f6d6adfb8932658b533349d43f08ec326 sparse fixup: warning: symbol '...' was not declared. Should it be static? --- diff --git a/src/graph.c b/src/graph.c index c78615ba..8cc793ec 100644 --- a/src/graph.c +++ b/src/graph.c @@ -57,6 +57,7 @@ #include "subnet.h" #include "utils.h" #include "xalloc.h" +#include "graph.h" /* Implementation of Kruskal's algorithm. Running time: O(E) @@ -112,7 +113,7 @@ void mst_kruskal(void) { Running time: O(N^2) */ -void sssp_dijkstra(void) { +static void sssp_dijkstra(void) { splay_node_t *node, *to; edge_t *e; node_t *n, *m; @@ -315,7 +316,7 @@ void sssp_bfs(void) { list_free(todo_list); } -void check_reachability() { +static void check_reachability() { splay_node_t *node, *next; node_t *n; char *name; diff --git a/src/linux/device.c b/src/linux/device.c index 111b98c6..5fb47718 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -33,6 +33,7 @@ #include "route.h" #include "utils.h" #include "xalloc.h" +#include "device.h" typedef enum device_type_t { DEVICE_TYPE_ETHERTAP, diff --git a/src/net_packet.c b/src/net_packet.c index 7e567e99..1805cf7e 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -56,7 +56,7 @@ #include "xalloc.h" int keylifetime = 0; -int keyexpires = 0; +static int keyexpires = 0; #ifdef HAVE_LZO static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS]; #endif @@ -150,7 +150,7 @@ void send_mtu_probe(node_t *n) { send_mtu_probe_handler(0, 0, n); } -void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) { +static void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) { ifdebug(TRAFFIC) logger(LOG_INFO, "Got MTU probe length %d from %s (%s)", packet->len, n->name, n->hostname); if(!packet->data[0]) { diff --git a/src/net_setup.c b/src/net_setup.c index 3d05ca9c..9d20fd57 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -81,7 +81,7 @@ bool read_rsa_public_key(connection_t *c) { return result; } -bool read_rsa_private_key() { +static bool read_rsa_private_key(void) { FILE *fp; char *fname; char *n, *d; @@ -220,7 +220,7 @@ void load_all_subnets(void) { /* Configure node_t myself and set up the local sockets (listen only) */ -bool setup_myself(void) { +static bool setup_myself(void) { config_t *cfg; subnet_t *subnet; char *name, *hostname, *mode, *afname, *cipher, *digest; diff --git a/src/net_socket.c b/src/net_socket.c index 163553ad..40120962 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -449,7 +449,7 @@ begin: return; } -void handle_meta_write(int sock, short events, void *data) { +static void handle_meta_write(int sock, short events, void *data) { ifdebug(META) logger(LOG_DEBUG, "handle_meta_write() called"); connection_t *c = data; @@ -466,7 +466,7 @@ void handle_meta_write(int sock, short events, void *data) { event_del(&c->outevent); } -void handle_meta_connection_error(struct bufferevent *event, short what, void *data) { +static void handle_meta_connection_error(struct bufferevent *event, short what, void *data) { connection_t *c = data; logger(LOG_ERR, "handle_meta_connection_error() called: %d: %s", what, strerror(errno)); terminate_connection(c, c->status.active); @@ -564,7 +564,7 @@ void handle_new_meta_connection(int sock, short events, void *data) { send_id(c); } -void free_outgoing(outgoing_t *outgoing) { +static void free_outgoing(outgoing_t *outgoing) { if(outgoing->ai) freeaddrinfo(outgoing->ai); diff --git a/src/process.c b/src/process.c index 737a75e2..1ec450cd 100644 --- a/src/process.c +++ b/src/process.c @@ -41,7 +41,7 @@ extern char **g_argv; extern bool use_logfile; #ifndef HAVE_MINGW -sigset_t emptysigset; +static sigset_t emptysigset; #endif static void memory_full(int size) { diff --git a/src/protocol.c b/src/protocol.c index 6cb29bf7..230ee3b8 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -195,7 +195,7 @@ bool seen_request(char *request) { } } -void age_past_requests(int fd, short events, void *data) { +static void age_past_requests(int fd, short events, void *data) { splay_node_t *node, *next; past_request_t *p; int left = 0, deleted = 0; diff --git a/src/tincctl.c b/src/tincctl.c index 000d383e..5477fd0e 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -30,19 +30,19 @@ #include "top.h" /* The name this program was run with. */ -char *program_name = NULL; +static char *program_name = NULL; /* If nonzero, display usage information and exit. */ -bool show_help = false; +static bool show_help = false; /* If nonzero, print the version on standard output and exit. */ -bool show_version = false; +static bool show_version = false; /* If nonzero, it will attempt to kill a running tincd and exit. */ -int kill_tincd = 0; +static int kill_tincd = 0; /* If nonzero, generate public/private keypair for this host/net. */ -int generate_keys = 0; +static int generate_keys = 0; static char *name = NULL; static char *identname = NULL; /* program name for syslog */ diff --git a/src/tincd.c b/src/tincd.c index 6256c915..25db1552 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -64,19 +64,19 @@ #include "xalloc.h" /* The name this program was run with. */ -char *program_name = NULL; +static char *program_name = NULL; /* If nonzero, display usage information and exit. */ -bool show_help = false; +static bool show_help = false; /* If nonzero, print the version on standard output and exit. */ -bool show_version = false; +static bool show_version = false; /* If nonzero, use null ciphers and skip all key exchanges. */ bool bypass_security = false; /* If nonzero, disable swapping for this process. */ -bool do_mlock = false; +static bool do_mlock = false; /* If nonzero, chroot to netdir after startup. */ static bool do_chroot = false; diff --git a/src/top.c b/src/top.c index 2dbd9c27..5ca97495 100644 --- a/src/top.c +++ b/src/top.c @@ -40,7 +40,7 @@ typedef struct nodestats_t { bool known; } nodestats_t; -const char *const sortname[] = { +static const char *const sortname[] = { "name", "in pkts", "in bytes", @@ -50,8 +50,8 @@ const char *const sortname[] = { "tot bytes", }; -int sortmode = 0; -bool cumulative = false; +static int sortmode = 0; +static bool cumulative = false; static list_t node_list; static struct timeval now, prev, diff; diff --git a/src/utils.c b/src/utils.c index dd7e4de2..4aed59f5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -23,9 +23,9 @@ #include "../src/logger.h" #include "utils.h" -const char hexadecimals[] = "0123456789ABCDEF"; +static const char hexadecimals[] = "0123456789ABCDEF"; -int charhex2bin(char c) { +static int charhex2bin(char c) { if(isdigit(c)) return c - '0'; else