Commit 9087c649 authored by Sevan Janiyan's avatar Sevan Janiyan Committed by GitHub
Browse files

Void (#328)

* First pass at setting the empty argument sections of functions with void.

* It appears that the cmdsock_shutdown() implementation expects a socket to
be specified when being called otherwise it doesn't do anything and just returns.
I've not tracked down the socket which needs to be passed to the function yet.
Back out the change to the cmdsock_shutdown() prototype to unbreak build.
parent 00ecef76
......@@ -182,19 +182,19 @@ static pid_t launch_daemon(char *name, char *path) {
#endif
#ifdef ENABLE_CHILLIPROXY
static void launch_chilliproxy() {
static void launch_chilliproxy(void) {
proxy_pid = launch_daemon("[chilli_proxy]", SBINDIR "/chilli_proxy");
}
#endif
#ifdef ENABLE_CHILLIREDIR
static void launch_chilliredir() {
static void launch_chilliredir(void) {
redir_pid = launch_daemon("[chilli_redir]", SBINDIR "/chilli_redir");
}
#endif
#ifdef ENABLE_CHILLIRADSEC
static void launch_chilliradsec() {
static void launch_chilliradsec(void) {
radsec_pid = launch_daemon("[chilli_radsec]", SBINDIR "/chilli_radsec");
}
#endif
......@@ -455,11 +455,11 @@ time_t mainclock_towall(time_t t) {
return mainclock.tv_sec;
}
time_t mainclock_wall() {
time_t mainclock_wall(void) {
return mainclock_towall(mainclock.tv_sec);
}
time_t mainclock_tick() {
time_t mainclock_tick(void) {
#ifdef HAVE_LIBRT
struct timespec ts;
#if defined(CLOCK_MONOTONIC)
......@@ -487,11 +487,11 @@ time_t mainclock_tick() {
return mainclock.tv_sec;
}
time_t mainclock_now() {
time_t mainclock_now(void) {
return mainclock.tv_sec;
}
time_t mainclock_rt() {
time_t mainclock_rt(void) {
time_t rt = 0;
#ifdef HAVE_LIBRT
struct timespec ts;
......@@ -890,7 +890,7 @@ static int newip(struct ippoolm_t **ipm, struct in_addr *hisip, uint8_t *hismac)
* A few functions to manage connections
*/
static int initconn() {
static int initconn(void) {
checktime = rereadtime = mainclock.tv_sec;
return 0;
}
......@@ -1183,7 +1183,7 @@ void session_interval(struct app_conn_t *conn) {
#endif
}
static int checkconn() {
static int checkconn(void) {
struct app_conn_t *conn;
struct dhcp_conn_t* dhcpconn;
uint32_t checkdiff;
......@@ -1232,7 +1232,7 @@ static int checkconn() {
return 0;
}
void chilli_freeconn() {
void chilli_freeconn(void) {
struct app_conn_t *conn, *c;
struct dhcp_conn_t *d = NULL;
......@@ -1252,7 +1252,7 @@ void chilli_freeconn() {
}
/* Kill all connections and send Radius Acct Stop */
int static killconn() {
int static killconn(void) {
struct app_conn_t *conn;
for (conn = firstusedconn; conn; conn = conn->next) {
......@@ -7182,7 +7182,7 @@ static int rtmon_accept(struct rtmon_t *rtmon, int idx) {
}
#endif
static inline void macauth_reserved() {
static inline void macauth_reserved(void) {
struct dhcp_conn_t *conn = dhcp->firstusedconn;
struct app_conn_t *appconn;
......@@ -7198,7 +7198,7 @@ static inline void macauth_reserved() {
}
#ifdef ENABLE_LAYER3
static int session_timeout() {
static int session_timeout(void) {
struct app_conn_t *conn = firstusedconn;
while (conn) {
......
......@@ -202,8 +202,8 @@ struct chilli_peer {
#endif
#ifdef ENABLE_STATFILE
int printstatus();
int loadstatus();
int printstatus(void);
int loadstatus(void);
#endif
int chilli_connect(struct app_conn_t **appconn, struct dhcp_conn_t *conn);
......@@ -262,16 +262,16 @@ int dnprot_reject(struct app_conn_t *appconn);
int get_urlparts(char *src, char *host, int hostsize, int *port, int *uripos);
int cmdsock_init();
int cmdsock_init(void);
int cmdsock_port_init();
int cmdsock_port_init(void);
void cmdsock_shutdown();
time_t mainclock_tick();
time_t mainclock_now();
time_t mainclock_rt();
time_t mainclock_wall();
time_t mainclock_tick(void);
time_t mainclock_now(void);
time_t mainclock_rt(void);
time_t mainclock_wall(void);
time_t mainclock_towall(time_t t);
int mainclock_diff(time_t past);
uint32_t mainclock_diffu(time_t past);
......@@ -296,8 +296,8 @@ int chilli_learn_location(uint8_t *loc, int loclen,
#ifdef HAVE_NETFILTER_COOVA
int kmod_coova_update(struct app_conn_t *appconn);
int kmod_coova_release(struct dhcp_conn_t *conn);
int kmod_coova_sync();
int kmod_coova_clear();
int kmod_coova_sync(void);
int kmod_coova_clear(void);
#endif
#ifdef HAVE_OPENSSL
......@@ -325,7 +325,7 @@ uint8_t* chilli_called_station(struct session_state *state);
int chilli_cmd(struct cmdsock_request *req, bstring s, int sock);
int chilli_handle_signal(void *ctx, int fd);
void chilli_freeconn();
void chilli_freeconn(void);
int runscript(struct app_conn_t *appconn, char* script,
char *loc, char *oloc);
......@@ -349,10 +349,10 @@ int selfpipe_init (void);
int selfpipe_read (void);
int selfpipe_trap (int signo);
int selfpipe_ignore (int signo);
void selfpipe_finish();
void selfpipe_finish(void);
#ifdef ENABLE_LOCATION
void location_init();
void location_init(void);
#ifdef HAVE_AVL
struct loc_search_t {
......
......@@ -20,7 +20,7 @@
#include "chilli.h"
int
cmdsock_init() {
cmdsock_init(void) {
struct sockaddr_un local;
int cmdsock;
......@@ -61,7 +61,7 @@ cmdsock_init() {
int
cmdsock_port_init() {
cmdsock_port_init(void) {
struct sockaddr_in local;
int cmdsock;
int rc;
......
......@@ -58,12 +58,12 @@ kmod_coova_release(struct dhcp_conn_t *conn) {
}
int
kmod_coova_clear() {
kmod_coova_clear(void) {
return kmod('/', 0);
}
int
kmod_coova_sync() {
kmod_coova_sync(void) {
char file[128];
char * line = 0;
size_t len = 0;
......
......@@ -509,7 +509,7 @@ void location_printlist(bstring s, char *loc, int json, int list) {
#endif
void location_init() {
void location_init(void) {
#ifdef HAVE_AVL
struct app_conn_t *conn = firstusedconn;
memset(&loc_search_tree, 0, sizeof(loc_search_tree));
......
......@@ -29,7 +29,7 @@ extern struct ippool_t *ippool;
#ifdef ENABLE_BINSTATFILE
static int has_loaded = 0;
int loadstatus() {
int loadstatus(void) {
char filedest[512];
FILE *file;
char c;
......@@ -303,7 +303,7 @@ int loadstatus() {
return 0;
}
int printstatus() {
int printstatus(void) {
char filedest[512];
time_t tm;
FILE *file;
......@@ -371,12 +371,12 @@ int printstatus() {
}
#else
#ifdef ENABLE_STATFILE
int loadstatus() {
int loadstatus(void) {
printstatus();
return 0;
}
int printstatus() {
int printstatus(void) {
FILE *file;
char filedest[512];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment