- Neat function prototypes, unshadowed local declarations.

git-svn-id: file:///svn/unbound/trunk@2188 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2010-07-07 13:13:36 +00:00
parent 391e1912de
commit f042f0dd5d
58 changed files with 136 additions and 132 deletions

View file

@ -47,7 +47,7 @@
#include "util/net_help.h"
struct acl_list*
acl_list_create()
acl_list_create(void)
{
struct acl_list* acl = (struct acl_list*)calloc(1,
sizeof(struct acl_list));

View file

@ -89,7 +89,7 @@ struct acl_addr {
* Create acl structure
* @return new structure or NULL on error.
*/
struct acl_list* acl_list_create();
struct acl_list* acl_list_create(void);
/**
* Delete acl structure.

View file

@ -131,7 +131,7 @@ static RETSIGTYPE record_sigh(int sig)
* Stores signals to replay later.
*/
static void
signal_handling_record()
signal_handling_record(void)
{
if( signal(SIGTERM, record_sigh) == SIG_ERR ||
#ifdef SIGQUIT
@ -169,7 +169,7 @@ signal_handling_playback(struct worker* wrk)
}
struct daemon*
daemon_init()
daemon_init(void)
{
struct daemon* daemon = (struct daemon*)calloc(1,
sizeof(struct daemon));
@ -276,7 +276,7 @@ static void daemon_setup_modules(struct daemon* daemon)
* @param shufport: the portlist output.
* @return number of ports available.
*/
int daemon_get_shufport(struct daemon* daemon, int* shufport)
static int daemon_get_shufport(struct daemon* daemon, int* shufport)
{
int i, n, k, temp;
int avail = 0;
@ -339,12 +339,13 @@ daemon_create_workers(struct daemon* daemon)
free(shufport);
}
#ifdef THREADS_DISABLED
/**
* Close all pipes except for the numbered thread.
* @param daemon: daemon to close pipes in.
* @param thr: thread number 0..num-1 of thread to skip.
*/
void close_other_pipes(struct daemon* daemon, int thr)
static void close_other_pipes(struct daemon* daemon, int thr)
{
int i;
for(i=0; i<daemon->num; i++)
@ -359,6 +360,7 @@ void close_other_pipes(struct daemon* daemon, int thr)
}
}
}
#endif /* THREADS_DISABLED */
/**
* Function to start one thread.

View file

@ -108,7 +108,7 @@ struct daemon {
* Initialize daemon structure.
* @return: The daemon structure, or NULL on error.
*/
struct daemon* daemon_init();
struct daemon* daemon_init(void);
/**
* Open shared listening ports (if needed).

View file

@ -1618,7 +1618,7 @@ do_list_local_data(SSL* ssl, struct worker* worker)
}
/** tell other processes to execute the command */
void
static void
distribute_cmd(struct daemon_remote* rc, SSL* ssl, char* cmd)
{
int i;

View file

@ -141,7 +141,7 @@ debug_total_mem(size_t calctotal)
#endif /* UNBOUND_ALLOC_STATS */
/** Report on memory usage by this thread and global */
void
static void
worker_mem_report(struct worker* ATTR_UNUSED(worker),
struct serviced_query* ATTR_UNUSED(cur_serv))
{

View file

@ -1,3 +1,6 @@
7 July 2010: Wouter
- Neat function prototypes, unshadowed local declarations.
6 July 2010: Wouter
- failure to chown the pidfile is not fatal any more.
- testbound uses UTC timezone.

View file

@ -49,7 +49,7 @@
#include "util/net_help.h"
struct iter_donotq*
donotq_create()
donotq_create(void)
{
struct iter_donotq* dq = (struct iter_donotq*)calloc(1,
sizeof(struct iter_donotq));

View file

@ -65,7 +65,7 @@ struct iter_donotq {
* Create donotqueryaddresses structure
* @return new structure or NULL on error.
*/
struct iter_donotq* donotq_create();
struct iter_donotq* donotq_create(void);
/**
* Delete donotqueryaddresses structure.

View file

@ -67,7 +67,7 @@ fwd_cmp(const void* k1, const void* k2)
}
struct iter_forwards*
forwards_create()
forwards_create(void)
{
struct iter_forwards* fwd = (struct iter_forwards*)calloc(1,
sizeof(struct iter_forwards));

View file

@ -89,7 +89,7 @@ struct iter_forward_zone {
* Create forwards
* @return new forwards or NULL on error.
*/
struct iter_forwards* forwards_create();
struct iter_forwards* forwards_create(void);
/**
* Delete forwards.

View file

@ -51,7 +51,7 @@
#include "util/data/dname.h"
struct iter_hints*
hints_create()
hints_create(void)
{
struct iter_hints* hints = (struct iter_hints*)calloc(1,
sizeof(struct iter_hints));

View file

@ -81,7 +81,7 @@ struct iter_hints_stub {
* Create hints
* @return new hints or NULL on error.
*/
struct iter_hints* hints_create();
struct iter_hints* hints_create(void);
/**
* Delete hints.

View file

@ -51,7 +51,7 @@
#include "util/net_help.h"
#include "util/storage/dnstree.h"
struct iter_priv* priv_create()
struct iter_priv* priv_create(void)
{
struct iter_priv* priv = (struct iter_priv*)calloc(1, sizeof(*priv));
if(!priv)

View file

@ -74,7 +74,7 @@ struct iter_priv {
* Create priv structure
* @return new structure or NULL on error.
*/
struct iter_priv* priv_create();
struct iter_priv* priv_create(void);
/**
* Delete priv structure.

View file

@ -141,7 +141,7 @@ response_type_from_server(int rdset,
* answer is there directly, our answer is there after
* a cname, or there is just a cname. */
for(i=0; i<msg->rep->an_numrrsets; i++) {
struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
s = msg->rep->rrsets[i];
/* if the answer section has NS rrset, and qtype ANY
* and the delegation is lower, and no CNAMEs followed,

View file

@ -463,8 +463,7 @@ handle_cname_response(struct module_qstate* qstate, struct iter_qstate* iq,
* @param initial_state The initial response state (normally this
* is QUERY_RESP_STATE, unless it is known that the request won't
* need iterative processing
* @param final_state The final state for the response to this
* request.
* @param finalstate The final state for the response to this request.
* @param subq_ret: if newly allocated, the subquerystate, or NULL if it does
* not need initialisation.
* @param v: if true, validation is done on the subquery.
@ -474,13 +473,13 @@ static int
generate_sub_request(uint8_t* qname, size_t qnamelen, uint16_t qtype,
uint16_t qclass, struct module_qstate* qstate, int id,
struct iter_qstate* iq, enum iter_state initial_state,
enum iter_state final_state, struct module_qstate** subq_ret, int v)
enum iter_state finalstate, struct module_qstate** subq_ret, int v)
{
struct module_qstate* subq = NULL;
struct iter_qstate* subiq = NULL;
uint16_t qflags = 0; /* OPCODE QUERY, no flags */
struct query_info qinf;
int prime = (final_state == PRIME_RESP_STATE)?1:0;
int prime = (finalstate == PRIME_RESP_STATE)?1:0;
qinf.qname = qname;
qinf.qname_len = qnamelen;
qinf.qtype = qtype;
@ -523,7 +522,7 @@ generate_sub_request(uint8_t* qname, size_t qnamelen, uint16_t qtype,
subiq->depth = iq->depth+1;
outbound_list_init(&subiq->outlist);
subiq->state = initial_state;
subiq->final_state = final_state;
subiq->final_state = finalstate;
subiq->qchase = subq->qinfo;
subiq->chase_flags = subq->query_flags;
subiq->refetch_glue = 0;
@ -2672,7 +2671,7 @@ static struct module_func_block iter_block = {
};
struct module_func_block*
iter_get_funcblock()
iter_get_funcblock(void)
{
return &iter_block;
}

View file

@ -314,7 +314,7 @@ struct iter_prep_list {
* Get the iterator function block.
* @return: function block with function pointers to iterator methods.
*/
struct module_func_block* iter_get_funcblock();
struct module_func_block* iter_get_funcblock(void);
/**
* Get iterator state as a string

View file

@ -67,7 +67,7 @@
#endif /* UB_ON_WINDOWS */
struct ub_ctx*
ub_ctx_create()
ub_ctx_create(void)
{
struct ub_ctx* ctx;
unsigned int seed;

View file

@ -375,7 +375,7 @@ static struct module_func_block pythonmod_block = {
&pythonmod_clear, &pythonmod_get_mem
};
struct module_func_block* pythonmod_get_funcblock()
struct module_func_block* pythonmod_get_funcblock(void)
{
return &pythonmod_block;
}

View file

@ -46,7 +46,7 @@
* Get the module function block.
* @return: function block with function pointers to module methods.
*/
struct module_func_block* pythonmod_get_funcblock();
struct module_func_block* pythonmod_get_funcblock(void);
/** python module init */
int pythonmod_init(struct module_env* env, int id);

View file

@ -52,7 +52,7 @@
#include "util/data/msgparse.h"
struct local_zones*
local_zones_create()
local_zones_create(void)
{
struct local_zones* zones = (struct local_zones*)calloc(1,
sizeof(*zones));
@ -290,7 +290,7 @@ get_rr_nameclass(const char* str, uint8_t** nm, uint16_t* dclass)
* @param type: type to look for (host order).
* @return rrset pointer or NULL if not found.
*/
struct local_rrset*
static struct local_rrset*
local_data_find_type(struct local_data* data, uint16_t type)
{
struct local_rrset* p;

View file

@ -149,7 +149,7 @@ struct local_rrset {
* Create local zones storage
* @return new struct or NULL on error.
*/
struct local_zones* local_zones_create();
struct local_zones* local_zones_create(void);
/**
* Delete local zones storage

View file

@ -84,7 +84,7 @@ struct lookinfo {
static int num_wait = 0;
/** usage information for asynclook */
void usage(char* argv[])
static void usage(char* argv[])
{
printf("usage: %s [options] name ...\n", argv[0]);
printf("names are looked up at the same time, asynchronously.\n");

View file

@ -68,7 +68,7 @@ int check_locking_order = 1;
static pid_t check_lock_pid;
/** print all possible debug info on the state of the system */
static void total_debug_info();
static void total_debug_info(void);
/** print pretty lock error and exit */
static void lock_error(struct checked_lock* lock,
@ -674,7 +674,7 @@ static void* checklock_main(void* arg)
}
/** init the main thread */
void checklock_start()
void checklock_start(void)
{
if(!key_created) {
struct thr_check* thisthr = (struct thr_check*)calloc(1,
@ -692,7 +692,7 @@ void checklock_start()
}
/** stop checklocks */
void checklock_stop()
void checklock_stop(void)
{
if(key_created) {
int i;
@ -726,7 +726,7 @@ checklock_thrcreate(pthread_t* id, void* (*func)(void*), void* arg)
/** count number of thread infos */
static int
count_thread_infos()
count_thread_infos(void)
{
int cnt = 0;
int i;
@ -795,7 +795,7 @@ thread_debug_info(struct thr_check* thr)
}
static void
total_debug_info()
total_debug_info(void)
{
int i;
log_info("checklocks: supervising %d threads.",

View file

@ -206,12 +206,12 @@ size_t lock_get_mem(void* lock);
/**
* Initialise checklock. Sets up internal debug structures.
*/
void checklock_start();
void checklock_start(void);
/**
* Cleanup internal debug state.
*/
void checklock_stop();
void checklock_stop(void);
/**
* Init locks.

View file

@ -139,7 +139,7 @@ struct tcp_proxy {
};
/** usage information for delayer */
void usage(char* argv[])
static void usage(char* argv[])
{
printf("usage: %s [options]\n", argv[0]);
printf(" -f addr : use addr, forward to that server, @port.\n");

View file

@ -98,7 +98,7 @@ fake_event_init(struct replay_scenario* scen)
}
void
fake_event_cleanup()
fake_event_cleanup(void)
{
replay_scenario_delete(saved_scenario);
saved_scenario = NULL;

View file

@ -61,7 +61,7 @@ void fake_event_init(struct replay_scenario* scen);
/**
* Deinit fake event services.
*/
void fake_event_cleanup();
void fake_event_cleanup(void);
/**
* Get filename to store temporary config stuff. The pid is added. in /tmp.

View file

@ -492,13 +492,13 @@ qlist_parse_line(ldns_buffer* buf, char* p)
ldns_buffer_write_u16_at(buf, 0, 0); /* zero ID */
if(rec) LDNS_RD_SET(ldns_buffer_begin(buf));
if(edns) {
struct edns_data edns;
memset(&edns, 0, sizeof(edns));
edns.edns_present = 1;
edns.udp_size = EDNS_ADVERTISED_SIZE;
struct edns_data ed;
memset(&ed, 0, sizeof(ed));
ed.edns_present = 1;
ed.udp_size = EDNS_ADVERTISED_SIZE;
/* Set DO bit in all EDNS datagrams ... */
edns.bits = EDNS_DO;
attach_edns_record(buf, &edns);
ed.bits = EDNS_DO;
attach_edns_record(buf, &ed);
}
ldns_rdf_deep_free(rdf);
return 1;

View file

@ -48,7 +48,7 @@
#include "testcode/readhex.h"
/** usage information for pktview */
void usage(char* argv[])
static void usage(char* argv[])
{
printf("usage: %s\n", argv[0]);
printf("present hex packet on stdin.\n");
@ -56,7 +56,7 @@ void usage(char* argv[])
}
/** read hex input */
void read_input(ldns_buffer* pkt, FILE* in)
static void read_input(ldns_buffer* pkt, FILE* in)
{
char buf[102400];
char* np = buf;
@ -69,7 +69,7 @@ void read_input(ldns_buffer* pkt, FILE* in)
}
/** analyze domain name in packet, possibly compressed */
void analyze_dname(ldns_buffer* pkt)
static void analyze_dname(ldns_buffer* pkt)
{
size_t oldpos = ldns_buffer_position(pkt);
size_t len;
@ -84,7 +84,7 @@ void analyze_dname(ldns_buffer* pkt)
}
/** analyze rdata in packet */
void analyze_rdata(ldns_buffer*pkt, const ldns_rr_descriptor* desc,
static void analyze_rdata(ldns_buffer*pkt, const ldns_rr_descriptor* desc,
uint16_t rdlen)
{
int rdf = 0;
@ -124,7 +124,7 @@ void analyze_rdata(ldns_buffer*pkt, const ldns_rr_descriptor* desc,
}
/** analyze rr in packet */
void analyze_rr(ldns_buffer* pkt, int q)
static void analyze_rr(ldns_buffer* pkt, int q)
{
uint16_t type, dclass, len;
uint32_t ttl;
@ -150,7 +150,7 @@ void analyze_rr(ldns_buffer* pkt, int q)
}
/** analyse pkt */
void analyze(ldns_buffer* pkt)
static void analyze(ldns_buffer* pkt)
{
uint16_t i, f, qd, an, ns, ar;
int rrnum = 0;

View file

@ -624,7 +624,7 @@ do_macro_recursion(rbtree_t* store, struct replay_runtime* runtime,
}
/** get var from store */
struct replay_var*
static struct replay_var*
macro_getvar(rbtree_t* store, char* name)
{
struct replay_var k;

View file

@ -58,7 +58,7 @@
#endif
/** usage information for streamtcp */
void usage(char* argv[])
static void usage(char* argv[])
{
printf("usage: %s [options] name type class ...\n", argv[0]);
printf(" sends the name-type-class queries over TCP.\n");

View file

@ -82,14 +82,14 @@ testbound_usage()
/**
* Add options from string to passed argc. splits on whitespace.
* @param optarg: the option argument, "-v -p 12345" or so.
* @param args: the option argument, "-v -p 12345" or so.
* @param pass_argc: ptr to the argc for unbound. Modified.
* @param pass_argv: the argv to pass to unbound. Modified.
*/
static void
add_opts(const char* optarg, int* pass_argc, char* pass_argv[])
add_opts(const char* args, int* pass_argc, char* pass_argv[])
{
const char *p = optarg, *np;
const char *p = args, *np;
size_t len;
while(p && isspace((int)*p))
p++;

View file

@ -121,7 +121,7 @@ test_anchors(ldns_buffer* buff, struct val_anchors* a)
unit_assert(anchors_lookup(a, (uint8_t*)"\002oo\000", 4, c) == NULL);
}
void anchors_test()
void anchors_test(void)
{
ldns_buffer* buff = ldns_buffer_new(65800);
struct val_anchors* a;

View file

@ -100,7 +100,7 @@ dname_test_qdtl(ldns_buffer* buff)
/** test query_dname_compare */
static void
dname_test_query_dname_compare()
dname_test_query_dname_compare(void)
{
unit_show_func("util/data/dname.c", "query_dname_compare");
unit_assert(query_dname_compare((uint8_t*)"", (uint8_t*)"") == 0);
@ -130,7 +130,7 @@ dname_test_query_dname_compare()
/** test dname_count_labels */
static void
dname_test_count_labels()
dname_test_count_labels(void)
{
unit_show_func("util/data/dname.c", "dname_count_labels");
unit_assert(dname_count_labels((uint8_t*)"") == 1);
@ -143,7 +143,7 @@ dname_test_count_labels()
/** test dname_count_size_labels */
static void
dname_test_count_size_labels()
dname_test_count_size_labels(void)
{
size_t sz = 0;
unit_show_func("util/data/dname.c", "dname_count_size_labels");
@ -270,7 +270,7 @@ dname_test_pkt_dname_len(ldns_buffer* buff)
/** test dname_lab_cmp */
static void
dname_test_dname_lab_cmp()
dname_test_dname_lab_cmp(void)
{
int ml = 0; /* number of labels that matched exactly */
unit_show_func("util/data/dname.c", "dname_lab_cmp");
@ -372,7 +372,7 @@ dname_test_dname_lab_cmp()
/** test dname_subdomain_c */
static void
dname_test_subdomain()
dname_test_subdomain(void)
{
unit_show_func("util/data/dname.c", "dname_subdomain");
unit_assert(dname_subdomain_c(
@ -409,7 +409,7 @@ dname_test_subdomain()
/** test dname_strict_subdomain */
static void
dname_test_strict_subdomain()
dname_test_strict_subdomain(void)
{
unit_show_func("util/data/dname.c", "dname_strict_subdomain");
unit_assert(!dname_strict_subdomain(
@ -446,7 +446,7 @@ dname_test_strict_subdomain()
/** test dname_is_root */
static void
dname_test_isroot()
dname_test_isroot(void)
{
unit_show_func("util/data/dname.c", "dname_isroot");
unit_assert(dname_is_root((uint8_t*)"\000"));
@ -459,7 +459,7 @@ dname_test_isroot()
/** test dname_remove_label */
static void
dname_test_removelabel()
dname_test_removelabel(void)
{
uint8_t* orig = (uint8_t*)"\007example\003com\000";
uint8_t* n = orig;
@ -478,7 +478,7 @@ dname_test_removelabel()
/** test dname_signame_label_count */
static void
dname_test_sigcount()
dname_test_sigcount(void)
{
unit_show_func("util/data/dname.c", "dname_signame_label_count");
unit_assert(dname_signame_label_count((uint8_t*)"\000") == 0);
@ -498,7 +498,7 @@ dname_test_sigcount()
/** test dname_is_wild routine */
static void
dname_test_iswild()
dname_test_iswild(void)
{
unit_show_func("util/data/dname.c", "dname_iswild");
unit_assert( !dname_is_wild((uint8_t*)"\000") );
@ -509,7 +509,7 @@ dname_test_iswild()
/** test dname_canonical_compare */
static void
dname_test_canoncmp()
dname_test_canoncmp(void)
{
unit_show_func("util/data/dname.c", "dname_canonical_compare");
/* equality */
@ -729,7 +729,7 @@ dname_test_canoncmp()
/** Test dname_get_shared_topdomain */
static void
dname_test_topdomain()
dname_test_topdomain(void)
{
unit_show_func("util/data/dname.c", "dname_get_shared_topdomain");
unit_assert( query_dname_compare(
@ -751,7 +751,7 @@ dname_test_topdomain()
/** Test dname_valid */
static void
dname_test_valid()
dname_test_valid(void)
{
unit_show_func("util/data/dname.c", "dname_valid");
unit_assert( dname_valid(
@ -831,7 +831,7 @@ dname_setup_bufs(ldns_buffer* loopbuf, ldns_buffer* boundbuf)
ldns_buffer_flip(boundbuf);
}
void dname_test()
void dname_test(void)
{
ldns_buffer* loopbuf = ldns_buffer_new(14);
ldns_buffer* boundbuf = ldns_buffer_new(16);

View file

@ -477,7 +477,7 @@ test_threaded_table(struct lruhash* table)
if(0) lruhash_status(table, "hashtest", 1);
}
void lruhash_test()
void lruhash_test(void)
{
/* start very very small array, so it can do lots of table_grow() */
/* also small in size so that reclaim has to be done quickly. */

View file

@ -65,7 +65,7 @@ int testcount = 0;
#include "util/alloc.h"
/** test alloc code */
static void
alloc_test() {
alloc_test(void) {
alloc_special_t *t1, *t2;
struct alloc_cache major, minor1, minor2;
int i;
@ -104,7 +104,7 @@ alloc_test() {
#include "util/net_help.h"
/** test net code */
static void
net_test()
net_test(void)
{
const char* t4[] = {"\000\000\000\000",
"\200\000\000\000",
@ -309,7 +309,7 @@ net_test()
#include "util/config_file.h"
/** test config_file: cfg_parse_memsize */
static void
config_memsize_test()
config_memsize_test(void)
{
size_t v = 0;
unit_show_func("util/config_file.c", "cfg_parse_memsize");
@ -348,7 +348,7 @@ config_memsize_test()
#include "util/rtt.h"
/** test RTT code */
static void
rtt_test()
rtt_test(void)
{
int init = 376;
int i;
@ -375,7 +375,7 @@ rtt_test()
#include "util/config_file.h"
/** test host cache */
static void
infra_test()
infra_test(void)
{
struct sockaddr_storage one;
socklen_t onelen;
@ -444,7 +444,7 @@ infra_test()
#include "util/random.h"
/** test randomness */
static void
rnd_test()
rnd_test(void)
{
struct ub_randstate* r;
int num = 1000, i;

View file

@ -57,20 +57,20 @@ void unit_show_func(const char* file, const char* func);
void unit_show_feature(const char* feature);
/** unit test lruhashtable implementation */
void lruhash_test();
void lruhash_test(void);
/** unit test slabhashtable implementation */
void slabhash_test();
void slabhash_test(void);
/** unit test for msgreply and msgparse */
void msgparse_test();
void msgparse_test(void);
/** unit test dname handling functions */
void dname_test();
void dname_test(void);
/** unit test trust anchor storage functions */
void anchors_test();
void anchors_test(void);
/** unit test for verification functions */
void verify_test();
void verify_test(void);
/** unit test for negative cache functions */
void neg_test();
void neg_test(void);
/** unit test for regional allocator functions */
void regional_test();
void regional_test(void);
#endif /* TESTCODE_UNITMAIN_H */

View file

@ -573,7 +573,7 @@ testfromdrillfile(ldns_buffer* pkt, struct alloc_cache* alloc,
fclose(in);
}
void msgparse_test()
void msgparse_test(void)
{
ldns_buffer* pkt = ldns_buffer_new(65553);
ldns_buffer* out = ldns_buffer_new(65553);

View file

@ -91,7 +91,7 @@ static void print_neg_cache(struct val_neg_cache* neg)
}
/** get static pointer to random zone name */
static char* get_random_zone()
static char* get_random_zone(void)
{
static char zname[256];
int labels = random() % 3;
@ -526,7 +526,7 @@ static void stress_test(struct val_neg_cache* neg)
}
}
void neg_test()
void neg_test(void)
{
struct val_neg_cache* neg;
srandom(48);

View file

@ -195,7 +195,7 @@ corner_cases(struct regional* r)
/** test specific cases */
static void
specific_cases()
specific_cases(void)
{
struct regional* r = regional_create();
corner_cases(r);
@ -228,7 +228,7 @@ burden_test(size_t max)
/** randomly allocate stuff */
static void
random_burden()
random_burden(void)
{
size_t max_alloc = 2048 + 128; /* small chance of LARGE */
int i;
@ -236,7 +236,7 @@ random_burden()
burden_test(max_alloc);
}
void regional_test()
void regional_test(void)
{
unit_show_feature("regional");
specific_cases();

View file

@ -356,7 +356,7 @@ test_threaded_table(struct slabhash* table)
if(0) slabhash_status(table, "hashtest", 1);
}
void slabhash_test()
void slabhash_test(void)
{
/* start very very small array, so it can do lots of table_grow() */
/* also small in size so that reclaim has to be done quickly. */

View file

@ -343,7 +343,7 @@ unitest_nsec_has_type_rdata(char* bitmap, size_t len, uint16_t type)
/** Test NSEC type bitmap routine */
static void
nsectest()
nsectest(void)
{
/* bitmap starts at type bitmap rdata field */
/* from rfc 4034 example */
@ -465,7 +465,7 @@ nsec3_hash_test(const char* fname)
}
void
verify_test()
verify_test(void)
{
unit_show_feature("signature verify");
verifytest_file("testdata/test_signatures.1", "20070818005004");

View file

@ -70,7 +70,7 @@ int ub_c_wrap(void);
static void init_outgoing_availports(int* array, int num);
struct config_file*
config_create()
config_create(void)
{
struct config_file* cfg;
cfg = (struct config_file*)calloc(1, sizeof(struct config_file));
@ -198,7 +198,7 @@ error_exit:
return NULL;
}
struct config_file* config_create_forlib()
struct config_file* config_create_forlib(void)
{
struct config_file* cfg = config_create();
if(!cfg) return NULL;
@ -848,7 +848,7 @@ int cfg_condense_ports(struct config_file* cfg, int** avail)
}
/** print error with file and line number */
void ub_c_error_va_list(const char *fmt, va_list args)
static void ub_c_error_va_list(const char *fmt, va_list args)
{
cfg_parser->errors++;
fprintf(stderr, "%s:%d: error: ", cfg_parser->filename,
@ -873,7 +873,7 @@ void ub_c_error(const char *str)
cfg_parser->line, str);
}
int ub_c_wrap()
int ub_c_wrap(void)
{
return 1;
}

View file

@ -327,13 +327,13 @@ struct config_strlist_head {
* Create config file structure. Filled with default values.
* @return: the new structure or NULL on memory error.
*/
struct config_file* config_create();
struct config_file* config_create(void);
/**
* Create config file structure for library use. Filled with default values.
* @return: the new structure or NULL on memory error.
*/
struct config_file* config_create_forlib();
struct config_file* config_create_forlib(void);
/**
* Read the config file from the specified filename.

View file

@ -48,7 +48,7 @@
/** block all signals, masks them away. */
void
ub_thread_blocksigs()
ub_thread_blocksigs(void)
{
#if defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS) || defined(HAVE_SIGPROCMASK)
# if defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS)

View file

@ -63,10 +63,10 @@
* The errno is logged to the logfile with a descriptive comment.
*/
#define LOCKRET(func) do {\
int err; \
if( (err=(func)) != 0) \
int lockret_err; \
if( (lockret_err=(func)) != 0) \
log_err("%s at %d could not " #func ": %s", \
__FILE__, __LINE__, strerror(err)); \
__FILE__, __LINE__, strerror(lockret_err)); \
} while(0)
/** DEBUG: use thread debug whenever possible */
@ -283,7 +283,7 @@ typedef void* ub_thread_key_t;
* Block all signals for this thread.
* fatal exit on error.
*/
void ub_thread_blocksigs();
void ub_thread_blocksigs(void);
/**
* unblock one signal for this thread.

View file

@ -333,7 +333,7 @@ comm_point_send_udp_msg(struct comm_point *c, ldns_buffer* packet,
}
/** print debug ancillary info */
void p_ancil(const char* str, struct comm_reply* r)
static void p_ancil(const char* str, struct comm_reply* r)
{
#if defined(AF_INET6) && defined(IPV6_PKTINFO) && (defined(HAVE_RECVMSG) || defined(HAVE_SENDMSG))
if(r->srctype != 4 && r->srctype != 6) {
@ -380,7 +380,7 @@ void p_ancil(const char* str, struct comm_reply* r)
}
/** send a UDP reply over specified interface*/
int
static int
comm_point_send_udp_msg_if(struct comm_point *c, ldns_buffer* packet,
struct sockaddr* addr, socklen_t addrlen, struct comm_reply* r)
{
@ -482,7 +482,7 @@ comm_point_udp_ancil_callback(int fd, short event, void* arg)
struct comm_reply rep;
struct msghdr msg;
struct iovec iov[1];
ssize_t recv;
ssize_t rcv;
char ancil[256];
int i;
#ifndef S_SPLINT_S
@ -512,15 +512,15 @@ comm_point_udp_ancil_callback(int fd, short event, void* arg)
msg.msg_controllen = sizeof(ancil);
#endif /* S_SPLINT_S */
msg.msg_flags = 0;
recv = recvmsg(fd, &msg, 0);
if(recv == -1) {
rcv = recvmsg(fd, &msg, 0);
if(rcv == -1) {
if(errno != EAGAIN && errno != EINTR) {
log_err("recvmsg failed: %s", strerror(errno));
}
return;
}
rep.addrlen = msg.msg_namelen;
ldns_buffer_skip(rep.c->buffer, recv);
ldns_buffer_skip(rep.c->buffer, rcv);
ldns_buffer_flip(rep.c->buffer);
rep.srctype = 0;
#ifndef S_SPLINT_S
@ -574,7 +574,7 @@ void
comm_point_udp_callback(int fd, short event, void* arg)
{
struct comm_reply rep;
ssize_t recv;
ssize_t rcv;
int i;
rep.c = (struct comm_point*)arg;
@ -589,10 +589,10 @@ comm_point_udp_callback(int fd, short event, void* arg)
rep.addrlen = (socklen_t)sizeof(rep.addr);
log_assert(fd != -1);
log_assert(ldns_buffer_remaining(rep.c->buffer) > 0);
recv = recvfrom(fd, (void*)ldns_buffer_begin(rep.c->buffer),
rcv = recvfrom(fd, (void*)ldns_buffer_begin(rep.c->buffer),
ldns_buffer_remaining(rep.c->buffer), 0,
(struct sockaddr*)&rep.addr, &rep.addrlen);
if(recv == -1) {
if(rcv == -1) {
#ifndef USE_WINSOCK
if(errno != EAGAIN && errno != EINTR)
log_err("recvfrom %d failed: %s",
@ -606,7 +606,7 @@ comm_point_udp_callback(int fd, short event, void* arg)
#endif
return;
}
ldns_buffer_skip(rep.c->buffer, recv);
ldns_buffer_skip(rep.c->buffer, rcv);
ldns_buffer_flip(rep.c->buffer);
rep.srctype = 0;
fptr_ok(fptr_whitelist_comm_point(rep.c->callback));

View file

@ -63,7 +63,7 @@
#endif
struct regional*
regional_create()
regional_create(void)
{
return regional_create_custom(REGIONAL_CHUNK_SIZE);
}

View file

@ -80,7 +80,7 @@ struct regional
* Create a new regional.
* @return: newly allocated regional.
*/
struct regional* regional_create();
struct regional* regional_create(void);
/**
* Create a new region, with custom settings.

View file

@ -80,7 +80,7 @@ dosetup(struct timehist* hist)
}
}
struct timehist* timehist_setup()
struct timehist* timehist_setup(void)
{
struct timehist* hist = (struct timehist*)calloc(1,
sizeof(struct timehist));
@ -184,7 +184,7 @@ void timehist_log(struct timehist* hist, const char* name)
}
/** total number in histogram */
size_t
static size_t
timehist_count(struct timehist* hist)
{
size_t i, res = 0;

View file

@ -71,7 +71,7 @@ struct timehist {
* Setup a histogram, default
* @return histogram or NULL on malloc failure.
*/
struct timehist* timehist_setup();
struct timehist* timehist_setup(void);
/**
* Delete histogram

View file

@ -2001,19 +2001,19 @@ autr_debug_print_tp(struct trust_anchor* tp)
log_info("assembled %d DS and %d DNSKEYs",
(int)tp->numDS, (int)tp->numDNSKEY);
if(0) { /* turned off because it prints to stderr */
ldns_buffer* buf = ldns_buffer_new(70000);
ldns_buffer* bf = ldns_buffer_new(70000);
ldns_rr_list* list;
if(tp->ds_rrset) {
list = packed_rrset_to_rr_list(tp->ds_rrset, buf);
list = packed_rrset_to_rr_list(tp->ds_rrset, bf);
ldns_rr_list_print(stderr, list);
ldns_rr_list_deep_free(list);
}
if(tp->dnskey_rrset) {
list = packed_rrset_to_rr_list(tp->dnskey_rrset, buf);
list = packed_rrset_to_rr_list(tp->dnskey_rrset, bf);
ldns_rr_list_print(stderr, list);
ldns_rr_list_deep_free(list);
}
ldns_buffer_free(buf);
ldns_buffer_free(bf);
}
log_info("file %s", tp->autr->file);
ctime_r(&tp->autr->last_queried, buf);

View file

@ -72,7 +72,7 @@ anchor_cmp(const void* k1, const void* k2)
}
struct val_anchors*
anchors_create()
anchors_create(void)
{
struct val_anchors* a = (struct val_anchors*)calloc(1, sizeof(*a));
if(!a)

View file

@ -132,7 +132,7 @@ struct trust_anchor {
* Create trust anchor storage
* @return new storage or NULL on error.
*/
struct val_anchors* anchors_create();
struct val_anchors* anchors_create(void);
/**
* Delete trust anchor storage.

View file

@ -2918,7 +2918,7 @@ static struct module_func_block val_block = {
};
struct module_func_block*
val_get_funcblock()
val_get_funcblock(void)
{
return &val_block;
}

View file

@ -250,7 +250,7 @@ struct val_qstate {
* Get the validator function block.
* @return: function block with function pointers to validator methods.
*/
struct module_func_block* val_get_funcblock();
struct module_func_block* val_get_funcblock(void);
/**
* Get validator state as a string