sparse fixup: warning: symbol '...' was not declared. Should it be static?
This commit is contained in:
parent
02e32cf61e
commit
d772289f6d
11 changed files with 27 additions and 25 deletions
|
@ -57,6 +57,7 @@
|
||||||
#include "subnet.h"
|
#include "subnet.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
#include "graph.h"
|
||||||
|
|
||||||
/* Implementation of Kruskal's algorithm.
|
/* Implementation of Kruskal's algorithm.
|
||||||
Running time: O(E)
|
Running time: O(E)
|
||||||
|
@ -112,7 +113,7 @@ void mst_kruskal(void) {
|
||||||
Running time: O(N^2)
|
Running time: O(N^2)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void sssp_dijkstra(void) {
|
static void sssp_dijkstra(void) {
|
||||||
splay_node_t *node, *to;
|
splay_node_t *node, *to;
|
||||||
edge_t *e;
|
edge_t *e;
|
||||||
node_t *n, *m;
|
node_t *n, *m;
|
||||||
|
@ -315,7 +316,7 @@ void sssp_bfs(void) {
|
||||||
list_free(todo_list);
|
list_free(todo_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_reachability() {
|
static void check_reachability() {
|
||||||
splay_node_t *node, *next;
|
splay_node_t *node, *next;
|
||||||
node_t *n;
|
node_t *n;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "route.h"
|
#include "route.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
#include "device.h"
|
||||||
|
|
||||||
typedef enum device_type_t {
|
typedef enum device_type_t {
|
||||||
DEVICE_TYPE_ETHERTAP,
|
DEVICE_TYPE_ETHERTAP,
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
int keylifetime = 0;
|
int keylifetime = 0;
|
||||||
int keyexpires = 0;
|
static int keyexpires = 0;
|
||||||
#ifdef HAVE_LZO
|
#ifdef HAVE_LZO
|
||||||
static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
|
static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
|
||||||
#endif
|
#endif
|
||||||
|
@ -150,7 +150,7 @@ void send_mtu_probe(node_t *n) {
|
||||||
send_mtu_probe_handler(0, 0, 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);
|
ifdebug(TRAFFIC) logger(LOG_INFO, "Got MTU probe length %d from %s (%s)", packet->len, n->name, n->hostname);
|
||||||
|
|
||||||
if(!packet->data[0]) {
|
if(!packet->data[0]) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ bool read_rsa_public_key(connection_t *c) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool read_rsa_private_key() {
|
static bool read_rsa_private_key(void) {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *fname;
|
char *fname;
|
||||||
char *n, *d;
|
char *n, *d;
|
||||||
|
@ -220,7 +220,7 @@ void load_all_subnets(void) {
|
||||||
/*
|
/*
|
||||||
Configure node_t myself and set up the local sockets (listen only)
|
Configure node_t myself and set up the local sockets (listen only)
|
||||||
*/
|
*/
|
||||||
bool setup_myself(void) {
|
static bool setup_myself(void) {
|
||||||
config_t *cfg;
|
config_t *cfg;
|
||||||
subnet_t *subnet;
|
subnet_t *subnet;
|
||||||
char *name, *hostname, *mode, *afname, *cipher, *digest;
|
char *name, *hostname, *mode, *afname, *cipher, *digest;
|
||||||
|
|
|
@ -449,7 +449,7 @@ begin:
|
||||||
return;
|
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");
|
ifdebug(META) logger(LOG_DEBUG, "handle_meta_write() called");
|
||||||
|
|
||||||
connection_t *c = data;
|
connection_t *c = data;
|
||||||
|
@ -466,7 +466,7 @@ void handle_meta_write(int sock, short events, void *data) {
|
||||||
event_del(&c->outevent);
|
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;
|
connection_t *c = data;
|
||||||
logger(LOG_ERR, "handle_meta_connection_error() called: %d: %s", what, strerror(errno));
|
logger(LOG_ERR, "handle_meta_connection_error() called: %d: %s", what, strerror(errno));
|
||||||
terminate_connection(c, c->status.active);
|
terminate_connection(c, c->status.active);
|
||||||
|
@ -564,7 +564,7 @@ void handle_new_meta_connection(int sock, short events, void *data) {
|
||||||
send_id(c);
|
send_id(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_outgoing(outgoing_t *outgoing) {
|
static void free_outgoing(outgoing_t *outgoing) {
|
||||||
if(outgoing->ai)
|
if(outgoing->ai)
|
||||||
freeaddrinfo(outgoing->ai);
|
freeaddrinfo(outgoing->ai);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern char **g_argv;
|
||||||
extern bool use_logfile;
|
extern bool use_logfile;
|
||||||
|
|
||||||
#ifndef HAVE_MINGW
|
#ifndef HAVE_MINGW
|
||||||
sigset_t emptysigset;
|
static sigset_t emptysigset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void memory_full(int size) {
|
static void memory_full(int size) {
|
||||||
|
|
|
@ -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;
|
splay_node_t *node, *next;
|
||||||
past_request_t *p;
|
past_request_t *p;
|
||||||
int left = 0, deleted = 0;
|
int left = 0, deleted = 0;
|
||||||
|
|
|
@ -30,19 +30,19 @@
|
||||||
#include "top.h"
|
#include "top.h"
|
||||||
|
|
||||||
/* The name this program was run with. */
|
/* The name this program was run with. */
|
||||||
char *program_name = NULL;
|
static char *program_name = NULL;
|
||||||
|
|
||||||
/* If nonzero, display usage information and exit. */
|
/* 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. */
|
/* 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. */
|
/* 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. */
|
/* 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 *name = NULL;
|
||||||
static char *identname = NULL; /* program name for syslog */
|
static char *identname = NULL; /* program name for syslog */
|
||||||
|
|
|
@ -64,19 +64,19 @@
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
/* The name this program was run with. */
|
/* The name this program was run with. */
|
||||||
char *program_name = NULL;
|
static char *program_name = NULL;
|
||||||
|
|
||||||
/* If nonzero, display usage information and exit. */
|
/* 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. */
|
/* 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. */
|
/* If nonzero, use null ciphers and skip all key exchanges. */
|
||||||
bool bypass_security = false;
|
bool bypass_security = false;
|
||||||
|
|
||||||
/* If nonzero, disable swapping for this process. */
|
/* If nonzero, disable swapping for this process. */
|
||||||
bool do_mlock = false;
|
static bool do_mlock = false;
|
||||||
|
|
||||||
/* If nonzero, chroot to netdir after startup. */
|
/* If nonzero, chroot to netdir after startup. */
|
||||||
static bool do_chroot = false;
|
static bool do_chroot = false;
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef struct nodestats_t {
|
||||||
bool known;
|
bool known;
|
||||||
} nodestats_t;
|
} nodestats_t;
|
||||||
|
|
||||||
const char *const sortname[] = {
|
static const char *const sortname[] = {
|
||||||
"name",
|
"name",
|
||||||
"in pkts",
|
"in pkts",
|
||||||
"in bytes",
|
"in bytes",
|
||||||
|
@ -50,8 +50,8 @@ const char *const sortname[] = {
|
||||||
"tot bytes",
|
"tot bytes",
|
||||||
};
|
};
|
||||||
|
|
||||||
int sortmode = 0;
|
static int sortmode = 0;
|
||||||
bool cumulative = false;
|
static bool cumulative = false;
|
||||||
|
|
||||||
static list_t node_list;
|
static list_t node_list;
|
||||||
static struct timeval now, prev, diff;
|
static struct timeval now, prev, diff;
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
#include "../src/logger.h"
|
#include "../src/logger.h"
|
||||||
#include "utils.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))
|
if(isdigit(c))
|
||||||
return c - '0';
|
return c - '0';
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue