Commit b454c031 authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] use ANSI prototypes, clean up some casts

parent e7c0d42b
...@@ -2574,7 +2574,7 @@ report(const char *format, ...) { ...@@ -2574,7 +2574,7 @@ report(const char *format, ...) {
} }
static void static void
build_final_keylist() { build_final_keylist(void) {
isc_result_t result; isc_result_t result;
dns_dbversion_t *ver = NULL; dns_dbversion_t *ver = NULL;
dns_diff_t diff; dns_diff_t diff;
......
...@@ -165,7 +165,8 @@ main(int argc, char *argv[]) { ...@@ -165,7 +165,8 @@ main(int argc, char *argv[]) {
#endif #endif
char *classname = NULL; char *classname = NULL;
dns_rdataclass_t rdclass; dns_rdataclass_t rdclass;
char ch, *endp; char *endp;
int ch;
#define CMDLINE_FLAGS \ #define CMDLINE_FLAGS \
"m:o:I:c:E:v:xz" "m:o:I:c:E:v:xz"
......
...@@ -735,7 +735,7 @@ destroy_managers(void) { ...@@ -735,7 +735,7 @@ destroy_managers(void) {
} }
static void static void
dump_symboltable() { dump_symboltable(void) {
int i; int i;
isc_result_t result; isc_result_t result;
const char *fname; const char *fname;
......
...@@ -607,7 +607,7 @@ ns_os_changeuser(void) { ...@@ -607,7 +607,7 @@ ns_os_changeuser(void) {
} }
void void
ns_os_adjustnofile() { ns_os_adjustnofile(void) {
#ifdef HAVE_LINUXTHREADS #ifdef HAVE_LINUXTHREADS
isc_result_t result; isc_result_t result;
isc_resourcevalue_t newvalue; isc_resourcevalue_t newvalue;
......
...@@ -44,7 +44,7 @@ int bindmain(int, char *[]); /* From main.c */ ...@@ -44,7 +44,7 @@ int bindmain(int, char *[]); /* From main.c */
* Initialize the Service by registering it. * Initialize the Service by registering it.
*/ */
void void
ntservice_init() { ntservice_init(void) {
if (!foreground) { if (!foreground) {
/* Register handler with the SCM */ /* Register handler with the SCM */
hServiceStatus = RegisterServiceCtrlHandler(BIND_SERVICE_NAME, hServiceStatus = RegisterServiceCtrlHandler(BIND_SERVICE_NAME,
...@@ -64,14 +64,14 @@ ntservice_init() { ...@@ -64,14 +64,14 @@ ntservice_init() {
} }
void void
ntservice_shutdown() { ntservice_shutdown(void) {
UpdateSCM(SERVICE_STOPPED); UpdateSCM(SERVICE_STOPPED);
} }
/* /*
* Routine to check if this is a service or a foreground program * Routine to check if this is a service or a foreground program
*/ */
BOOL BOOL
ntservice_isservice() { ntservice_isservice(void) {
return(!foreground); return(!foreground);
} }
/* /*
......
...@@ -56,7 +56,7 @@ static char *version_error = ...@@ -56,7 +56,7 @@ static char *version_error =
"named requires Windows 2000 Service Pack 2 or later to run correctly"; "named requires Windows 2000 Service Pack 2 or later to run correctly";
void void
ns_paths_init() { ns_paths_init(void) {
if (!Initialized) if (!Initialized)
isc_ntpaths_init(); isc_ntpaths_init();
......
...@@ -250,7 +250,7 @@ keyclass_fromtext(const char *name) { ...@@ -250,7 +250,7 @@ keyclass_fromtext(const char *name) {
} }
static void static void
usage() { usage(void) {
fprintf(stderr, fprintf(stderr,
"Usage:\n" "Usage:\n"
"\tpkcs11-keygen -a algorithm -b keysize -l label\n" "\tpkcs11-keygen -a algorithm -b keysize -l label\n"
......
...@@ -104,7 +104,7 @@ destroy_resolver(dns_resolver_t **resolverp) { ...@@ -104,7 +104,7 @@ destroy_resolver(dns_resolver_t **resolverp) {
} }
static void static void
test_dns_resolver_create() { test_dns_resolver_create(void) {
dns_resolver_t *resolver = NULL; dns_resolver_t *resolver = NULL;
t_assert("test_dns_resolver_create", 1, T_REQUIRED, "%s", t_assert("test_dns_resolver_create", 1, T_REQUIRED, "%s",
......
...@@ -76,7 +76,7 @@ isc_sockaddr_t addr; ...@@ -76,7 +76,7 @@ isc_sockaddr_t addr;
(void)NULL (void)NULL
static void static void
usage() { usage(void) {
fprintf(stderr, fprintf(stderr,
"usage: zone_test [-dqsSM] [-c class] [-f file] zone\n"); "usage: zone_test [-dqsSM] [-c class] [-f file] zone\n");
exit(1); exit(1);
......
...@@ -59,8 +59,9 @@ check_result(isc_result_t result, const char *message) { ...@@ -59,8 +59,9 @@ check_result(isc_result_t result, const char *message) {
} }
static void static void
usage() { usage(void) {
printf("Usage: %s salt algorithm iterations domain\n", program); fprintf(stderr, "Usage: %s salt algorithm iterations domain\n",
program);
exit(1); exit(1);
} }
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: ecdb.c,v 1.10.34.1 2012/02/07 00:44:14 each Exp $ */
#include "config.h" #include "config.h"
#include <isc/result.h> #include <isc/result.h>
...@@ -775,19 +773,24 @@ rdataset_settrust(dns_rdataset_t *rdataset, dns_trust_t trust) { ...@@ -775,19 +773,24 @@ rdataset_settrust(dns_rdataset_t *rdataset, dns_trust_t trust) {
static void static void
rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp) { rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp) {
ecdb_rdatasetiter_t *ecdbiterator;
isc_mem_t *mctx; isc_mem_t *mctx;
union {
dns_rdatasetiter_t *rdatasetiterator;
ecdb_rdatasetiter_t *ecdbiterator;
} u;
REQUIRE(iteratorp != NULL); REQUIRE(iteratorp != NULL);
ecdbiterator = (ecdb_rdatasetiter_t *)*iteratorp; REQUIRE(DNS_RDATASETITER_VALID(*iteratorp));
REQUIRE(DNS_RDATASETITER_VALID(&ecdbiterator->common));
mctx = ecdbiterator->common.db->mctx; u.rdatasetiterator = *iteratorp;
ecdbiterator->common.magic = 0; mctx = u.ecdbiterator->common.db->mctx;
u.ecdbiterator->common.magic = 0;
dns_db_detachnode(ecdbiterator->common.db, &ecdbiterator->common.node); dns_db_detachnode(u.ecdbiterator->common.db,
isc_mem_put(mctx, ecdbiterator, sizeof(ecdb_rdatasetiter_t)); &u.ecdbiterator->common.node);
isc_mem_put(mctx, u.ecdbiterator,
sizeof(ecdb_rdatasetiter_t));
*iteratorp = NULL; *iteratorp = NULL;
} }
......
...@@ -208,7 +208,7 @@ set_state(unsigned int family, isc_uint32_t ipnum, const geoipv6_t *ipnum6, ...@@ -208,7 +208,7 @@ set_state(unsigned int family, isc_uint32_t ipnum, const geoipv6_t *ipnum6,
} }
static geoip_state_t * static geoip_state_t *
get_state() { get_state(void) {
#ifdef ISC_PLATFORM_USETHREADS #ifdef ISC_PLATFORM_USETHREADS
isc_result_t result; isc_result_t result;
geoip_state_t *state; geoip_state_t *state;
......
...@@ -242,8 +242,7 @@ dst__openssl_init(const char *engine) { ...@@ -242,8 +242,7 @@ dst__openssl_init(const char *engine) {
} }
void void
dst__openssl_destroy() { dst__openssl_destroy(void) {
/* /*
* Sequence taken from apps_shutdown() in <apps/apps.h>. * Sequence taken from apps_shutdown() in <apps/apps.h>.
*/ */
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id$ */
/*! \file */ /*! \file */
/* Principal Authors: DCL */ /* Principal Authors: DCL */
...@@ -646,7 +644,7 @@ dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt, ...@@ -646,7 +644,7 @@ dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt,
isc_crc64_final(&crc); isc_crc64_final(&crc);
#ifdef DEBUG #ifdef DEBUG
hexdump("serializing CRC", crc, sizeof(crc)); hexdump("serializing CRC", &crc, sizeof(crc));
#endif #endif
/* Serialize header */ /* Serialize header */
...@@ -841,7 +839,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize, ...@@ -841,7 +839,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize,
isc_crc64_final(&crc); isc_crc64_final(&crc);
#ifdef DEBUG #ifdef DEBUG
hexdump("deserializing CRC", crc, sizeof(crc)); hexdump("deserializing CRC", &crc, sizeof(crc));
#endif #endif
/* Check file hash */ /* Check file hash */
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id$ */
/*! \file */ /*! \file */
/* /*
......
...@@ -57,7 +57,7 @@ static dns_db_t *db1 = NULL, *db2 = NULL; ...@@ -57,7 +57,7 @@ static dns_db_t *db1 = NULL, *db2 = NULL;
static dns_dbversion_t *v1 = NULL, *v2 = NULL; static dns_dbversion_t *v1 = NULL, *v2 = NULL;
static void static void
setup_db() { setup_db(void) {
isc_result_t result; isc_result_t result;
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone, result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
dns_rdataclass_in, 0, NULL, &db1); dns_rdataclass_in, 0, NULL, &db1);
...@@ -71,7 +71,7 @@ setup_db() { ...@@ -71,7 +71,7 @@ setup_db() {
} }
static void static void
close_db() { close_db(void) {
if (v1 != NULL) { if (v1 != NULL) {
dns_db_closeversion(db1, &v1, ISC_FALSE); dns_db_closeversion(db1, &v1, ISC_FALSE);
ATF_REQUIRE_EQ(v1, NULL); ATF_REQUIRE_EQ(v1, NULL);
......
...@@ -65,7 +65,7 @@ make_dispatchset(unsigned int ndisps) { ...@@ -65,7 +65,7 @@ make_dispatchset(unsigned int ndisps) {
} }
static void static void
teardown() { teardown(void) {
if (dset != NULL) if (dset != NULL)
dns_dispatchset_destroy(&dset); dns_dispatchset_destroy(&dset);
if (dispatchmgr != NULL) if (dispatchmgr != NULL)
......
...@@ -76,7 +76,7 @@ static isc_logcategory_t categories[] = { ...@@ -76,7 +76,7 @@ static isc_logcategory_t categories[] = {
}; };
static void static void
cleanup_managers() { cleanup_managers(void) {
if (app_running) if (app_running)
isc_app_finish(); isc_app_finish();
if (socketmgr != NULL) if (socketmgr != NULL)
...@@ -90,7 +90,7 @@ cleanup_managers() { ...@@ -90,7 +90,7 @@ cleanup_managers() {
} }
static isc_result_t static isc_result_t
create_managers() { create_managers(void) {
isc_result_t result; isc_result_t result;
#ifdef ISC_PLATFORM_USETHREADS #ifdef ISC_PLATFORM_USETHREADS
ncpus = isc_os_ncpus(); ncpus = isc_os_ncpus();
...@@ -167,7 +167,7 @@ dns_test_begin(FILE *logfile, isc_boolean_t start_managers) { ...@@ -167,7 +167,7 @@ dns_test_begin(FILE *logfile, isc_boolean_t start_managers) {
} }
void void
dns_test_end() { dns_test_end(void) {
if (lctx != NULL) if (lctx != NULL)
isc_log_destroy(&lctx); isc_log_destroy(&lctx);
if (dst_active) { if (dst_active) {
...@@ -243,7 +243,7 @@ dns_test_makezone(const char *name, dns_zone_t **zonep, dns_view_t *view, ...@@ -243,7 +243,7 @@ dns_test_makezone(const char *name, dns_zone_t **zonep, dns_view_t *view,
} }
isc_result_t isc_result_t
dns_test_setupzonemgr() { dns_test_setupzonemgr(void) {
isc_result_t result; isc_result_t result;
REQUIRE(zonemgr == NULL); REQUIRE(zonemgr == NULL);
...@@ -272,7 +272,7 @@ dns_test_releasezone(dns_zone_t *zone) { ...@@ -272,7 +272,7 @@ dns_test_releasezone(dns_zone_t *zone) {
} }
void void
dns_test_closezonemgr() { dns_test_closezonemgr(void) {
REQUIRE(zonemgr != NULL); REQUIRE(zonemgr != NULL);
dns_zonemgr_shutdown(zonemgr); dns_zonemgr_shutdown(zonemgr);
......
...@@ -148,7 +148,7 @@ thread_key_mutex_init(void) { ...@@ -148,7 +148,7 @@ thread_key_mutex_init(void) {
} }
static isc_result_t static isc_result_t
thread_key_init() { thread_key_init(void) {
isc_result_t result; isc_result_t result;
result = isc_once_do(&once, thread_key_mutex_init); result = isc_once_do(&once, thread_key_mutex_init);
......
...@@ -179,7 +179,7 @@ isc_appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr) { ...@@ -179,7 +179,7 @@ isc_appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr) {
} }
isc_result_t isc_result_t
isc_app_start() { isc_app_start(void) {
if (isc_bind9) if (isc_bind9)
return (isc__app_start()); return (isc__app_start());
...@@ -205,7 +205,7 @@ isc_app_run() { ...@@ -205,7 +205,7 @@ isc_app_run() {
} }
isc_result_t isc_result_t
isc_app_shutdown() { isc_app_shutdown(void) {
if (isc_bind9) if (isc_bind9)
return (isc__app_shutdown()); return (isc__app_shutdown());
...@@ -213,7 +213,7 @@ isc_app_shutdown() { ...@@ -213,7 +213,7 @@ isc_app_shutdown() {
} }
isc_result_t isc_result_t
isc_app_reload() { isc_app_reload(void) {
if (isc_bind9) if (isc_bind9)
return (isc__app_reload()); return (isc__app_reload());
...@@ -221,7 +221,7 @@ isc_app_reload() { ...@@ -221,7 +221,7 @@ isc_app_reload() {
} }
void void
isc_app_finish() { isc_app_finish(void) {
if (!isc_bind9) if (!isc_bind9)
return; return;
...@@ -229,7 +229,7 @@ isc_app_finish() { ...@@ -229,7 +229,7 @@ isc_app_finish() {
} }
void void
isc_app_block() { isc_app_block(void) {
if (!isc_bind9) if (!isc_bind9)
return; return;
...@@ -237,7 +237,7 @@ isc_app_block() { ...@@ -237,7 +237,7 @@ isc_app_block() {
} }
void void
isc_app_unblock() { isc_app_unblock(void) {
if (!isc_bind9) if (!isc_bind9)
return; return;
......
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