From: jsg Date: Sat, 10 Aug 2024 05:32:28 +0000 (+0000) Subject: use void when functions have no args X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7a7a726b09c7c74e339f4dc2dfd71f22d5d73faf;p=openbsd use void when functions have no args ok deraadt@ --- diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c index 28555f7970e..2919a87799c 100644 --- a/usr.sbin/pppd/auth.c +++ b/usr.sbin/pppd/auth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.c,v 1.41 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: auth.c,v 1.42 2024/08/10 05:32:28 jsg Exp $ */ /* * auth.c - PPP authentication and phase control. @@ -519,7 +519,7 @@ connect_time_expired(void *arg) * auth_check_options - called to check authentication options. */ void -auth_check_options() +auth_check_options(void) { lcp_options *wo = &lcp_wantoptions[0]; int can_auth; @@ -758,7 +758,7 @@ plogin(char *user, char *passwd, char **msg, int *msglen) * plogout - Logout the user. */ static void -plogout() +plogout(void) { char *tty; @@ -846,7 +846,7 @@ get_pap_passwd(char *passwd) * secrets that we could possibly use for authenticating the peer. */ static int -have_pap_secret() +have_pap_secret(void) { FILE *f; int ret; diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c index ae2bc1a211d..c574a3f1327 100644 --- a/usr.sbin/pppd/chat/chat.c +++ b/usr.sbin/pppd/chat/chat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chat.c,v 1.36 2024/08/09 05:16:15 deraadt Exp $ */ +/* $OpenBSD: chat.c,v 1.37 2024/08/10 05:32:28 jsg Exp $ */ /* * Chat -- a program for automatic session establishment (i.e. dial @@ -407,7 +407,7 @@ do_file(char *chat_file) /* * We got an error parsing the command line. */ -void usage() +void usage(void) { fprintf(stderr, "\ usage: %s [-eSsVv] [-f chat_file] [-r report_file] [-T phone_number]\n\ @@ -472,7 +472,7 @@ SIGTYPE sigalrm(int signo) logmsg("alarm"); } -void unalarm() +void unalarm(void) { int flags; @@ -498,7 +498,7 @@ SIGTYPE sighup(int signo) fatal(2, "SIGHUP"); } -void init() +void init(void) { signal(SIGINT, sigint); signal(SIGTERM, sigterm); @@ -510,7 +510,7 @@ void init() alarmed = 0; } -void set_tty_parameters() +void set_tty_parameters(void) { #if defined(get_term_param) term_parms t; @@ -534,7 +534,7 @@ void set_tty_parameters() #endif } -void break_sequence() +void break_sequence(void) { #ifdef TERMIOS tcsendbreak (0, 0); @@ -1108,7 +1108,7 @@ void chat_send (char *s) fatal(1, "Failed"); } -int get_char() +int get_char(void) { int status; char c; diff --git a/usr.sbin/pppd/demand.c b/usr.sbin/pppd/demand.c index 2ac37049e58..953cfdd6431 100644 --- a/usr.sbin/pppd/demand.c +++ b/usr.sbin/pppd/demand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: demand.c,v 1.12 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: demand.c,v 1.13 2024/08/10 05:32:28 jsg Exp $ */ /* * demand.c - Support routines for demand-dialling. @@ -80,7 +80,7 @@ static int active_packet(unsigned char *, int); * demand_conf - configure the interface for doing dial-on-demand. */ void -demand_conf() +demand_conf(void) { int i; struct protent *protp; @@ -119,7 +119,7 @@ demand_conf() * without an error. */ void -demand_drop() +demand_drop(void) { struct packet *pkt, *nextpkt; int i; @@ -146,7 +146,7 @@ demand_drop() * demand_unblock - set each enabled network protocol to pass packets. */ void -demand_unblock() +demand_unblock(void) { int i; struct protent *protp; diff --git a/usr.sbin/pppd/ipcp.c b/usr.sbin/pppd/ipcp.c index 0e4e936b60d..d359cc79180 100644 --- a/usr.sbin/pppd/ipcp.c +++ b/usr.sbin/pppd/ipcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipcp.c,v 1.16 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: ipcp.c,v 1.17 2024/08/10 05:32:28 jsg Exp $ */ /* * ipcp.c - PPP IP Control Protocol. @@ -1048,7 +1048,7 @@ endswitch: * and assign appropriate defaults. */ static void -ip_check_options() +ip_check_options(void) { struct hostent *hp; u_int32_t local; diff --git a/usr.sbin/pppd/magic.c b/usr.sbin/pppd/magic.c index fcc82215dd3..a815306a2cf 100644 --- a/usr.sbin/pppd/magic.c +++ b/usr.sbin/pppd/magic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magic.c,v 1.10 2013/09/29 16:24:22 deraadt Exp $ */ +/* $OpenBSD: magic.c,v 1.11 2024/08/10 05:32:28 jsg Exp $ */ /* * magic.c - PPP Magic Number routines. @@ -59,7 +59,7 @@ * and current time, currently. */ void -magic_init() +magic_init(void) { } @@ -67,7 +67,7 @@ magic_init() * magic - Returns the next magic number. */ u_int32_t -magic() +magic(void) { return arc4random(); } diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index 74dc4ad5cea..cb54143b6b8 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.57 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.58 2024/08/10 05:32:28 jsg Exp $ */ /* * main.c - Point-to-Point Protocol main module @@ -606,7 +606,7 @@ main(int argc, char *argv[]) * detach - detach us from the controlling terminal. */ void -detach() +detach(void) { if (detached) return; @@ -631,7 +631,7 @@ holdoff_end(void *arg) * get_input - called when incoming data is available. */ static void -get_input() +get_input(void) { int len, i; u_char *p; @@ -710,7 +710,7 @@ get_input() * quit - Clean up state and exit (with an error indication). */ void -quit() +quit(void) { die(1); } @@ -732,7 +732,7 @@ die(int status) * cleanup - restore anything which needs to be restored before we exit */ static void -cleanup() +cleanup(void) { sys_cleanup(); @@ -747,7 +747,7 @@ cleanup() * close_tty - restore the terminal device and close it. */ static void -close_tty() +close_tty(void) { disestablish_ppp(ttyfd); @@ -847,7 +847,7 @@ untimeout(void (*func)(void *), void *arg) * calltimeout - Call any timeout routines which are now due. */ static void -calltimeout() +calltimeout(void) { struct callout *p; diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c index b76e8025361..0df6215d2bf 100644 --- a/usr.sbin/pppd/options.c +++ b/usr.sbin/pppd/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.31 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: options.c,v 1.32 2024/08/10 05:32:28 jsg Exp $ */ /* * options.c - handles option processing for PPP. @@ -509,7 +509,7 @@ scan_args(int argc, char **argv) * usage - print out a message telling how to use the program. */ void -usage() +usage(void) { if (phase == PHASE_INITIALIZE) fprintf(stderr, usage_string, VERSION, PATCHLEVEL, IMPLEMENTATION, @@ -623,7 +623,7 @@ err: * and if so, interpret options from it. */ int -options_from_user() +options_from_user(void) { char *user, *path, *file; int ret; @@ -645,7 +645,7 @@ options_from_user() * device, and if so, interpret options from it. */ int -options_for_tty() +options_for_tty(void) { char *dev, *path; int ret; diff --git a/usr.sbin/pppd/pppstats/pppstats.c b/usr.sbin/pppd/pppstats/pppstats.c index 90d71f542ee..50c6c9d3f8d 100644 --- a/usr.sbin/pppd/pppstats/pppstats.c +++ b/usr.sbin/pppd/pppstats/pppstats.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pppstats.c,v 1.13 2024/08/09 05:16:15 deraadt Exp $ */ +/* $OpenBSD: pppstats.c,v 1.14 2024/08/10 05:32:28 jsg Exp $ */ /* * print PPP statistics: @@ -82,7 +82,7 @@ void intpr(void); int main(int, char *argv[]); void -usage() +usage(void) { extern char *__progname; @@ -155,7 +155,7 @@ get_ppp_cstats(struct ppp_comp_stats *csp) * First line printed is cumulative. */ void -intpr() +intpr(void) { register int line = 0; sigset_t oldmask, mask; diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c index 8e5c2ad6993..25e1e336783 100644 --- a/usr.sbin/pppd/sys-bsd.c +++ b/usr.sbin/pppd/sys-bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys-bsd.c,v 1.34 2024/08/09 05:16:13 deraadt Exp $ */ +/* $OpenBSD: sys-bsd.c,v 1.35 2024/08/10 05:32:28 jsg Exp $ */ /* * sys-bsd.c - System-dependent procedures for setting up @@ -147,7 +147,7 @@ static int get_ether_addr(u_int32_t, struct sockaddr_dl *); * sys_init - System-dependent initialization. */ void -sys_init() +sys_init(void) { /* Get an internet socket for doing socket ioctl's on. */ if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { @@ -162,7 +162,7 @@ sys_init() * This should call die() because it's called from die(). */ void -sys_cleanup() +sys_cleanup(void) { struct ifreq ifr; @@ -186,7 +186,7 @@ sys_cleanup() * sys_close - Clean up in a child process before execing. */ void -sys_close() +sys_close(void) { close(sockfd); if (loop_slave >= 0) { @@ -199,7 +199,7 @@ sys_close() * sys_check_options - check the options that the user specified */ void -sys_check_options() +sys_check_options(void) { } @@ -208,7 +208,7 @@ sys_check_options() * (in fact we check whether we can do an ioctl on ppp0). */ int -ppp_available() +ppp_available(void) { int s, ok; struct ifreq ifr; @@ -311,7 +311,7 @@ establish_ppp(int fd) * restore_loop - reattach the ppp unit to the loopback. */ void -restore_loop() +restore_loop(void) { int x; @@ -368,7 +368,7 @@ disestablish_ppp(int fd) * Check whether the link seems not to be 8-bit clean. */ void -clean_check() +clean_check(void) { int x; char *s; @@ -507,7 +507,7 @@ setdtr(int fd, int on) * Here we use a pty. */ void -open_ppp_loopback() +open_ppp_loopback(void) { int flags; struct termios tios; @@ -676,7 +676,7 @@ read_packet(u_char *buf) * Return value is 1 if we need to bring up the link, 0 otherwise. */ int -get_loop_output() +get_loop_output(void) { int rv = 0; int n; @@ -1445,7 +1445,7 @@ lock(char *dev) * unlock - remove our lockfile */ void -unlock() +unlock(void) { if (lock_file) { unlink(lock_file);