Commit 5777c44a authored by Ondřej Surý's avatar Ondřej Surý

Reformat using the new rules

parent 654927c8
Pipeline #34033 failed with stages
in 3 minutes and 16 seconds
...@@ -47,12 +47,12 @@ void ...@@ -47,12 +47,12 @@ void
DestroySockets(void); DestroySockets(void);
#endif /* ifdef _WIN32 */ #endif /* ifdef _WIN32 */
extern int debug; extern int debug;
extern const char * journal; extern const char *journal;
extern bool nomerge; extern bool nomerge;
extern bool docheckmx; extern bool docheckmx;
extern bool docheckns; extern bool docheckns;
extern bool dochecksrv; extern bool dochecksrv;
extern dns_zoneopt_t zone_options; extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS ISC_LANG_ENDDECLS
......
...@@ -56,7 +56,8 @@ isc_log_t *logc = NULL; ...@@ -56,7 +56,8 @@ isc_log_t *logc = NULL;
} while (0) } while (0)
/*% usage */ /*% usage */
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -62,7 +62,8 @@ static enum { progmode_check, progmode_compile } progmode; ...@@ -62,7 +62,8 @@ static enum { progmode_check, progmode_compile } progmode;
} \ } \
} while (0) } while (0)
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -127,11 +127,11 @@ static char anchortext[] = TRUST_ANCHORS; ...@@ -127,11 +127,11 @@ static char anchortext[] = TRUST_ANCHORS;
/* /*
* Static function prototypes * Static function prototypes
*/ */
static isc_result_t get_reverse(char *reverse, size_t len, char *value, static isc_result_t
bool strict); get_reverse(char *reverse, size_t len, char *value, bool strict);
static isc_result_t parse_uint(uint32_t *uip, const char *value, uint32_t max, static isc_result_t
const char *desc); parse_uint(uint32_t *uip, const char *value, uint32_t max, const char *desc);
static void static void
usage(void) { usage(void) {
...@@ -205,7 +205,8 @@ usage(void) { ...@@ -205,7 +205,8 @@ usage(void) {
exit(1); exit(1);
} }
ISC_PLATFORM_NORETURN_PRE static void fatal(const char *format, ...) ISC_PLATFORM_NORETURN_PRE static void
fatal(const char *format, ...)
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST; ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
static void static void
...@@ -221,7 +222,8 @@ fatal(const char *format, ...) { ...@@ -221,7 +222,8 @@ fatal(const char *format, ...) {
exit(1); exit(1);
} }
static void warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2); static void
warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
static void static void
warn(const char *format, ...) { warn(const char *format, ...) {
...@@ -241,7 +243,8 @@ static isc_logcategory_t categories[] = { { "delv", 0 }, { NULL, 0 } }; ...@@ -241,7 +243,8 @@ static isc_logcategory_t categories[] = { { "delv", 0 }, { NULL, 0 } };
static isc_logmodule_t modules[] = { { "delv", 0 }, { NULL, 0 } }; static isc_logmodule_t modules[] = { { "delv", 0 }, { NULL, 0 } };
static void delv_log(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3); static void
delv_log(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
static void static void
delv_log(int level, const char *fmt, ...) { delv_log(int level, const char *fmt, ...) {
......
...@@ -107,7 +107,8 @@ usage(void) { ...@@ -107,7 +107,8 @@ usage(void) {
fprintf(stderr, "Press <Help> for complete list of options\n"); fprintf(stderr, "Press <Help> for complete list of options\n");
} }
#else /* if TARGET_OS_IPHONE */ #else /* if TARGET_OS_IPHONE */
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -122,10 +122,12 @@ int lookup_counter = 0; ...@@ -122,10 +122,12 @@ int lookup_counter = 0;
static char servercookie[256]; static char servercookie[256];
#ifdef HAVE_LIBIDN2 #ifdef HAVE_LIBIDN2
static void idn_locale_to_ace(const char *src, char *dst, size_t dstlen); static void
static void idn_ace_to_locale(const char *src, char **dst); idn_locale_to_ace(const char *src, char *dst, size_t dstlen);
static isc_result_t idn_output_filter(isc_buffer_t *buffer, static void
unsigned int used_org); idn_ace_to_locale(const char *src, char **dst);
static isc_result_t
idn_output_filter(isc_buffer_t *buffer, unsigned int used_org);
#endif /* HAVE_LIBIDN2 */ #endif /* HAVE_LIBIDN2 */
isc_socket_t *keep = NULL; isc_socket_t *keep = NULL;
...@@ -227,19 +229,26 @@ void (*dighost_shutdown)(void); ...@@ -227,19 +229,26 @@ void (*dighost_shutdown)(void);
/* forward declarations */ /* forward declarations */
static void cancel_lookup(dig_lookup_t *lookup); static void
cancel_lookup(dig_lookup_t *lookup);
static void recv_done(isc_task_t *task, isc_event_t *event); static void
recv_done(isc_task_t *task, isc_event_t *event);
static void send_udp(dig_query_t *query); static void
send_udp(dig_query_t *query);
static void connect_timeout(isc_task_t *task, isc_event_t *event); static void
connect_timeout(isc_task_t *task, isc_event_t *event);
static void launch_next_query(dig_query_t *query, bool include_question); static void
launch_next_query(dig_query_t *query, bool include_question);
static void check_next_lookup(dig_lookup_t *lookup); static void
check_next_lookup(dig_lookup_t *lookup);
static bool next_origin(dig_lookup_t *oldlookup); static bool
next_origin(dig_lookup_t *oldlookup);
static int static int
count_dots(char *string) { count_dots(char *string) {
...@@ -2718,7 +2727,8 @@ force_timeout(dig_query_t *query) { ...@@ -2718,7 +2727,8 @@ force_timeout(dig_query_t *query) {
} }
} }
static void connect_done(isc_task_t *task, isc_event_t *event); static void
connect_done(isc_task_t *task, isc_event_t *event);
/*% /*%
* Unlike send_udp, this can't be called multiple times with the same * Unlike send_udp, this can't be called multiple times with the same
......
...@@ -124,8 +124,10 @@ static const char *rtypetext[] = { ...@@ -124,8 +124,10 @@ static const char *rtypetext[] = {
#define N_KNOWN_RRTYPES (sizeof(rtypetext) / sizeof(rtypetext[0])) #define N_KNOWN_RRTYPES (sizeof(rtypetext) / sizeof(rtypetext[0]))
static void flush_lookup_list(void); static void
static void getinput(isc_task_t *task, isc_event_t *event); flush_lookup_list(void);
static void
getinput(isc_task_t *task, isc_event_t *event);
static char * static char *
rcode_totext(dns_rcode_t rcode) { rcode_totext(dns_rcode_t rcode) {
...@@ -876,7 +878,8 @@ get_next_command(void) { ...@@ -876,7 +878,8 @@ get_next_command(void) {
isc_mem_free(mctx, buf); isc_mem_free(mctx, buf);
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -121,8 +121,8 @@ typedef struct keyinfo { ...@@ -121,8 +121,8 @@ typedef struct keyinfo {
} keyinfo_t; } keyinfo_t;
/* A replaceable function that can generate a DS RRset from some input */ /* A replaceable function that can generate a DS RRset from some input */
typedef isc_result_t ds_maker_func_t(dns_rdatalist_t *dslist, isc_buffer_t *buf, typedef isc_result_t
dns_rdata_t *rdata); ds_maker_func_t(dns_rdatalist_t *dslist, isc_buffer_t *buf, dns_rdata_t *rdata);
static dns_rdataset_t cdnskey_set, cdnskey_sig; static dns_rdataset_t cdnskey_set, cdnskey_sig;
static dns_rdataset_t cds_set, cds_sig; static dns_rdataset_t cds_set, cds_sig;
...@@ -1016,7 +1016,8 @@ nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) { ...@@ -1016,7 +1016,8 @@ nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
} }
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -320,7 +320,8 @@ emits(bool showall, bool cds, dns_rdata_t *rdata) { ...@@ -320,7 +320,8 @@ emits(bool showall, bool cds, dns_rdata_t *rdata) {
} }
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -264,7 +264,8 @@ emit(const char *dir, dns_rdata_t *rdata) { ...@@ -264,7 +264,8 @@ emit(const char *dir, dns_rdata_t *rdata) {
dst_key_free(&key); dst_key_free(&key);
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
const char *program = "dnssec-keyfromlabel"; const char *program = "dnssec-keyfromlabel";
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -69,9 +69,11 @@ const char *program = "dnssec-keygen"; ...@@ -69,9 +69,11 @@ const char *program = "dnssec-keygen";
isc_log_t *lctx = NULL; isc_log_t *lctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void progress(int p); static void
progress(int p);
struct keygen_ctx { struct keygen_ctx {
const char *predecessor; const char *predecessor;
......
...@@ -40,7 +40,8 @@ const char *program = "dnssec-revoke"; ...@@ -40,7 +40,8 @@ const char *program = "dnssec-revoke";
static isc_mem_t *mctx = NULL; static isc_mem_t *mctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -43,7 +43,8 @@ const char *program = "dnssec-settime"; ...@@ -43,7 +43,8 @@ const char *program = "dnssec-settime";
static isc_mem_t *mctx = NULL; static isc_mem_t *mctx = NULL;
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -186,7 +186,8 @@ static dns_ttl_t maxttl = 0; ...@@ -186,7 +186,8 @@ static dns_ttl_t maxttl = 0;
UNLOCK(&statslock); \ UNLOCK(&statslock); \
} }
static void sign(isc_task_t *task, isc_event_t *event); static void
sign(isc_task_t *task, isc_event_t *event);
/*% /*%
* Store a copy of 'name' in 'fzonecut' and return a pointer to that copy. * Store a copy of 'name' in 'fzonecut' and return a pointer to that copy.
...@@ -3123,7 +3124,8 @@ print_version(FILE *fp) { ...@@ -3123,7 +3124,8 @@ print_version(FILE *fp) {
fprintf(fp, "; dnssec_signzone version " VERSION "\n"); fprintf(fp, "; dnssec_signzone version " VERSION "\n");
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -137,7 +137,8 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) { ...@@ -137,7 +137,8 @@ loadzone(char *file, char *origin, dns_rdataclass_t rdclass, dns_db_t **db) {
} }
} }
ISC_PLATFORM_NORETURN_PRE static void usage(void) ISC_PLATFORM_NORETURN_POST; ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void static void
usage(void) { usage(void) {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c /*! verbosity: set by -v and -q option in each program, defined in dnssectool.c
*/ */
extern int verbose; extern int verbose;
extern bool quiet; extern bool quiet;
/*! program name, statically initialized in each program */ /*! program name, statically initialized in each program */
......
...@@ -32,12 +32,18 @@ ...@@ -32,12 +32,18 @@
typedef struct builtin builtin_t; typedef struct builtin builtin_t;
static isc_result_t do_version_lookup(dns_sdblookup_t *lookup); static isc_result_t
static isc_result_t do_hostname_lookup(dns_sdblookup_t *lookup); do_version_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_authors_lookup(dns_sdblookup_t *lookup); static isc_result_t
static isc_result_t do_id_lookup(dns_sdblookup_t *lookup); do_hostname_lookup(dns_sdblookup_t *lookup);
static isc_result_t do_empty_lookup(dns_sdblookup_t *lookup); static isc_result_t
static isc_result_t do_dns64_lookup(dns_sdblookup_t *lookup); do_authors_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_id_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_empty_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_dns64_lookup(dns_sdblookup_t *lookup);
/* /*
* We can't use function pointers as the db_data directly * We can't use function pointers as the db_data directly
......
...@@ -107,8 +107,10 @@ struct named_controls { ...@@ -107,8 +107,10 @@ struct named_controls {
isccc_symtab_t *symtab; isccc_symtab_t *symtab;
}; };
static void control_newconn(isc_task_t *task, isc_event_t *event); static void
static void control_recvmessage(isc_task_t *task, isc_event_t *event); control_newconn(isc_task_t *task, isc_event_t *event);
static void
control_recvmessage(isc_task_t *task, isc_event_t *event);
#define CLOCKSKEW 300 #define CLOCKSKEW 300
......
...@@ -302,9 +302,9 @@ library_fatal_error(const char *file, int line, const char *format, ...@@ -302,9 +302,9 @@ library_fatal_error(const char *file, int line, const char *format,
exit(1); exit(1);
} }
static void library_unexpected_error(const char *file, int line, static void
const char *format, va_list args) library_unexpected_error(const char *file, int line, const char *format,
ISC_FORMAT_PRINTF(3, 0); va_list args) ISC_FORMAT_PRINTF(3, 0);
static void static void
library_unexpected_error(const char *file, int line, const char *format, library_unexpected_error(const char *file, int line, const char *format,
......
...@@ -383,74 +383,86 @@ ISC_PLATFORM_NORETURN_PRE static void ...@@ -383,74 +383,86 @@ ISC_PLATFORM_NORETURN_PRE static void
fatal(named_server_t *server, const char *msg, fatal(named_server_t *server, const char *msg,
isc_result_t result) ISC_PLATFORM_NORETURN_POST; isc_result_t result) ISC_PLATFORM_NORETURN_POST;
static void named_server_reload(isc_task_t *task, isc_event_t *event); static void
named_server_reload(isc_task_t *task, isc_event_t *event);
static isc_result_t ns_listenelt_fromconfig(const cfg_obj_t *listener, static isc_result_t
const cfg_obj_t *config, ns_listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, cfg_aclconfctx_t *actx, isc_mem_t *mctx,
isc_mem_t *mctx, uint16_t family, uint16_t family, ns_listenelt_t **target);
ns_listenelt_t **target); static isc_result_t
static isc_result_t ns_listenlist_fromconfig(const cfg_obj_t *listenlist, ns_listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
const cfg_obj_t *config, cfg_aclconfctx_t *actx, isc_mem_t *mctx,
cfg_aclconfctx_t *actx, uint16_t family, ns_listenlist_t **target);
isc_mem_t *mctx, uint16_t family,
ns_listenlist_t **target);