sparse fixup: warning: symbol '...' was not declared. Should it be static?
authorSven-Haegar Koch <haegar@sdinet.de>
Sat, 28 May 2011 01:56:06 +0000 (03:56 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 28 May 2011 13:24:39 +0000 (15:24 +0200)
src/graph.c
src/linux/device.c
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/process.c
src/protocol.c
src/tincctl.c
src/tincd.c
src/top.c
src/utils.c

index c78615b..8cc793e 100644 (file)
@@ -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;
index 111b98c..5fb4771 100644 (file)
@@ -33,6 +33,7 @@
 #include "route.h"
 #include "utils.h"
 #include "xalloc.h"
+#include "device.h"
 
 typedef enum device_type_t {
        DEVICE_TYPE_ETHERTAP,
index 7e567e9..1805cf7 100644 (file)
@@ -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]) {
index 3d05ca9..9d20fd5 100644 (file)
@@ -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;
index 163553a..4012096 100644 (file)
@@ -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);
 
index 737a75e..1ec450c 100644 (file)
@@ -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) {
index 6cb29bf..230ee3b 100644 (file)
@@ -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;
index 000d383..5477fd0 100644 (file)
 #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 */
index 6256c91..25db155 100644 (file)
 #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;
index 2dbd9c2..5ca9749 100644 (file)
--- 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;
index dd7e4de..4aed59f 100644 (file)
@@ -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