Commit 82ca3342 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

declare arguments as UNUSED() when used in assertions only

parent 68e4926b
......@@ -300,7 +300,8 @@ client_send(isc_task_t *task, isc_event_t *ev)
isc_socketevent_t *dev = (isc_socketevent_t *)ev;
UNUSED(task);
UNUSED(dev);
INSIST(CLIENT_ISSEND(client));
INSIST(client->sendbuf == dev->region.base);
......
......@@ -460,6 +460,8 @@ static void
client_shutdown(isc_task_t *task, isc_event_t *event) {
ns_client_t *client;
UNUSED(task);
REQUIRE(event != NULL);
REQUIRE(event->ev_type == ISC_TASKEVENT_SHUTDOWN);
client = event->ev_arg;
......@@ -579,6 +581,8 @@ client_senddone(isc_task_t *task, isc_event_t *event) {
ns_client_t *client;
isc_socketevent_t *sevent = (isc_socketevent_t *) event;
UNUSED(task);
REQUIRE(sevent != NULL);
REQUIRE(sevent->ev_type == ISC_SOCKEVENT_SENDDONE);
client = sevent->ev_arg;
......@@ -815,6 +819,8 @@ client_request(isc_task_t *task, isc_event_t *event) {
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
UNUSED(task);
INSIST(client->recursionquota == NULL);
INSIST(client->state ==
......@@ -1075,6 +1081,8 @@ client_timeout(isc_task_t *task, isc_event_t *event) {
REQUIRE(task == client->task);
REQUIRE(client->timer != NULL);
UNUSED(task);
CTRACE("timeout");
isc_event_free(&event);
......@@ -1240,6 +1248,8 @@ client_newconn(isc_task_t *task, isc_event_t *event) {
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(client->task == task);
UNUSED(task);
INSIST(client->state == NS_CLIENTSTATE_READY);
INSIST(client->naccepts == 1);
......
......@@ -1719,6 +1719,8 @@ query_resume(isc_task_t *task, isc_event_t *event) {
* Resume a query after recursion.
*/
UNUSED(task);
REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE);
client = devent->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
......
......@@ -2307,6 +2307,8 @@ updatedone_action(isc_task_t *task, isc_event_t *event)
update_event_t *uev = (update_event_t *) event;
ns_client_t *client = (ns_client_t *) event->ev_arg;
UNUSED(task);
INSIST(event->ev_type == DNS_EVENT_UPDATEDONE);
INSIST(task == client->task);
......
......@@ -176,6 +176,7 @@ fetch_done(isc_task_t *task, isc_event_t *event) {
dns_byaddr_t *byaddr = event->ev_arg;
dns_fetchevent_t *fevent;
UNUSED(task);
REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE);
REQUIRE(VALID_BYADDR(byaddr));
REQUIRE(byaddr->task == task);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cache.c,v 1.18 2000/04/25 19:35:39 tale Exp $ */
/* $Id: cache.c,v 1.19 2000/04/28 01:23:49 gson Exp $ */
#include <config.h>
......@@ -452,6 +452,7 @@ end_cleaning(cache_cleaner_t *cleaner, isc_event_t *event) {
static void
cleaning_timer_action(isc_task_t *task, isc_event_t *event) {
cache_cleaner_t *cleaner = event->ev_arg;
UNUSED(task);
INSIST(task == cleaner->task);
INSIST(event->ev_type == ISC_TIMEREVENT_TICK);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: confctx.c,v 1.52 2000/04/28 01:10:29 halley Exp $ */
/* $Id: confctx.c,v 1.53 2000/04/28 01:23:54 gson Exp $ */
#include <config.h>
......@@ -2617,6 +2617,8 @@ cfg_get_iplist(dns_c_options_t *options,
{
isc_result_t res;
UNUSED(options);
REQUIRE(DNS_C_CONFOPT_VALID(options));
REQUIRE(resval != NULL);
......
......@@ -2256,6 +2256,8 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
rdatasetheader_t *foundsig, *nssig, *cnamesig;
rbtdb_rdatatype_t sigtype, nxtype;
UNUSED(version);
search.rbtdb = (dns_rbtdb_t *)db;
REQUIRE(VALID_RBTDB(search.rbtdb));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.29 2000/04/27 00:02:22 tale Exp $ */
/* $Id: tsig_250.c,v 1.30 2000/04/28 01:23:58 gson Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
......@@ -467,6 +467,7 @@ additionaldata_any_tsig(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
......@@ -479,6 +480,7 @@ digest_any_tsig(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
UNUSED(rdata);
UNUSED(digest);
UNUSED(arg);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: afsdb_18.c,v 1.22 2000/04/27 00:02:23 tale Exp $ */
/* $Id: afsdb_18.c,v 1.23 2000/04/28 01:23:59 gson Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
......@@ -185,12 +185,13 @@ fromstruct_afsdb(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
static inline isc_result_t
tostruct_afsdb(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
{
UNUSED(target);
UNUSED(mctx);
REQUIRE(rdata->type == 18);
REQUIRE(target != NULL);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
return (ISC_R_NOTIMPLEMENTED);
}
......@@ -202,6 +203,9 @@ freestruct_afsdb(void *source)
REQUIRE(source != NULL);
REQUIRE(afsdb->common.rdtype == 18);
REQUIRE(ISC_FALSE);
UNUSED(source);
UNUSED(afsdb);
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.c,v 1.23 2000/04/27 00:02:24 tale Exp $ */
/* $Id: cert_37.c,v 1.24 2000/04/28 01:23:59 gson Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
......@@ -165,7 +165,8 @@ tostruct_cert(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
REQUIRE(rdata->type == 37);
REQUIRE(target != NULL && target == NULL);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -176,6 +177,8 @@ static inline void
freestruct_cert(void *target) {
REQUIRE(target != NULL && target != NULL);
REQUIRE(ISC_FALSE); /* XXX */
UNUSED(target);
}
static inline isc_result_t
......@@ -184,6 +187,7 @@ additionaldata_cert(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 37);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cname_5.c,v 1.26 2000/04/27 23:57:55 gson Exp $ */
/* $Id: cname_5.c,v 1.27 2000/04/28 01:24:00 gson Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
......@@ -152,6 +152,7 @@ tostruct_cname(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
REQUIRE(rdata->type == 5);
REQUIRE(target != NULL);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dname_39.c,v 1.18 2000/04/27 00:02:25 tale Exp $ */
/* $Id: dname_39.c,v 1.19 2000/04/28 01:24:00 gson Exp $ */
/* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */
......@@ -149,6 +149,7 @@ fromstruct_dname(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
static inline isc_result_t
tostruct_dname(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
{
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -163,12 +164,15 @@ freestruct_dname(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /* XXX */
UNUSED(source);
}
static inline isc_result_t
additionaldata_dname(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
void *arg)
{
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: gpos_27.c,v 1.16 2000/04/07 03:54:12 explorer Exp $ */
/* $Id: gpos_27.c,v 1.17 2000/04/28 01:24:01 gson Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
......@@ -135,6 +135,7 @@ tostruct_gpos(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
REQUIRE(rdata->type == 27);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -146,6 +147,8 @@ freestruct_gpos(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /* XXX */
UNUSED(source);
}
static inline isc_result_t
......@@ -154,6 +157,7 @@ additionaldata_gpos(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 27);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.c,v 1.22 2000/04/07 03:54:13 explorer Exp $ */
/* $Id: hinfo_13.c,v 1.23 2000/04/28 01:24:01 gson Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
......@@ -122,6 +122,7 @@ tostruct_hinfo(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
REQUIRE(rdata->type == 13);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -132,16 +133,19 @@ static inline void
freestruct_hinfo(void *source) {
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /* XXX */
UNUSED(source);
}
static inline isc_result_t
additionaldata_hinfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
void *arg)
{
REQUIRE(rdata->type == 13);
UNUSED(add);
UNUSED(arg);
REQUIRE(rdata->type == 13);
UNUSED(rdata);
return (ISC_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: isdn_20.c,v 1.16 2000/04/07 03:54:14 explorer Exp $ */
/* $Id: isdn_20.c,v 1.17 2000/04/28 01:24:01 gson Exp $ */
/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
......@@ -126,11 +126,12 @@ fromstruct_isdn(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
static inline isc_result_t
tostruct_isdn(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
REQUIRE(rdata->type == 20);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
REQUIRE(rdata->type == 20);
return (ISC_R_NOTIMPLEMENTED);
}
......@@ -138,17 +139,20 @@ static inline void
freestruct_isdn(void *source) {
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
additionaldata_isdn(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
void *arg)
{
REQUIRE(rdata->type == 20);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
REQUIRE(rdata->type == 20);
return (ISC_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: key_25.c,v 1.21 2000/04/27 00:02:26 tale Exp $ */
/* $Id: key_25.c,v 1.22 2000/04/28 01:24:02 gson Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
......@@ -264,6 +264,7 @@ additionaldata_key(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 25);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: loc_29.c,v 1.15 2000/04/27 00:02:27 tale Exp $ */
/* $Id: loc_29.c,v 1.16 2000/04/28 01:24:02 gson Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
......@@ -583,11 +583,12 @@ fromstruct_loc(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
static inline isc_result_t
tostruct_loc(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
{
REQUIRE(rdata->type == 29);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
REQUIRE(rdata->type == 29);
return (ISC_R_NOTIMPLEMENTED);
}
......@@ -596,17 +597,20 @@ freestruct_loc(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
additionaldata_loc(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
void *arg)
{
REQUIRE(rdata->type == 29);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
REQUIRE(rdata->type == 29);
return (ISC_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mb_7.c,v 1.25 2000/04/27 00:02:27 tale Exp $ */
/* $Id: mb_7.c,v 1.26 2000/04/28 01:24:03 gson Exp $ */
/* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */
......@@ -144,6 +144,7 @@ fromstruct_mb(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
static inline isc_result_t
tostruct_mb(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -154,6 +155,7 @@ tostruct_mb(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
static inline void
freestruct_mb(void *source) {
UNUSED(source);
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: md_3.c,v 1.27 2000/04/27 23:57:55 gson Exp $ */
/* $Id: md_3.c,v 1.28 2000/04/28 01:24:03 gson Exp $ */
/* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */
......@@ -157,6 +157,8 @@ static inline void
freestruct_md(void *source) {
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mf_4.c,v 1.25 2000/04/27 23:57:55 gson Exp $ */
/* $Id: mf_4.c,v 1.26 2000/04/28 01:24:04 gson Exp $ */
/* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */
......@@ -164,6 +164,8 @@ freestruct_mf(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mg_8.c,v 1.23 2000/04/27 00:02:29 tale Exp $ */
/* $Id: mg_8.c,v 1.24 2000/04/28 01:24:04 gson Exp $ */
/* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */
......@@ -152,6 +152,7 @@ tostruct_mg(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
REQUIRE(rdata->type == 8);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -163,6 +164,7 @@ freestruct_mg(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
......@@ -171,8 +173,9 @@ additionaldata_mg(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 8);
(void)add;
(void)arg;
UNUSED(add);
UNUSED(arg);
UNUSED(rdata);
return (ISC_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: minfo_14.c,v 1.24 2000/04/27 00:02:30 tale Exp $ */
/* $Id: minfo_14.c,v 1.25 2000/04/28 01:24:05 gson Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
......@@ -198,6 +198,7 @@ tostruct_minfo(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
REQUIRE(rdata->type == 14);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -209,6 +210,8 @@ freestruct_minfo(void *source)
{
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
......@@ -217,8 +220,9 @@ additionaldata_minfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 14);
(void)add;
(void)arg;
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
return (ISC_R_SUCCESS);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mr_9.c,v 1.22 2000/04/27 00:02:31 tale Exp $ */
/* $Id: mr_9.c,v 1.23 2000/04/28 01:24:05 gson Exp $ */
/* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */
......@@ -145,6 +145,7 @@ static inline isc_result_t
tostruct_mr(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
REQUIRE(rdata->type == 9);
UNUSED(rdata);
UNUSED(target);
UNUSED(mctx);
......@@ -155,6 +156,8 @@ static inline void
freestruct_mr(void *source) {
REQUIRE(source != NULL);
REQUIRE(ISC_FALSE); /*XXX*/
UNUSED(source);
}
static inline isc_result_t
......@@ -163,6 +166,7 @@ additionaldata_mr(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 9);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
...