Commit d32b934d authored by Robert Edmonds's avatar Robert Edmonds Committed by Ondřej Surý

Clean up some problems found with -Wstrict-prototypes

parent 9bb7e93c
......@@ -36,7 +36,7 @@ struct heap {
#define HHEAD(h) HELEMENT((h), 1)
#define EMPTY_HEAP(h) ((h)->num == 0) /* h->num == 0 */
int heap_init(struct heap *, int (*cmp)(), int);
int heap_init(struct heap *, int (*cmp)(void *, void *), int);
void heap_deinit(struct heap *);
void heap_delmin(struct heap *);
......
......@@ -29,10 +29,10 @@ static inline int timercmp_ge(struct timeval *a, struct timeval *b) {
return timercmp(a, b, >) || timercmp(a, b, ==);
}
static int compare_event_heap_nodes(event_t *e1, event_t *e2)
static int compare_event_heap_nodes(void *e1, void *e2)
{
if (timercmp(&e1->tv, &e2->tv, <)) return -1;
if (timercmp(&e1->tv, &e2->tv, >)) return 1;
if (timercmp(&((event_t *)e1)->tv, &((event_t *)e2)->tv, <)) return -1;
if (timercmp(&((event_t *)e1)->tv, &((event_t *)e2)->tv, >)) return 1;
return 0;
}
......
......@@ -31,7 +31,7 @@
#include "knot/conf/conf.h"
#include "libknot/errcode.h"
static char* pid_filename()
static char* pid_filename(void)
{
conf_val_t val = conf_get(conf(), C_SRV, C_RUNDIR);
char *rundir = conf_abs_path(&val, NULL);
......@@ -103,7 +103,7 @@ static int pid_write(const char *filename)
return ret;
}
char *pid_check_and_create()
char *pid_check_and_create(void)
{
struct stat st;
char *pidfile = pid_filename();
......@@ -116,7 +116,7 @@ char *pid_check_and_create()
return NULL;
} else if (stat(pidfile, &st) == 0) {
log_warning("removing stale PID file '%s'", pidfile);
pid_cleanup(pidfile);
pid_cleanup();
}
/* Create a PID file. */
......@@ -131,7 +131,7 @@ char *pid_check_and_create()
return pidfile;
}
void pid_cleanup()
void pid_cleanup(void)
{
char *pidfile = pid_filename();
if (pidfile != NULL) {
......
......@@ -33,14 +33,14 @@
* \retval NULL if failed.
* \retval Created PID file path.
*/
char *pid_check_and_create();
char *pid_check_and_create(void);
/*!
* \brief Remove PID file.
*
* \warning PID file content won't be checked.
*/
void pid_cleanup();
void pid_cleanup(void);
/*!
* \brief Return true if the PID is running.
......
......@@ -64,7 +64,7 @@ typedef struct tcp_context {
#define TCP_THROTTLE_HI 2 /*!< Maximum recovery time on errors. */
/*! \brief Calculate TCP throttle time (random). */
static inline int tcp_throttle() {
static inline int tcp_throttle(void) {
return TCP_THROTTLE_LO + (dnssec_random_uint16_t() % TCP_THROTTLE_HI);
}
......
......@@ -392,7 +392,7 @@ static int udp_recvmmsg_send(void *d)
#endif /* HAVE_RECVMMSG */
/*! \brief Initialize UDP master routine on run-time. */
void __attribute__ ((constructor)) udp_master_init()
void __attribute__ ((constructor)) udp_master_init(void)
{
/* Initialize defaults. */
_udp_init = udp_recvfrom_init;
......
......@@ -39,7 +39,7 @@ typedef int (*zone_tree_apply_cb_t)(zone_node_t **node, void *data);
*
* \return created zone tree structure.
*/
zone_tree_t* zone_tree_create();
zone_tree_t* zone_tree_create(void);
/*!
* \brief Return weight of the zone tree (number of nodes).
......
......@@ -362,7 +362,7 @@ size_t knot_tsig_rdata_tsig_variables_length(const knot_rrset_t *tsig)
}
_public_
size_t knot_tsig_rdata_tsig_timers_length()
size_t knot_tsig_rdata_tsig_timers_length(void)
{
/*! \todo Cleanup */
return KNOT_TSIG_TIMERS_LENGTH;
......
......@@ -94,7 +94,7 @@ uint16_t knot_tsig_rdata_other_data_length(const knot_rrset_t *tsig);
size_t knot_tsig_rdata_tsig_variables_length(const knot_rrset_t *tsig);
size_t knot_tsig_rdata_tsig_timers_length();
size_t knot_tsig_rdata_tsig_timers_length(void);
/*!
* \brief Return TSIG RRSET maximum wire size for given algorithm.
......
......@@ -35,7 +35,7 @@ struct conf_includes {
/*!
* \brief Initialize structure for storing names of included files.
*/
conf_includes_t *conf_includes_init()
conf_includes_t *conf_includes_init(void)
{
conf_includes_t *includes = calloc(1, sizeof(conf_includes_t));
if (!includes) {
......
......@@ -36,7 +36,7 @@ typedef struct conf_includes conf_includes_t;
/*!
* \brief Initialize structure for storing names of included files.
*/
conf_includes_t *conf_includes_init();
conf_includes_t *conf_includes_init(void);
/*!
* \brief Free structure for storing the names of included files.
......
......@@ -22,7 +22,7 @@
#include "tests/tests.h"
#include "functions.c"
int test__date_to_timestamp()
int test__date_to_timestamp(void)
{
time_t ref_timestamp, max_timestamp;
uint32_t test_timestamp;
......
......@@ -26,6 +26,6 @@
#pragma once
int test__date_to_timestamp();
int test__date_to_timestamp(void);
/*! @} */
......@@ -50,7 +50,7 @@ static void help(void)
" -h Print this help.\n");
}
static int time_test()
static int time_test(void)
{
pthread_t t1, t2, t3;
int ret1, ret2, ret3;
......
......@@ -175,7 +175,7 @@ static int format_item(conf_io_t *io)
return KNOT_EOK;
}
static void test_conf_io_begin()
static void test_conf_io_begin(void)
{
ok(conf_io_begin(true) == KNOT_TXN_ENOTEXISTS, "begin child txn with no parent");
ok(conf()->io.txn == NULL, "check txn depth");
......@@ -202,7 +202,7 @@ static void test_conf_io_begin()
#endif
}
static void test_conf_io_abort()
static void test_conf_io_abort(void)
{
#if defined(__OpenBSD__)
SKIP_OPENBSD
......@@ -257,7 +257,7 @@ static void test_conf_io_abort()
#endif
}
static void test_conf_io_commit()
static void test_conf_io_commit(void)
{
ok(conf_io_commit(false) == KNOT_TXN_ENOTEXISTS, "commit no txt txn");
ok(conf_io_commit(true) == KNOT_TXN_ENOTEXISTS, "commit no txt txn");
......@@ -308,7 +308,7 @@ static void test_conf_io_commit()
#endif
}
static void test_conf_io_check()
static void test_conf_io_check(void)
{
conf_io_t io = { NULL };
......@@ -350,7 +350,7 @@ static void test_conf_io_check()
conf_io_abort(false);
}
static void test_conf_io_set()
static void test_conf_io_set(void)
{
conf_io_t io = { NULL };
......@@ -450,7 +450,7 @@ static void test_conf_io_set()
ok(conf_refresh_txn(conf()) == KNOT_EOK, "update read-only txn");
}
static void test_conf_io_unset()
static void test_conf_io_unset(void)
{
// ERR no txn.
ok(conf_io_unset("server", "version", NULL, "text") ==
......@@ -633,7 +633,7 @@ static void test_conf_io_unset()
conf_io_abort(false);
}
static void test_conf_io_get()
static void test_conf_io_get(void)
{
const char *ref;
char out[OUT_LEN];
......@@ -761,7 +761,7 @@ static void test_conf_io_get()
conf_io_abort(false);
}
static void test_conf_io_diff()
static void test_conf_io_diff(void)
{
const char *ref;
char out[OUT_LEN];
......@@ -858,7 +858,7 @@ static void test_conf_io_diff()
conf_io_abort(false);
}
static void test_conf_io_list()
static void test_conf_io_list(void)
{
const char *ref;
char out[OUT_LEN];
......
......@@ -714,7 +714,7 @@ static void test_unique(void)
knot_rrset_clear(&opt_rr, NULL);
}
static void test_client_subnet()
static void test_client_subnet(void)
{
int ret;
knot_addr_family_t family;
......@@ -826,7 +826,7 @@ static void test_client_subnet()
"EDNS-client-subnet: parse (cmp addr)");
}
static void test_alignment()
static void test_alignment(void)
{
int ret;
......
......@@ -28,7 +28,7 @@ enum serials {
S_HIGHEST = 0xffffffff // highest value
};
static uint32_t random_serial()
static uint32_t random_serial(void)
{
uint32_t s = rand() & 0xff;
s |= (rand() & 0xff) << 8;
......
......@@ -23,7 +23,7 @@
static knot_dname_t* NAME[NCOUNT];
static zone_node_t NODE[NCOUNT];
static knot_dname_t* ORDER[NCOUNT];
static void ztree_init_data()
static void ztree_init_data(void)
{
NAME[0] = knot_dname_from_str_alloc(".");
NAME[1] = knot_dname_from_str_alloc("master.ac.");
......@@ -43,7 +43,7 @@ static void ztree_init_data()
}
}
static void ztree_free_data()
static void ztree_free_data(void)
{
for (unsigned i = 0; i < NCOUNT; ++i)
knot_dname_free(NAME + i, NULL);
......
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