From 1d1731fae96c314d336747b085a6efb43942991a Mon Sep 17 00:00:00 2001 From: Hiten Pandya Date: Sat, 4 Oct 2003 20:36:55 +0000 Subject: [PATCH] K&R style function removal. Update functions to ANSI style. While I am there, add $DragonFly$ IDs to these files, or the commit just busts up. Also fixup C Style comments on the files. Patch has been tested by submitter and me. Submitted by: Eirik Nygaard Reviewed by: Hiten Pandya --- usr.bin/apply/apply.c | 5 +- usr.bin/doscmd/ParseBuffer.c | 7 +- usr.bin/doscmd/ems.c | 8 +- usr.bin/doscmd/i386-pinsn.c | 13 +- usr.bin/doscmd/mem.c | 6 +- usr.bin/doscmd/port.c | 4 +- usr.bin/doscmd/tty.c | 44 ++--- usr.bin/doscmd/video.c | 6 +- usr.bin/doscmd/xms.c | 12 +- usr.bin/du/du.c | 39 ++--- usr.bin/ee/ee.c | 282 ++++++++++++++----------------- usr.bin/ee/new_curse.c | 269 +++++++++++------------------- usr.bin/enigma/enigma.c | 12 +- usr.bin/env/env.c | 8 +- usr.bin/expand/expand.c | 11 +- usr.bin/false/false.c | 5 +- usr.bin/find/find.c | 17 +- usr.bin/find/function.c | 247 +++++++--------------------- usr.bin/find/ls.c | 22 +-- usr.bin/find/main.c | 10 +- usr.bin/find/misc.c | 12 +- usr.bin/find/operator.c | 22 +-- usr.bin/find/option.c | 11 +- usr.bin/finger/finger.c | 18 +- usr.bin/finger/lprint.c | 17 +- usr.bin/finger/net.c | 5 +- usr.bin/finger/sprint.c | 7 +- usr.bin/finger/util.c | 37 ++--- usr.bin/fold/fold.c | 14 +- usr.bin/from/from.c | 15 +- usr.bin/fstat/cd9660.c | 6 +- usr.bin/fstat/fstat.c | 70 +++----- usr.bin/fstat/msdosfs.c | 6 +- usr.bin/fsync/fsync.c | 4 +- usr.bin/ftp/cmds.c | 301 +++++++++------------------------- usr.bin/ftp/complete.c | 26 +-- usr.bin/ftp/domacro.c | 6 +- usr.bin/ftp/fetch.c | 20 +-- usr.bin/ftp/ftp.c | 84 +++------- usr.bin/ftp/main.c | 30 ++-- usr.bin/ftp/ruserpass.c | 10 +- usr.bin/ftp/util.c | 56 ++----- usr.bin/gcore/gcore.c | 45 ++--- usr.bin/gcore/md-nop.c | 7 +- usr.bin/gcore/md-sparc.c | 12 +- usr.bin/getopt/getopt.c | 6 +- usr.bin/gprof/alpha.c | 8 +- usr.bin/gprof/arcs.c | 43 ++--- usr.bin/gprof/dfn.c | 25 ++- usr.bin/gprof/gprof.c | 37 ++--- usr.bin/gprof/hertz.c | 4 +- usr.bin/gprof/hp300.c | 8 +- usr.bin/gprof/i386.c | 8 +- usr.bin/gprof/lookup.c | 9 +- usr.bin/gprof/mips.c | 7 +- usr.bin/gprof/printgprof.c | 64 +++----- usr.bin/gprof/printlist.c | 10 +- usr.bin/gprof/sparc.c | 7 +- usr.bin/gprof/tahoe.c | 19 +-- usr.bin/gprof/vax.c | 19 +-- usr.bin/head/head.c | 27 ++- usr.bin/hexdump/conv.c | 10 +- usr.bin/hexdump/display.c | 20 +-- usr.bin/hexdump/hexdump.c | 6 +- usr.bin/hexdump/hexsyntax.c | 8 +- usr.bin/hexdump/odsyntax.c | 10 +- usr.bin/hexdump/parse.c | 28 ++-- usr.bin/id/id.c | 40 ++--- usr.bin/ipcrm/ipcrm.c | 23 +-- usr.bin/ipcs/ipcs.c | 17 +- usr.bin/join/join.c | 37 ++--- usr.bin/jot/jot.c | 27 ++- usr.bin/kdump/kdump.c | 37 ++--- usr.bin/key/skey.c | 10 +- usr.bin/keyinit/skeyinit.c | 9 +- usr.bin/keylogin/keylogin.c | 4 +- usr.bin/keylogout/keylogout.c | 6 +- usr.bin/ktrace/ktrace.c | 18 +- usr.bin/ktrace/subr.c | 14 +- usr.bin/kzip/kzip.c | 4 +- usr.bin/lam/lam.c | 4 +- usr.bin/last/last.c | 34 ++-- usr.bin/lastcomm/lastcomm.c | 31 ++-- usr.bin/ldd/ldd.c | 10 +- usr.bin/ldd/sods.c | 10 +- usr.bin/leave/leave.c | 15 +- usr.bin/lex/ccl.c | 19 +-- usr.bin/lex/dfa.c | 38 ++--- usr.bin/lex/ecs.c | 15 +- usr.bin/lex/gen.c | 38 ++--- usr.bin/lex/initscan.c | 17 +- usr.bin/lex/main.c | 22 +-- usr.bin/lex/misc.c | 135 +++++---------- usr.bin/lex/nfa.c | 50 ++---- usr.bin/lex/sym.c | 42 ++--- usr.bin/lex/tblcmp.c | 42 ++--- usr.bin/lex/yylex.c | 4 +- usr.bin/lock/lock.c | 8 +- usr.bin/logger/logger.c | 23 +-- usr.bin/login/login.c | 48 ++---- usr.bin/login/login_access.c | 28 +--- usr.bin/login/login_fbtab.c | 18 +- usr.bin/logname/logname.c | 10 +- usr.bin/look/look.c | 38 ++--- usr.bin/mail/aux.c | 71 +++----- usr.bin/mail/cmd1.c | 53 +++--- usr.bin/mail/cmd2.c | 68 +++----- usr.bin/mail/cmd3.c | 78 +++------ usr.bin/mail/collect.c | 37 ++--- usr.bin/mail/edit.c | 17 +- usr.bin/mail/fio.c | 46 ++---- usr.bin/mail/getname.c | 8 +- usr.bin/mail/head.c | 25 +-- usr.bin/mail/lex.c | 42 ++--- usr.bin/mail/list.c | 53 ++---- usr.bin/mail/main.c | 11 +- usr.bin/mail/names.c | 58 ++----- usr.bin/mail/popen.c | 67 +++----- usr.bin/mail/quit.c | 11 +- usr.bin/mail/send.c | 49 ++---- usr.bin/mail/strings.c | 9 +- usr.bin/mail/temp.c | 4 +- usr.bin/mail/tty.c | 16 +- usr.bin/mail/v7.local.c | 10 +- usr.bin/mail/vars.c | 26 +-- usr.bin/make/arch.c | 5 +- usr.bin/mesg/mesg.c | 10 +- usr.bin/mkfifo/mkfifo.c | 10 +- usr.bin/mktemp/mktemp.c | 6 +- usr.bin/msgs/msgs.c | 49 +++--- usr.bin/mt/mt.c | 24 +-- usr.bin/ncplogin/ncplogin.c | 6 +- usr.bin/netstat/main.c | 10 +- usr.bin/newkey/generic.c | 13 +- usr.bin/newkey/newkey.c | 18 +- usr.bin/newkey/update.c | 39 ++--- usr.bin/nfsstat/nfsstat.c | 23 ++- usr.bin/nice/nice.c | 8 +- usr.bin/nl/nl.c | 14 +- usr.bin/nm/nm.c | 51 ++---- usr.bin/nohup/nohup.c | 14 +- usr.bin/passwd/local_passwd.c | 14 +- usr.bin/passwd/passwd.c | 12 +- usr.bin/pr/egetopt.c | 7 +- usr.bin/pr/pr.c | 81 +++------ usr.bin/printenv/printenv.c | 10 +- usr.bin/printf/printf.c | 34 ++-- usr.bin/sasc/sasc.c | 6 +- usr.bin/script/script.c | 30 ++-- usr.bin/sed/compile.c | 51 ++---- usr.bin/sed/main.c | 27 +-- usr.bin/sed/misc.c | 6 +- usr.bin/sed/process.c | 35 ++-- usr.bin/showmount/showmount.c | 46 ++---- usr.bin/size/size.c | 16 +- usr.bin/soelim/soelim.c | 11 +- usr.bin/strings/strings.c | 14 +- usr.bin/strip/strip.c | 24 +-- usr.bin/su/su.c | 19 +-- usr.bin/symorder/symorder.c | 36 ++-- usr.bin/systat/cmds.c | 13 +- usr.bin/systat/devs.c | 4 +- usr.bin/systat/fetch.c | 6 +- usr.bin/systat/icmp.c | 5 +- usr.bin/systat/iostat.c | 45 ++--- usr.bin/systat/ip.c | 5 +- usr.bin/systat/keyboard.c | 4 +- usr.bin/systat/main.c | 34 +--- usr.bin/systat/mbufs.c | 15 +- usr.bin/systat/netcmds.c | 46 ++---- usr.bin/systat/netstat.c | 39 ++--- usr.bin/systat/pigs.c | 17 +- usr.bin/systat/swap.c | 17 +- usr.bin/systat/tcp.c | 5 +- usr.bin/systat/vmstat.c | 66 +++----- usr.bin/tail/forward.c | 15 +- usr.bin/tail/misc.c | 14 +- usr.bin/tail/read.c | 10 +- usr.bin/tail/reverse.c | 21 +-- usr.bin/tail/tail.c | 15 +- usr.bin/talk/ctl.c | 9 +- usr.bin/talk/ctl_transact.c | 8 +- usr.bin/talk/display.c | 15 +- usr.bin/talk/get_addrs.c | 5 +- usr.bin/talk/get_iface.c | 6 +- usr.bin/talk/get_names.c | 6 +- usr.bin/talk/init_disp.c | 13 +- usr.bin/talk/invite.c | 11 +- usr.bin/talk/io.c | 10 +- usr.bin/talk/look_up.c | 7 +- usr.bin/talk/msgs.c | 9 +- usr.bin/talk/talk.c | 8 +- usr.bin/tconv/quit.c | 22 +-- usr.bin/tconv/tconv.c | 96 +++++------ usr.bin/tcopy/tcopy.c | 31 ++-- usr.bin/tee/tee.c | 16 +- usr.bin/telnet/commands.c | 5 +- usr.bin/tftp/main.c | 127 ++++++-------- usr.bin/tftp/tftp.c | 58 +++---- usr.bin/tftp/tftpsubs.c | 30 ++-- usr.bin/time/time.c | 15 +- usr.bin/tip/tip/cmds.c | 130 +++++++-------- usr.bin/top/machine.c | 93 +++-------- usr.bin/touch/touch.c | 36 ++-- usr.bin/tput/tput.c | 20 +-- usr.bin/tr/str.c | 26 +-- usr.bin/tr/tr.c | 14 +- usr.bin/true/true.c | 5 +- usr.bin/truncate/truncate.c | 6 +- usr.bin/truss/i386-linux.c | 4 +- usr.bin/tset/map.c | 11 +- usr.bin/tset/misc.c | 8 +- usr.bin/tset/set.c | 15 +- usr.bin/tset/term.c | 12 +- usr.bin/tset/tset.c | 22 +-- usr.bin/tset/wrterm.c | 5 +- usr.bin/tsort/tsort.c | 43 ++--- usr.bin/tty/tty.c | 10 +- usr.bin/uac/uac.c | 8 +- usr.bin/ul/ul.c | 58 +++---- usr.bin/unexpand/unexpand.c | 13 +- usr.bin/uniq/uniq.c | 24 +-- usr.bin/unvis/unvis.c | 15 +- usr.bin/users/users.c | 15 +- usr.bin/vgrind/regexp.c | 24 +-- usr.bin/vgrind/vfontedpr.c | 44 ++--- usr.bin/vgrind/vgrindefs.c | 31 ++-- usr.bin/vis/foldit.c | 5 +- usr.bin/vis/vis.c | 17 +- usr.bin/vmstat/vmstat.c | 45 ++--- usr.bin/w/pr_time.c | 8 +- usr.bin/w/proc_compare.c | 5 +- usr.bin/w/w.c | 30 ++-- usr.bin/wall/wall.c | 4 +- usr.bin/wc/wc.c | 11 +- usr.bin/what/what.c | 14 +- usr.bin/write/write.c | 44 ++--- usr.bin/xinstall/xinstall.c | 41 ++--- usr.bin/yacc/closure.c | 27 ++- usr.bin/yacc/error.c | 112 ++++--------- usr.bin/yacc/lalr.c | 75 ++++----- usr.bin/yacc/lr0.c | 74 ++++----- usr.bin/yacc/main.c | 39 ++--- usr.bin/yacc/mkpar.c | 58 +++---- usr.bin/yacc/output.c | 112 ++++++------- usr.bin/yacc/reader.c | 157 +++++++++--------- usr.bin/yacc/skeleton.c | 5 +- usr.bin/yacc/symtab.c | 19 +-- usr.bin/yacc/verbose.c | 53 +++--- usr.bin/yacc/warshall.c | 12 +- usr.bin/yes/yes.c | 6 +- usr.bin/ypcat/ypcat.c | 16 +- usr.bin/ypmatch/ypmatch.c | 7 +- usr.bin/ypwhich/ypwhich.c | 11 +- 254 files changed, 2674 insertions(+), 4662 deletions(-) diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index 055bb65ff5..6b019a53f3 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -35,7 +35,7 @@ * * @(#)apply.c 8.4 (Berkeley) 4/4/94 * $FreeBSD: src/usr.bin/apply/apply.c,v 1.8.2.3 2001/08/01 23:28:04 obrien Exp $ - * $DragonFly: src/usr.bin/apply/apply.c,v 1.2 2003/06/17 04:29:25 dillon Exp $ + * $DragonFly: src/usr.bin/apply/apply.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -57,7 +57,8 @@ static int exec_shell(const char *, char *, char *); static void usage(void); int -main(int argc, char *argv[]) { +main(int argc, char *argv[]) +{ int ch, debug, i, magic, n, nargs, offset, rval; size_t clen, cmdsize, l; char *c, *cmd, *name, *p, *q, *shell, *slashp, *tmpshell; diff --git a/usr.bin/doscmd/ParseBuffer.c b/usr.bin/doscmd/ParseBuffer.c index 86a0c25c98..7184075e4a 100644 --- a/usr.bin/doscmd/ParseBuffer.c +++ b/usr.bin/doscmd/ParseBuffer.c @@ -30,7 +30,7 @@ * BSDI ParseBuffer.c,v 2.2 1996/04/08 19:32:15 bostic Exp * * $FreeBSD: src/usr.bin/doscmd/ParseBuffer.c,v 1.2.2.2 2002/04/25 11:04:50 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/ParseBuffer.c,v 1.2 2003/06/17 04:29:25 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/ParseBuffer.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -38,10 +38,7 @@ #include "doscmd.h" int -ParseBuffer(obuf, av, mac) -char *obuf; -char **av; -int mac; +ParseBuffer(char *obuf, char **av, int mac) { static char *_buf; char *buf; diff --git a/usr.bin/doscmd/ems.c b/usr.bin/doscmd/ems.c index 54acbe410b..3e20b67ef4 100644 --- a/usr.bin/doscmd/ems.c +++ b/usr.bin/doscmd/ems.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/ems.c,v 1.3.2.2 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/ems.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/ems.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ /* @@ -140,7 +140,7 @@ static u_long move_ems_to_ems(u_short, u_short, u_short, u_short, */ int -ems_init() +ems_init(void) { unsigned i; @@ -1083,7 +1083,7 @@ ems_entry(regcontext_t *REGS) /* Initialize the EMS memory: Return 1 on success, 0 on failure */ static int -init_mapfile() +init_mapfile(void) { char path[256]; int mfd; @@ -1234,7 +1234,7 @@ context_to_handle(short handle) /* Find the next free handle, returns -1 if there are no more handles */ static long -find_next_free_handle() +find_next_free_handle(void) { int i; diff --git a/usr.bin/doscmd/i386-pinsn.c b/usr.bin/doscmd/i386-pinsn.c index 1b074e65e9..048b0a5184 100644 --- a/usr.bin/doscmd/i386-pinsn.c +++ b/usr.bin/doscmd/i386-pinsn.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/usr.bin/doscmd/i386-pinsn.c,v 1.1.6.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/i386-pinsn.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/i386-pinsn.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #ifdef DISASSEMBLER @@ -1430,7 +1430,7 @@ const char *fgrps[][8] = { static void -dofloat () +dofloat (void) { struct dis386 *dp; unsigned char floatop; @@ -1691,7 +1691,7 @@ OP_G(int bytemode) } static int -get32() +get32(void) { int x = 0; @@ -1703,7 +1703,7 @@ get32() } static int -get16() +get16(void) { int x = 0; @@ -1951,10 +1951,7 @@ OP_rm(int bytemode) #else -i386dis (pc, inbuf, outbuf, mode) - int pc; - unsigned char *inbuf; - char *outbuf; +i386dis (int pc, unsigned char *inbuf, char outbuf, int mode) { strcpy (outbuf, "(no disassembler)"); return (1); diff --git a/usr.bin/doscmd/mem.c b/usr.bin/doscmd/mem.c index 6fff9d7b9b..bd39a28344 100644 --- a/usr.bin/doscmd/mem.c +++ b/usr.bin/doscmd/mem.c @@ -30,7 +30,7 @@ * BSDI mem.c,v 2.2 1996/04/08 19:32:57 bostic Exp * * $FreeBSD: src/usr.bin/doscmd/mem.c,v 1.2.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/mem.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/mem.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -268,7 +268,7 @@ got: #ifdef MEM_TEST -mem_check () +mem_check (void) { struct mem_block *mp; for (mp = mem_blocks.next; mp != &mem_blocks; mp = mp->next) { @@ -285,7 +285,7 @@ mem_check () char *blocks[10]; -main () +main (void) { int i; int n; diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c index e6202d8a66..ef7ddad5fc 100644 --- a/usr.bin/doscmd/port.c +++ b/usr.bin/doscmd/port.c @@ -30,7 +30,7 @@ * BSDI port.c,v 2.2 1996/04/08 19:33:03 bostic Exp * * $FreeBSD: src/usr.bin/doscmd/port.c,v 1.5.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/port.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/port.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -428,7 +428,7 @@ inb_speaker(int port __unused) } void -speaker_init() +speaker_init(void) { define_input_port_handler(0x61, inb_speaker); define_output_port_handler(0x61, outb_speaker); diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c index f66e7acc9a..efd1d56a88 100644 --- a/usr.bin/doscmd/tty.c +++ b/usr.bin/doscmd/tty.c @@ -30,7 +30,7 @@ * BSDI tty.c,v 2.4 1996/04/08 22:03:27 prb Exp * * $FreeBSD: src/usr.bin/doscmd/tty.c,v 1.8.2.2 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/tty.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/tty.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -206,7 +206,7 @@ Failure(void *arg __unused) } static void -SetVREGCur() +SetVREGCur(void) { int cp = row * width + col; VGA_CRTC[CRTC_CurLocHi] = cp >> 8; @@ -244,7 +244,7 @@ _kbd_event(int fd, int cond, void *arg __unused, regcontext_t *REGS __unused) } void -console_init() +console_init(void) { int fd; caddr_t addr; @@ -377,7 +377,7 @@ video_update(regcontext_t *REGS __unused) #ifndef NO_X static void -video_update_graphics() +video_update_graphics(void) { vram2ximage(); @@ -389,7 +389,7 @@ video_update_graphics() } static void -video_update_text() +video_update_text(void) { static int or = -1; static int oc = -1; @@ -509,7 +509,7 @@ video_update_text() - It only works for the 16 color modes. - It only works on 15/16-bit TrueColor visuals. */ static void -vram2ximage() +vram2ximage(void) { int i, x, y, yoffset; u_int16_t *image = (u_int16_t *)xi->data; @@ -1429,7 +1429,7 @@ tty_report(int *r, int *c) } void -tty_flush() +tty_flush(void) { K_NEXT = K_FREE = K_BUFSTARTP; } @@ -1614,7 +1614,7 @@ putchar_graphics(int xy, int c, int attr) } #endif -void tty_pause() +void tty_pause(void) { sigset_t set; @@ -1716,13 +1716,13 @@ tty_peek(REGISTERS, int flag) } int -tty_state() +tty_state(void) { return(K1_STATUS); } int -tty_estate() +tty_estate(void) { int state = 0; if (K2_STATUS & K2_SYSREQ) @@ -1829,7 +1829,7 @@ tty_char(int r, int c) } int -KbdEmpty() +KbdEmpty(void) { return(K_NEXT == K_FREE); } @@ -1854,7 +1854,7 @@ KbdWrite(u_short code) } u_short -KbdRead() +KbdRead(void) { int kf = K_NEXT; @@ -1866,13 +1866,13 @@ KbdRead() } u_short -KbdPeek() +KbdPeek(void) { return(K_BUF(K_NEXT)); } void -kbd_init() +kbd_init(void) { u_long vec; @@ -1890,7 +1890,7 @@ kbd_init() } void -kbd_bios_init() +kbd_bios_init(void) { BIOSDATA[0x96] = 0x10; /* MF II kbd, 101 keys */ K1_STATUS = 0; @@ -1940,7 +1940,7 @@ dac2rgb(XColor *color, int i) /* Get a connection to the X server and create the window. */ void -init_window() +init_window(void) { #ifndef NO_X XGCValues gcv; @@ -2017,7 +2017,7 @@ init_window() } void -load_font() +load_font(void) { #ifndef NO_X XGCValues gcv; @@ -2061,7 +2061,7 @@ load_font() /* Get a new, or resize an old XImage as canvas for the graphics display. */ void -get_ximage() +get_ximage(void) { #ifndef NO_X if (xi != NULL) @@ -2084,7 +2084,7 @@ get_ximage() /* Get memory for the text line buffer. */ void -get_lines() +get_lines(void) { int i; @@ -2119,7 +2119,7 @@ get_lines() #ifndef NO_X /* Prepare the LUT for the VRAM -> XImage conversion. */ static void -prepare_lut() +prepare_lut(void) { int i, j, k; @@ -2138,7 +2138,7 @@ prepare_lut() /* Resize the window, using information from 'vga_status[]'. This function is called after a mode change. */ void -resize_window() +resize_window(void) { #ifndef NO_X XSizeHints *sh; @@ -2189,7 +2189,7 @@ resize_window() To do: do not use 'pixels[]', use an array of 'XColor's which we can allocate and free on demand. Install a private colormap if necessary. */ void -update_pixels() +update_pixels(void) { #ifndef NO_X int i; diff --git a/usr.bin/doscmd/video.c b/usr.bin/doscmd/video.c index 26acb67856..bae3d6f9a0 100644 --- a/usr.bin/doscmd/video.c +++ b/usr.bin/doscmd/video.c @@ -24,7 +24,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/video.c,v 1.5.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/video.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/video.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -237,7 +237,7 @@ video_outb(int port, u_int8_t value) } void -video_init() +video_init(void) { /* If we are running under X, get a connection to the X server and create an empty window of size (1, 1). It makes a couple of init functions a @@ -280,7 +280,7 @@ video_init() } void -video_bios_init() +video_bios_init(void) { u_char *p; u_long vec; diff --git a/usr.bin/doscmd/xms.c b/usr.bin/doscmd/xms.c index 695168603f..260148456f 100644 --- a/usr.bin/doscmd/xms.c +++ b/usr.bin/doscmd/xms.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/xms.c,v 1.6.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/xms.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/xms.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ /* @@ -215,7 +215,7 @@ faterr: /* Try to merge neighbouring blocks in the free list */ static void -merge_blocks() +merge_blocks(void) { UMB_block *bp; u_long endaddr; @@ -318,7 +318,7 @@ create_block(u_long addr, u_long size) * startup. */ -void initHMA() +void initHMA(void) { int mfd; @@ -394,7 +394,7 @@ void initHMA() /* Enable the a20 "address line" by unmapping the 64kB over 1MB */ -static void enable_a20() +static void enable_a20(void) { if (HMA_a20 < 0) return; @@ -419,7 +419,7 @@ static void enable_a20() } /* Disable the a20 "address line" by mapping the 64kB over 1MB again */ -static void disable_a20() +static void disable_a20(void) { if (HMA_a20 < 0) return; @@ -460,7 +460,7 @@ get_raw_extmemory_info(regcontext_t *REGS) /* Handle management routine: Find next free handle */ static int -get_free_handle() +get_free_handle(void) { int i; /* Linear search, there are only a few handles */ diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index ee23318b02..96e6e706e2 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)du.c 8.5 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/du/du.c,v 1.17.2.4 2002/12/12 16:29:39 trhodes Exp $ - * $DragonFly: src/usr.bin/du/du.c,v 1.3 2003/09/28 17:24:30 dillon Exp $ + * $DragonFly: src/usr.bin/du/du.c,v 1.4 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -89,18 +89,16 @@ struct ignentry { SLIST_ENTRY(ignentry) next; }; -int linkchk __P((FTSENT *)); -static void usage __P((void)); -void prthumanval __P((double)); -unit_t unit_adjust __P((double *)); -void ignoreadd __P((const char *)); -void ignoreclean __P((void)); -int ignorep __P((FTSENT *)); +int linkchk(FTSENT *); +static void usage(void); +void prthumanval(double); +unit_t unit_adjust(double *); +void ignoreadd(const char *); +void ignoreclean(void); +int ignorep(FTSENT *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { FTS *fts; FTSENT *p; @@ -310,8 +308,7 @@ typedef struct _ID { int -linkchk(p) - FTSENT *p; +linkchk(FTSENT *p) { static ID **files; static int *maxfiles, *nfiles; @@ -354,8 +351,7 @@ linkchk(p) * */ unit_t -unit_adjust(val) - double *val; +unit_adjust(double *val) { double abval; unit_t unit; @@ -376,8 +372,7 @@ unit_adjust(val) } void -prthumanval(bytes) - double bytes; +prthumanval(double bytes) { unit_t unit; @@ -393,7 +388,7 @@ prthumanval(bytes) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k] [-x] [-I mask] [file ...]\n"); @@ -401,8 +396,7 @@ usage() } void -ignoreadd(mask) - const char *mask; +ignoreadd(const char *mask) { struct ignentry *ign; @@ -416,7 +410,7 @@ ignoreadd(mask) } void -ignoreclean() +ignoreclean(void) { struct ignentry *ign; @@ -429,8 +423,7 @@ ignoreclean() } int -ignorep(ent) - FTSENT *ent; +ignorep(FTSENT *ent) { struct ignentry *ign; diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c index 9e205df488..f55df96c55 100644 --- a/usr.bin/ee/ee.c +++ b/usr.bin/ee/ee.c @@ -50,7 +50,7 @@ | copyright. All rights are reserved. * * $FreeBSD: src/usr.bin/ee/ee.c,v 1.16.2.6 2002/05/11 16:33:06 mp Exp $ - * $DragonFly: src/usr.bin/ee/ee.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/ee/ee.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ char *ee_copyright_message = @@ -548,9 +548,7 @@ FILE *fopen(); /* declaration for open function */ #endif /* __STDC__ */ int -main(argc, argv) /* beginning of main program */ -int argc; -char *argv[]; +main(int argc, char **argv) /* beginning of main program */ { int counter; @@ -665,11 +663,11 @@ char *argv[]; return(0); } +/* factor: resize factor */ +/* rline: position in line */ unsigned char * -resiz_line(factor, rline, rpos) /* resize the line to length + factor*/ -int factor; /* resize factor */ -struct text *rline; /* position in line */ -int rpos; +resiz_line(int factor, struct text *rline, int rpos) +/* resize the line to length + factor*/ { unsigned char *rpoint; int resiz_var; @@ -682,8 +680,7 @@ int rpos; } void -insert(character) /* insert character into line */ -int character; /* new character */ +insert(int character) /* insert character into line */ { int counter; int value; @@ -767,8 +764,7 @@ int character; /* new character */ } void -delete(disp) /* delete character */ -int disp; +delete(int disp) /* delete character */ { unsigned char *tp; unsigned char *temp2; @@ -875,8 +871,7 @@ int disp; } void -scanline(pos) /* find the proper horizontal position for the pointer */ -unsigned char *pos; +scanline(unsigned char *pos) /* find the proper horizontal position for the pointer */ { int temp; unsigned char *ptr; @@ -915,8 +910,7 @@ unsigned char *pos; } int -tabshift(temp_int) /* give the number of spaces to shift */ -int temp_int; +tabshift(int temp_int) /* give the number of spaces to shift */ { int leftover; @@ -928,10 +922,8 @@ int temp_int; } int -out_char(window, character, column) /* output non-printing character */ -WINDOW *window; -char character; -int column; +out_char(WINDOW *window, int character, int column) +/* output non-printing character */ { int i1, i2; unsigned char *string; @@ -976,10 +968,9 @@ int column; return(strlen(string)); } -int -len_char(character, column) /* return the length of the character */ -char character; -int column; /* the column must be known to provide spacing for tabs */ +/* column: the column must be known to provide spacing for tabs */ +int +len_char(int character, int column) /* return the length of the character */ { int length; @@ -999,13 +990,16 @@ int column; /* the column must be known to provide spacing for tabs */ return(length); } -void -draw_line(vertical, horiz, ptr, t_pos, length) /* redraw line from current position */ -int vertical; /* current vertical position on screen */ -int horiz; /* current horizontal position on screen */ -unsigned char *ptr; /* pointer to line */ -int t_pos; /* current position (offset in bytes) from bol */ -int length; /* length (in bytes) of line */ +/* +vertical: current vertical position on screen +horiz: current horizontal position on screen +ptr: pointer to line +t_pos: current position (offset in bytes) from bol +length: length (in bytes) of line +*/ +void +draw_line(int vertical, int horiz, unsigned char *ptr, int t_pos, int length) +/* redraw line from current position */ { int d; /* partial length of special or tab char to display */ unsigned char *temp; /* temporary pointer to position in line */ @@ -1057,8 +1051,7 @@ int length; /* length (in bytes) of line */ } void -insert_line(disp) /* insert new line */ -int disp; +insert_line(int disp) /* insert new line */ { int temp_pos; int temp_pos2; @@ -1132,18 +1125,18 @@ int disp; } } -struct text *txtalloc() /* allocate space for line structure */ +struct text *txtalloc(void) /* allocate space for line structure */ { return((struct text *) malloc(sizeof( struct text))); } -struct files *name_alloc() /* allocate space for file name list node */ +struct files *name_alloc(void) /* allocate space for file name list node */ { return((struct files *) malloc(sizeof( struct files))); } -unsigned char *next_word(string) /* move to next word in string */ -unsigned char *string; +unsigned char *next_word(unsigned char *string) +/* move to next word in string */ { while ((*string != (char) NULL) && ((*string != 32) && (*string != 9))) string++; @@ -1153,7 +1146,7 @@ unsigned char *string; } void -prev_word() /* move to start of previous word in text */ +prev_word(void) /* move to start of previous word in text */ { if (position != 1) { @@ -1174,7 +1167,7 @@ prev_word() /* move to start of previous word in text */ } void -control() /* use control for commands */ +control(void) /* use control for commands */ { char *string; @@ -1252,7 +1245,7 @@ control() /* use control for commands */ */ void -emacs_control() +emacs_control(void) { char *string; @@ -1326,7 +1319,7 @@ emacs_control() } void -bottom() /* go to bottom of file */ +bottom(void) /* go to bottom of file */ { while (curr_line->next_line != NULL) curr_line = curr_line->next_line; @@ -1339,7 +1332,7 @@ bottom() /* go to bottom of file */ } void -top() /* go to top of file */ +top(void) /* go to top of file */ { while (curr_line->prev_line != NULL) curr_line = curr_line->prev_line; @@ -1352,7 +1345,7 @@ top() /* go to top of file */ } void -nextline() /* move pointers to start of next line */ +nextline(void) /* move pointers to start of next line */ { curr_line = curr_line->next_line; point = curr_line->line; @@ -1370,7 +1363,7 @@ nextline() /* move pointers to start of next line */ } void -prevline() /* move pointers to start of previous line*/ +prevline(void) /* move pointers to start of previous line*/ { curr_line = curr_line->prev_line; point = curr_line->line; @@ -1390,8 +1383,7 @@ prevline() /* move pointers to start of previous line*/ } void -left(disp) /* move left one character */ -int disp; +left(int disp) /* move left one character */ { if (point != curr_line->line) /* if not at begin of line */ { @@ -1424,8 +1416,7 @@ int disp; } void -right(disp) /* move right one character */ -int disp; +right(int disp) /* move right one character */ { if (position < curr_line->line_length) { @@ -1463,7 +1454,7 @@ int disp; } void -find_pos() /* move to the same column as on other line */ +find_pos(void) /* move to the same column as on other line */ { scr_horz = 0; position = 1; @@ -1499,7 +1490,7 @@ find_pos() /* move to the same column as on other line */ } void -up() /* move up one line */ +up(void) /* move up one line */ { if (curr_line->prev_line != NULL) { @@ -1510,7 +1501,7 @@ up() /* move up one line */ } void -down() /* move down one line */ +down(void) /* move down one line */ { if (curr_line->next_line != NULL) { @@ -1520,7 +1511,7 @@ down() /* move down one line */ } void -function_key() /* process function key */ +function_key(void) /* process function key */ { if (in == KEY_LEFT) left(TRUE); @@ -1625,7 +1616,7 @@ function_key() /* process function key */ } void -print_buffer() +print_buffer(void) { char buffer[256]; @@ -1638,7 +1629,7 @@ print_buffer() } void -command_prompt() +command_prompt(void) { char *cmd_str; int result; @@ -1674,8 +1665,7 @@ command_prompt() } void -command(cmd_str1) /* process commands from keyboard */ -char *cmd_str1; +command(char *cmd_str1) /* process commands from keyboard */ { char *cmd_str2 = NULL; char *cmd_str = cmd_str1; @@ -1828,10 +1818,8 @@ char *cmd_str1; } int -scan(line, offset, column) /* determine horizontal position for get_string */ -char *line; -int offset; -int column; +scan(char *line, int offset, int column) +/* determine horizontal position for get_string */ { char *stemp; int i; @@ -1849,10 +1837,13 @@ int column; return(j); } +/* +prompt: string containing user prompt message +advance: if true, skip leading spaces and tabs +*/ char * -get_string(prompt, advance) /* read string from input on command line */ -char *prompt; /* string containing user prompt message */ -int advance; /* if true, skip leading spaces and tabs */ +get_string(char *prompt, int advance) +/* read string from input on command line */ { char *string; char *tmp_string; @@ -1931,10 +1922,7 @@ int advance; /* if true, skip leading spaces and tabs */ } int -compare(string1, string2, sensitive) /* compare two strings */ -char *string1; -char *string2; -int sensitive; +compare(char *string1, char *string2, int sensitive) /* compare two strings */ { char *strng1; char *strng2; @@ -1969,8 +1957,7 @@ int sensitive; } void -goto_line(cmd_str) -char *cmd_str; +goto_line(char *cmd_str) { int number; int i; @@ -2019,9 +2006,8 @@ char *cmd_str; } void -midscreen(line, pnt) /* put current line in middle of screen */ -int line; -unsigned char *pnt; +midscreen(int line, unsigned char *pnt) +/* put current line in middle of screen */ { struct text *mid_line; int i; @@ -2040,9 +2026,8 @@ unsigned char *pnt; } void -get_options(numargs, arguments) /* get arguments from command line */ -int numargs; -char *arguments[]; +get_options(int numargs, char **arguments) +/* get arguments from command line */ { char *buff; int count; @@ -2123,7 +2108,7 @@ char *arguments[]; } void -check_fp() /* open or close files according to flags */ +check_fp(void) /* open or close files according to flags */ { int line_num; int temp; @@ -2205,8 +2190,7 @@ check_fp() /* open or close files according to flags */ } void -get_file(file_name) /* read specified file into current buffer */ -char *file_name; +get_file(char *file_name) /* read specified file into current buffer */ { int can_read; /* file has at least one character */ int length; /* length of line read by read */ @@ -2272,11 +2256,14 @@ char *file_name; } } -void -get_line(length, in_string, append) /* read string and split into lines */ -int length; /* length of string read by read */ -unsigned char *in_string; /* string read by read */ -int *append; /* TRUE if must append more text to end of current line */ +/* +length: length of string read by read +in_string: string read by read +append: TRUE if must append more text to end of current line +*/ +void +get_line(int length, unsigned char *in_string, int *append) +/* read string and split into lines */ { unsigned char *str1; unsigned char *str2; @@ -2343,7 +2330,7 @@ int *append; /* TRUE if must append more text to end of current line */ } void -draw_screen() /* redraw the screen from current postion */ +draw_screen(void) /* redraw the screen from current postion */ { struct text *temp_line; unsigned char *line_out; @@ -2364,7 +2351,7 @@ draw_screen() /* redraw the screen from current postion */ } void -finish() /* prepare to exit edit session */ +finish(void) /* prepare to exit edit session */ { char *file_name = in_file_name; @@ -2401,8 +2388,7 @@ finish() /* prepare to exit edit session */ } int -quit(noverify) /* exit editor */ -int noverify; +quit(int noverify) /* exit editor */ { char *ans; @@ -2439,8 +2425,7 @@ int noverify; } void -edit_abort(arg) -int arg; +edit_abort(int arg) { wrefresh(com_win); resetty(); @@ -2450,7 +2435,7 @@ int arg; } void -delete_text() +delete_text(void) { while (curr_line->next_line != NULL) curr_line = curr_line->next_line; @@ -2470,8 +2455,7 @@ delete_text() } int -write_file(file_name) -char *file_name; +write_file(char *file_name) { char cr; char *tmp_point; @@ -2544,8 +2528,7 @@ char *file_name; } int -search(display_message) /* search for string in srch_str */ -int display_message; +search(int display_message) /* search for string in srch_str */ { int lines_moved; int iter; @@ -2657,7 +2640,7 @@ int display_message; } void -search_prompt() /* prompt and read search string (srch_str) */ +search_prompt(void) /* prompt and read search string (srch_str) */ { if (srch_str != NULL) free(srch_str); @@ -2678,7 +2661,7 @@ search_prompt() /* prompt and read search string (srch_str) */ } void -del_char() /* delete current character */ +del_char(void) /* delete current character */ { in = 8; /* backspace */ if (position < curr_line->line_length) /* if not end of line */ @@ -2702,7 +2685,7 @@ del_char() /* delete current character */ } void -undel_char() /* undelete last deleted character */ +undel_char(void) /* undelete last deleted character */ { if (d_char[0] == '\n') /* insert line if last del_char deleted eol */ insert_line(TRUE); @@ -2719,7 +2702,7 @@ undel_char() /* undelete last deleted character */ } void -del_word() /* delete word in front of cursor */ +del_word(void) /* delete word in front of cursor */ { int tposit; int difference; @@ -2773,7 +2756,7 @@ del_word() /* delete word in front of cursor */ } void -undel_word() /* undelete last deleted word */ +undel_word(void) /* undelete last deleted word */ { int temp; int tposit; @@ -2835,7 +2818,7 @@ undel_word() /* undelete last deleted word */ } void -del_line() /* delete from cursor to end of line */ +del_line(void) /* delete from cursor to end of line */ { unsigned char *dl1; unsigned char *dl2; @@ -2868,7 +2851,7 @@ del_line() /* delete from cursor to end of line */ } void -undel_line() /* undelete last deleted line */ +undel_line(void) /* undelete last deleted line */ { unsigned char *ud1; unsigned char *ud2; @@ -2896,7 +2879,7 @@ undel_line() /* undelete last deleted line */ } void -adv_word() /* advance to next word */ +adv_word(void) /* advance to next word */ { while ((position < curr_line->line_length) && ((*point != 32) && (*point != 9))) right(TRUE); @@ -2905,9 +2888,7 @@ while ((position < curr_line->line_length) && ((*point == 32) || (*point == 9))) } void -move_rel(direction, lines) /* move relative to current line */ -char *direction; -int lines; +move_rel(char *direction, int lines) /* move relative to current line */ { int i; char *tmp; @@ -2971,7 +2952,7 @@ int lines; } void -eol() /* go to end of line */ +eol(void) /* go to end of line */ { if (position < curr_line->line_length) { @@ -2987,7 +2968,7 @@ eol() /* go to end of line */ } void -bol() /* move to beginning of line */ +bol(void) /* move to beginning of line */ { if (point != curr_line->line) { @@ -3002,7 +2983,7 @@ bol() /* move to beginning of line */ } void -adv_line() /* advance to beginning of next line */ +adv_line(void) /* advance to beginning of next line */ { if ((point != curr_line->line) || (scr_pos > 0)) { @@ -3017,9 +2998,9 @@ adv_line() /* advance to beginning of next line */ } } +/* string: string containing user command */ void -sh_command(string) /* execute shell command */ -char *string; /* string containing user command */ +sh_command(char *string) /* execute shell command */ { char *temp_point; char *last_slash; @@ -3213,7 +3194,7 @@ char *string; /* string containing user command */ } void -set_up_term() /* set up the terminal for operating with ae */ +set_up_term(void) /* set up the terminal for operating with ae */ { if (!curses_initialized) { @@ -3271,7 +3252,7 @@ set_up_term() /* set up the terminal for operating with ae */ } void -resize_check() +resize_check(void) { if ((LINES == local_LINES) && (COLS == local_COLS)) return; @@ -3290,8 +3271,7 @@ resize_check() static char item_alpha[] = "abcdefghijklmnopqrstuvwxyz0123456789 "; int -menu_op(menu_list) -struct menu_entries menu_list[]; +menu_op(struct menu_entries *menu_list) { WINDOW *temp_win; int max_width, max_height; @@ -3503,12 +3483,9 @@ struct menu_entries menu_list[]; } void -paint_menu(menu_list, max_width, max_height, list_size, top_offset, menu_win, - off_start, vert_size) -struct menu_entries menu_list[]; -int max_width, max_height, list_size, top_offset; -WINDOW *menu_win; -int off_start, vert_size; +paint_menu(struct menu_entries *menu_list, int max_width, int max_height, + int list_size, int top_offset, WINDOW *menu_win, int off_start, + int vert_size) { int counter, temp_int; @@ -3606,7 +3583,7 @@ int off_start, vert_size; } void -help() +help(void) { int counter; @@ -3633,7 +3610,7 @@ help() } void -paint_info_win() +paint_info_win(void) { int counter; @@ -3655,7 +3632,7 @@ paint_info_win() } void -no_info_window() +no_info_window(void) { if (!info_window) return; @@ -3673,7 +3650,7 @@ no_info_window() } void -create_info_window() +create_info_window(void) { if (info_window) return; @@ -3698,8 +3675,7 @@ create_info_window() } int -file_op(arg) -int arg; +file_op(int arg) { char *string; int flag; @@ -3772,7 +3748,7 @@ int arg; } void -shell_op() +shell_op(void) { char *string; @@ -3785,7 +3761,7 @@ shell_op() } void -leave_op() +leave_op(void) { if (text_changes) { @@ -3796,7 +3772,7 @@ leave_op() } void -redraw() +redraw(void) { if (info_window) { @@ -3814,8 +3790,8 @@ redraw() */ int -Blank_Line(test_line) /* test if line has any non-space characters */ -struct text *test_line; +Blank_Line(struct text *test_line) +/* test if line has any non-space characters */ { unsigned char *line; int length; @@ -3847,7 +3823,7 @@ struct text *test_line; } void -Format() /* format the paragraph according to set margins */ +Format(void) /* format the paragraph according to set margins */ { int string_count; int offset; @@ -4075,7 +4051,7 @@ unsigned char *init_name[3] = { }; void -ee_init() /* check for init file and read it if it exists */ +ee_init(void) /* check for init file and read it if it exists */ { FILE *init_file; unsigned char *string; @@ -4199,7 +4175,7 @@ ee_init() /* check for init file and read it if it exists */ */ void -dump_ee_conf() +dump_ee_conf(void) { FILE *init_file; FILE *old_init_file = NULL; @@ -4299,8 +4275,7 @@ dump_ee_conf() } void -echo_string(string) /* echo the given string */ -char *string; +echo_string(char *string) /* echo the given string */ { char *temp; int Counter; @@ -4351,7 +4326,7 @@ char *string; } void -spell_op() /* check spelling of words in the editor */ +spell_op(void) /* check spelling of words in the editor */ { if (restrict_mode()) { @@ -4371,7 +4346,7 @@ spell_op() /* check spelling of words in the editor */ } void -ispell_op() +ispell_op(void) { char name[128]; char string[256]; @@ -4396,8 +4371,7 @@ ispell_op() } int -first_word_len(test_line) -struct text *test_line; +first_word_len(struct text *test_line) { int counter; unsigned char *pnt; @@ -4433,7 +4407,7 @@ struct text *test_line; } void -Auto_Format() /* format the paragraph according to set margins */ +Auto_Format(void) /* format the paragraph according to set margins */ { int string_count; int offset; @@ -4693,7 +4667,7 @@ Auto_Format() /* format the paragraph according to set margins */ } void -modes_op() +modes_op(void) { int ret_value; int counter; @@ -4793,9 +4767,8 @@ modes_op() } char * -is_in_string(string, substring) /* a strchr() look-alike for systems without - strchr() */ -char * string, *substring; +is_in_string(char *string, char *substring) +/* a strchr() look-alike for systems without strchr() */ { char *full, *sub; @@ -4817,8 +4790,7 @@ char * string, *substring; */ char * -resolve_name(name) -char *name; +resolve_name(char *name) { char long_buffer[1024]; char short_buffer[128]; @@ -4941,7 +4913,7 @@ char *name; } int -restrict_mode() +restrict_mode(void) { if (!restricted) return(FALSE); @@ -4961,9 +4933,7 @@ restrict_mode() */ int -unique_test(string, list) -char *string; -char *list[]; +unique_test(char *string, char **list) { int counter; int num_match; @@ -4982,9 +4952,7 @@ char *list[]; } void -renumber_lines(firstline, startnumber) -struct text *firstline; -int startnumber; +renumber_lines(struct text *firstline, int startnumber) { struct text *lineptr; int i; @@ -5002,9 +4970,7 @@ int startnumber; */ char * -catgetlocal(number, string) -int number; -char *string; +catgetlocal(int number, char *string) { char *temp1; char *temp2; @@ -5028,7 +4994,7 @@ char *string; */ void -strings_init() +strings_init(void) { int counter; diff --git a/usr.bin/ee/new_curse.c b/usr.bin/ee/new_curse.c index 98bc9b2444..0d74bc68b9 100644 --- a/usr.bin/ee/new_curse.c +++ b/usr.bin/ee/new_curse.c @@ -38,7 +38,7 @@ | All are rights reserved. | | $FreeBSD: src/usr.bin/ee/new_curse.c,v 1.4.2.1 2001/06/10 11:06:06 sobomax Exp $ - | $DragonFly: src/usr.bin/ee/new_curse.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + | $DragonFly: src/usr.bin/ee/new_curse.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ | */ @@ -692,8 +692,7 @@ FILE *fopen(); /* declaration for open function */ */ void -copy_window(origin, destination) -WINDOW *origin, *destination; +copy_window(WINDOW *origin, WINDOW *destination) { int row, column; struct _line *orig, *dest; @@ -727,8 +726,7 @@ WINDOW *origin, *destination; } void -reinitscr(foo) -int foo; +reinitscr(int foo) { WINDOW *local_virt; WINDOW *local_std; @@ -765,7 +763,7 @@ int foo; #endif /* SIGWINCH */ void -initscr() /* initialize terminal for operations */ +initscr(void) /* initialize terminal for operations */ { int value; char *lines_string; @@ -1033,7 +1031,7 @@ printf("starting initscr \n");fflush(stdout); #ifndef CAP int -Get_int() /* get a two-byte integer from the terminfo file */ +Get_int(void) /* get a two-byte integer from the terminfo file */ { int High_byte; int Low_byte; @@ -1054,7 +1052,7 @@ Get_int() /* get a two-byte integer from the terminfo file */ } int -INFO_PARSE() /* parse off the data in the terminfo data file */ +INFO_PARSE(void) /* parse off the data in the terminfo data file */ { int offset; int magic_number = 0; @@ -1137,7 +1135,7 @@ INFO_PARSE() /* parse off the data in the terminfo data file */ #endif /* ifndef CAP */ int -AtoI() /* convert ascii text to integers */ +AtoI(void) /* convert ascii text to integers */ { int Temp; @@ -1151,7 +1149,7 @@ AtoI() /* convert ascii text to integers */ } void -Key_Get() /* create linked list with all key sequences obtained from terminal database */ +Key_Get(void) /* create linked list with all key sequences obtained from terminal database */ { int Counter; int Klen; @@ -1230,7 +1228,7 @@ Key_Get() /* create linked list with all key sequences obtained from terminal d */ void -keys_vt100() +keys_vt100(void) { int counter; int Klen; @@ -1253,8 +1251,7 @@ keys_vt100() #ifdef CAP char * -String_Get(param) /* read the string */ -char *param; +String_Get(char *param) /* read the string */ { char *String; char *Temp; @@ -1334,8 +1331,7 @@ char *param; } int -tc_Get_int(param) /* read the integer */ -int param; +tc_Get_int(int param) /* read the integer */ { int Itemp; @@ -1356,7 +1352,7 @@ int param; } void -Find_term() /* find terminal description in termcap file */ +Find_term(void) /* find terminal description in termcap file */ { char *Name; char *Ftemp; @@ -1393,7 +1389,7 @@ Find_term() /* find terminal description in termcap file */ } void -CAP_PARSE() /* parse off the data in the termcap data file */ +CAP_PARSE(void) /* parse off the data in the termcap data file */ { int offset; int found; @@ -1456,8 +1452,7 @@ CAP_PARSE() /* parse off the data in the termcap data file */ #endif /* ifdef CAP */ struct _line * -Screenalloc(columns) -int columns; +Screenalloc(int columns) { int i; struct _line *tmp; @@ -1481,9 +1476,12 @@ int columns; return(tmp); } -WINDOW *newwin(lines, cols, start_l, start_c) -int lines, cols; /* number of lines and columns to be in window */ -int start_l, start_c; /* starting line and column to be inwindow */ +/* +lines, cols: number of lines and columns to be in window +start_l, start_c: starting line and column to be in window +*/ +WINDOW +*newwin(int lines, int cols, int start_l, int start_c) { WINDOW *Ntemp; struct _line *temp_screen; @@ -1514,11 +1512,13 @@ int start_l, start_c; /* starting line and column to be inwindow */ } #ifdef CAP +/* +p_list: stack of values +place: place keeper of top of stack +*/ void -Cap_Out(string, p_list, place) /* interpret the output string if necessary */ -char *string; -int p_list[]; /* stack of values */ -int place; /* place keeper of top of stack */ +Cap_Out(char *string, int *p_list, int place) +/* interpret the output string if necessary */ { char *Otemp; /* temporary string pointer to parse output */ int delay; @@ -1631,9 +1631,7 @@ int place; /* place keeper of top of stack */ int variable[27]; int -Operation(Temp_Stack, place) /* handle conditional operations */ -int Temp_Stack[]; -int place; +Operation(int *Temp_Stack, int place) /* handle conditional operations */ { int temp; @@ -1816,10 +1814,8 @@ int place; } void -Info_Out(string, p_list, place) /* interpret the output string if necessary */ -char *string; -int p_list[]; -int place; +Info_Out(char *string, int *p_list, int place) +/* interpret the output string if necessary */ { char *tchar; int delay; @@ -2011,9 +2007,8 @@ int place; #endif void -wmove(window, row, column) /* move cursor to indicated position in window */ -WINDOW *window; -int row, column; +wmove(WINDOW *window, int row, int column) +/* move cursor to indicated position in window */ { if ((row < window->Num_lines) && (column < window->Num_cols)) { @@ -2023,10 +2018,7 @@ int row, column; } void -clear_line(line, column, cols) -struct _line *line; -int column; -int cols; +clear_line(struct _line *line, int column, int cols) { int j; @@ -2044,8 +2036,7 @@ int cols; } void -werase(window) /* clear the specified window */ -WINDOW *window; +werase(WINDOW *window) /* clear the specified window */ { int i; struct _line *tmp; @@ -2057,8 +2048,8 @@ WINDOW *window; } void -wclrtoeol(window) /* erase from current cursor position to end of line */ -WINDOW *window; +wclrtoeol(WINDOW *window) +/* erase from current cursor position to end of line */ { int column, row; struct _line *tmp; @@ -2072,8 +2063,7 @@ WINDOW *window; } void -wrefresh(window) /* flush all previous output */ -WINDOW *window; +wrefresh(WINDOW *window) /* flush all previous output */ { wnoutrefresh(window); #ifdef DIAG @@ -2111,8 +2101,7 @@ WINDOW *window; } void -touchwin(window) -WINDOW *window; +touchwin(WINDOW *window) { struct _line *user_line; int line_counter = 0; @@ -2126,8 +2115,7 @@ WINDOW *window; } void -wnoutrefresh(window) -WINDOW *window; +wnoutrefresh(WINDOW *window) { struct _line *user_line; struct _line *virtual_line; @@ -2194,13 +2182,12 @@ WINDOW *window; } void -flushinp() /* flush input */ +flushinp(void) /* flush input */ { } void -ungetch(c) /* push a character back on input */ -int c; +ungetch(int c) /* push a character back on input */ { if (bufp < 100) in_buff[bufp++] = c; @@ -2208,7 +2195,7 @@ int c; #ifdef BSD_SELECT int -timed_getchar() +timed_getchar(void) { struct timeval tv; fd_set fds; @@ -2240,8 +2227,7 @@ timed_getchar() #endif int -wgetch(window) /* get character from specified window */ -WINDOW *window; +wgetch(WINDOW *window) /* get character from specified window */ { int in_value; char temp; @@ -2295,8 +2281,7 @@ WINDOW *window; #ifndef BSD_SELECT void -Clear(arg) /* notify that time out has occurred */ -int arg; +Clear(int arg) /* notify that time out has occurred */ { Time_Out = TRUE; #ifdef DEBUG @@ -2306,9 +2291,9 @@ fflush(stderr); } #endif /* BSD_SELECT */ +/* first_char: first character of sequence */ int -Get_key(first_char) /* try to decode key sequence */ -int first_char; /* first character of sequence */ +Get_key(int first_char) /* try to decode key sequence */ { int in_char; int Count; @@ -2396,9 +2381,7 @@ fprintf(stderr, "ungetting character %d\n", string[Count]);fflush(stdout); } void -waddch(window, c) /* output the character in the specified window */ -WINDOW *window; -int c; +waddch(WINDOW *window, int c) /* output the character in the specified window */ { int row, column; int shift; /* number of spaces to shift if a tab */ @@ -2477,8 +2460,7 @@ int c; } void -winsertln(window) /* insert a blank line into the specified window */ -WINDOW *window; +winsertln(WINDOW *window) /* insert a blank line into the specified window */ { int row, column; struct _line *tmp; @@ -2519,8 +2501,7 @@ WINDOW *window; } void -wdeleteln(window) /* delete a line in the specified window */ -WINDOW *window; +wdeleteln(WINDOW *window) /* delete a line in the specified window */ { int row, column; struct _line *tmp; @@ -2567,8 +2548,8 @@ WINDOW *window; } void -wclrtobot(window) /* delete from current position to end of the window */ -WINDOW *window; +wclrtobot(WINDOW *window) +/* delete from current position to end of the window */ { int row, column; struct _line *tmp; @@ -2588,24 +2569,20 @@ WINDOW *window; } void -wstandout(window) /* begin standout mode in window */ -WINDOW *window; +wstandout(WINDOW *window) /* begin standout mode in window */ { if (Numbers[sg__] < 1) /* if not magic cookie glitch */ window->Attrib |= A_STANDOUT; } void -wstandend(window) /* end standout mode in window */ -WINDOW *window; +wstandend(WINDOW *window) /* end standout mode in window */ { window->Attrib &= ~A_STANDOUT; } void -waddstr(window, string) /* write 'string' in window */ -WINDOW *window; -char *string; +waddstr(WINDOW *window, char *string) /* write 'string' in window */ { char *wstring; @@ -2614,16 +2591,14 @@ char *string; } void -clearok(window, flag) /* erase screen and redraw at next refresh */ -WINDOW *window; -int flag; +clearok(WINDOW *window, int flag) /* erase screen and redraw at next refresh */ { Repaint_screen = TRUE; } void -echo() /* turn on echoing */ +echo(void) /* turn on echoing */ { int value; @@ -2637,7 +2612,7 @@ echo() /* turn on echoing */ } void -noecho() /* turn off echoing */ +noecho(void) /* turn off echoing */ { int value; @@ -2651,7 +2626,7 @@ noecho() /* turn off echoing */ } void -raw() /* set to read characters immediately */ +raw(void) /* set to read characters immediately */ { int value; @@ -2679,7 +2654,7 @@ raw() /* set to read characters immediately */ } void -noraw() /* set to normal character read mode */ +noraw(void) /* set to normal character read mode */ { int value; @@ -2699,7 +2674,7 @@ noraw() /* set to normal character read mode */ } void -nl() +nl(void) { int value; @@ -2710,7 +2685,7 @@ nl() } void -nonl() +nonl(void) { int value; @@ -2722,38 +2697,32 @@ nonl() } void -saveterm() +saveterm(void) { } void -fixterm() +fixterm(void) { } void -resetterm() +resetterm(void) { } void -nodelay(window, flag) -WINDOW *window; -int flag; +nodelay(WINDOW *window, int flag) { } void -idlok(window, flag) -WINDOW *window; -int flag; +idlok(WINDOW *window, int flag) { } void -keypad(window, flag) -WINDOW *window; -int flag; +keypad(WINDOW *window, int flag) { if (flag) String_Out(String_table[ks__], NULL, 0); @@ -2762,7 +2731,7 @@ int flag; } void -savetty() /* save current tty stats */ +savetty(void) /* save current tty stats */ { int value; @@ -2774,7 +2743,7 @@ savetty() /* save current tty stats */ } void -resetty() /* restore previous tty stats */ +resetty(void) /* restore previous tty stats */ { int value; @@ -2786,7 +2755,7 @@ resetty() /* restore previous tty stats */ } void -endwin() /* end windows */ +endwin(void) /* end windows */ { keypad(stdscr, FALSE); initialized = FALSE; @@ -2803,8 +2772,7 @@ endwin() /* end windows */ } void -delwin(window) /* delete the window structure */ -WINDOW *window; +delwin(WINDOW *window) /* delete the window structure */ { int i; @@ -2826,33 +2794,15 @@ WINDOW *window; } } -#ifndef __STDC__ -void -wprintw(va_alist) -va_dcl -#else /* __STDC__ */ void wprintw(WINDOW *window, const char *format, ...) -#endif /* __STDC__ */ { -#ifndef __STDC__ - WINDOW *window; - char *format; va_list ap; -#else - va_list ap; -#endif int value; char *fpoint; char *wtemp; -#ifndef __STDC__ - va_start(ap); - window = va_arg(ap, WINDOW *); - format = va_arg(ap, char *); -#else /* __STDC__ */ va_start(ap, format); -#endif /* __STDC__ */ fpoint = (char *) format; while (*fpoint != (char) NULL) @@ -2897,15 +2847,11 @@ wprintw(WINDOW *window, const char *format, ...) else waddch(window, *fpoint++); } -#ifdef __STDC__ va_end(ap); -#endif /* __STDC__ */ } void -iout(window, value) /* output characters */ -WINDOW *window; -int value; +iout(WINDOW *window, int value) /* output characters */ { int i; @@ -2915,9 +2861,7 @@ int value; } int -Comp_line(line1, line2) /* compare lines */ -struct _line *line1; -struct _line *line2; +Comp_line(struct _line *line1, struct _line *line2) /* compare lines */ { int count1, count2; int i; @@ -2952,10 +2896,7 @@ struct _line *line2; } struct _line * -Insert_line(row, end_row, window) /* insert line into screen */ -int row; -int end_row; -WINDOW *window; +Insert_line(int row, int end_row, WINDOW *window) /* insert line into screen */ { int i; struct _line *tmp; @@ -3014,10 +2955,8 @@ WINDOW *window; struct _line * -Delete_line(row, end_row, window) /* delete a line on screen */ -int row; -int end_row; -WINDOW *window; +Delete_line(int row, int end_row, struct _line *window) +/* delete a line on screen */ { int i; struct _line *tmp; @@ -3085,9 +3024,7 @@ WINDOW *window; } void -CLEAR_TO_EOL(window, row, column) -WINDOW *window; -int row, column; +CLEAR_TO_EOL(WINDOW *window, int row, int column) { int x, y; struct _line *tmp1; @@ -3121,10 +3058,8 @@ int row, column; } int -check_delete(window, line, offset, pointer_new, pointer_old) -WINDOW *window; -int line, offset; -struct _line *pointer_new, *pointer_old; +check_delete(WINDOW *window, int line, int offset, struct _line *pointer_new, + struct _line *pointer_old) { int end_old; int end_new; @@ -3173,10 +3108,8 @@ struct _line *pointer_new, *pointer_old; */ int -check_insert(window, line, offset, pointer_new, pointer_old) -WINDOW *window; -int line, offset; -struct _line *pointer_new, *pointer_old; +check_insert(WINDOW *window, int line, int offset, struct _line *pointer_new, + struct _line *pointer_old) { int changed; int end_old, end_new; @@ -3239,7 +3172,7 @@ struct _line *pointer_new, *pointer_old; } void -doupdate() +doupdate(void) { WINDOW *window; int similar; @@ -3614,10 +3547,8 @@ doupdate() } void -Position(window, row, col) /* position the cursor for output on the screen */ -WINDOW *window; -int row; -int col; +Position(WINDOW *window, int row, int col) +/* position the cursor for output on the screen */ { int list[10]; int place; @@ -3644,11 +3575,8 @@ int col; } void -Char_del(line, attrib, offset, maxlen) /* delete chars from line */ -char *line; -char *attrib; -int offset; -int maxlen; +Char_del(char *line, char *attrib, int offset, int maxlen) +/* delete chars from line */ { int one, two; @@ -3661,13 +3589,8 @@ int maxlen; } void -Char_ins(line, attrib, newc, newatt, offset, maxlen) /* insert chars in line */ -char *line; -char *attrib; -char newc; -char newatt; -int offset; -int maxlen; +Char_ins(char *line, char *attrib, char newc, char newatt, int offset, + int maxlen) /* insert chars in line */ { int one, two; @@ -3685,7 +3608,7 @@ int maxlen; } void -attribute_on() +attribute_on(void) { if (String_table[sa__]) { @@ -3697,7 +3620,7 @@ attribute_on() } void -attribute_off() +attribute_off(void) { if (String_table[me__]) String_Out(String_table[me__], NULL, 0); @@ -3711,12 +3634,8 @@ attribute_off() } void -Char_out(newc, newatt, line, attrib, offset) /* output character with proper attribute */ -char newc; -char newatt; -char *line; -char *attrib; -int offset; +Char_out(char newc, char newatt, char *line, char *attrib, int offset) +/* output character with proper attribute */ { @@ -3754,15 +3673,13 @@ int offset; */ void -nc_setattrib(flag) -int flag; +nc_setattrib(int flag) { nc_attributes |= flag; } void -nc_clearattrib(flag) -int flag; +nc_clearattrib(int flag) { nc_attributes &= ~flag; } diff --git a/usr.bin/enigma/enigma.c b/usr.bin/enigma/enigma.c index 0dcb55a8e9..3f16931f4b 100644 --- a/usr.bin/enigma/enigma.c +++ b/usr.bin/enigma/enigma.c @@ -10,7 +10,7 @@ * Upgraded to function properly on 64-bit machines. * * $FreeBSD: src/usr.bin/enigma/enigma.c,v 1.2.6.3 2001/08/01 23:51:34 obrien Exp $ - * $DragonFly: src/usr.bin/enigma/enigma.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/enigma/enigma.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -37,8 +37,7 @@ void shuffle(char *); void setup(char *); void -setup(pw) - char *pw; +setup(char *pw) { int ic, i, k, temp, pf[2], pid; unsigned rnd; @@ -110,9 +109,7 @@ setup(pw) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int i, n1, n2, nr1, nr2; int secureflg = 0, kflag = 0; @@ -170,8 +167,7 @@ main(argc, argv) } void -shuffle(deckary) - char deckary[]; +shuffle(char *deckary) { int i, ic, k, temp; unsigned rnd; diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c index 495cdb6509..1a3e4526c7 100644 --- a/usr.bin/env/env.c +++ b/usr.bin/env/env.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)env.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/usr.bin/env/env.c,v 1.5.2.3 2002/06/26 08:23:36 tjr Exp $ - * $DragonFly: src/usr.bin/env/env.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/env/env.c,v 1.3 2003/10/04 20:36:43 hmp Exp $ */ #include @@ -48,9 +48,7 @@ extern char **environ; static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { char **ep, *p; char *cleanenv[1]; @@ -79,7 +77,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: env [-] [-i] [name=value ...] [utility [argument ...]]\n"); diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c index 17249d4e82..3f6483ce8c 100644 --- a/usr.bin/expand/expand.c +++ b/usr.bin/expand/expand.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)expand.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/expand/expand.c,v 1.5.2.6 2002/07/09 10:47:59 tjr Exp $ - * $DragonFly: src/usr.bin/expand/expand.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/expand/expand.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -53,9 +53,7 @@ static void getstops(char *); static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int c, column; register int n; @@ -150,8 +148,7 @@ main(argc, argv) } static void -getstops(cp) - register char *cp; +getstops(register char *cp) { register int i; @@ -176,7 +173,7 @@ getstops(cp) } static void -usage() +usage(void) { (void)fprintf (stderr, "usage: expand [-t tablist] [file ...]\n"); exit(1); diff --git a/usr.bin/false/false.c b/usr.bin/false/false.c index 88bd3c47fa..ff036c8fe9 100644 --- a/usr.bin/false/false.c +++ b/usr.bin/false/false.c @@ -32,9 +32,12 @@ * * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)false.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/false/false.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ -main() +int +main(void) { exit(1); } diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c index 8eb963b76f..ed27b216b7 100644 --- a/usr.bin/find/find.c +++ b/usr.bin/find/find.c @@ -35,7 +35,7 @@ * * @(#)find.c 8.5 (Berkeley) 8/5/94 * $FreeBSD: src/usr.bin/find/find.c,v 1.7.6.3 2001/05/06 09:53:22 phk Exp $ - * $DragonFly: src/usr.bin/find/find.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/find.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -51,7 +51,7 @@ #include "find.h" -static int find_compare __P((const FTSENT **s1, const FTSENT **s2)); +static int find_compare(const FTSENT **s1, const FTSENT **s2); /* * find_compare -- @@ -60,8 +60,7 @@ static int find_compare __P((const FTSENT **s1, const FTSENT **s2)); * order within each directory. */ static int -find_compare(s1, s2) - const FTSENT **s1, **s2; +find_compare(const FTSENT **s1, const FTSENT **s2) { return (strcoll((*s1)->fts_name, (*s2)->fts_name)); @@ -73,8 +72,7 @@ find_compare(s1, s2) * command arguments. */ PLAN * -find_formplan(argv) - char **argv; +find_formplan(char **argv) { PLAN *plan, *tail, *new; @@ -169,11 +167,12 @@ FTS *tree; /* pointer to top of FTS hierarchy */ * find_execute -- * take a search plan and an array of search paths and executes the plan * over all FTSENT's returned for the given search paths. + * + * plan: search plan + * paths: array of pathnames to traverse */ int -find_execute(plan, paths) - PLAN *plan; /* search plan */ - char **paths; /* array of pathnames to traverse */ +find_execute(PLAN *plan, char **paths) { register FTSENT *entry; PLAN *p; diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 34b1e5e89a..468ba7c99e 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -35,7 +35,7 @@ * * @(#)function.c 8.10 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/find/function.c,v 1.22.2.11 2002/11/15 11:38:15 sheldonh Exp $ - * $DragonFly: src/usr.bin/find/function.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/function.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -60,7 +60,7 @@ #include "find.h" -time_t get_date __P((char *date, struct timeb *now)); +time_t get_date (char *date, struct timeb *now); #define COMPARE(a, b) do { \ switch (plan->flags & F_ELG_MASK) { \ @@ -76,8 +76,7 @@ time_t get_date __P((char *date, struct timeb *now)); } while(0) static PLAN * -palloc(option) - OPTION *option; +palloc(OPTION *option) { PLAN *new; @@ -94,9 +93,7 @@ palloc(option) * Parse a string of the form [+-]# and return the value. */ static long long -find_parsenum(plan, option, vp, endch) - PLAN *plan; - char *option, *vp, *endch; +find_parsenum(PLAN *plan, char *option, char *vp, char *endch) { long long value; char *endchar, *str; /* Pointer to character ending conversion. */ @@ -137,9 +134,7 @@ find_parsenum(plan, option, vp, endch) * Parse a string of the form [+-]([0-9]+[smhdw]?)+ and return the value. */ static long long -find_parsetime(plan, option, vp) - PLAN *plan; - char *option, *vp; +find_parsetime(PLAN *plan, char *option, char *vp) { long long secs, value; char *str, *unit; /* Pointer to character ending conversion. */ @@ -214,9 +209,7 @@ find_parsetime(plan, option, vp) * and increment the argument vector pointer. */ static char * -nextarg(option, argvp) - OPTION *option; - char ***argvp; +nextarg(OPTION *option, char ***argvp) { char *arg; @@ -246,9 +239,7 @@ nextarg(option, argvp) * and the current time is n min periods. */ int -f_Xmin(plan, entry) - PLAN *plan; - FTSENT *entry; +f_Xmin(PLAN *plan, FTSENT *entry) { extern time_t now; @@ -265,9 +256,7 @@ f_Xmin(plan, entry) } PLAN * -c_Xmin(option, argvp) - OPTION *option; - char ***argvp; +c_Xmin(OPTION *option, char ***argvp) { char *nmins; PLAN *new; @@ -292,9 +281,7 @@ c_Xmin(option, argvp) */ int -f_Xtime(plan, entry) - PLAN *plan; - FTSENT *entry; +f_Xtime(PLAN *plan, FTSENT *entry) { extern time_t now; int exact_time; @@ -326,9 +313,7 @@ f_Xtime(plan, entry) } PLAN * -c_Xtime(option, argvp) - OPTION *option; - char ***argvp; +c_Xtime(OPTION *option, char ***argvp) { char *value; PLAN *new; @@ -353,9 +338,7 @@ c_Xtime(option, argvp) * find_execute() so their f_* functions are set to f_always_true(). */ PLAN * -c_mXXdepth(option, argvp) - OPTION *option; - char ***argvp; +c_mXXdepth(OPTION *option, char ***argvp) { char *dstr; PLAN *new; @@ -379,9 +362,7 @@ c_mXXdepth(option, argvp) * True always. Makes its best shot and continues on regardless. */ int -f_delete(plan, entry) - PLAN *plan; - FTSENT *entry; +f_delete(PLAN *plan, FTSENT *entry) { /* ignore these from fts */ if (strcmp(entry->fts_accpath, ".") == 0 || @@ -421,9 +402,7 @@ f_delete(plan, entry) } PLAN * -c_delete(option, argvp) - OPTION *option; - char ***argvp; +c_delete(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_NOSTAT; /* no optimise */ @@ -444,17 +423,13 @@ c_delete(option, argvp) * itself. */ int -f_always_true(plan, entry) - PLAN *plan; - FTSENT *entry; +f_always_true(PLAN *plan, FTSENT *entry) { return 1; } PLAN * -c_depth(option, argvp) - OPTION *option; - char ***argvp; +c_depth(OPTION *option, char ***argvp) { isdepth = 1; @@ -467,9 +442,7 @@ c_depth(option, argvp) * True if the file or directory is empty */ int -f_empty(plan, entry) - PLAN *plan; - FTSENT *entry; +f_empty(PLAN *plan, FTSENT *entry) { if (S_ISREG(entry->fts_statp->st_mode) && entry->fts_statp->st_size == 0) @@ -497,9 +470,7 @@ f_empty(plan, entry) } PLAN * -c_empty(option, argvp) - OPTION *option; - char ***argvp; +c_empty(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_NOSTAT; @@ -522,9 +493,7 @@ c_empty(option, argvp) * of the user before executing the utility. */ int -f_exec(plan, entry) - register PLAN *plan; - FTSENT *entry; +f_exec(register PLAN *plan, FTSENT *entry) { extern int dotfd; register int cnt; @@ -577,9 +546,7 @@ f_exec(plan, entry) * strings, but also flags meaning that the string has to be massaged. */ PLAN * -c_exec(option, argvp) - OPTION *option; - char ***argvp; +c_exec(OPTION *option, char ***argvp) { PLAN *new; /* node returned */ register int cnt; @@ -629,9 +596,7 @@ c_exec(option, argvp) } int -f_flags(plan, entry) - PLAN *plan; - FTSENT *entry; +f_flags(PLAN *plan, FTSENT *entry) { u_long flags; @@ -648,9 +613,7 @@ f_flags(plan, entry) } PLAN * -c_flags(option, argvp) - OPTION *option; - char ***argvp; +c_flags(OPTION *option, char ***argvp) { char *flags_str; PLAN *new; @@ -683,9 +646,7 @@ c_flags(option, argvp) * basis. */ PLAN * -c_follow(option, argvp) - OPTION *option; - char ***argvp; +c_follow(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_PHYSICAL; ftsoptions |= FTS_LOGICAL; @@ -699,9 +660,7 @@ c_follow(option, argvp) * True if the file is of a certain type. */ int -f_fstype(plan, entry) - PLAN *plan; - FTSENT *entry; +f_fstype(PLAN *plan, FTSENT *entry) { static dev_t curdev; /* need a guaranteed illegal dev value */ static int first = 1; @@ -759,9 +718,7 @@ f_fstype(plan, entry) #if !defined(__NetBSD__) PLAN * -c_fstype(option, argvp) - OPTION *option; - char ***argvp; +c_fstype(OPTION *option, char ***argvp) { char *fsname; register PLAN *new; @@ -811,17 +768,13 @@ c_fstype(option, argvp) * name, gname is taken as a group ID. */ int -f_group(plan, entry) - PLAN *plan; - FTSENT *entry; +f_group(PLAN *plan, FTSENT *entry) { return entry->fts_statp->st_gid == plan->g_data; } PLAN * -c_group(option, argvp) - OPTION *option; - char ***argvp; +c_group(OPTION *option, char ***argvp) { char *gname; PLAN *new; @@ -850,17 +803,13 @@ c_group(option, argvp) * True if the file has inode # n. */ int -f_inum(plan, entry) - PLAN *plan; - FTSENT *entry; +f_inum(PLAN *plan, FTSENT *entry) { COMPARE(entry->fts_statp->st_ino, plan->i_data); } PLAN * -c_inum(option, argvp) - OPTION *option; - char ***argvp; +c_inum(OPTION *option, char ***argvp) { char *inum_str; PLAN *new; @@ -879,17 +828,13 @@ c_inum(option, argvp) * True if the file has n links. */ int -f_links(plan, entry) - PLAN *plan; - FTSENT *entry; +f_links(PLAN *plan, FTSENT *entry) { COMPARE(entry->fts_statp->st_nlink, plan->l_data); } PLAN * -c_links(option, argvp) - OPTION *option; - char ***argvp; +c_links(OPTION *option, char ***argvp) { char *nlinks; PLAN *new; @@ -908,18 +853,14 @@ c_links(option, argvp) * Always true - prints the current entry to stdout in "ls" format. */ int -f_ls(plan, entry) - PLAN *plan; - FTSENT *entry; +f_ls(PLAN *plan, FTSENT *entry) { printlong(entry->fts_path, entry->fts_accpath, entry->fts_statp); return 1; } PLAN * -c_ls(option, argvp) - OPTION *option; - char ***argvp; +c_ls(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_NOSTAT; isoutput = 1; @@ -934,18 +875,14 @@ c_ls(option, argvp) * matches pattern using Pattern Matching Notation S3.14 */ int -f_name(plan, entry) - PLAN *plan; - FTSENT *entry; +f_name(PLAN *plan, FTSENT *entry) { return !fnmatch(plan->c_data, entry->fts_name, plan->flags & F_IGNCASE ? FNM_CASEFOLD : 0); } PLAN * -c_name(option, argvp) - OPTION *option; - char ***argvp; +c_name(OPTION *option, char ***argvp) { char *pattern; PLAN *new; @@ -964,9 +901,7 @@ c_name(option, argvp) * file. */ int -f_newer(plan, entry) - PLAN *plan; - FTSENT *entry; +f_newer(PLAN *plan, FTSENT *entry) { if (plan->flags & F_TIME_C) return entry->fts_statp->st_ctime > plan->t_data; @@ -977,9 +912,7 @@ f_newer(plan, entry) } PLAN * -c_newer(option, argvp) - OPTION *option; - char ***argvp; +c_newer(OPTION *option, char ***argvp) { char *fn_or_tspec; PLAN *new; @@ -1014,17 +947,13 @@ c_newer(option, argvp) * of the getgrnam() 9.2.1 [POSIX.1] function returns NULL. */ int -f_nogroup(plan, entry) - PLAN *plan; - FTSENT *entry; +f_nogroup(PLAN *plan, FTSENT *entry) { return group_from_gid(entry->fts_statp->st_gid, 1) == NULL; } PLAN * -c_nogroup(option, argvp) - OPTION *option; - char ***argvp; +c_nogroup(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_NOSTAT; @@ -1038,17 +967,13 @@ c_nogroup(option, argvp) * of the getpwuid() 9.2.2 [POSIX.1] function returns NULL. */ int -f_nouser(plan, entry) - PLAN *plan; - FTSENT *entry; +f_nouser(PLAN *plan, FTSENT *entry) { return user_from_uid(entry->fts_statp->st_uid, 1) == NULL; } PLAN * -c_nouser(option, argvp) - OPTION *option; - char ***argvp; +c_nouser(OPTION *option, char ***argvp) { ftsoptions &= ~FTS_NOSTAT; @@ -1062,9 +987,7 @@ c_nouser(option, argvp) * matches pattern using Pattern Matching Notation S3.14 */ int -f_path(plan, entry) - PLAN *plan; - FTSENT *entry; +f_path(PLAN *plan, FTSENT *entry) { return !fnmatch(plan->c_data, entry->fts_path, plan->flags & F_IGNCASE ? FNM_CASEFOLD : 0); @@ -1080,9 +1003,7 @@ f_path(plan, entry) * symbolic mode. */ int -f_perm(plan, entry) - PLAN *plan; - FTSENT *entry; +f_perm(PLAN *plan, FTSENT *entry) { mode_t mode; @@ -1098,9 +1019,7 @@ f_perm(plan, entry) } PLAN * -c_perm(option, argvp) - OPTION *option; - char ***argvp; +c_perm(OPTION *option, char ***argvp) { char *perm; PLAN *new; @@ -1134,18 +1053,14 @@ c_perm(option, argvp) * standard output. */ int -f_print(plan, entry) - PLAN *plan; - FTSENT *entry; +f_print(PLAN *plan, FTSENT *entry) { (void)puts(entry->fts_path); return 1; } PLAN * -c_print(option, argvp) - OPTION *option; - char ***argvp; +c_print(OPTION *option, char ***argvp) { isoutput = 1; @@ -1159,9 +1074,7 @@ c_print(option, argvp) * standard output followed by a NUL character */ int -f_print0(plan, entry) - PLAN *plan; - FTSENT *entry; +f_print0(PLAN *plan, FTSENT *entry) { fputs(entry->fts_path, stdout); fputc('\0', stdout); @@ -1176,9 +1089,7 @@ f_print0(plan, entry) * Prune a portion of the hierarchy. */ int -f_prune(plan, entry) - PLAN *plan; - FTSENT *entry; +f_prune(PLAN *plan, FTSENT *entry) { extern FTS *tree; @@ -1196,9 +1107,7 @@ f_prune(plan, entry) * regular expression. */ int -f_regex(plan, entry) - PLAN *plan; - FTSENT *entry; +f_regex(PLAN *plan, FTSENT *entry) { char *str; size_t len; @@ -1231,9 +1140,7 @@ f_regex(plan, entry) } PLAN * -c_regex(option, argvp) - OPTION *option; - char ***argvp; +c_regex(OPTION *option, char ***argvp) { PLAN *new; char *pattern; @@ -1263,9 +1170,7 @@ c_regex(option, argvp) /* c_simple covers c_prune, c_openparen, c_closeparen, c_not, c_or */ PLAN * -c_simple(option, argvp) - OPTION *option; - char ***argvp; +c_simple(OPTION *option, char ***argvp) { return palloc(option); } @@ -1281,9 +1186,7 @@ c_simple(option, argvp) static int divsize = 1; int -f_size(plan, entry) - PLAN *plan; - FTSENT *entry; +f_size(PLAN *plan, FTSENT *entry) { off_t size; @@ -1293,9 +1196,7 @@ f_size(plan, entry) } PLAN * -c_size(option, argvp) - OPTION *option; - char ***argvp; +c_size(OPTION *option, char ***argvp) { char *size_str; PLAN *new; @@ -1320,17 +1221,13 @@ c_size(option, argvp) * regular file or whiteout respectively. */ int -f_type(plan, entry) - PLAN *plan; - FTSENT *entry; +f_type(PLAN *plan, FTSENT *entry) { return (entry->fts_statp->st_mode & S_IFMT) == plan->m_data; } PLAN * -c_type(option, argvp) - OPTION *option; - char ***argvp; +c_type(OPTION *option, char ***argvp) { char *typestring; PLAN *new; @@ -1384,17 +1281,13 @@ c_type(option, argvp) * return a valid user name, uname is taken as a user ID. */ int -f_user(plan, entry) - PLAN *plan; - FTSENT *entry; +f_user(PLAN *plan, FTSENT *entry) { return entry->fts_statp->st_uid == plan->u_data; } PLAN * -c_user(option, argvp) - OPTION *option; - char ***argvp; +c_user(OPTION *option, char ***argvp) { char *username; PLAN *new; @@ -1424,9 +1317,7 @@ c_user(option, argvp) * different device ID (st_dev, see stat() S5.6.2 [POSIX.1]) */ PLAN * -c_xdev(option, argvp) - OPTION *option; - char ***argvp; +c_xdev(OPTION *option, char ***argvp) { ftsoptions |= FTS_XDEV; @@ -1439,9 +1330,7 @@ c_xdev(option, argvp) * True if expression is true. */ int -f_expr(plan, entry) - PLAN *plan; - FTSENT *entry; +f_expr(PLAN *plan, FTSENT *entry) { register PLAN *p; register int state = 0; @@ -1459,17 +1348,13 @@ f_expr(plan, entry) */ int -f_openparen(plan, entry) - PLAN *plan; - FTSENT *entry; +f_openparen(PLAN *plan, FTSENT *entry) { abort(); } int -f_closeparen(plan, entry) - PLAN *plan; - FTSENT *entry; +f_closeparen(PLAN *plan, FTSENT *entry) { abort(); } @@ -1481,9 +1366,7 @@ f_closeparen(plan, entry) * AND operator. Since AND is implicit, no node is allocated. */ PLAN * -c_and(option, argvp) - OPTION *option; - char ***argvp; +c_and(OPTION *option, char ***argvp) { return NULL; } @@ -1494,9 +1377,7 @@ c_and(option, argvp) * Negation of a primary; the unary NOT operator. */ int -f_not(plan, entry) - PLAN *plan; - FTSENT *entry; +f_not(PLAN *plan, FTSENT *entry) { register PLAN *p; register int state = 0; @@ -1515,9 +1396,7 @@ f_not(plan, entry) * not evaluated if the first expression is true. */ int -f_or(plan, entry) - PLAN *plan; - FTSENT *entry; +f_or(PLAN *plan, FTSENT *entry) { register PLAN *p; register int state = 0; diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index ffdf72e4fe..f67d42b7f0 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -32,7 +32,7 @@ * * @(#)ls.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/find/ls.c,v 1.5.6.3 2002/03/12 19:34:50 phantom Exp $ - * $DragonFly: src/usr.bin/find/ls.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/ls.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -49,14 +49,16 @@ /* Derived from the print routines in the ls(1) source code. */ -static void printlink __P((char *)); -static void printtime __P((time_t)); +static void printlink (char *); +static void printtime (time_t); +/* +name: filename to print +accpath: current valid path to filename +sb: stat buffer +*/ void -printlong(name, accpath, sb) - char *name; /* filename to print */ - char *accpath; /* current valid path to filename */ - struct stat *sb; /* stat buffer */ +printlong(char *name, char *accpath, struct stat *sb) { char modep[15], *user_from_uid(), *group_from_gid(); @@ -79,8 +81,7 @@ printlong(name, accpath, sb) } static void -printtime(ftime) - time_t ftime; +printtime(time_t ftime) { char longstring[80]; static time_t now; @@ -104,8 +105,7 @@ printtime(ftime) } static void -printlink(name) - char *name; +printlink(char *name) { int lnklen; char path[MAXPATHLEN + 1]; diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index a793cb561f..629c50cc60 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1990, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)main.c 8.4 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/find/main.c,v 1.9.6.2 2001/02/25 21:56:59 knu Exp $ - * $DragonFly: src/usr.bin/find/main.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/main.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -66,12 +66,10 @@ int isxargs; /* don't permit xargs delimiting chars */ int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */ int regexp_flags = REG_BASIC; /* use the "basic" regexp by default*/ -static void usage __P((void)); +static void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register char **p, **start; int Hflag, Lflag, ch; @@ -153,7 +151,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]\n"); diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c index ba88466c89..73ac7b93d2 100644 --- a/usr.bin/find/misc.c +++ b/usr.bin/find/misc.c @@ -35,7 +35,7 @@ * * @(#)misc.c 8.2 (Berkeley) 4/1/94 * $FreeBSD: src/usr.bin/find/misc.c,v 1.2.12.1 2000/06/23 18:38:46 roberto Exp $ - * $DragonFly: src/usr.bin/find/misc.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/misc.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -55,9 +55,7 @@ * Replace occurrences of {} in s1 with s2 and return the result string. */ void -brace_subst(orig, store, path, len) - char *orig, **store, *path; - int len; +brace_subst(char *orig, char **store, char *path, int len) { register int plen; register char ch, *p; @@ -82,8 +80,7 @@ brace_subst(orig, store, path, len) * input. If the input is 'y' then 1 is returned. */ int -queryuser(argv) - register char **argv; +queryuser(register char **argv) { int ch, first, nl; @@ -116,8 +113,7 @@ queryuser(argv) * malloc with error checking. */ void * -emalloc(len) - u_int len; +emalloc(u_int len) { void *p; diff --git a/usr.bin/find/operator.c b/usr.bin/find/operator.c index a462a522ab..b5c9213a62 100644 --- a/usr.bin/find/operator.c +++ b/usr.bin/find/operator.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/find/operator.c,v 1.5.6.1 2001/05/06 09:53:22 phk Exp $ - * $DragonFly: src/usr.bin/find/operator.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/operator.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ * * @(#)operator.c 8.1 (Berkeley) 6/6/93 */ @@ -51,9 +51,9 @@ * yanknode -- * destructively removes the top from the plan */ +/* planp: pointer to top of plan (modified) */ static PLAN * -yanknode(planp) - PLAN **planp; /* pointer to top of plan (modified) */ +yanknode(PLAN **planp) { PLAN *node; /* top node removed from the plan */ @@ -70,9 +70,9 @@ yanknode(planp) * paren_squish. In comments below, an expression is either a * simple node or a f_expr node containing a list of simple nodes. */ +/* planp: pointer to top of plan (modified) */ static PLAN * -yankexpr(planp) - PLAN **planp; /* pointer to top of plan (modified) */ +yankexpr(PLAN **planp) { register PLAN *next; /* temp node holding subexpression results */ PLAN *node; /* pointer to returned node or expression */ @@ -123,9 +123,9 @@ yankexpr(planp) * paren_squish -- * replaces "parentheisized" plans in our search plan with "expr" nodes. */ +/* plan: plan with ( ) nodes */ PLAN * -paren_squish(plan) - PLAN *plan; /* plan with ( ) nodes */ +paren_squish(PLAN *plan) { register PLAN *expr; /* pointer to next expression */ register PLAN *tail; /* pointer to tail of result plan */ @@ -161,9 +161,9 @@ paren_squish(plan) * not_squish -- * compresses "!" expressions in our search plan. */ +/* plan: plan to process */ PLAN * -not_squish(plan) - PLAN *plan; /* plan to process */ +not_squish(PLAN *plan) { register PLAN *next; /* next node being processed */ register PLAN *node; /* temporary node used in f_not processing */ @@ -225,9 +225,9 @@ not_squish(plan) * or_squish -- * compresses -o expressions in our search plan. */ +/* plan: plan with ors to be squished */ PLAN * -or_squish(plan) - PLAN *plan; /* plan with ors to be squished */ +or_squish(PLAN *plan) { register PLAN *next; /* next node being processed */ register PLAN *tail; /* pointer to tail of result plan */ diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c index d79256f029..317ddb06c1 100644 --- a/usr.bin/find/option.c +++ b/usr.bin/find/option.c @@ -35,7 +35,7 @@ * * @(#)option.c 8.2 (Berkeley) 4/16/94 * $FreeBSD: src/usr.bin/find/option.c,v 1.9.2.6 2003/02/22 16:33:24 des Exp $ - * $DragonFly: src/usr.bin/find/option.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/find/option.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -132,8 +132,7 @@ static OPTION const options[] = { * this switch stuff. */ PLAN * -find_create(argvp) - char ***argvp; +find_create(char ***argvp) { register OPTION *p; PLAN *new; @@ -151,8 +150,7 @@ find_create(argvp) } OPTION * -option(name) - char *name; +option(char *name) { OPTION tmp; int typecompare __P((const void *, const void *)); @@ -163,8 +161,7 @@ option(name) } int -typecompare(a, b) - const void *a, *b; +typecompare(const void *a, const void *b) { return (strcmp(((OPTION *)a)->name, ((OPTION *)b)->name)); } diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c index 09a0228c98..fa124aecd6 100644 --- a/usr.bin/finger/finger.c +++ b/usr.bin/finger/finger.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)finger.c 8.5 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/finger/finger.c,v 1.15.2.9 2002/07/29 18:52:52 ume Exp $ - * $DragonFly: src/usr.bin/finger/finger.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/finger/finger.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ /* @@ -92,9 +92,7 @@ static void usage(void); static void userlist(int, char **); static int -option(argc, argv) - int argc; - char **argv; +option(int argc, char **argv) { int ch; @@ -141,16 +139,14 @@ option(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: finger [-46lmpshoT] [login ...]\n"); exit(1); } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int envargc, argcnt; char *envargv[3]; @@ -219,7 +215,7 @@ main(argc, argv) } static void -loginlist() +loginlist(void) { PERSON *pn; DBT data, key; @@ -259,9 +255,7 @@ loginlist() } static void -userlist(argc, argv) - int argc; - char **argv; +userlist(int argc, char **argv) { PERSON *pn; DBT data, key; diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index 8476f32fa3..7318fbb9fd 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -35,7 +35,7 @@ * * @(#)lprint.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/finger/lprint.c,v 1.10.2.4 2002/07/03 01:14:24 des Exp $ - * $DragonFly: src/usr.bin/finger/lprint.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/finger/lprint.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -64,7 +64,7 @@ static void lprint(PERSON *); static void vputc(unsigned char); void -lflag_print() +lflag_print(void) { extern int pplan; PERSON *pn; @@ -96,8 +96,7 @@ lflag_print() } static void -lprint(pn) - PERSON *pn; +lprint(PERSON *pn) { extern time_t now; struct tm *delta; @@ -253,9 +252,7 @@ no_gecos: } static int -demi_print(str, oddfield) - char *str; - int oddfield; +demi_print(char *str, int oddfield) { static int lenlast; int lenthis, maxlen; @@ -293,8 +290,7 @@ demi_print(str, oddfield) } int -show_text(directory, file_name, header) - const char *directory, *file_name, *header; +show_text(const char *directory, const char *file_name, const char *header) { struct stat sb; FILE *fp; @@ -347,8 +343,7 @@ show_text(directory, file_name, header) } static void -vputc(ch) - unsigned char ch; +vputc(unsigned char ch) { int meta; diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c index 67ecfb9c24..9e9b7d0084 100644 --- a/usr.bin/finger/net.c +++ b/usr.bin/finger/net.c @@ -35,7 +35,7 @@ * * @(#)net.c 8.4 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/finger/net.c,v 1.12.2.4 2002/12/16 08:41:28 roam Exp $ - * $DragonFly: src/usr.bin/finger/net.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/finger/net.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -62,8 +62,7 @@ static int do_protocol(const char *name, const struct addrinfo *ai); static void trying(const struct addrinfo *ai); void -netfinger(name) - char *name; +netfinger(char *name) { int error, multi; char *host; diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c index a573cddc93..c9b11fa74a 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -35,7 +35,7 @@ * * @(#)sprint.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/finger/sprint.c,v 1.11.2.5 2002/07/03 01:14:24 des Exp $ - * $DragonFly: src/usr.bin/finger/sprint.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/finger/sprint.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -51,7 +51,7 @@ static void stimeprint(WHERE *); void -sflag_print() +sflag_print(void) { extern time_t now; extern int oflag; @@ -158,8 +158,7 @@ no_gecos: } static void -stimeprint(w) - WHERE *w; +stimeprint(WHERE *w) { struct tm *delta; diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c index caf4768be1..3e8d8859bf 100644 --- a/usr.bin/finger/util.c +++ b/usr.bin/finger/util.c @@ -35,7 +35,7 @@ * * @(#)util.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/finger/util.c,v 1.8.2.6 2002/07/03 01:14:24 des Exp $ - * $DragonFly: src/usr.bin/finger/util.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/finger/util.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -60,9 +60,7 @@ static void userinfo(PERSON *, struct passwd *); static WHERE *walloc(PERSON *); int -match(pw, user) - struct passwd *pw; - char *user; +match(struct passwd *pw, char *user) { char *p, *t; char name[1024]; @@ -102,8 +100,7 @@ match(pw, user) } void -enter_lastlog(pn) - PERSON *pn; +enter_lastlog(PERSON *pn) { WHERE *w; static int opened, fd; @@ -152,9 +149,7 @@ enter_lastlog(pn) } void -enter_where(ut, pn) - struct utmp *ut; - PERSON *pn; +enter_where(struct utmp *ut, PERSON *pn) { WHERE *w; @@ -169,8 +164,7 @@ enter_where(ut, pn) } PERSON * -enter_person(pw) - struct passwd *pw; +enter_person(struct passwd *pw) { DBT data, key; PERSON *pn; @@ -205,8 +199,7 @@ enter_person(pw) } PERSON * -find_person(name) - char *name; +find_person(char *name) { struct passwd *pw; @@ -235,7 +228,7 @@ find_person(name) } PERSON * -palloc() +palloc(void) { PERSON *p; @@ -245,8 +238,7 @@ palloc() } static WHERE * -walloc(pn) - PERSON *pn; +walloc(PERSON *pn) { WHERE *w; @@ -263,8 +255,7 @@ walloc(pn) } char * -prphone(num) - char *num; +prphone(char *num) { char *p; int len; @@ -313,8 +304,7 @@ prphone(num) } static void -find_idle_and_ttywrite(w) - WHERE *w; +find_idle_and_ttywrite(WHERE *w) { extern time_t now; struct stat sb; @@ -337,9 +327,7 @@ find_idle_and_ttywrite(w) } static void -userinfo(pn, pw) - PERSON *pn; - struct passwd *pw; +userinfo(PERSON *pn, struct passwd *pw) { char *p, *t; char *bp, name[1024]; @@ -405,8 +393,7 @@ userinfo(pn, pw) */ int -hide(pw) - struct passwd *pw; +hide(struct passwd *pw) { struct stat st; char buf[MAXPATHLEN]; diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c index 2d1125ff36..e87b5b7046 100644 --- a/usr.bin/fold/fold.c +++ b/usr.bin/fold/fold.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)fold.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/fold/fold.c,v 1.4.2.3 2002/07/11 01:01:44 tjr Exp $ - * $DragonFly: src/usr.bin/fold/fold.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/fold/fold.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -58,9 +58,7 @@ int bflag; /* Count bytes, not columns */ int sflag; /* Split on word boundaries */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int ch; int rval, width; @@ -113,7 +111,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: fold [-bs] [-w width] [file ...]\n"); exit(1); @@ -131,8 +129,7 @@ usage() * returns embedded in the input stream. */ void -fold(width) - register int width; +fold(register int width) { static char *buf; static int buf_max; @@ -186,8 +183,7 @@ fold(width) * Update the current column position for a character. */ static int -newpos(col, ch) - int col, ch; +newpos(int col, int ch) { if (bflag) diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c index 472a252894..89c0e8c76d 100644 --- a/usr.bin/from/from.c +++ b/usr.bin/from/from.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)from.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/from/from.c,v 1.8.2.1 2000/10/06 08:19:19 ru Exp $ - * $DragonFly: src/usr.bin/from/from.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/from/from.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -46,13 +46,11 @@ #include #include -int match __P((char *, char *)); -static void usage __P((void)); +int match(char *, char *); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct passwd *pwd; int ch, count, newline; @@ -128,15 +126,14 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: from [-c] [-f file] [-s sender] [user]\n"); exit(1); } int -match(line, sender) - register char *line, *sender; +match(register char *line, register char *sender) { register char ch, pch, first, *p, *t; diff --git a/usr.bin/fstat/cd9660.c b/usr.bin/fstat/cd9660.c index 52544a46eb..185974e665 100644 --- a/usr.bin/fstat/cd9660.c +++ b/usr.bin/fstat/cd9660.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/cd9660.c,v 1.1.2.3 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.3 2003/08/27 03:21:49 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.4 2003/10/04 20:36:44 hmp Exp $ */ /* @@ -59,9 +59,7 @@ #include "fstat.h" int -isofs_filestat(vp, fsp) - struct vnode *vp; - struct filestat *fsp; +isofs_filestat(struct vnode *vp, struct filestat *fsp) { struct iso_node isonode; diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index f9666d9041..9cbaa05861 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)fstat.c 8.3 (Berkeley) 5/2/95 * $FreeBSD: src/usr.bin/fstat/fstat.c,v 1.21.2.7 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.5 2003/08/27 03:21:49 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.6 2003/10/04 20:36:44 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -128,23 +128,21 @@ int maxfiles; kvm_t *kd; -void dofiles __P((struct kinfo_proc *kp)); -void dommap __P((struct kinfo_proc *kp)); -void vtrans __P((struct vnode *vp, int i, int flag)); -int ufs_filestat __P((struct vnode *vp, struct filestat *fsp)); -int nfs_filestat __P((struct vnode *vp, struct filestat *fsp)); -char *getmnton __P((struct mount *m)); -void pipetrans __P((struct pipe *pi, int i, int flag)); -void socktrans __P((struct socket *sock, int i)); -void getinetproto __P((int number)); -int getfname __P((char *filename)); -void usage __P((void)); +void dofiles(struct kinfo_proc *kp); +void dommap(struct kinfo_proc *kp); +void vtrans(struct vnode *vp, int i, int flag); +int ufs_filestat(struct vnode *vp, struct filestat *fsp); +int nfs_filestat(struct vnode *vp, struct filestat *fsp); +char *getmnton(struct mount *m); +void pipetrans(struct pipe *pi, int i, int flag); +void socktrans(struct socket *sock, int i); +void getinetproto(int number); +int getfname(char *filename); +void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register struct passwd *passwd; struct kinfo_proc *p, *plast; @@ -282,8 +280,7 @@ int Pid; * print open files attributed to this process */ void -dofiles(kp) - struct kinfo_proc *kp; +dofiles(struct kinfo_proc *kp) { int i; struct file file; @@ -374,8 +371,7 @@ dofiles(kp) } void -dommap(kp) - struct kinfo_proc *kp; +dommap(struct kinfo_proc *kp) { struct proc *p = &kp->kp_proc; struct vmspace vmspace; @@ -433,10 +429,7 @@ dommap(kp) } void -vtrans(vp, i, flag) - struct vnode *vp; - int i; - int flag; +vtrans(struct vnode *vp, int i, int flag) { struct vnode vn; struct filestat fst; @@ -542,9 +535,7 @@ vtrans(vp, i, flag) } int -ufs_filestat(vp, fsp) - struct vnode *vp; - struct filestat *fsp; +ufs_filestat(struct vnode *vp, struct filestat *fsp) { struct inode inode; @@ -568,9 +559,7 @@ ufs_filestat(vp, fsp) } int -nfs_filestat(vp, fsp) - struct vnode *vp; - struct filestat *fsp; +nfs_filestat(struct vnode *vp, struct filestat *fsp) { struct nfsnode nfsnode; register mode_t mode; @@ -618,8 +607,7 @@ nfs_filestat(vp, fsp) char * -getmnton(m) - struct mount *m; +getmnton(struct mount *m) { static struct mount mount; static struct mtab { @@ -646,10 +634,7 @@ getmnton(m) } void -pipetrans(pi, i, flag) - struct pipe *pi; - int i; - int flag; +pipetrans(struct pipe *pi, int i, int flag) { struct pipe pip; char rw[3]; @@ -678,9 +663,7 @@ bad: } void -socktrans(sock, i) - struct socket *sock; - int i; +socktrans(struct socket *sock, int i) { static char *stypename[] = { "unused", /* 0 */ @@ -807,8 +790,7 @@ bad: * in order to work out the associated udev_t */ udev_t -dev2udev(dev) - dev_t dev; +dev2udev(dev_t dev) { struct specinfo si; @@ -825,8 +807,7 @@ dev2udev(dev) * print name of protocol number */ void -getinetproto(number) - int number; +getinetproto(int number) { static int isopen; register struct protoent *pe; @@ -840,8 +821,7 @@ getinetproto(number) } int -getfname(filename) - char *filename; +getfname(char *filename) { struct stat statbuf; DEVS *cur; @@ -862,7 +842,7 @@ getfname(filename) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: fstat [-fmnv] [-p pid] [-u user] [-N system] [-M core] [file ...]\n"); diff --git a/usr.bin/fstat/msdosfs.c b/usr.bin/fstat/msdosfs.c index 17bc24fe37..6b4bf55716 100644 --- a/usr.bin/fstat/msdosfs.c +++ b/usr.bin/fstat/msdosfs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/msdosfs.c,v 1.1.2.2 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/msdosfs.c,v 1.4 2003/09/10 22:45:50 rob Exp $ + * $DragonFly: src/usr.bin/fstat/msdosfs.c,v 1.5 2003/10/04 20:36:44 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -73,9 +73,7 @@ struct dosmount { }; int -msdosfs_filestat(vp, fsp) - struct vnode *vp; - struct filestat *fsp; +msdosfs_filestat(struct vnode *vp, struct filestat *fsp) { struct denode denode; static struct dosmount *mounts; diff --git a/usr.bin/fsync/fsync.c b/usr.bin/fsync/fsync.c index f602a385e2..3c7e935d65 100644 --- a/usr.bin/fsync/fsync.c +++ b/usr.bin/fsync/fsync.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fsync/fsync.c,v 1.1.2.2 2000/07/25 07:48:25 ps Exp $ - * $DragonFly: src/usr.bin/fsync/fsync.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/fsync/fsync.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -56,7 +56,7 @@ main(int argc, char *argv[]) } void -usage() +usage(void) { fprintf(stderr, "usage: fsync file ...\n"); exit(EX_USAGE); diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 39432d5a5c..344d832c81 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/cmds.c,v 1.16.2.3 2002/08/27 09:55:08 yar Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/cmds.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/cmds.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ /* $NetBSD: cmds.c,v 1.30.2.1 1997/11/18 00:58:26 mellon Exp $ */ /* @@ -84,9 +84,7 @@ struct types { * Set transfer type. */ void -settype(argc, argv) - int argc; - char *argv[]; +settype(int argc, char **argv) { struct types *p; int comret; @@ -133,8 +131,7 @@ settype(argc, argv) * Used to change to and from ascii for listings. */ void -changetype(newtype, show) - int newtype, show; +changetype(int newtype, int show) { struct types *p; int comret, oldverbose = verbose; @@ -172,9 +169,7 @@ char *stype[] = { */ /*VARARGS*/ void -setbinary(argc, argv) - int argc; - char *argv[]; +setbinary(int argc, char **argv) { stype[1] = "binary"; @@ -186,9 +181,7 @@ setbinary(argc, argv) */ /*VARARGS*/ void -setascii(argc, argv) - int argc; - char *argv[]; +setascii(int argc, char **argv) { stype[1] = "ascii"; @@ -200,9 +193,7 @@ setascii(argc, argv) */ /*VARARGS*/ void -settenex(argc, argv) - int argc; - char *argv[]; +settenex(int argc, char **argv) { stype[1] = "tenex"; @@ -214,9 +205,7 @@ settenex(argc, argv) */ /*ARGSUSED*/ void -setftmode(argc, argv) - int argc; - char *argv[]; +setftmode(int argc, char **argv) { printf("We only support %s mode, sorry.\n", modename); @@ -228,9 +217,7 @@ setftmode(argc, argv) */ /*ARGSUSED*/ void -setform(argc, argv) - int argc; - char *argv[]; +setform(int argc, char **argv) { printf("We only support %s format, sorry.\n", formname); @@ -242,9 +229,7 @@ setform(argc, argv) */ /*ARGSUSED*/ void -setstruct(argc, argv) - int argc; - char *argv[]; +setstruct(int argc, char **argv) { printf("We only support %s structure, sorry.\n", structname); @@ -255,9 +240,7 @@ setstruct(argc, argv) * Send a single file. */ void -put(argc, argv) - int argc; - char *argv[]; +put(int argc, char **argv) { char *cmd; int loc = 0; @@ -306,9 +289,7 @@ usage: * Send multiple files. */ void -mput(argc, argv) - int argc; - char *argv[]; +mput(int argc, char **argv) { int i; sig_t oldintr; @@ -425,18 +406,14 @@ mput(argc, argv) } void -reget(argc, argv) - int argc; - char *argv[]; +reget(int argc, char **argv) { (void)getit(argc, argv, 1, "r+w"); } void -get(argc, argv) - int argc; - char *argv[]; +get(int argc, char **argv) { (void)getit(argc, argv, 0, restart_point ? "r+w" : "w" ); @@ -446,11 +423,7 @@ get(argc, argv) * Receive one file. */ int -getit(argc, argv, restartit, mode) - int argc; - char *argv[]; - int restartit; - const char *mode; +getit(int argc, char **argv, int restartit, const char *mode) { int loc = 0; int rval = 0; @@ -536,8 +509,7 @@ freegetit: /* ARGSUSED */ void -mabort(signo) - int signo; +mabort(int signo) { int ointer, oconf; @@ -565,9 +537,7 @@ mabort(signo) * Get multiple files. */ void -mget(argc, argv) - int argc; - char *argv[]; +mget(int argc, char **argv) { sig_t oldintr; int ch, ointer; @@ -620,8 +590,7 @@ mget(argc, argv) } char * -onoff(bool) - int bool; +onoff(int bool) { return (bool ? "on" : "off"); @@ -632,9 +601,7 @@ onoff(bool) */ /*ARGSUSED*/ void -status(argc, argv) - int argc; - char *argv[]; +status(int argc, char **argv) { int i; @@ -699,11 +666,7 @@ status(argc, argv) * Toggle a variable */ int -togglevar(argc, argv, var, mesg) - int argc; - char *argv[]; - int *var; - const char *mesg; +togglevar(int argc, char **argv, int *var, const char *mesg) { if (argc < 2) { *var = !*var; @@ -725,9 +688,7 @@ togglevar(argc, argv, var, mesg) */ /*VARARGS*/ void -setbell(argc, argv) - int argc; - char *argv[]; +setbell(int argc, char **argv) { code = togglevar(argc, argv, &bell, "Bell mode"); @@ -739,9 +700,7 @@ setbell(argc, argv) */ /*VARARGS*/ void -setedit(argc, argv) - int argc; - char *argv[]; +setedit(int argc, char **argv) { code = togglevar(argc, argv, &editing, "Editing mode"); @@ -754,9 +713,7 @@ setedit(argc, argv) */ /*VARARGS*/ void -settrace(argc, argv) - int argc; - char *argv[]; +settrace(int argc, char **argv) { code = togglevar(argc, argv, &trace, "Packet tracing"); @@ -767,9 +724,7 @@ settrace(argc, argv) */ /*VARARGS*/ void -sethash(argc, argv) - int argc; - char *argv[]; +sethash(int argc, char **argv) { if (argc == 1) hash = !hash; @@ -806,9 +761,7 @@ sethash(argc, argv) */ /*VARARGS*/ void -setverbose(argc, argv) - int argc; - char *argv[]; +setverbose(int argc, char **argv) { code = togglevar(argc, argv, &verbose, "Verbose mode"); @@ -819,9 +772,7 @@ setverbose(argc, argv) */ /*VARARGS*/ void -setport(argc, argv) - int argc; - char *argv[]; +setport(int argc, char **argv) { code = togglevar(argc, argv, &sendport, "Use of PORT cmds"); @@ -832,9 +783,7 @@ setport(argc, argv) */ /*VARARGS*/ void -setprogress(argc, argv) - int argc; - char *argv[]; +setprogress(int argc, char **argv) { code = togglevar(argc, argv, &progress, "Progress bar"); @@ -845,9 +794,7 @@ setprogress(argc, argv) */ /*VARARGS*/ void -setprompt(argc, argv) - int argc; - char *argv[]; +setprompt(int argc, char **argv) { code = togglevar(argc, argv, &interactive, "Interactive mode"); @@ -858,9 +805,7 @@ setprompt(argc, argv) */ /*VARARGS*/ void -setgate(argc, argv) - int argc; - char *argv[]; +setgate(int argc, char **argv) { static char gsbuf[MAXHOSTNAMELEN]; @@ -914,9 +859,7 @@ setgate(argc, argv) */ /*VARARGS*/ void -setglob(argc, argv) - int argc; - char *argv[]; +setglob(int argc, char **argv) { code = togglevar(argc, argv, &doglob, "Globbing"); @@ -927,9 +870,7 @@ setglob(argc, argv) */ /*VARARGS*/ void -setpreserve(argc, argv) - int argc; - char *argv[]; +setpreserve(int argc, char **argv) { code = togglevar(argc, argv, &preserve, "Preserve modification times"); @@ -940,9 +881,7 @@ setpreserve(argc, argv) */ /*VARARGS*/ void -setdebug(argc, argv) - int argc; - char *argv[]; +setdebug(int argc, char **argv) { if (argc > 2) { printf("usage: %s [ on | off | debuglevel ]\n", argv[0]); @@ -979,9 +918,7 @@ setdebug(argc, argv) * Set current working directory on remote machine. */ void -cd(argc, argv) - int argc; - char *argv[]; +cd(int argc, char **argv) { int r; @@ -1005,9 +942,7 @@ cd(argc, argv) * Set current working directory on local machine. */ void -lcd(argc, argv) - int argc; - char *argv[]; +lcd(int argc, char **argv) { char buf[MAXPATHLEN]; char *oldargv1; @@ -1042,9 +977,7 @@ lcd(argc, argv) * Delete a single file. */ void -delete(argc, argv) - int argc; - char *argv[]; +delete(int argc, char **argv) { if ((argc < 2 && !another(&argc, &argv, "remote-file")) || argc > 2) { @@ -1059,9 +992,7 @@ delete(argc, argv) * Delete multiple files. */ void -mdelete(argc, argv) - int argc; - char *argv[]; +mdelete(int argc, char **argv) { sig_t oldintr; int ointer; @@ -1101,9 +1032,7 @@ mdelete(argc, argv) * Rename a remote file. */ void -renamefile(argc, argv) - int argc; - char *argv[]; +renamefile(int argc, char **argv) { if (argc < 2 && !another(&argc, &argv, "from-name")) @@ -1122,9 +1051,7 @@ usage: * Get a directory listing of remote files. */ void -ls(argc, argv) - int argc; - char *argv[]; +ls(int argc, char **argv) { const char *cmd; char *oldargv2, *globargv2; @@ -1166,9 +1093,7 @@ freels: * Get a directory listing of multiple remote files. */ void -mls(argc, argv) - int argc; - char *argv[]; +mls(int argc, char **argv) { sig_t oldintr; int ointer, i; @@ -1220,9 +1145,7 @@ usage: */ /*ARGSUSED*/ void -shell(argc, argv) - int argc; - char *argv[]; +shell(int argc, char **argv) { pid_t pid; sig_t old1, old2; @@ -1279,9 +1202,7 @@ shell(argc, argv) * Send new user information (re-login) */ void -user(argc, argv) - int argc; - char *argv[]; +user(int argc, char **argv) { char acct[80]; int n, aflag = 0; @@ -1325,9 +1246,7 @@ user(argc, argv) */ /*VARARGS*/ void -pwd(argc, argv) - int argc; - char *argv[]; +pwd(int argc, char **argv) { int oldverbose = verbose; @@ -1346,9 +1265,7 @@ pwd(argc, argv) * Print working directory on local machine. */ void -lpwd(argc, argv) - int argc; - char *argv[]; +lpwd(int argc, char **argv) { char buf[MAXPATHLEN]; @@ -1363,9 +1280,7 @@ lpwd(argc, argv) * Make a directory. */ void -makedir(argc, argv) - int argc; - char *argv[]; +makedir(int argc, char **argv) { if ((argc < 2 && !another(&argc, &argv, "directory-name")) || @@ -1385,9 +1300,7 @@ makedir(argc, argv) * Remove a directory. */ void -removedir(argc, argv) - int argc; - char *argv[]; +removedir(int argc, char **argv) { if ((argc < 2 && !another(&argc, &argv, "directory-name")) || @@ -1407,9 +1320,7 @@ removedir(argc, argv) * Send a line, verbatim, to the remote machine. */ void -quote(argc, argv) - int argc; - char *argv[]; +quote(int argc, char **argv) { if (argc < 2 && !another(&argc, &argv, "command line to send")) { @@ -1426,9 +1337,7 @@ quote(argc, argv) * word "SITE" is added at the front. */ void -site(argc, argv) - int argc; - char *argv[]; +site(int argc, char **argv) { if (argc < 2 && !another(&argc, &argv, "arguments to SITE command")) { @@ -1444,10 +1353,7 @@ site(argc, argv) * Send the result as a one-line command and get response. */ void -quote1(initial, argc, argv) - const char *initial; - int argc; - char *argv[]; +quote1(const char *initial, int argc, char **argv) { int i, len, len1; char buf[BUFSIZ]; /* must be >= sizeof(line) */ @@ -1469,9 +1375,7 @@ quote1(initial, argc, argv) } void -do_chmod(argc, argv) - int argc; - char *argv[]; +do_chmod(int argc, char **argv) { if (argc < 2 && !another(&argc, &argv, "mode")) @@ -1486,9 +1390,7 @@ usage: } void -do_umask(argc, argv) - int argc; - char *argv[]; +do_umask(int argc, char **argv) { int oldverbose = verbose; @@ -1498,9 +1400,7 @@ do_umask(argc, argv) } void -idle(argc, argv) - int argc; - char *argv[]; +idle(int argc, char **argv) { int oldverbose = verbose; @@ -1513,9 +1413,7 @@ idle(argc, argv) * Ask the other side for help. */ void -rmthelp(argc, argv) - int argc; - char *argv[]; +rmthelp(int argc, char **argv) { int oldverbose = verbose; @@ -1529,9 +1427,7 @@ rmthelp(argc, argv) */ /*VARARGS*/ void -quit(argc, argv) - int argc; - char *argv[]; +quit(int argc, char **argv) { if (connected) @@ -1547,9 +1443,7 @@ quit(argc, argv) * Terminate session, but don't exit. */ void -disconnect(argc, argv) - int argc; - char *argv[]; +disconnect(int argc, char **argv) { if (!connected) @@ -1567,9 +1461,7 @@ disconnect(argc, argv) } void -account(argc, argv) - int argc; - char *argv[]; +account(int argc, char **argv) { char *ap; @@ -1588,8 +1480,7 @@ account(argc, argv) jmp_buf abortprox; void -proxabort(notused) - int notused; +proxabort(int notused) { alarmtimer(0); @@ -1607,9 +1498,7 @@ proxabort(notused) } void -doproxy(argc, argv) - int argc; - char *argv[]; +doproxy(int argc, char **argv) { struct cmd *c; int cmdpos; @@ -1668,27 +1557,21 @@ doproxy(argc, argv) } void -setcase(argc, argv) - int argc; - char *argv[]; +setcase(int argc, char **argv) { code = togglevar(argc, argv, &mcase, "Case mapping"); } void -setcr(argc, argv) - int argc; - char *argv[]; +setcr(int argc, char **argv) { code = togglevar(argc, argv, &crflag, "Carriage Return stripping"); } void -setntrans(argc, argv) - int argc; - char *argv[]; +setntrans(int argc, char **argv) { if (argc == 1) { ntflag = 0; @@ -1709,8 +1592,7 @@ setntrans(argc, argv) } char * -dotrans(name) - char *name; +dotrans(char *name) { static char new[MAXPATHLEN]; char *cp1, *cp2 = new; @@ -1738,9 +1620,7 @@ dotrans(name) } void -setnmap(argc, argv) - int argc; - char *argv[]; +setnmap(int argc, char **argv) { char *cp; @@ -1772,8 +1652,7 @@ setnmap(argc, argv) } char * -domap(name) - char *name; +domap(char *name) { static char new[MAXPATHLEN]; char *cp1 = name, *cp2 = mapin; @@ -1945,9 +1824,7 @@ LOOP: } void -setpassive(argc, argv) - int argc; - char *argv[]; +setpassive(int argc, char **argv) { code = togglevar(argc, argv, &passivemode, @@ -1955,9 +1832,7 @@ setpassive(argc, argv) } void -setepsv4(argc, argv) - int argc; - char *argv[]; +setepsv4(int argc, char **argv) { code = togglevar(argc, argv, &epsv4, verbose ? "Use of EPSV/EPRT on IPv4 ftp" : NULL); @@ -1965,18 +1840,14 @@ setepsv4(argc, argv) } void -setsunique(argc, argv) - int argc; - char *argv[]; +setsunique(int argc, char **argv) { code = togglevar(argc, argv, &sunique, "Store unique"); } void -setrunique(argc, argv) - int argc; - char *argv[]; +setrunique(int argc, char **argv) { code = togglevar(argc, argv, &runique, "Receive unique"); @@ -1984,9 +1855,7 @@ setrunique(argc, argv) /* change directory to parent directory */ void -cdup(argc, argv) - int argc; - char *argv[]; +cdup(int argc, char **argv) { int r; @@ -2004,9 +1873,7 @@ cdup(argc, argv) * Restart transfer at specific point */ void -restart(argc, argv) - int argc; - char *argv[]; +restart(int argc, char **argv) { if (argc > 2) { @@ -2035,18 +1902,14 @@ restart(argc, argv) * Show remote system type */ void -syst(argc, argv) - int argc; - char *argv[]; +syst(int argc, char **argv) { (void)command("SYST"); } void -macdef(argc, argv) - int argc; - char *argv[]; +macdef(int argc, char **argv) { char *tmp; int c; @@ -2108,9 +1971,7 @@ macdef(argc, argv) * Restrict FTP data port range to a high group of "safe" ports */ void -setrestrict(argc, argv) - int argc; - char *argv[]; +setrestrict(int argc, char **argv) { code = togglevar(argc, argv, &restricted_data_ports, verbose ? "Restricted data ports" : NULL); @@ -2120,9 +1981,7 @@ setrestrict(argc, argv) * Get size of file on remote machine */ void -sizecmd(argc, argv) - int argc; - char *argv[]; +sizecmd(int argc, char **argv) { off_t size; @@ -2141,9 +2000,7 @@ sizecmd(argc, argv) * Get last modification time of file on remote machine */ void -modtime(argc, argv) - int argc; - char *argv[]; +modtime(int argc, char **argv) { time_t mtime; @@ -2162,9 +2019,7 @@ modtime(argc, argv) * Show status on remote machine */ void -rmtstatus(argc, argv) - int argc; - char *argv[]; +rmtstatus(int argc, char **argv) { (void)command(argc > 1 ? "STAT %s" : "STAT" , argv[1]); @@ -2174,9 +2029,7 @@ rmtstatus(argc, argv) * Get file if modtime is more recent than current file */ void -newer(argc, argv) - int argc; - char *argv[]; +newer(int argc, char **argv) { if (getit(argc, argv, -1, "w")) @@ -2188,9 +2041,7 @@ newer(argc, argv) * Display one file through $PAGER (defaults to "more"). */ void -page(argc, argv) - int argc; - char *argv[]; +page(int argc, char **argv) { int ohash, overbose; char *p, *pager, *oldargv1; diff --git a/usr.bin/ftp/complete.c b/usr.bin/ftp/complete.c index b5415bf7d1..497a8c5332 100644 --- a/usr.bin/ftp/complete.c +++ b/usr.bin/ftp/complete.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/complete.c,v 1.5.2.1 2001/11/25 18:28:06 iedowse Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/complete.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/complete.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ /* $NetBSD: complete.c,v 1.11 1997/09/13 09:05:53 lukem Exp $ */ /*- @@ -60,8 +60,7 @@ #include "ftp_var.h" static int -comparstr(a, b) - const void *a, *b; +comparstr(const void *a, const void *b) { return (strcoll(*(char **)a, *(char **)b)); } @@ -77,10 +76,7 @@ comparstr(a, b) * words stringlist containing possible matches */ static unsigned char -complete_ambiguous(word, list, words) - char *word; - int list; - StringList *words; +complete_ambiguous(char *word, int list, StringList *words) { char insertstr[2 * MAXPATHLEN]; char *lastmatch; @@ -138,9 +134,7 @@ complete_ambiguous(word, list, words) * Complete a command */ static unsigned char -complete_command(word, list) - char *word; - int list; +complete_command(char *word, int list) { struct cmd *c; StringList *words; @@ -166,9 +160,7 @@ complete_command(word, list) * Complete a local file */ static unsigned char -complete_local(word, list) - char *word; - int list; +complete_local(char *word, int list) { StringList *words; char dir[MAXPATHLEN]; @@ -222,9 +214,7 @@ complete_local(word, list) * Complete a remote file */ static unsigned char -complete_remote(word, list) - char *word; - int list; +complete_remote(char *word, int list) { static StringList *dirlist; static char lastdir[MAXPATHLEN]; @@ -302,9 +292,7 @@ complete_remote(word, list) * Generic complete routine */ unsigned char -complete(el, ch) - EditLine *el; - int ch; +complete(EditLine *el, int ch) { static char word[FTPBUFLEN]; static int lastc_argc, lastc_argo; diff --git a/usr.bin/ftp/domacro.c b/usr.bin/ftp/domacro.c index 0cc98e215e..2465f06c44 100644 --- a/usr.bin/ftp/domacro.c +++ b/usr.bin/ftp/domacro.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/domacro.c,v 1.6 1999/08/28 01:01:31 peter Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/domacro.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/domacro.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ /* $NetBSD: domacro.c,v 1.10 1997/07/20 09:45:45 lukem Exp $ */ /* @@ -49,9 +49,7 @@ #include "ftp_var.h" void -domacro(argc, argv) - int argc; - char *argv[]; +domacro(int argc, char **argv) { int i, j, count = 2, loopflg = 0; char *cp1, *cp2, line2[200]; diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 5f02d40388..31a2570a7c 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -37,7 +37,7 @@ * * $NetBSD: fetch.c,v 1.16.2.1 1997/11/18 01:00:22 mellon Exp $ * $FreeBSD: src/usr.bin/ftp/fetch.c,v 1.12.2.6 2002/10/19 12:50:26 roam Exp $ - * $DragonFly: src/usr.bin/ftp/Attic/fetch.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/ftp/Attic/fetch.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ #include @@ -68,8 +68,8 @@ #include "ftp_var.h" -static int url_get __P((const char *, const char *)); -void aborthttp __P((int)); +static int url_get(const char *, const char *); +void aborthttp(int); #define FTP_URL "ftp://" /* ftp URL prefix */ @@ -88,9 +88,7 @@ jmp_buf httpabort; * Returns -1 on failure, 0 on success */ static int -url_get(origline, proxyenv) - const char *origline; - const char *proxyenv; +url_get(const char *origline, const char *proxyenv) { struct addrinfo hints; struct addrinfo *res0, *res; @@ -435,8 +433,7 @@ cleanup_url_get: * Abort a http retrieval */ void -aborthttp(notused) - int notused; +aborthttp(int notused) { alarmtimer(0); @@ -460,9 +457,7 @@ aborthttp(notused) * Otherwise, 0 is returned if all files retrieved successfully. */ int -auto_fetch(argc, argv) - int argc; - char *argv[]; +auto_fetch(int argc, char **argv) { static char lasthost[MAXHOSTNAMELEN]; char *xargv[5]; @@ -700,8 +695,7 @@ parsed_url: } int -isurl(p) - const char *p; +isurl(const char *p) { char *path, pton_buf[16]; diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index f1f974ada7..4e87dee1e2 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/ftp.c,v 1.28.2.5 2002/07/25 15:29:18 ume Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/ftp.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/ftp.c,v 1.3 2003/10/04 20:36:44 hmp Exp $ */ /* $NetBSD: ftp.c,v 1.29.2.1 1997/11/18 01:01:04 mellon Exp $ */ /* @@ -93,9 +93,7 @@ union sockunion { union sockunion myctladdr, hisctladdr, data_addr; char * -hookup(host0, port) - const char *host0; - char *port; +hookup(const char *host0, char *port) { int s, len, tos, error; struct addrinfo hints, *res, *res0; @@ -246,8 +244,7 @@ bad: } void -cmdabort(notused) - int notused; +cmdabort(int notused) { alarmtimer(0); @@ -260,29 +257,15 @@ cmdabort(notused) /*VARARGS*/ int -#ifdef __STDC__ command(const char *fmt, ...) -#else -command(va_alist) - va_dcl -#endif { va_list ap; int r; sig_t oldintr; -#ifndef __STDC__ - const char *fmt; -#endif - abrtflag = 0; if (debug) { fputs("---> ", stdout); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); - fmt = va_arg(ap, const char *); -#endif if (strncmp("PASS ", fmt, 5) == 0) fputs("PASS XXXX", stdout); else if (strncmp("ACCT ", fmt, 5) == 0) @@ -299,12 +282,7 @@ command(va_alist) return (0); } oldintr = signal(SIGINT, cmdabort); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); - fmt = va_arg(ap, char *); -#endif vfprintf(cout, fmt, ap); va_end(ap); fputs("\r\n", cout); @@ -320,8 +298,7 @@ command(va_alist) char reply_string[BUFSIZ]; /* first line of previous reply */ int -getreply(expecteof) - int expecteof; +getreply(int expecteof) { char current_line[BUFSIZ]; /* last line of previous reply */ int c, n, line; @@ -452,9 +429,7 @@ getreply(expecteof) } int -empty(mask, sec) - fd_set *mask; - int sec; +empty(fd_set *mask, int sec) { struct timeval t; @@ -466,8 +441,7 @@ empty(mask, sec) jmp_buf sendabort; void -abortsend(notused) - int notused; +abortsend(int notused) { alarmtimer(0); @@ -479,9 +453,8 @@ abortsend(notused) } void -sendrequest(cmd, local, remote, printnames) - const char *cmd, *local, *remote; - int printnames; +sendrequest(const char *cmd, const char *local, const char *remote, + int printnames) { struct stat st; int c, d; @@ -758,8 +731,7 @@ cleanupsend: jmp_buf recvabort; void -abortrecv(notused) - int notused; +abortrecv(int notused) { alarmtimer(0); @@ -771,9 +743,8 @@ abortrecv(notused) } void -recvrequest(cmd, local, remote, lmode, printnames, ignorespecial) - const char *cmd, *local, *remote, *lmode; - int printnames, ignorespecial; +recvrequest(const char *cmd, const char *local, const char *remote, + const char *lmode, int printnames, int ignorespecial) { FILE *fout, *din; int (*closefunc) __P((FILE *)); @@ -1149,7 +1120,7 @@ abort: * otherwise the server's connect may fail. */ int -initconn() +initconn(void) { char *p, *a; int result, len, tmpno = 0; @@ -1531,8 +1502,7 @@ bad: } FILE * -dataconn(lmode) - const char *lmode; +dataconn(const char *lmode) { union sockunion from; int s, fromlen, tos; @@ -1562,8 +1532,7 @@ dataconn(lmode) } void -psummary(notused) - int notused; +psummary(int notused) { if (bytes > 0) @@ -1571,8 +1540,7 @@ psummary(notused) } void -psabort(notused) - int notused; +psabort(int notused) { alarmtimer(0); @@ -1580,8 +1548,7 @@ psabort(notused) } void -pswitch(flag) - int flag; +pswitch(int flag) { sig_t oldintr; static struct comvars { @@ -1673,8 +1640,7 @@ pswitch(flag) } void -abortpt(notused) - int notused; +abortpt(int notused) { alarmtimer(0); @@ -1687,8 +1653,7 @@ abortpt(notused) } void -proxtrans(cmd, local, remote) - const char *cmd, *local, *remote; +proxtrans(const char *cmd, const char *local, const char *remote) { sig_t oldintr; int prox_type, nfnd; @@ -1816,9 +1781,7 @@ abort: } void -reset(argc, argv) - int argc; - char *argv[]; +reset(int argc, char **argv) { fd_set mask; int nfnd = 1; @@ -1838,8 +1801,7 @@ reset(argc, argv) } char * -gunique(local) - const char *local; +gunique(const char *local) { static char new[MAXPATHLEN]; char *cp = strrchr(local, '/'); @@ -1884,8 +1846,7 @@ gunique(local) } void -abort_remote(din) - FILE *din; +abort_remote(FILE *din) { char buf[BUFSIZ]; int nfnd; @@ -1932,8 +1893,7 @@ abort_remote(din) } void -ai_unmapped(ai) - struct addrinfo *ai; +ai_unmapped(struct addrinfo *ai) { struct sockaddr_in6 *sin6; struct sockaddr_in sin; diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 3d3825a145..cbc3905531 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/main.c,v 1.25.2.4 2002/08/27 09:55:08 yar Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/main.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/main.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ /* $NetBSD: main.c,v 1.26 1997/10/14 16:31:22 christos Exp $ */ /* @@ -65,12 +65,10 @@ int family = AF_UNSPEC; -int main __P((int, char **)); +int main(int, char **); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, top, rval; struct passwd *pw = NULL; @@ -303,7 +301,7 @@ main(argc, argv) } void -intr() +intr(void) { alarmtimer(0); @@ -311,7 +309,7 @@ intr() } void -lostpeer() +lostpeer(void) { alarmtimer(0); @@ -345,7 +343,7 @@ lostpeer() * Generate a prompt */ char * -prompt() +prompt(void) { return ("ftp> "); } @@ -354,8 +352,7 @@ prompt() * Command parser. */ void -cmdscanner(top) - int top; +cmdscanner(int top) { struct cmd *c; int num; @@ -445,8 +442,7 @@ cmdscanner(top) } struct cmd * -getcmd(name) - const char *name; +getcmd(const char *name) { const char *p, *q; struct cmd *c, *found; @@ -483,7 +479,7 @@ getcmd(name) int slrflag; void -makeargv() +makeargv(void) { char *argp; @@ -526,7 +522,7 @@ makeargv() * handle quoting and strings */ char * -slurpstring() +slurpstring(void) { int got_one = 0; char *sb = stringbase; @@ -658,9 +654,7 @@ OUT: * Call each command handler with argc == 0 and argv[0] == name. */ void -help(argc, argv) - int argc; - char *argv[]; +help(int argc, char **argv) { struct cmd *c; @@ -696,7 +690,7 @@ help(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: %s [-46adeginptUvV] [-P port] [-s src_addr] [host [port]]\n" diff --git a/usr.bin/ftp/ruserpass.c b/usr.bin/ftp/ruserpass.c index ab1d69e09a..77866f1d08 100644 --- a/usr.bin/ftp/ruserpass.c +++ b/usr.bin/ftp/ruserpass.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/ruserpass.c,v 1.9 1999/08/28 01:01:34 peter Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/ruserpass.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/ruserpass.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ /* $NetBSD: ruserpass.c,v 1.14.2.1 1997/11/18 01:02:05 mellon Exp $ */ /* @@ -54,7 +54,7 @@ #include "ftp_var.h" -static int token __P((void)); +static int token(void); static FILE *cfile; #define DEFAULT 1 @@ -82,9 +82,7 @@ static struct toktab { }; int -ruserpass(host, aname, apass, aacct) - const char *host; - char **aname, **apass, **aacct; +ruserpass(const char *host, char **aname, char **apass, char **aacct) { char *hdir, buf[BUFSIZ], *tmp; char myname[MAXHOSTNAMELEN], *mydomain; @@ -265,7 +263,7 @@ bad: } static int -token() +token(void) { char *cp; int c; diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 1c2d8aa244..329082cc96 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/usr.bin/ftp/util.c,v 1.12.2.4 2002/08/27 09:55:08 yar Exp $ */ -/* $DragonFly: src/usr.bin/ftp/Attic/util.c,v 1.2 2003/06/17 04:29:26 dillon Exp $ */ +/* $DragonFly: src/usr.bin/ftp/Attic/util.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ /* $NetBSD: util.c,v 1.16.2.1 1997/11/18 01:02:33 mellon Exp $ */ /* @@ -74,9 +74,7 @@ * auto-login, if possible. */ void -setpeer(argc, argv) - int argc; - char *argv[]; +setpeer(int argc, char **argv) { char *host; char *port; @@ -188,9 +186,7 @@ setpeer(argc, argv) * login to remote host, using given username & password if supplied */ int -login(host, user, pass) - const char *host; - char *user, *pass; +login(const char *host, char *user, char *pass) { char tmp[80]; char *acct; @@ -297,10 +293,7 @@ login(host, user, pass) * Returns false if no new arguments have been added. */ int -another(pargc, pargv, prompt) - int *pargc; - char ***pargv; - const char *prompt; +another(int *pargc, char ***pargv, const char *prompt) { int len = strlen(line), ret; @@ -328,10 +321,7 @@ another(pargc, pargv, prompt) * of writing to the screen. */ char * -remglob(argv, doswitch, errbuf) - char *argv[]; - int doswitch; - char **errbuf; +remglob(char **argv, int doswitch, char **errbuf) { char temp[MAXPATHLEN]; static char buf[MAXPATHLEN]; @@ -403,8 +393,7 @@ remglob(argv, doswitch, errbuf) } int -confirm(cmd, file) - const char *cmd, *file; +confirm(const char *cmd, const char *file) { char line[BUFSIZ]; @@ -436,8 +425,7 @@ confirm(cmd, file) * from the expression, we return only the first. */ int -globulize(cpp) - char **cpp; +globulize(char **cpp) { glob_t gl; int flags; @@ -465,9 +453,7 @@ globulize(cpp) * determine size of remote file */ off_t -remotesize(file, noisy) - const char *file; - int noisy; +remotesize(const char *file, int noisy) { int overbose; off_t size; @@ -496,9 +482,7 @@ remotesize(file, noisy) * determine last modification time (in GMT) of remote file */ time_t -remotemodtime(file, noisy) - const char *file; - int noisy; +remotemodtime(const char *file, int noisy) { struct tm timebuf; time_t rtime; @@ -557,11 +541,10 @@ remotemodtime(file, noisy) return (rtime); } -void updateprogressmeter __P((int)); +void updateprogressmeter(int); void -updateprogressmeter(dummy) - int dummy; +updateprogressmeter(int dummy) { static pid_t pgrp = -1; int ctty_pgrp; @@ -590,8 +573,7 @@ updateprogressmeter(dummy) static struct timeval start; void -progressmeter(flag) - int flag; +progressmeter(int flag) { /* * List of order of magnitude prefixes. @@ -705,8 +687,7 @@ progressmeter(flag) * instead of STDOUT. */ void -ptransfer(siginfo) - int siginfo; +ptransfer(int siginfo) { struct timeval now, td; double elapsed; @@ -747,8 +728,7 @@ ptransfer(siginfo) * List words in stringlist, vertically arranged */ void -list_vertical(sl) - StringList *sl; +list_vertical(StringList *sl) { int i, j, w; int columns, width, lines, items; @@ -789,8 +769,7 @@ list_vertical(sl) * Update the global ttywidth value, using TIOCGWINSZ. */ void -setttywidth(a) - int a; +setttywidth(int a) { struct winsize winsize; @@ -804,8 +783,7 @@ setttywidth(a) * Set the SIGALRM interval timer for wait seconds, 0 to disable. */ void -alarmtimer(wait) - int wait; +alarmtimer(int wait) { struct itimerval itv; @@ -820,7 +798,7 @@ alarmtimer(wait) */ #ifndef SMALL void -controlediting() +controlediting(void) { if (editing && el == NULL && hist == NULL) { el = el_init(__progname, stdin, stdout); /* init editline */ diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c index 0559a0c179..c8cf603467 100644 --- a/usr.bin/gcore/gcore.c +++ b/usr.bin/gcore/gcore.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)gcore.c 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/usr.bin/gcore/gcore.c,v 1.15.2.2 2001/08/17 20:56:22 mikeh Exp $ - * $DragonFly: src/usr.bin/gcore/gcore.c,v 1.3 2003/07/13 05:45:16 dillon Exp $ + * $DragonFly: src/usr.bin/gcore/gcore.c,v 1.4 2003/10/04 20:36:45 hmp Exp $ */ /* @@ -70,12 +70,12 @@ #include "extern.h" -static void core __P((int, int, struct kinfo_proc *)); -static void datadump __P((int, int, struct proc *, u_long, int)); -static void killed __P((int)); -static void restart_target __P((void)); -static void usage __P((void)) __dead2; -static void userdump __P((int, struct proc *, u_long, int)); +static void core(int, int, struct kinfo_proc *); +static void datadump(int, int, struct proc *, u_long, int); +static void killed(int); +static void restart_target(void); +static void usage(void) __dead2; +static void userdump(int, struct proc *, u_long, int); kvm_t *kd; /* XXX undocumented routine, should be in kvm.h? */ @@ -85,9 +85,7 @@ static int data_offset; static pid_t pid; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register struct proc *p; struct kinfo_proc *ki = NULL; @@ -210,10 +208,7 @@ main(argc, argv) * Build the core file. */ void -core(efd, fd, ki) - int efd; - int fd; - struct kinfo_proc *ki; +core(int efd, int fd, struct kinfo_proc *ki) { union { struct user user; @@ -254,12 +249,8 @@ core(efd, fd, ki) } void -datadump(efd, fd, p, addr, npage) - register int efd; - register int fd; - struct proc *p; - register u_long addr; - register int npage; +datadump(register int efd, register int fd, struct proc *p, + register u_long addr, register int npage) { register int cc, delta; char buffer[PAGE_SIZE]; @@ -288,8 +279,7 @@ datadump(efd, fd, p, addr, npage) } static void -killed(sig) - int sig; +killed(int sig) { restart_target(); signal(sig, SIG_DFL); @@ -297,17 +287,14 @@ killed(sig) } static void -restart_target() +restart_target(void) { kill(pid, SIGCONT); } void -userdump(fd, p, addr, npage) - register int fd; - struct proc *p; - register u_long addr; - register int npage; +userdump(register int fd, struct proc *p, register u_long addr, + register int npage) { register int cc; char buffer[PAGE_SIZE]; @@ -326,7 +313,7 @@ userdump(fd, p, addr, npage) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: gcore [-s] [-c core] [executable] pid\n"); exit(1); diff --git a/usr.bin/gcore/md-nop.c b/usr.bin/gcore/md-nop.c index 1332170c66..0004c749d4 100644 --- a/usr.bin/gcore/md-nop.c +++ b/usr.bin/gcore/md-nop.c @@ -32,7 +32,7 @@ * * @(#)md-nop.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/gcore/md-nop.c,v 1.3 1999/08/28 01:01:39 peter Exp $ - * $DragonFly: src/usr.bin/gcore/md-nop.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/gcore/md-nop.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -43,10 +43,7 @@ #include "extern.h" void -md_core(kd, fd, ki) - kvm_t *kd; - int fd; - struct kinfo_proc *ki; +md_core(kvm_t *kd, int fd, struct kinfo_proc *ki) { /* Don't need to fix anything for this architecture. */ return; diff --git a/usr.bin/gcore/md-sparc.c b/usr.bin/gcore/md-sparc.c index 42daa949a1..633eb5def7 100644 --- a/usr.bin/gcore/md-sparc.c +++ b/usr.bin/gcore/md-sparc.c @@ -35,6 +35,8 @@ * SUCH DAMAGE. * * @(#)md-sparc.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gcore/md-sparc.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -58,10 +60,7 @@ #endif static void -shift_page(fd, off, ssize) - register int fd; - register off_t off; - register int ssize; +shift_page(register int fd, register off_t off, register int ssize) { char buffer[NBPG]; @@ -80,10 +79,7 @@ shift_page(fd, off, ssize) * from the top of the kernel stack and store it in the pcb. */ void -md_core(kd, fd, ki) - kvm_t *kd; - int fd; - struct kinfo_proc *ki; +md_core(kvm_t *kd, int fd, struct kinfo_proc *ki) { register struct rwindow *rw; register int nsaved, cc, ssize; diff --git a/usr.bin/getopt/getopt.c b/usr.bin/getopt/getopt.c index eba1b98c03..8eaacb7e57 100644 --- a/usr.bin/getopt/getopt.c +++ b/usr.bin/getopt/getopt.c @@ -1,13 +1,11 @@ /* $FreeBSD: src/usr.bin/getopt/getopt.c,v 1.4.2.2 2001/07/30 10:16:38 dd Exp $ */ -/* $DragonFly: src/usr.bin/getopt/getopt.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ */ +/* $DragonFly: src/usr.bin/getopt/getopt.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include #include #include -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char **argv) { int c; int status = 0; diff --git a/usr.bin/gprof/alpha.c b/usr.bin/gprof/alpha.c index 6a474086a3..5e4b57d096 100644 --- a/usr.bin/gprof/alpha.c +++ b/usr.bin/gprof/alpha.c @@ -1,11 +1,11 @@ +/* + * $DragonFly: src/usr.bin/gprof/Attic/alpha.c,v 1.2 2003/10/04 20:36:45 hmp Exp $ + */ #include "gprof.h" /* * gprof -c isn't currently supported... */ -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long»p_lowpc,unsigned long p_highpc) { } diff --git a/usr.bin/gprof/arcs.c b/usr.bin/gprof/arcs.c index e8a97af238..255f1bfda9 100644 --- a/usr.bin/gprof/arcs.c +++ b/usr.bin/gprof/arcs.c @@ -32,7 +32,7 @@ * * @(#)arcs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/gprof/arcs.c,v 1.6 1999/08/28 01:01:54 peter Exp $ - * $DragonFly: src/usr.bin/gprof/arcs.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/gprof/arcs.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -48,10 +48,7 @@ int oldcycle; /* * add (or just increment) an arc */ -addarc( parentp , childp , count ) - nltype *parentp; - nltype *childp; - long count; +addarc(nltype *parentp, nltype *childp, long count) { arctype *arcp; @@ -101,15 +98,13 @@ addarc( parentp , childp , count ) */ nltype **topsortnlp; -topcmp( npp1 , npp2 ) - nltype **npp1; - nltype **npp2; +topcmp(nltype **npp1, nltype **npp2) { return (*npp1) -> toporder - (*npp2) -> toporder; } nltype ** -doarcs() +doarcs(void) { nltype *parentp, **timesortnlp; arctype *arcp; @@ -251,7 +246,7 @@ doarcs() return( timesortnlp ); } -dotime() +dotime(void) { int index; @@ -261,8 +256,7 @@ dotime() } } -timepropagate( parentp ) - nltype *parentp; +timepropagate(nltype *parentp) { arctype *arcp; nltype *childp; @@ -349,7 +343,7 @@ timepropagate( parentp ) } } -cyclelink() +cyclelink(void) { register nltype *nlp; register nltype *cyclenlp; @@ -443,7 +437,7 @@ cyclelink() /* * analyze cycles to determine breakup */ -cycleanalyze() +cycleanalyze(void) { arctype **cyclestack; arctype **stkp; @@ -520,10 +514,7 @@ cycleanalyze() return( done ); } -descend( node , stkstart , stkp ) - nltype *node; - arctype **stkstart; - arctype **stkp; +descend(nltype *node , arctype **stkstart, arctype **stkp) { arctype *arcp; bool ret; @@ -553,9 +544,7 @@ descend( node , stkstart , stkp ) } } -addcycle( stkstart , stkend ) - arctype **stkstart; - arctype **stkend; +addcycle(arctype **stkstart, arctype **stkend) { arctype **arcpp; arctype **stkloc; @@ -628,7 +617,7 @@ addcycle( stkstart , stkend ) return( TRUE ); } -compresslist() +compresslist(void) { cltype *clp; cltype **prev; @@ -740,8 +729,7 @@ compresslist() } #ifdef DEBUG -printsubcycle( clp ) - cltype *clp; +printsubcycle(cltype *clp) { arctype **arcpp; arctype **endlist; @@ -755,7 +743,7 @@ printsubcycle( clp ) } #endif DEBUG -cycletime() +cycletime(void) { int cycle; nltype *cyclenlp; @@ -784,7 +772,7 @@ cycletime() * propfraction as the sum of fractional parents' propfractions * and while we're here, sum time for functions. */ -doflags() +doflags(void) { int index; nltype *childp; @@ -878,8 +866,7 @@ doflags() * print flag of the child (cycle) appropriately. * similarly, deal with propagation fractions from parents. */ -inheritflags( childp ) - nltype *childp; +inheritflags(nltype *childp) { nltype *headp; arctype *arcp; diff --git a/usr.bin/gprof/dfn.c b/usr.bin/gprof/dfn.c index eab9e8cb1c..c51b21d6dd 100644 --- a/usr.bin/gprof/dfn.c +++ b/usr.bin/gprof/dfn.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)dfn.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/dfn.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -48,7 +50,7 @@ int dfn_depth; int dfn_counter; -dfn_init() +dfn_init(void) { dfn_depth = 0; @@ -58,8 +60,7 @@ dfn_init() /* * given this parent, depth first number its children. */ -dfn( parentp ) - nltype *parentp; +dfn(nltype *parentp) { arctype *arcp; @@ -104,8 +105,7 @@ dfn( parentp ) /* * push a parent onto the stack and mark it busy */ -dfn_pre_visit( parentp ) - nltype *parentp; +dfn_pre_visit(nltype *parentp) { dfn_depth += 1; @@ -129,8 +129,7 @@ dfn_pre_visit( parentp ) * are we already numbered? */ bool -dfn_numbered( childp ) - nltype *childp; +dfn_numbered(nltype *childp) { return ( childp -> toporder != DFN_NAN && childp -> toporder != DFN_BUSY ); @@ -140,8 +139,7 @@ dfn_numbered( childp ) * are we already busy? */ bool -dfn_busy( childp ) - nltype *childp; +dfn_busy(nltype *childp) { if ( childp -> toporder == DFN_NAN ) { @@ -153,8 +151,7 @@ dfn_busy( childp ) /* * MISSING: an explanation */ -dfn_findcycle( childp ) - nltype *childp; +dfn_findcycle(nltype *childp) { int cycletop; nltype *cycleheadp; @@ -263,8 +260,7 @@ dfn_findcycle( childp ) * deal with self-cycles * for lint: ARGSUSED */ -dfn_self_cycle( parentp ) - nltype *parentp; +dfn_self_cycle(nltype *parentp) { /* * since we are taking out self-cycles elsewhere @@ -284,8 +280,7 @@ dfn_self_cycle( parentp ) * [MISSING: an explanation] * and pop it off the stack */ -dfn_post_visit( parentp ) - nltype *parentp; +dfn_post_visit(nltype *parentp) { nltype *memberp; diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index ca7490a836..6b0c213cfb 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)gprof.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/gprof/gprof.c,v 1.11 1999/08/28 01:01:55 peter Exp $ - * $DragonFly: src/usr.bin/gprof/gprof.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/gprof/gprof.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -46,9 +46,7 @@ static struct gmonhdr gmonhdr; static int lflag; static int Lflag; -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { char **sp; nltype **timesortnlp; @@ -224,8 +222,7 @@ main(argc, argv) * an array of sampling hits within pc ranges, * and the arcs. */ -getpfile(filename) - char *filename; +getpfile(char *filename) { FILE *pfile; FILE *openpfile(); @@ -253,8 +250,7 @@ getpfile(filename) } FILE * -openpfile(filename) - char *filename; +openpfile(char *filename) { struct gmonhdr tmp; FILE *pfile; @@ -311,8 +307,7 @@ openpfile(filename) return(pfile); } -tally( rawp ) - struct rawarc *rawp; +tally(struct rawarc *rawp) { nltype *parentp; nltype *childp; @@ -339,8 +334,7 @@ tally( rawp ) /* * dump out the gmon.sum file */ -dumpsum( sumfile ) - char *sumfile; +dumpsum(char *sumfile) { register nltype *nlp; register arctype *arcp; @@ -389,9 +383,7 @@ dumpsum( sumfile ) } static int -valcmp(v1, v2) - const void *v1; - const void *v2; +valcmp(const void *v1, const void *v2) { const nltype *p1 = (const nltype *)v1; const nltype *p2 = (const nltype *)v2; @@ -405,8 +397,7 @@ valcmp(v1, v2) return EQUALTO; } -readsamples(pfile) - FILE *pfile; +readsamples(FILE *pfile) { register i; UNIT sample; @@ -462,7 +453,7 @@ readsamples(pfile) * only one sample for every four bytes of text space and never * have any overlap (the two end cases, above). */ -asgnsamples() +asgnsamples(void) { register int j; UNIT ccnt; @@ -528,8 +519,7 @@ asgnsamples() unsigned long -min(a, b) - unsigned long a,b; +min(unsigned long a, unsigned long b) { if (ab) return(a); @@ -551,7 +540,7 @@ max(a, b) * if it turns out that the entry point is in one bucket and the code * for a routine is in the next bucket. */ -alignentries() +alignentries(void) { register struct nl *nlp; unsigned long bucket_of_entry; @@ -573,7 +562,7 @@ alignentries() } } -done() +done(void) { exit(0); diff --git a/usr.bin/gprof/hertz.c b/usr.bin/gprof/hertz.c index d38119f177..155e980076 100644 --- a/usr.bin/gprof/hertz.c +++ b/usr.bin/gprof/hertz.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)hertz.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/hertz.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -41,7 +43,7 @@ */ #define HZ_WRONG 0 -hertz() +hertz(void) { struct itimerval tim; diff --git a/usr.bin/gprof/hp300.c b/usr.bin/gprof/hp300.c index 6a474086a3..70877cbf3a 100644 --- a/usr.bin/gprof/hp300.c +++ b/usr.bin/gprof/hp300.c @@ -1,11 +1,11 @@ +/* + * $DragonFly: src/usr.bin/gprof/Attic/hp300.c,v 1.2 2003/10/04 20:36:45 hmp Exp $ + */ #include "gprof.h" /* * gprof -c isn't currently supported... */ -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc ) { } diff --git a/usr.bin/gprof/i386.c b/usr.bin/gprof/i386.c index 6a474086a3..abea9c89c8 100644 --- a/usr.bin/gprof/i386.c +++ b/usr.bin/gprof/i386.c @@ -1,11 +1,11 @@ +/* + * $DragonFly: src/usr.bin/gprof/i386.c,v 1.2 2003/10/04 20:36:45 hmp Exp $ + */ #include "gprof.h" /* * gprof -c isn't currently supported... */ -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc) { } diff --git a/usr.bin/gprof/lookup.c b/usr.bin/gprof/lookup.c index ff2e20a649..dcb587269a 100644 --- a/usr.bin/gprof/lookup.c +++ b/usr.bin/gprof/lookup.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)lookup.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/lookup.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include "gprof.h" @@ -41,8 +43,7 @@ * entry point. */ nltype * -nllookup( address ) - unsigned long address; +nllookup(unsigned long address) { register long low; register long middle; @@ -81,9 +82,7 @@ nllookup( address ) } arctype * -arclookup( parentp , childp ) - nltype *parentp; - nltype *childp; +arclookup(nltype *parentp, nltype *childp) { arctype *arcp; diff --git a/usr.bin/gprof/mips.c b/usr.bin/gprof/mips.c index ff4a0e206e..a60fbd3fbf 100644 --- a/usr.bin/gprof/mips.c +++ b/usr.bin/gprof/mips.c @@ -37,6 +37,8 @@ * From: sparc.c 5.1 (Berkeley) 7/7/92 * * @(#)mips.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/Attic/mips.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include "gprof.h" @@ -68,10 +70,7 @@ nltype indirectchild = { (arctype *) 0 /* list of callee arcs */ }; -findcall(parentp, p_lowpc, p_highpc) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc) { register u_long pc; nltype *childp; diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c index 7c0657dd33..7f03941562 100644 --- a/usr.bin/gprof/printgprof.c +++ b/usr.bin/gprof/printgprof.c @@ -32,14 +32,14 @@ * * @(#)printgprof.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/gprof/printgprof.c,v 1.6 1999/08/28 01:01:56 peter Exp $ - * $DragonFly: src/usr.bin/gprof/printgprof.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/gprof/printgprof.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include #include "gprof.h" #include "pathnames.h" -printprof() +printprof(void) { register nltype *np; nltype **sortednlp; @@ -67,8 +67,7 @@ printprof() free( sortednlp ); } -timecmp( npp1 , npp2 ) - nltype **npp1, **npp2; +timecmp(nltype **npp1, nltype **npp2) { double timediff; long calldiff; @@ -89,7 +88,7 @@ timecmp( npp1 , npp2 ) /* * header for flatprofline */ -flatprofheader() +flatprofheader(void) { if ( bflag ) { @@ -116,8 +115,7 @@ flatprofheader() "name" ); } -flatprofline( np ) - register nltype *np; +flatprofline(register nltype *np) { if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 ) { @@ -150,7 +148,7 @@ flatprofline( np ) printf( "\n" ); } -gprofheader() +gprofheader(void) { if ( bflag ) { @@ -178,8 +176,7 @@ gprofheader() printf( "\n" ); } -gprofline( np ) - register nltype *np; +gprofline(register nltype *np) { char kirkbuffer[ BUFSIZ ]; @@ -203,8 +200,7 @@ gprofline( np ) printf( "\n" ); } -printgprof(timesortnlp) - nltype **timesortnlp; +printgprof(nltype **timesortnlp) { int index; nltype *parentp; @@ -252,9 +248,7 @@ printgprof(timesortnlp) * all else being equal, sort by names. */ int -totalcmp( npp1 , npp2 ) - nltype **npp1; - nltype **npp2; +totalcmp(nltype **npp1, nltype **npp2 ) { register nltype *np1 = *npp1; register nltype *np2 = *npp2; @@ -285,8 +279,7 @@ totalcmp( npp1 , npp2 ) return strcmp( np1 -> name , np2 -> name ); } -printparents( childp ) - nltype *childp; +printparents(nltype *childp) { nltype *parentp; arctype *arcp; @@ -329,8 +322,7 @@ printparents( childp ) } } -printchildren( parentp ) - nltype *parentp; +printchildren(nltype *parentp) { nltype *childp; arctype *arcp; @@ -362,8 +354,7 @@ printchildren( parentp ) } } -printname( selfp ) - nltype *selfp; +printname(nltype *selfp) { if ( selfp -> name != 0 ) { @@ -389,8 +380,7 @@ printname( selfp ) } } -sortchildren( parentp ) - nltype *parentp; +sortchildren(nltype *parentp) { arctype *arcp; arctype *detachedp; @@ -429,8 +419,7 @@ sortchildren( parentp ) parentp -> children = sorted.arc_childlist; } -sortparents( childp ) - nltype *childp; +sortparents(nltype *childp) { arctype *arcp; arctype *detachedp; @@ -472,8 +461,7 @@ sortparents( childp ) /* * print a cycle header */ -printcycle( cyclep ) - nltype *cyclep; +printcycle(nltype *cyclep) { char kirkbuffer[ BUFSIZ ]; @@ -496,8 +484,7 @@ printcycle( cyclep ) /* * print the members of a cycle */ -printmembers( cyclep ) - nltype *cyclep; +printmembers(nltype *cyclep) { nltype *memberp; @@ -520,8 +507,7 @@ printmembers( cyclep ) /* * sort members of a cycle */ -sortmembers( cyclep ) - nltype *cyclep; +sortmembers(nltype *cyclep) { nltype *todo; nltype *doing; @@ -551,9 +537,7 @@ sortmembers( cyclep ) * next is sort on ncalls + selfcalls. */ int -membercmp( this , that ) - nltype *this; - nltype *that; +membercmp(nltype *this, nltype *that) { double thistime = this -> propself + this -> propchild; double thattime = that -> propself + that -> propchild; @@ -584,9 +568,7 @@ membercmp( this , that ) * arc count as minor key */ int -arccmp( thisp , thatp ) - arctype *thisp; - arctype *thatp; +arccmp(arctype *thisp, arctype *thatp) { nltype *thisparentp = thisp -> arc_parentp; nltype *thischildp = thisp -> arc_childp; @@ -662,8 +644,7 @@ arccmp( thisp , thatp ) } } -printblurb( blurbname ) - char *blurbname; +printblurb(char *blurbname) { FILE *blurbfile; int input; @@ -680,13 +661,12 @@ printblurb( blurbname ) } int -namecmp( npp1 , npp2 ) - nltype **npp1, **npp2; +namecmp(nltype **npp1, nltype **npp2) { return( strcmp( (*npp1) -> name , (*npp2) -> name ) ); } -printindex() +printindex(void) { nltype **namesortnlp; register nltype *nlp; diff --git a/usr.bin/gprof/printlist.c b/usr.bin/gprof/printlist.c index d784ad391b..d16608d035 100644 --- a/usr.bin/gprof/printlist.c +++ b/usr.bin/gprof/printlist.c @@ -32,7 +32,7 @@ * * @(#)printlist.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/gprof/printlist.c,v 1.3 1999/08/28 01:01:56 peter Exp $ - * $DragonFly: src/usr.bin/gprof/printlist.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/gprof/printlist.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -57,9 +57,7 @@ struct stringlist *elist = &ehead; struct stringlist Ehead = { 0 , 0 }; struct stringlist *Elist = &Ehead; -addlist( listp , funcname ) - struct stringlist *listp; - char *funcname; +addlist(struct stringlist *listp, char *funcname) { struct stringlist *slp; @@ -74,9 +72,7 @@ addlist( listp , funcname ) } bool -onlist( listp , funcname ) - struct stringlist *listp; - char *funcname; +onlist(struct stringlist *listp, char *funcname) { struct stringlist *slp; diff --git a/usr.bin/gprof/sparc.c b/usr.bin/gprof/sparc.c index 306cc85f96..ba9edccd56 100644 --- a/usr.bin/gprof/sparc.c +++ b/usr.bin/gprof/sparc.c @@ -35,6 +35,8 @@ * SUCH DAMAGE. * * @(#)sparc.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/sparc.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include "gprof.h" @@ -66,10 +68,7 @@ nltype indirectchild = { (arctype *) 0 /* list of callee arcs */ }; -findcall(parentp, p_lowpc, p_highpc) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc) { register u_long pc; nltype *childp; diff --git a/usr.bin/gprof/tahoe.c b/usr.bin/gprof/tahoe.c index 7491f6d51f..e96cca8027 100644 --- a/usr.bin/gprof/tahoe.c +++ b/usr.bin/gprof/tahoe.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)tahoe.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/Attic/tahoe.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include "gprof.h" @@ -60,8 +62,7 @@ nltype indirectchild = { }; operandenum -operandmode( modep ) - unsigned char *modep; +operandmode(unsigned char *modep) { long usesreg = ((long)*modep) & 0xf; @@ -100,8 +101,7 @@ operandmode( modep ) } char * -operandname( mode ) - operandenum mode; +operandname(operandenum mode) { switch ( mode ) { @@ -152,8 +152,7 @@ operandname( mode ) } long -operandlength( modep ) - unsigned char *modep; +operandlength(unsigned char *modep) { switch ( operandmode( modep ) ) { @@ -188,8 +187,7 @@ operandlength( modep ) } unsigned long -reladdr( modep ) - char *modep; +reladdr(char *modep) { operandenum mode = operandmode( modep ); char *cp; @@ -217,10 +215,7 @@ reladdr( modep ) } } -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc) { unsigned char *instructp; long length; diff --git a/usr.bin/gprof/vax.c b/usr.bin/gprof/vax.c index 9cbf8b30db..a602106932 100644 --- a/usr.bin/gprof/vax.c +++ b/usr.bin/gprof/vax.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)vax.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/gprof/Attic/vax.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include "gprof.h" @@ -60,8 +62,7 @@ nltype indirectchild = { }; operandenum -operandmode( modep ) - struct modebyte *modep; +operandmode(struct modebyte *modep) { long usesreg = modep -> regfield; @@ -100,8 +101,7 @@ operandmode( modep ) } char * -operandname( mode ) - operandenum mode; +operandname(operandname mode) { switch ( mode ) { @@ -152,8 +152,7 @@ operandname( mode ) } long -operandlength( modep ) - struct modebyte *modep; +operandlength(struct modebyte *modep) { switch ( operandmode( modep ) ) { @@ -188,8 +187,7 @@ operandlength( modep ) } unsigned long -reladdr( modep ) - struct modebyte *modep; +reladdr(struct modebyte *modep) { operandenum mode = operandmode( modep ); char *cp; @@ -213,10 +211,7 @@ reladdr( modep ) } } -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; +findcall(nltype *parentp, unsigned long p_lowpc, unsigned long p_highpc) { unsigned char *instructp; long length; diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c index 879568742c..9fe22ad692 100644 --- a/usr.bin/head/head.c +++ b/usr.bin/head/head.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1987, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)head.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/head/head.c,v 1.10.2.1 2002/02/16 12:29:04 dwmalone Exp $ - * $DragonFly: src/usr.bin/head/head.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/head/head.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -51,15 +51,13 @@ * Bill Joy UCB August 24, 1977 */ -void head __P((FILE *, int)); -void head_bytes __P((FILE *, int)); -void obsolete __P((char *[])); -void usage __P((void)); +void head(FILE *, int); +void head_bytes(FILE *, int); +void obsolete(char *[]); +void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int ch; FILE *fp; @@ -117,9 +115,7 @@ main(argc, argv) } void -head(fp, cnt) - FILE *fp; - register int cnt; +head(FILE *fp, register int cnt) { char *cp; int error, readlen; @@ -133,9 +129,7 @@ head(fp, cnt) } void -head_bytes(fp, cnt) - FILE *fp; - register int cnt; +head_bytes(FILE *fp, register int cnt) { char buf[4096]; register int readlen; @@ -155,8 +149,7 @@ head_bytes(fp, cnt) } void -obsolete(argv) - char *argv[]; +obsolete(char **argv) { char *ap; @@ -174,7 +167,7 @@ obsolete(argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: head [-n lines | -c bytes] [file ...]\n"); diff --git a/usr.bin/hexdump/conv.c b/usr.bin/hexdump/conv.c index f10c9ad950..8c5616e158 100644 --- a/usr.bin/hexdump/conv.c +++ b/usr.bin/hexdump/conv.c @@ -32,7 +32,7 @@ * * @(#)conv.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/hexdump/conv.c,v 1.1.1.1.14.1 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/conv.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/conv.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -42,9 +42,7 @@ #include "hexdump.h" void -conv_c(pr, p) - PR *pr; - u_char *p; +conv_c(PR *pr, u_char *p) { char buf[10]; char const *str; @@ -90,9 +88,7 @@ strpr: *pr->cchar = 's'; } void -conv_u(pr, p) - PR *pr; - u_char *p; +conv_u(PR *pr, u_char *p) { static char const * list[] = { "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 72c5e87910..685f253433 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -32,7 +32,7 @@ * * @(#)display.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/hexdump/display.c,v 1.4.2.2 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/display.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/display.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -54,7 +54,7 @@ static off_t eaddress; /* end address */ static __inline void print(PR *, u_char *); void -display() +display(void) { extern FU *endfu; register FS *fs; @@ -109,9 +109,7 @@ display() } static __inline void -print(pr, bp) - PR *pr; - u_char *bp; +print(PR *pr, u_char *bp) { long double ldbl; double f8; @@ -208,8 +206,7 @@ print(pr, bp) } void -bpad(pr) - PR *pr; +bpad(PR *pr) { static char const *spec = " -0+#"; register char *p1, *p2; @@ -229,7 +226,7 @@ bpad(pr) static char **_argv; u_char * -get() +get(void) { static int ateof = 1; static u_char *curp, *savp; @@ -304,8 +301,7 @@ get() } int -next(argv) - char **argv; +next(char **argv) { extern int exitval; static int done; @@ -340,9 +336,7 @@ next(argv) } void -doskip(fname, statok) - const char *fname; - int statok; +doskip(const char *fname, int statok) { register int cnt; struct stat sb; diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c index 8ede910f31..d9adf27ed0 100644 --- a/usr.bin/hexdump/hexdump.c +++ b/usr.bin/hexdump/hexdump.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)hexdump.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/hexdump/hexdump.c,v 1.4.2.2 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/hexdump.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/hexdump.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -49,9 +49,7 @@ int exitval; /* final exit value */ int length = -1; /* max bytes to read */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register FS *tfs; char *p; diff --git a/usr.bin/hexdump/hexsyntax.c b/usr.bin/hexdump/hexsyntax.c index 115bbcecda..598af193f9 100644 --- a/usr.bin/hexdump/hexsyntax.c +++ b/usr.bin/hexdump/hexsyntax.c @@ -32,7 +32,7 @@ * * @(#)hexsyntax.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/hexdump/hexsyntax.c,v 1.8.2.1 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/hexsyntax.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/hexsyntax.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -48,9 +48,7 @@ off_t skip; /* bytes to skip */ void -newsyntax(argc, argvp) - int argc; - char ***argvp; +newsyntax(int argc, char ***argvp) { int ch; char *p, **argv; @@ -131,7 +129,7 @@ newsyntax(argc, argvp) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]", diff --git a/usr.bin/hexdump/odsyntax.c b/usr.bin/hexdump/odsyntax.c index 0b67e29024..7410c468ae 100644 --- a/usr.bin/hexdump/odsyntax.c +++ b/usr.bin/hexdump/odsyntax.c @@ -32,7 +32,7 @@ * * @(#)odsyntax.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/hexdump/odsyntax.c,v 1.8.2.1 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/odsyntax.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/odsyntax.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -60,9 +60,7 @@ static void odoffset(int, char ***); static void odusage(void); void -oldsyntax(argc, argvp) - int argc; - char ***argvp; +oldsyntax(int argc, char ***argvp) { static char empty[] = "", padding[] = PADDING; int ch; @@ -189,9 +187,7 @@ odusage(void) } static void -odoffset(argc, argvp) - int argc; - char ***argvp; +odoffset(int argc, char ***argvp) { unsigned char *p, *num, *end; int base; diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index 9188a78b17..11c0ef2e3c 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -32,7 +32,7 @@ * * @(#)parse.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/hexdump/parse.c,v 1.4.2.1 2002/07/23 14:27:06 tjr Exp $ - * $DragonFly: src/usr.bin/hexdump/parse.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/hexdump/parse.c,v 1.3 2003/10/04 20:36:45 hmp Exp $ */ #include @@ -48,8 +48,7 @@ FU *endfu; /* format at end-of-data */ void -addfile(name) - char *name; +addfile(char *name) { register unsigned char *p; FILE *fp; @@ -74,8 +73,7 @@ addfile(name) } void -add(fmt) - const char *fmt; +add(const char *fmt) { unsigned const char *p, *savep; static FS **nextfs; @@ -150,8 +148,7 @@ add(fmt) static const char *spec = ".#-+ 0123456789"; int -size(fs) - FS *fs; +size(FS *fs) { register FU *fu; register int bcnt, cursize; @@ -204,8 +201,7 @@ size(fs) } void -rewrite(fs) - FS *fs; +rewrite(FS *fs) { enum { NOTOKAY, USEBCNT, USEPREC } sokay; register PR *pr, **nextpr; @@ -445,8 +441,7 @@ isint2: switch(fu->bcnt) { } void -escape(p1) - register char *p1; +escape(register char *p1) { register char *p2; @@ -488,28 +483,25 @@ escape(p1) } void -badcnt(s) - char *s; +badcnt(char *s) { errx(1, "%s: bad byte count", s); } void -badsfmt() +badsfmt(void) { errx(1, "%%s: requires a precision or a byte count"); } void -badfmt(fmt) - const char *fmt; +badfmt(const char *fmt) { errx(1, "\"%s\": bad format", fmt); } void -badconv(ch) - char *ch; +badconv(char *ch) { errx(1, "%%%s: bad conversion character", ch); } diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c index badd494f67..f10a2981c0 100644 --- a/usr.bin/id/id.c +++ b/usr.bin/id/id.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)id.c 8.2 (Berkeley) 2/16/94 * $FreeBSD: src/usr.bin/id/id.c,v 1.12.2.3 2001/12/20 12:09:03 ru Exp $ - * $DragonFly: src/usr.bin/id/id.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/id/id.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ #include @@ -46,22 +46,20 @@ #include #include -int main __P((int, char *[])); -void current __P((void)); -void pline __P((struct passwd *)); -void pretty __P((struct passwd *)); -void group __P((struct passwd *, int)); -void usage __P((void)); -void user __P((struct passwd *)); +int main(int, char *[]); +void current(void); +void pline(struct passwd *); +void pretty(struct passwd *); +void group(struct passwd *, int); +void usage(void); +void user(struct passwd *); struct passwd * who __P((char *)); int isgroups, iswhoami; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct group *gr; struct passwd *pw; @@ -169,8 +167,7 @@ main(argc, argv) } void -pretty(pw) - struct passwd *pw; +pretty(struct passwd *pw) { struct group *gr; u_int eid, rid; @@ -210,7 +207,7 @@ pretty(pw) } void -current() +current(void) { struct group *gr; struct passwd *pw; @@ -251,8 +248,7 @@ current() } void -user(pw) - struct passwd *pw; +user(struct passwd *pw) { struct group *gr; const char *fmt; @@ -279,9 +275,7 @@ user(pw) } void -group(pw, nflag) - struct passwd *pw; - int nflag; +group(struct passwd *pw, int nflag) { struct group *gr; int cnt, id, lastid, ngroups; @@ -316,8 +310,7 @@ group(pw, nflag) } struct passwd * -who(u) - char *u; +who(char *u) { struct passwd *pw; long id; @@ -337,8 +330,7 @@ who(u) } void -pline(pw) - struct passwd *pw; +pline(struct passwd *pw) { u_int rid; @@ -355,7 +347,7 @@ pline(pw) void -usage() +usage(void) { if (isgroups) diff --git a/usr.bin/ipcrm/ipcrm.c b/usr.bin/ipcrm/ipcrm.c index 508bf21cce..d790fdf1e7 100644 --- a/usr.bin/ipcrm/ipcrm.c +++ b/usr.bin/ipcrm/ipcrm.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ipcrm/ipcrm.c,v 1.6 1999/08/28 01:02:14 peter Exp $ - * $DragonFly: src/usr.bin/ipcrm/ipcrm.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ipcrm/ipcrm.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ #include @@ -50,7 +50,7 @@ int signaled; -void usage() +void usage(void) { fprintf(stderr, "%s\n%s\n", "usage: ipcrm [-q msqid] [-m shmid] [-s semid]", @@ -58,9 +58,7 @@ void usage() exit(1); } -int msgrm(key, id) - key_t key; - int id; +int msgrm(key_t key, int id) { if (key) { id = msgget(key, 0); @@ -70,9 +68,7 @@ int msgrm(key, id) return msgctl(id, IPC_RMID, NULL); } -int shmrm(key, id) - key_t key; - int id; +int shmrm(key_t key, int id) { if (key) { id = shmget(key, 0, 0); @@ -82,9 +78,7 @@ int shmrm(key, id) return shmctl(id, IPC_RMID, NULL); } -int semrm(key, id) - key_t key; - int id; +int semrm(key_t key, int id) { union semun arg; @@ -96,15 +90,12 @@ int semrm(key, id) return semctl(id, 0, IPC_RMID, arg); } -void not_configured() +void not_configured(void) { signaled++; } -int main(argc, argv) - int argc; - char *argv[]; - +int main(int argc, char **argv) { int c, result, errflg, target_id; key_t target_key; diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c index 34d15f36e1..69be01a72e 100644 --- a/usr.bin/ipcs/ipcs.c +++ b/usr.bin/ipcs/ipcs.c @@ -25,7 +25,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ipcs/ipcs.c,v 1.12.2.4 2003/04/08 11:01:34 tjr Exp $ - * $DragonFly: src/usr.bin/ipcs/ipcs.c,v 1.3 2003/08/27 03:21:49 dillon Exp $ + * $DragonFly: src/usr.bin/ipcs/ipcs.c,v 1.4 2003/10/04 20:36:46 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -56,7 +56,7 @@ struct msqid_ds *msqids; struct shminfo shminfo; struct shmid_ds *shmsegs; -void usage __P((void)); +void usage(void); static struct nlist symbols[] = { {"_sema"}, @@ -79,8 +79,7 @@ static struct nlist symbols[] = { static kvm_t *kd; char * -fmt_perm(mode) - u_short mode; +fmt_perm(u_short mode) { static char buffer[100]; @@ -100,9 +99,7 @@ fmt_perm(mode) } void -cvt_time(t, buf) - time_t t; - char *buf; +cvt_time(time_t t, char *buf) { struct tm *tm; @@ -128,9 +125,7 @@ cvt_time(t, buf) #define TIME 16 int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int display = SHMINFO | MSGINFO | SEMINFO; int option = 0; @@ -477,7 +472,7 @@ main(argc, argv) } void -usage() +usage(void) { fprintf(stderr, diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c index 12a5a48de3..8f23dbc90c 100644 --- a/usr.bin/join/join.c +++ b/usr.bin/join/join.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)join.c 8.6 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/join/join.c,v 1.10.2.1 2002/06/18 05:14:49 jmallett Exp $ - * $DragonFly: src/usr.bin/join/join.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/join/join.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ #include @@ -105,9 +105,7 @@ void slurp(INPUT *); void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { INPUT *F1, *F2; int aflag, ch, cval, vflag; @@ -261,8 +259,7 @@ main(argc, argv) } void -slurp(F) - INPUT *F; +slurp(INPUT *F) { LINE *lp, *lastlp, tmp; size_t len; @@ -351,9 +348,7 @@ slurp(F) } int -cmp(lp1, fieldno1, lp2, fieldno2) - LINE *lp1, *lp2; - u_long fieldno1, fieldno2; +cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2) { if (lp1->fieldcnt <= fieldno1) return (lp2->fieldcnt <= fieldno2 ? 0 : 1); @@ -363,8 +358,7 @@ cmp(lp1, fieldno1, lp2, fieldno2) } void -joinlines(F1, F2) - INPUT *F1, *F2; +joinlines(INPUT *F1, INPUT *F2) { unsigned int cnt1, cnt2; @@ -384,9 +378,7 @@ joinlines(F1, F2) } void -outoneline(F, lp) - INPUT *F; - LINE *lp; +outoneline(INPUT *F, LINE *lp) { unsigned int cnt; @@ -414,9 +406,7 @@ outoneline(F, lp) } void -outtwoline(F1, lp1, F2, lp2) - INPUT *F1, *F2; - LINE *lp1, *lp2; +outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2) { unsigned int cnt; @@ -452,10 +442,7 @@ outtwoline(F1, lp1, F2, lp2) } void -outfield(lp, fieldno, out_empty) - LINE *lp; - u_long fieldno; - int out_empty; +outfield(LINE *lp, u_long fieldno, int out_empty) { if (needsep++) (void)printf("%c", *tabchar); @@ -478,8 +465,7 @@ outfield(lp, fieldno, out_empty) * fields. */ void -fieldarg(option) - char *option; +fieldarg(char *option) { u_long fieldno, filenum; char *end, *token; @@ -513,8 +499,7 @@ fieldarg(option) } void -obsolete(argv) - char **argv; +obsolete(char **argv) { unsigned int len; char **p, *ap, *t; @@ -599,7 +584,7 @@ jbad: errx(1, "illegal option -- %s", ap); } void -usage() +usage(void) { (void)fprintf(stderr, "%s %s\n%s\n", "usage: join [-a fileno | -v fileno ] [-e string] [-1 field]", diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index b7b002eab3..c1fe2bd6fa 100644 --- a/usr.bin/jot/jot.c +++ b/usr.bin/jot/jot.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)jot.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/jot/jot.c,v 1.13.2.3 2001/12/17 13:49:50 gallatin Exp $ - * $DragonFly: src/usr.bin/jot/jot.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/jot/jot.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ /* @@ -74,16 +74,14 @@ int nofinalnl; const char *sepstring = "\n"; char format[BUFSIZ]; -int main __P((int, char *[])); -void getformat __P((void)); -int getprec __P((char *)); -int putdata __P((double, long)); -static void usage __P((void)); +int main(int, char *[]); +void getformat(void); +int getprec(char *); +int putdata(double, long); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { double xd, yd; long id; @@ -282,9 +280,7 @@ main(argc, argv) } int -putdata(x, notlast) - double x; - long notlast; +putdata(double x, long notlast) { if (boring) @@ -319,7 +315,7 @@ putdata(x, notlast) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: jot [-cnr] [-b word] [-w word] [-s string] [-p precision]", @@ -328,8 +324,7 @@ usage() } int -getprec(str) - char *str; +getprec(char *str) { char *p; char *q; @@ -346,7 +341,7 @@ getprec(str) } void -getformat() +getformat(void) { char *p, *p2; int dot, hash, space, sign, numbers = 0; diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index bc4097f744..528aa72341 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)kdump.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/kdump/kdump.c,v 1.17 1999/12/29 05:05:33 peter Exp $ - * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ + * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.4 2003/10/04 20:36:46 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -61,9 +61,7 @@ struct ktr_header ktr_header; #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, ktrlen, size; register void *m; @@ -154,9 +152,7 @@ main(argc, argv) } } -fread_tail(buf, size, num) - char *buf; - int num, size; +fread_tail(char *buf, int size, int num) { int i; @@ -167,8 +163,7 @@ fread_tail(buf, size, num) return (i); } -dumpheader(kth) - struct ktr_header *kth; +dumpheader(struct ktr_header *kth) { static char unknown[64]; static struct timeval prevtime, temp; @@ -226,8 +221,7 @@ static char *ptrace_ops[] = { "PT_KILL", "PT_STEP", "PT_ATTACH", "PT_DETACH", }; -ktrsyscall(ktr) - register struct ktr_syscall *ktr; +ktrsyscall(register struct ktr_syscall *ktr) { register narg = ktr->ktr_narg; register register_t *ip; @@ -309,8 +303,7 @@ ktrsyscall(ktr) (void)putchar('\n'); } -ktrsysret(ktr) - struct ktr_sysret *ktr; +ktrsysret(struct ktr_sysret *ktr) { register register_t ret = ktr->ktr_retval; register int error = ktr->ktr_error; @@ -344,14 +337,12 @@ ktrsysret(ktr) (void)putchar('\n'); } -ktrnamei(cp, len) - char *cp; +ktrnamei(char *cp, int len) { (void)printf("\"%.*s\"\n", len, cp); } -ktrgenio(ktr, len) - struct ktr_genio *ktr; +ktrgenio(struct ktr_genio *ktr, int len) { register int datalen = len - sizeof (struct ktr_genio); register char *dp = (char *)ktr + sizeof (struct ktr_genio); @@ -422,8 +413,7 @@ char *signames[] = { "USR2", NULL, /* 31 - 32 */ }; -ktrpsig(psig) - struct ktr_psig *psig; +ktrpsig(struct ktr_psig *psig) { (void)printf("SIG%s ", signames[psig->signo]); if (psig->action == SIG_DFL) @@ -433,16 +423,13 @@ ktrpsig(psig) (u_long)psig->action, psig->mask, psig->code); } -ktrcsw(cs) - struct ktr_csw *cs; +ktrcsw(struct ktr_csw *cs) { (void)printf("%s %s\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel"); } -ktruser(len, p) - int len; - unsigned char *p; +ktruser(int len, unsigned char *p) { (void)printf("%d ", len); while (len--) @@ -451,7 +438,7 @@ ktruser(len, p) } -usage() +usage(void) { (void)fprintf(stderr, "usage: kdump [-dnlRT] [-f trfile] [-m maxdata] [-t [cnisuw]]\n"); diff --git a/usr.bin/key/skey.c b/usr.bin/key/skey.c index deb34d143b..a3a7c00662 100644 --- a/usr.bin/key/skey.c +++ b/usr.bin/key/skey.c @@ -10,7 +10,7 @@ * > * * $FreeBSD: src/usr.bin/key/skey.c,v 1.6.6.1 2001/03/04 08:35:48 kris Exp $ - * $DragonFly: src/usr.bin/key/skey.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/key/skey.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ #include @@ -27,12 +27,10 @@ #include -static void usage __P((void)); +static void usage(void); int -main(argc,argv) -int argc; -char *argv[]; +main(int argc, char **argv) { int n,cnt,i; char passwd[256] /* ,passwd2[256] */; @@ -116,7 +114,7 @@ char *argv[]; } static void -usage() +usage(void) { fprintf(stderr,"usage: key [-n count] [/] \n"); exit(1); diff --git a/usr.bin/keyinit/skeyinit.c b/usr.bin/keyinit/skeyinit.c index 4ec4159f93..7453c34b03 100644 --- a/usr.bin/keyinit/skeyinit.c +++ b/usr.bin/keyinit/skeyinit.c @@ -1,5 +1,8 @@ /* change password or add user to S/KEY authentication system. - * S/KEY is a tradmark of Bellcore */ + * S/KEY is a tradmark of Bellcore. + * + * $DragonFly: src/usr.bin/keyinit/skeyinit.c,v 1.2 2003/10/04 20:36:46 hmp Exp $ + */ #include #include @@ -15,9 +18,7 @@ #define NAMELEN 2 int -main(argc,argv) -int argc; -char *argv[]; +main(int argc, char **argv) { struct skey skey; int rval,n,nn,i,defaultsetup; diff --git a/usr.bin/keylogin/keylogin.c b/usr.bin/keylogin/keylogin.c index bb8966e49a..220e493bd5 100644 --- a/usr.bin/keylogin/keylogin.c +++ b/usr.bin/keylogin/keylogin.c @@ -28,6 +28,8 @@ * Mountain View, California 94043 * * @(#)keylogin.c 1.4 91/03/11 Copyr 1986 Sun Micro + * + * $DragonFly: src/usr.bin/keylogin/keylogin.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ /* @@ -45,7 +47,7 @@ #include int -main() +main(void) { char fullname[MAXNETNAMELEN + 1]; struct netstarg netst; diff --git a/usr.bin/keylogout/keylogout.c b/usr.bin/keylogout/keylogout.c index 7b525b1c6a..6e38d4e72e 100644 --- a/usr.bin/keylogout/keylogout.c +++ b/usr.bin/keylogout/keylogout.c @@ -28,7 +28,7 @@ * Mountain View, California 94043 * * $FreeBSD: src/usr.bin/keylogout/keylogout.c,v 1.3 1999/08/28 01:02:29 peter Exp $ - * $DragonFly: src/usr.bin/keylogout/keylogout.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/keylogout/keylogout.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ /* * Copyright (C) 1986, Sun Microsystems, Inc. @@ -43,9 +43,7 @@ #include int -main(argc,argv) - int argc; - char *argv[]; +main(int argc, char **argv) { static char secret[HEXKEYBYTES + 1]; diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index 0560121aa1..039e12adc8 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)ktrace.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/ktrace/ktrace.c,v 1.12.2.3 2001/07/11 00:29:27 mikeh Exp $ - * $DragonFly: src/usr.bin/ktrace/ktrace.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ktrace/ktrace.c,v 1.3 2003/10/04 20:36:46 hmp Exp $ */ #include @@ -50,12 +50,10 @@ #include "ktrace.h" -void no_ktrace __P((int)); -void usage __P((void)); +void no_ktrace(int); +void usage(void); -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { enum { NOTSET, CLEAR, CLEARALL } clear; int append, ch, fd, inherit, ops, pid, pidset, trpoints; @@ -157,8 +155,7 @@ main(argc, argv) exit(0); } -rpid(p) - char *p; +rpid(char *p) { static int first; @@ -174,7 +171,7 @@ rpid(p) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t cnisuw]", @@ -183,8 +180,7 @@ usage() } void -no_ktrace(sig) - int sig; +no_ktrace(int sig) { (void)fprintf(stderr, "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index c189d2d693..289c53a21c 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -32,7 +32,7 @@ * * @(#)subr.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/ktrace/subr.c,v 1.6 1999/08/28 01:02:34 peter Exp $ - * $DragonFly: src/usr.bin/ktrace/subr.c,v 1.3 2003/08/27 03:21:50 dillon Exp $ + * $DragonFly: src/usr.bin/ktrace/subr.c,v 1.4 2003/10/04 20:36:46 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -48,8 +48,7 @@ #include "ktrace.h" -getpoints(s) - char *s; +getpoints(char *s) { int facs = 0; @@ -84,24 +83,21 @@ getpoints(s) return (facs); } -timevaladd(t1, t2) - struct timeval *t1, *t2; +timevaladd(struct timeval *t1, struct timeval *t2) { t1->tv_sec += t2->tv_sec; t1->tv_usec += t2->tv_usec; timevalfix(t1); } -timevalsub(t1, t2) - struct timeval *t1, *t2; +timevalsub(struct timeval *t1, struct timeval *t2) { t1->tv_sec -= t2->tv_sec; t1->tv_usec -= t2->tv_usec; timevalfix(t1); } -timevalfix(t1) - struct timeval *t1; +timevalfix(struct timeval *t1) { if (t1->tv_usec < 0) { t1->tv_sec--; diff --git a/usr.bin/kzip/kzip.c b/usr.bin/kzip/kzip.c index 14b2f56c08..861a1d1a18 100644 --- a/usr.bin/kzip/kzip.c +++ b/usr.bin/kzip/kzip.c @@ -11,7 +11,7 @@ * based on tools/build.c by Linus Torvalds * * $FreeBSD: src/usr.bin/kzip/kzip.c,v 1.13.2.2 2000/07/20 10:35:20 kris Exp $ - * $DragonFly: src/usr.bin/kzip/kzip.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/kzip/kzip.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include @@ -31,7 +31,7 @@ * ends up at 1Mb */ static void -usage() +usage(void) { fprintf(stderr, "usage: kzip [-v] [ -l loadaddr] kernel\n"); exit(1); diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c index 62a06bb1ea..6f93f0de00 100644 --- a/usr.bin/lam/lam.c +++ b/usr.bin/lam/lam.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)lam.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/lam/lam.c,v 1.3.2.3 2001/08/11 03:03:19 mike Exp $ - * $DragonFly: src/usr.bin/lam/lam.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/lam/lam.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ /* @@ -211,7 +211,7 @@ gatherline(struct openfile *ip) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: lam [ -f min.max ] [ -s sepstring ] [ -t c ] file ...", diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 9050955de2..68ac9ca2c3 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/last/last.c,v 1.10.6.11 2002/11/02 23:00:26 mux Exp $ - * $DragonFly: src/usr.bin/last/last.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/last/last.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ * * @(#) Copyright (c) 1987, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)last.c 8.2 (Berkeley) 4/2/94 @@ -115,9 +115,7 @@ usage(void) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; char *p; @@ -193,7 +191,7 @@ main(argc, argv) * read through the wtmp file */ void -wtmp() +wtmp(void) { struct utmp *bp; /* current structure */ struct stat stb; /* stat of file for size */ @@ -229,8 +227,7 @@ wtmp() * process a single wtmp entry */ void -doentry(bp) - struct utmp *bp; +doentry(struct utmp *bp) { struct ttytab *tt, *ttx; /* ttylist entry */ @@ -317,9 +314,7 @@ doentry(bp) * logout type (crash/shutdown) as appropriate. */ void -printentry(bp, tt) - struct utmp *bp; - struct ttytab *tt; +printentry(struct utmp *bp, struct ttytab *tt) { char ct[80]; struct tm *tm; @@ -368,8 +363,7 @@ printentry(bp, tt) * see if want this entry */ int -want(bp) - struct utmp *bp; +want(struct utmp *bp) { ARG *step; @@ -402,9 +396,7 @@ want(bp) * add an entry to a linked list of arguments */ void -addarg(type, arg) - int type; - char *arg; +addarg(int type, char *arg) { ARG *cur; @@ -423,8 +415,7 @@ addarg(type, arg) * off the domain suffix since that's what login(1) does. */ void -hostconv(arg) - char *arg; +hostconv(char *arg) { static int first = 1; static char *hostdot, name[MAXHOSTNAMELEN]; @@ -447,8 +438,7 @@ hostconv(arg) * convert tty to correct name. */ char * -ttyconv(arg) - char *arg; +ttyconv(char *arg) { char *mval; @@ -480,8 +470,7 @@ ttyconv(arg) * Derived from atime_arg1() in usr.bin/touch/touch.c */ time_t -dateconv(arg) - char *arg; +dateconv(char *arg) { time_t timet; struct tm *t; @@ -552,8 +541,7 @@ terr: errx(1, * on interrupt, we inform the user how far we've gotten */ void -onintr(signo) - int signo; +onintr(int signo) { char ct[80]; struct tm *tm; diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c index 9cb14e7268..4ca00dba3d 100644 --- a/usr.bin/lastcomm/lastcomm.c +++ b/usr.bin/lastcomm/lastcomm.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)lastcomm.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/lastcomm/lastcomm.c,v 1.10.2.3 2001/10/01 12:51:15 dd Exp $ - * $DragonFly: src/usr.bin/lastcomm/lastcomm.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/lastcomm/lastcomm.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include @@ -50,11 +50,11 @@ #include #include "pathnames.h" -time_t expand __P((u_int)); -char *flagbits __P((int)); -const char *getdev __P((dev_t)); -int requested __P((char *[], struct acct *)); -static void usage __P((void)); +time_t expand(u_int); +char *flagbits(int); +const char *getdev(dev_t); +int requested(char *[], struct acct *); +static void usage(void); #define AC_UTIME 1 /* user */ #define AC_STIME 2 /* system */ @@ -67,9 +67,7 @@ static void usage __P((void)); #define AC_HZ ((double)AHZ) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { char *p; struct acct ab; @@ -212,8 +210,7 @@ main(argc, argv) } time_t -expand(t) - u_int t; +expand(u_int t) { time_t nt; @@ -227,8 +224,7 @@ expand(t) } char * -flagbits(f) - int f; +flagbits(int f) { static char flags[20] = "-"; char *p; @@ -246,9 +242,7 @@ flagbits(f) } int -requested(argv, acp) - char *argv[]; - struct acct *acp; +requested(char **argv, struct acct *acp) { const char *p; @@ -265,8 +259,7 @@ requested(argv, acp) } const char * -getdev(dev) - dev_t dev; +getdev(dev_t dev) { static dev_t lastdev = (dev_t)-1; static const char *lastname; @@ -281,7 +274,7 @@ getdev(dev) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: lastcomm [-EScesu] [ -f file ] [command ...] [user ...] [tty ...]\n"); diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 6d793a61f9..6b736e0db3 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ldd/ldd.c,v 1.18.2.7 2002/02/27 18:35:53 sobomax Exp $ - * $DragonFly: src/usr.bin/ldd/ldd.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ldd/ldd.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include @@ -41,20 +41,18 @@ #include #include -extern void dump_file __P((const char *)); +extern void dump_file(const char *); extern int error_count; void -usage() +usage(void) { fprintf(stderr, "usage: ldd [-v] [-f format] program ...\n"); exit(1); } int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char **argv) { char *fmt1 = NULL, *fmt2 = NULL; int rval; diff --git a/usr.bin/ldd/sods.c b/usr.bin/ldd/sods.c index ea53be80f7..37678f1b06 100644 --- a/usr.bin/ldd/sods.c +++ b/usr.bin/ldd/sods.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ldd/sods.c,v 1.9.2.2 2001/07/11 23:59:11 obrien Exp $ - * $DragonFly: src/usr.bin/ldd/sods.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/ldd/sods.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include @@ -379,7 +379,7 @@ dump_rels(const char *label, const struct relocation_info *base, } static void -dump_rtsyms() +dump_rtsyms(void) { unsigned long i; @@ -392,7 +392,7 @@ dump_rtsyms() } static void -dump_segs() +dump_segs(void) { printf(" Text segment starts at address %lx\n", origin + N_TXTOFF(*ex)); if (N_GETFLAG(*ex) & EX_DYNAMIC) { @@ -415,7 +415,7 @@ dump_segs() } static void -dump_sods() +dump_sods(void) { long sod_offset; long paths_offset; @@ -517,7 +517,7 @@ dump_sym(const struct nlist *np) } static void -dump_syms() +dump_syms(void) { unsigned long i; diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c index f694535a0e..4b6af797eb 100644 --- a/usr.bin/leave/leave.c +++ b/usr.bin/leave/leave.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)leave.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/leave/leave.c,v 1.5.2.2 2001/07/30 09:43:30 dd Exp $ - * $DragonFly: src/usr.bin/leave/leave.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/leave/leave.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include @@ -44,8 +44,8 @@ #include #include -void doalarm __P((u_int)); -static void usage __P((void)); +void doalarm(u_int); +static void usage(void); /* * leave [[+]hhmm] @@ -55,9 +55,7 @@ static void usage __P((void)); * It nags you like a mother hen. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register u_int secs; register int hours, minutes; @@ -130,8 +128,7 @@ main(argc, argv) } void -doalarm(secs) - u_int secs; +doalarm(u_int secs) { register int bother; time_t daytime; @@ -183,7 +180,7 @@ doalarm(secs) } static void -usage() +usage(void) { fprintf(stderr, "usage: leave [[+]hhmm]\n"); exit(1); diff --git a/usr.bin/lex/ccl.c b/usr.bin/lex/ccl.c index 1fc0dfe2c6..692cc1c829 100644 --- a/usr.bin/lex/ccl.c +++ b/usr.bin/lex/ccl.c @@ -28,15 +28,13 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/ccl.c,v 2.9 93/09/16 20:32:14 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/ccl.c,v 1.5 1999/10/27 07:56:43 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/ccl.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/ccl.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" /* ccladd - add a single character to a ccl */ -void ccladd( cclp, ch ) -int cclp; -int ch; +void ccladd(int cclp, int ch) { int ind, len, newpos, i; @@ -70,7 +68,7 @@ int ch; /* cclinit - return an empty ccl */ -int cclinit() +int cclinit(void) { if ( ++lastccl >= current_maxccls ) { @@ -104,11 +102,10 @@ int cclinit() /* cclnegate - negate the given ccl */ -void cclnegate( cclp ) -int cclp; - { +void cclnegate(int cclp) +{ cclng[cclp] = 1; - } +} /* list_character_set - list the members of a set of characters in CCL form @@ -118,9 +115,7 @@ int cclp; * has a non-zero value in the cset array. */ -void list_character_set( file, cset ) -FILE *file; -int cset[]; +void list_character_set(FILE *file, int *cset) { register int i; diff --git a/usr.bin/lex/dfa.c b/usr.bin/lex/dfa.c index f0f338682c..3c3b01c8cf 100644 --- a/usr.bin/lex/dfa.c +++ b/usr.bin/lex/dfa.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/dfa.c,v 2.26 95/04/20 13:53:14 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/dfa.c,v 1.5 1999/10/27 07:56:43 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/dfa.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/dfa.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -50,9 +50,7 @@ int symfollowset PROTO((int[], int, int, int[])); * indexed by equivalence class. */ -void check_for_backing_up( ds, state ) -int ds; -int state[]; +void check_for_backing_up(int ds, int *state) { if ( (reject && ! dfaacc[ds].dfaacc_set) || (! reject && ! dfaacc[ds].dfaacc_state) ) @@ -100,10 +98,8 @@ int state[]; * accset[1 .. nacc] is the list of accepting numbers for the DFA state. */ -void check_trailing_context( nfa_states, num_states, accset, nacc ) -int *nfa_states, num_states; -int *accset; -int nacc; +void check_trailing_context(int *nfa_states, int num_states, int *accset, + int nacc) { register int i, j; @@ -145,9 +141,7 @@ int nacc; * and writes a report to the given file. */ -void dump_associated_rules( file, ds ) -FILE *file; -int ds; +void dump_associated_rules(FILE *file, int ds) { register int i, j; register int num_associated_rules = 0; @@ -197,9 +191,7 @@ int ds; * is done to the given file. */ -void dump_transitions( file, state ) -FILE *file; -int state[]; +void dump_transitions(FILE *file, int *state) { register int i, ec; int out_char_set[CSIZE]; @@ -246,8 +238,7 @@ int state[]; * hashval is the hash value for the dfa corresponding to the state set. */ -int *epsclosure( t, ns_addr, accset, nacc_addr, hv_addr ) -int *t, *ns_addr, accset[], *nacc_addr, *hv_addr; +int *epsclosure(int *t, int *ns_addr, int *accset, int *nacc_addr, int *hv_addr) { register int stkpos, ns, tsp; int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum; @@ -368,7 +359,7 @@ ADD_STATE(state) \ /* increase_max_dfas - increase the maximum number of DFAs */ -void increase_max_dfas() +void increase_max_dfas(void) { current_max_dfas += MAX_DFAS_INCREMENT; @@ -394,7 +385,7 @@ void increase_max_dfas() * dfa starts out in state #1. */ -void ntod() +void ntod(void) { int *accset, ds, nacc, newds; int sym, hashval, numstates, dsize; @@ -792,8 +783,8 @@ void ntod() * On return, the dfa state number is in newds. */ -int snstods( sns, numstates, accset, nacc, hashval, newds_addr ) -int sns[], numstates, accset[], nacc, hashval, *newds_addr; +int snstods(int *sns, int numstates, int *accset, int nacc, int hashval, + int *newds_addr) { int didsort = 0; register int i, j; @@ -924,8 +915,7 @@ int sns[], numstates, accset[], nacc, hashval, *newds_addr; * int transsym, int nset[current_max_dfa_size] ); */ -int symfollowset( ds, dsize, transsym, nset ) -int ds[], dsize, transsym, nset[]; +int symfollowset(int *ds, int dsize, int transsym, int *nset) { int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist; @@ -1012,9 +1002,7 @@ int ds[], dsize, transsym, nset[]; * int symlist[numecs], int duplist[numecs] ); */ -void sympartition( ds, numstates, symlist, duplist ) -int ds[], numstates; -int symlist[], duplist[]; +void sympartition(int *ds, int numstates, int *symlist, int *duplist) { int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich; diff --git a/usr.bin/lex/ecs.c b/usr.bin/lex/ecs.c index b920b97cd9..593afcc1ee 100644 --- a/usr.bin/lex/ecs.c +++ b/usr.bin/lex/ecs.c @@ -28,13 +28,13 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/ecs.c,v 2.9 93/12/07 10:18:20 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/ecs.c,v 1.5 1999/10/27 07:56:43 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/ecs.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/ecs.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" /* ccl2ecl - convert character classes to set of equivalence classes */ -void ccl2ecl() +void ccl2ecl(void) { int i, ich, newlen, cclp, ccls, cclmec; @@ -75,8 +75,7 @@ void ccl2ecl() * Returned is the number of classes. */ -int cre8ecs( fwd, bck, num ) -int fwd[], bck[], num; +int cre8ecs(int *fwd, int *bck, int num) { int i, j, numcl; @@ -114,9 +113,8 @@ int fwd[], bck[], num; * NUL_mapping is the value which NUL (0) should be mapped to. */ -void mkeccl( ccls, lenccl, fwd, bck, llsiz, NUL_mapping ) -Char ccls[]; -int lenccl, fwd[], bck[], llsiz, NUL_mapping; +void mkeccl(Char *ccls, int lenccl, int *fwd, int *bck, int llsiz, + int NUL_mapping) { int cclp, oldec, newec; int cclm, i, j; @@ -209,8 +207,7 @@ int lenccl, fwd[], bck[], llsiz, NUL_mapping; /* mkechar - create equivalence class for single character */ -void mkechar( tch, fwd, bck ) -int tch, fwd[], bck[]; +void mkechar(int tch, int *fwd, int *bck) { /* If until now the character has been a proper subset of * an equivalence class, break it away to create a new ec diff --git a/usr.bin/lex/gen.c b/usr.bin/lex/gen.c index e90ff063ab..a19a665d82 100644 --- a/usr.bin/lex/gen.c +++ b/usr.bin/lex/gen.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/gen.c,v 2.56 96/05/25 20:43:38 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/gen.c,v 1.5 1999/10/27 07:56:44 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/gen.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/gen.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -61,7 +61,7 @@ static char C_state_decl[] = /* Indent to the current level. */ -void do_indent() +void do_indent(void) { register int i = indent_level * 8; @@ -81,7 +81,7 @@ void do_indent() /* Generate the code to keep backing-up information. */ -void gen_backing_up() +void gen_backing_up(void) { if ( reject || num_backing_up == 0 ) return; @@ -102,7 +102,7 @@ void gen_backing_up() /* Generate the code to perform the backing up. */ -void gen_bu_action() +void gen_bu_action(void) { if ( reject || num_backing_up == 0 ) return; @@ -131,7 +131,7 @@ void gen_bu_action() /* genctbl - generates full speed compressed transition table */ -void genctbl() +void genctbl(void) { register int i; int end_of_buffer_action = num_rules + 1; @@ -227,7 +227,7 @@ void genctbl() /* Generate equivalence-class tables. */ -void genecs() +void genecs(void) { register int i, j; int numrows; @@ -269,7 +269,7 @@ void genecs() /* Generate the code to find the action number. */ -void gen_find_action() +void gen_find_action(void) { if ( fullspd ) indent_puts( "yy_act = yy_current_state[-1].yy_nxt;" ); @@ -408,7 +408,7 @@ void gen_find_action() /* genftbl - generate full transition table */ -void genftbl() +void genftbl(void) { register int i; int end_of_buffer_action = num_rules + 1; @@ -442,8 +442,7 @@ void genftbl() /* Generate the code to find the next compressed-table state. */ -void gen_next_compressed_state( char_map ) -char *char_map; +void gen_next_compressed_state(char *char_map) { indent_put2s( "register YY_CHAR yy_c = %s;", char_map ); @@ -488,7 +487,7 @@ char *char_map; /* Generate the code to find the next match. */ -void gen_next_match() +void gen_next_match(void) { /* NOTE - changes in here should be reflected in gen_next_state() and * gen_NUL_trans(). @@ -597,8 +596,7 @@ void gen_next_match() /* Generate the code to find the next state. */ -void gen_next_state( worry_about_NULs ) -int worry_about_NULs; +void gen_next_state(int worry_about_NULs) { /* NOTE - changes in here should be reflected in gen_next_match() */ char char_map[256]; @@ -663,7 +661,7 @@ int worry_about_NULs; /* Generate the code to make a NUL transition. */ -void gen_NUL_trans() +void gen_NUL_trans(void) { /* NOTE - changes in here should be reflected in gen_next_match() */ /* Only generate a definition for "yy_cp" if we'll generate code * that uses it. Otherwise lint and the like complain. @@ -750,7 +748,7 @@ void gen_NUL_trans() /* Generate the code to find the start state. */ -void gen_start_state() +void gen_start_state(void) { if ( fullspd ) { @@ -783,7 +781,7 @@ void gen_start_state() /* gentabs - generate data statements for the transition tables */ -void gentabs() +void gentabs(void) { int i, j, k, *accset, nacc, *acc_array, total_states; int end_of_buffer_action = num_rules + 1; @@ -1032,8 +1030,7 @@ void gentabs() * current indentation level, adding a final newline. */ -void indent_put2s( fmt, arg ) -char fmt[], arg[]; +void indent_put2s(char *fmt, char *arg) { do_indent(); out_str( fmt, arg ); @@ -1045,8 +1042,7 @@ char fmt[], arg[]; * newline. */ -void indent_puts( str ) -char str[]; +void indent_puts(char *str) { do_indent(); outn( str ); @@ -1056,7 +1052,7 @@ char str[]; /* make_tables - generate transition tables and finishes generating output file */ -void make_tables() +void make_tables(void) { register int i; int did_eof_rule = false; diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 367863f260..da3cff248d 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -4,7 +4,7 @@ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ * $FreeBSD: src/usr.bin/lex/initscan.c,v 1.6 1999/10/27 07:56:45 obrien Exp $ - * $DragonFly: src/usr.bin/lex/initscan.c,v 1.2 2003/06/17 04:29:27 dillon Exp $ + * $DragonFly: src/usr.bin/lex/initscan.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #define FLEX_SCANNER @@ -3639,7 +3639,7 @@ int main() -int yywrap() +int yywrap(void) { if ( --num_input_files > 0 ) { @@ -3654,8 +3654,7 @@ int yywrap() /* set_input_file - open the given file (if NULL, stdin) for scanning */ -void set_input_file( file ) -char *file; +void set_input_file(char *file) { if ( file && strcmp( file, "-" ) ) { @@ -3678,21 +3677,17 @@ char *file; /* Wrapper routines for accessing the scanner's malloc routines. */ -void *flex_alloc( size ) -size_t size; +void *flex_alloc(size_t size) { return (void *) malloc( size ); } -void *flex_realloc( ptr, size ) -void *ptr; -size_t size; +void *flex_realloc(void *ptr, size_t size) { return (void *) realloc( ptr, size ); } -void flex_free( ptr ) -void *ptr; +void flex_free(void *ptr) { if ( ptr ) free( ptr ); diff --git a/usr.bin/lex/main.c b/usr.bin/lex/main.c index 4113ae4b16..b7d54d4409 100644 --- a/usr.bin/lex/main.c +++ b/usr.bin/lex/main.c @@ -31,7 +31,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/main.c,v 2.64 96/05/25 20:42:42 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/main.c,v 1.7 1999/10/27 07:56:45 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/main.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/main.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -128,9 +128,7 @@ static int outfile_created = 0; static char *skelname = NULL; -int main( argc, argv ) -int argc; -char **argv; +int main(int argc, char **argv) { int i; @@ -171,7 +169,7 @@ char **argv; /* check_options - check user-specified options */ -void check_options() +void check_options(void) { int i; @@ -347,9 +345,7 @@ void check_options() * This routine does not return. */ -void flexend( exit_status ) -int exit_status; - +void flexend(int exit_status) { int tblsiz; int unlink(); @@ -579,9 +575,7 @@ _( " %d/%d character classes needed %d/%d words of storage, %d reused\n" ), /* flexinit - initialize flex */ -void flexinit( argc, argv ) -int argc; -char **argv; +void flexinit(int argc, char **argv) { int i, sawcmpflag; char *arg; @@ -848,7 +842,7 @@ char **argv; /* readin - read in the rules section of the input file(s) */ -void readin() +void readin(void) { static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;"; static char yy_nostdinit[] = @@ -1053,7 +1047,7 @@ _( "Variable trailing context rules entail a large performance penalty\n" ) ); /* set_up_initial_allocations - allocate memory for internal tables */ -void set_up_initial_allocations() +void set_up_initial_allocations(void) { current_mns = INITIAL_MNS; firstst = allocate_integer_array( current_mns ); @@ -1108,7 +1102,7 @@ void set_up_initial_allocations() } -void usage() +void usage(void) { FILE *f = stdout; diff --git a/usr.bin/lex/misc.c b/usr.bin/lex/misc.c index 024815d286..75d0a847a2 100644 --- a/usr.bin/lex/misc.c +++ b/usr.bin/lex/misc.c @@ -28,14 +28,12 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/misc.c,v 2.47 95/04/28 11:39:39 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/misc.c,v 1.5 1999/10/27 07:56:45 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/misc.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/misc.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" -void action_define( defname, value ) -char *defname; -int value; +void action_define(char *defname, int value) { char buf[MAXLINE]; @@ -51,8 +49,7 @@ int value; } -void add_action( new_text ) -char *new_text; +void add_action(char *new_text) { int len = strlen( new_text ); @@ -80,9 +77,7 @@ char *new_text; /* allocate_array - allocate memory for an integer array of the given size */ -void *allocate_array( size, element_size ) -int size; -size_t element_size; +void *allocate_array(int size, size_t element_size) { register void *mem; size_t num_bytes = element_size * size; @@ -98,8 +93,7 @@ size_t element_size; /* all_lower - true if a string is all lower-case */ -int all_lower( str ) -register char *str; +int all_lower(register char *str) { while ( *str ) { @@ -114,8 +108,7 @@ register char *str; /* all_upper - true if a string is all upper-case */ -int all_upper( str ) -register char *str; +int all_upper(register char *str) { while ( *str ) { @@ -143,8 +136,7 @@ register char *str; * n - the number of elements of 'v' to be sorted */ -void bubble( v, n ) -int v[], n; +void bubble(int *v, int n) { register int i, j, k; @@ -164,8 +156,7 @@ int v[], n; * and exits. */ -void check_char( c ) -int c; +void check_char(int c) { if ( c >= CSIZE ) lerrsf( _( "bad character '%s' detected in check_char()" ), @@ -181,8 +172,7 @@ int c; /* clower - replace upper-case letter to lower-case */ -Char clower( c ) -register int c; +Char clower(register int c) { return (Char) ((isascii( c ) && isupper( c )) ? tolower( c ) : c); } @@ -190,8 +180,7 @@ register int c; /* copy_string - returns a dynamically allocated copy of a string */ -char *copy_string( str ) -register const char *str; +char *copy_string(register const char *str) { register const char *c1; register char *c2; @@ -219,8 +208,7 @@ register const char *str; * returns a dynamically allocated copy of a (potentially) unsigned string */ -Char *copy_unsigned_string( str ) -register Char *str; +Char *copy_unsigned_string(register Char *str) { register Char *c; Char *copy; @@ -256,9 +244,7 @@ register Char *str; * n - number of elements of v to be sorted */ -void cshell( v, n, special_case_0 ) -Char v[]; -int n, special_case_0; +void cshell(Char *v, int n, int special_case_0) { int gap, i, j, jg; Char k; @@ -290,7 +276,7 @@ int n, special_case_0; /* dataend - finish up a block of data declarations */ -void dataend() +void dataend(void) { if ( datapos > 0 ) dataflush(); @@ -305,7 +291,7 @@ void dataend() /* dataflush - flush generated data statements */ -void dataflush() +void dataflush(void) { outc( '\n' ); @@ -325,8 +311,7 @@ void dataflush() /* flexerror - report an error message and terminate */ -void flexerror( msg ) -const char msg[]; +void flexerror(const char *msg) { fprintf( stderr, "%s: %s\n", program_name, msg ); flexend( 1 ); @@ -335,8 +320,7 @@ const char msg[]; /* flexfatal - report a fatal error message and terminate */ -void flexfatal( msg ) -const char msg[]; +void flexfatal(const char *msg) { fprintf( stderr, _( "%s: fatal internal error, %s\n" ), program_name, msg ); @@ -346,8 +330,7 @@ const char msg[]; /* htoi - convert a hexadecimal digit string to an integer value */ -int htoi( str ) -Char str[]; +int htoi(Char *str) { unsigned int result; @@ -359,9 +342,7 @@ Char str[]; /* lerrif - report an error message formatted with one integer argument */ -void lerrif( msg, arg ) -const char msg[]; -int arg; +void lerrif(const char *msg, int arg) { char errmsg[MAXLINE]; (void) sprintf( errmsg, msg, arg ); @@ -371,8 +352,7 @@ int arg; /* lerrsf - report an error message formatted with one string argument */ -void lerrsf( msg, arg ) -const char msg[], arg[]; +void lerrsf(const char *msg, const char *arg) { char errmsg[MAXLINE]; @@ -383,9 +363,7 @@ const char msg[], arg[]; /* line_directive_out - spit out a "#line" statement */ -void line_directive_out( output_file, do_infile ) -FILE *output_file; -int do_infile; +void line_directive_out(FILE *output_file, int do_infile) { char directive[MAXLINE], filename[MAXLINE]; char *s1, *s2, *s3; @@ -440,7 +418,7 @@ int do_infile; * representing where the user's section 1 definitions end * and the prolog begins */ -void mark_defs1() +void mark_defs1(void) { defs1_offset = 0; action_array[action_index++] = '\0'; @@ -452,7 +430,7 @@ void mark_defs1() /* mark_prolog - mark the current position in the action array as * representing the end of the action prolog */ -void mark_prolog() +void mark_prolog(void) { action_array[action_index++] = '\0'; action_offset = action_index; @@ -464,8 +442,7 @@ void mark_prolog() * * Generates a data statement initializing the current 2-D array to "value". */ -void mk2data( value ) -int value; +void mk2data(int value) { if ( datapos >= NUMDATAITEMS ) { @@ -491,8 +468,7 @@ int value; * Generates a data statement initializing the current array element to * "value". */ -void mkdata( value ) -int value; +void mkdata(int value) { if ( datapos >= NUMDATAITEMS ) { @@ -514,8 +490,7 @@ int value; /* myctoi - return the integer represented by a string of digits */ -int myctoi( array ) -char array[]; +int myctoi(char *array) { int val = 0; @@ -527,8 +502,7 @@ char array[]; /* myesc - return character corresponding to escape sequence */ -Char myesc( array ) -Char array[]; +Char myesc(Char *array) { Char c, esc_char; @@ -607,8 +581,7 @@ Char array[]; /* otoi - convert an octal digit string to an integer value */ -int otoi( str ) -Char str[]; +int otoi(Char *str) { unsigned int result; @@ -621,39 +594,31 @@ Char str[]; * generated scanner, keeping track of the line count. */ -void out( str ) -const char str[]; +void out(const char *str) { fputs( str, stdout ); out_line_count( str ); } -void out_dec( fmt, n ) -const char fmt[]; -int n; +void out_dec(const char *fmt, int n) { printf( fmt, n ); out_line_count( fmt ); } -void out_dec2( fmt, n1, n2 ) -const char fmt[]; -int n1, n2; +void out_dec2(const char *fmt, int n1, int n2) { printf( fmt, n1, n2 ); out_line_count( fmt ); } -void out_hex( fmt, x ) -const char fmt[]; -unsigned int x; +void out_hex(const char *fmt, unsigned int x) { printf( fmt, x ); out_line_count( fmt ); } -void out_line_count( str ) -const char str[]; +void out_line_count(const char *str) { register int i; @@ -662,16 +627,14 @@ const char str[]; ++out_linenum; } -void out_str( fmt, str ) -const char fmt[], str[]; +void out_str(const char *fmt, const char *str) { printf( fmt, str ); out_line_count( fmt ); out_line_count( str ); } -void out_str3( fmt, s1, s2, s3 ) -const char fmt[], s1[], s2[], s3[]; +void out_str3(const char *fmt, const char *s1, const char *s2, const char *s3) { printf( fmt, s1, s2, s3 ); out_line_count( fmt ); @@ -680,17 +643,14 @@ const char fmt[], s1[], s2[], s3[]; out_line_count( s3 ); } -void out_str_dec( fmt, str, n ) -const char fmt[], str[]; -int n; +void out_str_dec(const char *fmt, const char *str, int n) { printf( fmt, str, n ); out_line_count( fmt ); out_line_count( str ); } -void outc( c ) -int c; +void outc(int c) { putc( c, stdout ); @@ -698,8 +658,7 @@ int c; ++out_linenum; } -void outn( str ) -const char str[]; +void outn(const char *str) { puts( str ); out_line_count( str ); @@ -712,8 +671,7 @@ const char str[]; * The returned string is in static storage. */ -char *readable_form( c ) -register int c; +char *readable_form(register int c) { static char rform[10]; @@ -754,10 +712,7 @@ register int c; /* reallocate_array - increase the size of a dynamic array */ -void *reallocate_array( array, size, element_size ) -void *array; -int size; -size_t element_size; +void *reallocate_array(void *array, int size, size_t element_size) { register void *new_array; size_t num_bytes = element_size * size; @@ -776,7 +731,7 @@ size_t element_size; * Copies skelfile or skel array to stdout until a line beginning with * "%%" or EOF is found. */ -void skelout() +void skelout(void) { char buf_storage[MAXLINE]; char *buf = buf_storage; @@ -834,8 +789,7 @@ void skelout() * element_n. Formats the output with spaces and carriage returns. */ -void transition_struct_out( element_v, element_n ) -int element_v, element_n; +void transition_struct_out(int element_v, int element_n) { out_dec2( " {%4d,%4d },", element_v, element_n ); @@ -856,8 +810,7 @@ int element_v, element_n; /* The following is only needed when building flex's parser using certain * broken versions of bison. */ -void *yy_flex_xmalloc( size ) -int size; +void *yy_flex_xmalloc(int size) { void *result = flex_alloc( (size_t) size ); @@ -874,9 +827,7 @@ int size; * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero. */ -void zero_out( region_ptr, size_in_bytes ) -char *region_ptr; -size_t size_in_bytes; +void zero_out(char *region_ptr, size_t size_in_bytes ) { register char *rp, *rp_end; diff --git a/usr.bin/lex/nfa.c b/usr.bin/lex/nfa.c index b308256d3c..2b4e010476 100644 --- a/usr.bin/lex/nfa.c +++ b/usr.bin/lex/nfa.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/nfa.c,v 2.17 95/03/04 16:11:42 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/nfa.c,v 1.5 1999/10/27 07:56:46 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/nfa.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/nfa.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -44,8 +44,7 @@ void mkxtion PROTO((int, int)); * accepting_number becomes mach's accepting number. */ -void add_accept( mach, accepting_number ) -int mach, accepting_number; +void add_accept(int mach, int accepting_number) { /* Hang the accepting number off an epsilon state. if it is associated * with a state that has a non-epsilon out-transition, then the state @@ -76,8 +75,7 @@ int mach, accepting_number; * num - the number of copies of singl to be present in newsng */ -int copysingl( singl, num ) -int singl, num; +int copysingl(int singl, int num) { int copy, i; @@ -92,9 +90,7 @@ int singl, num; /* dumpnfa - debugging routine to write out an nfa */ -void dumpnfa( state1 ) -int state1; - +void dumpnfa(int state1) { int sym, tsp1, tsp2, anum, ns; @@ -147,8 +143,7 @@ int state1; * states accessible by the arrays firstst and lastst */ -int dupmachine( mach ) -int mach; +int dupmachine(int mach) { int i, init, state_offset; int state = 0; @@ -197,8 +192,7 @@ int mach; * context has variable length. */ -void finish_rule( mach, variable_trail_rule, headcnt, trailcnt ) -int mach, variable_trail_rule, headcnt, trailcnt; +void finish_rule(int mach, int variable_trail_rule, int headcnt, int trailcnt) { char action_text[MAXLINE]; @@ -292,8 +286,7 @@ int mach, variable_trail_rule, headcnt, trailcnt; * FIRST is set to new by the operation. last is unmolested. */ -int link_machines( first, last ) -int first, last; +int link_machines(int first, int last) { if ( first == NIL ) return last; @@ -320,8 +313,7 @@ int first, last; * The "beginning" states are the epsilon closure of the first state */ -void mark_beginning_as_normal( mach ) -register int mach; +void mark_beginning_as_normal(register int mach) { switch ( state_type[mach] ) { @@ -366,8 +358,7 @@ register int mach; * more mkbranch's. Compare with mkor() */ -int mkbranch( first, second ) -int first, second; +int mkbranch(int first, int second) { int eps; @@ -394,8 +385,7 @@ int first, second; * new - a new state which matches the closure of "state" */ -int mkclos( state ) -int state; +int mkclos(int state) { return mkopt( mkposcl( state ) ); } @@ -415,8 +405,7 @@ int state; * 2. mach is destroyed by the call */ -int mkopt( mach ) -int mach; +int mkopt(int mach) { int eps; @@ -453,8 +442,7 @@ int mach; * the number of epsilon states needed */ -int mkor( first, second ) -int first, second; +int mkor(int first, int second) { int eps, orend; @@ -513,8 +501,7 @@ int first, second; * new - a machine matching the positive closure of "state" */ -int mkposcl( state ) -int state; +int mkposcl(int state) { int eps; @@ -545,8 +532,7 @@ int state; * if "ub" is INFINITY then "new" matches "lb" or more occurrences of "mach" */ -int mkrep( mach, lb, ub ) -int mach, lb, ub; +int mkrep(int mach, int lb, int ub) { int base_mach, tail, copy, i; @@ -592,8 +578,7 @@ int mach, lb, ub; * that it admittedly is) */ -int mkstate( sym ) -int sym; +int mkstate(int sym) { if ( ++lastnfa >= current_mns ) { @@ -670,8 +655,7 @@ int sym; * stateto - the state to which the transition is to be made */ -void mkxtion( statefrom, stateto ) -int statefrom, stateto; +void mkxtion(int statefrom, int stateto) { if ( trans1[statefrom] == NO_TRANSITION ) trans1[statefrom] = stateto; @@ -689,7 +673,7 @@ int statefrom, stateto; /* new_rule - initialize for a new rule */ -void new_rule() +void new_rule(void) { if ( ++num_rules >= current_max_rules ) { diff --git a/usr.bin/lex/sym.c b/usr.bin/lex/sym.c index 92054cd9d0..ad202dbe6f 100644 --- a/usr.bin/lex/sym.c +++ b/usr.bin/lex/sym.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/sym.c,v 2.19 95/03/04 16:11:04 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/sym.c,v 1.5 1999/10/27 07:56:47 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/sym.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/sym.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -50,12 +50,8 @@ struct hash_entry *findsym(); * -1 is returned if the symbol already exists, and the change not made. */ -int addsym( sym, str_def, int_def, table, table_size ) -register char sym[]; -char *str_def; -int int_def; -hash_table table; -int table_size; +int addsym(register char *sym, char *str_def, int int_def, hash_table table, + int table_size) { int hash_val = hashfunct( sym, table_size ); register struct hash_entry *sym_entry = table[hash_val]; @@ -100,9 +96,7 @@ int table_size; /* cclinstal - save the text of a character class */ -void cclinstal( ccltxt, cclnum ) -Char ccltxt[]; -int cclnum; +void cclinstal(Char *ccltxt, int cclnum) { /* We don't bother checking the return status because we are not * called unless the symbol is new. @@ -120,8 +114,7 @@ int cclnum; * Returns 0 if there's no CCL associated with the text. */ -int ccllookup( ccltxt ) -Char ccltxt[]; +int ccllookup(Char *ccltxt) { return findsym( (char *) ccltxt, ccltab, CCL_HASH_SIZE )->int_val; } @@ -129,10 +122,7 @@ Char ccltxt[]; /* findsym - find symbol in symbol table */ -struct hash_entry *findsym( sym, table, table_size ) -register char sym[]; -hash_table table; -int table_size; +struct hash_entry *findsym(register char *sym, hash_table table, int table_size) { static struct hash_entry empty_entry = { @@ -155,9 +145,7 @@ int table_size; /* hashfunct - compute the hash value for "str" and hash size "hash_size" */ -int hashfunct( str, hash_size ) -register char str[]; -int hash_size; +int hashfunct(register char *str, int hash_size) { register int hashval; register int locstr; @@ -177,9 +165,7 @@ int hash_size; /* ndinstal - install a name definition */ -void ndinstal( name, definition ) -char name[]; -Char definition[]; +void ndinstal(char *name, Char *definition) { char *copy_string(); Char *copy_unsigned_string(); @@ -196,8 +182,7 @@ Char definition[]; * Returns a nil pointer if the name definition does not exist. */ -Char *ndlookup( nd ) -char nd[]; +Char *ndlookup(char *nd) { return (Char *) findsym( nd, ndtbl, NAME_TABLE_HASH_SIZE )->str_val; } @@ -205,7 +190,7 @@ char nd[]; /* scextend - increase the maximum number of start conditions */ -void scextend() +void scextend(void) { current_max_scs += MAX_SCS_INCREMENT; @@ -225,9 +210,7 @@ void scextend() * The start condition is "exclusive" if xcluflg is true. */ -void scinstal( str, xcluflg ) -char str[]; -int xcluflg; +void scinstal(char *str, int xcluflg) { char *copy_string(); @@ -257,8 +240,7 @@ int xcluflg; * Returns 0 if no such start condition. */ -int sclookup( str ) -char str[]; +int sclookup(char *str) { return findsym( str, sctbl, START_COND_HASH_SIZE )->int_val; } diff --git a/usr.bin/lex/tblcmp.c b/usr.bin/lex/tblcmp.c index 96dcc0a60e..5c0e78384c 100644 --- a/usr.bin/lex/tblcmp.c +++ b/usr.bin/lex/tblcmp.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/tblcmp.c,v 2.11 94/11/05 17:08:28 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/tblcmp.c,v 1.5 1999/10/27 07:56:47 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/tblcmp.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/tblcmp.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include "flexdef.h" @@ -77,8 +77,7 @@ int tbldiff PROTO((int[], int, int[])); * cost only one difference. */ -void bldtbl( state, statenum, totaltrans, comstate, comfreq ) -int state[], statenum, totaltrans, comstate, comfreq; +void bldtbl(int *state, int statenum, int totaltrans, int comstate, int comfreq) { int extptr, extrct[2][CSIZE + 1]; int mindiff, minprot, i, d; @@ -227,7 +226,7 @@ int state[], statenum, totaltrans, comstate, comfreq; * classes. */ -void cmptmps() +void cmptmps(void) { int tmpstorage[CSIZE + 1]; register int *tmp = tmpstorage, i, j; @@ -300,7 +299,7 @@ void cmptmps() /* expand_nxt_chk - expand the next check arrays */ -void expand_nxt_chk() +void expand_nxt_chk(void) { register int old_max = current_max_xpairs; @@ -335,8 +334,7 @@ void expand_nxt_chk() * and an action number will be added in [-1]. */ -int find_table_space( state, numtrans ) -int *state, numtrans; +int find_table_space(int *state, int numtrans) { /* Firstfree is the position of the first possible occurrence of two * consecutive unused records in the chk and nxt arrays. @@ -434,7 +432,7 @@ int *state, numtrans; * Initializes "firstfree" to be one beyond the end of the table. Initializes * all "chk" entries to be zero. */ -void inittbl() +void inittbl(void) { register int i; @@ -466,7 +464,7 @@ void inittbl() /* mkdeftbl - make the default, "jam" table entries */ -void mkdeftbl() +void mkdeftbl(void) { int i; @@ -516,9 +514,8 @@ void mkdeftbl() * state array. */ -void mkentry( state, numchars, statenum, deflink, totaltrans ) -register int *state; -int numchars, statenum, deflink, totaltrans; +void mkentry(register int *state, int numchars, int statenum, int deflink, + int totaltrans) { register int minec, maxec, i, baseaddr; int tblbase, tbllast; @@ -644,8 +641,7 @@ int numchars, statenum, deflink, totaltrans; * has only one out-transition */ -void mk1tbl( state, sym, onenxt, onedef ) -int state, sym, onenxt, onedef; +void mk1tbl(int state, int sym, int onenxt, int onedef) { if ( firstfree < sym ) firstfree = sym; @@ -671,8 +667,7 @@ int state, sym, onenxt, onedef; /* mkprot - create new proto entry */ -void mkprot( state, statenum, comstate ) -int state[], statenum, comstate; +void mkprot(int *state, int statenum, int comstate ) { int i, slot, tblbase; @@ -710,8 +705,7 @@ int state[], statenum, comstate; * to it */ -void mktemplate( state, statenum, comstate ) -int state[], statenum, comstate; +void mktemplate(int *state, int statenum, int comstate) { int i, numdiff, tmpbase, tmp[CSIZE + 1]; Char transset[CSIZE + 1]; @@ -763,8 +757,7 @@ int state[], statenum, comstate; /* mv2front - move proto queue element to front of queue */ -void mv2front( qelm ) -int qelm; +void mv2front(int qelm) { if ( firstprot != qelm ) { @@ -791,8 +784,7 @@ int qelm; * Transnum is the number of out-transitions for the state. */ -void place_state( state, statenum, transnum ) -int *state, statenum, transnum; +void place_state(int *state, int statenum, int transnum ) { register int i; register int *state_ptr; @@ -835,8 +827,7 @@ int *state, statenum, transnum; * no room, we process the sucker right now. */ -void stack1( statenum, sym, nextstate, deflink ) -int statenum, sym, nextstate, deflink; +void stack1(int statenum, int sym, int nextstate, int deflink) { if ( onesp >= ONE_STACK_SIZE - 1 ) mk1tbl( statenum, sym, nextstate, deflink ); @@ -866,8 +857,7 @@ int statenum, sym, nextstate, deflink; * number is "numecs" minus the number of "SAME_TRANS" entries in "ext". */ -int tbldiff( state, pr, ext ) -int state[], pr, ext[]; +int tbldiff(int *state, int pr, int *ext) { register int i, *sp = state, *ep = ext, *protp; register int numdiff = 0; diff --git a/usr.bin/lex/yylex.c b/usr.bin/lex/yylex.c index 918d8c9e09..2b5d2472c3 100644 --- a/usr.bin/lex/yylex.c +++ b/usr.bin/lex/yylex.c @@ -28,7 +28,7 @@ /* $Header: /home/daffy/u0/vern/flex/RCS/yylex.c,v 2.13 95/03/04 16:10:41 vern Exp $ */ /* $FreeBSD: src/usr.bin/lex/yylex.c,v 1.5 1999/10/27 07:56:48 obrien Exp $ */ -/* $DragonFly: src/usr.bin/lex/yylex.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/lex/yylex.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ #include #include "flexdef.h" @@ -37,7 +37,7 @@ /* yylex - scan for a regular expression token */ -int yylex() +int yylex(void) { int toktype; static int beglin = false; diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c index ab215f5803..96b86b781c 100644 --- a/usr.bin/lock/lock.c +++ b/usr.bin/lock/lock.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1980, 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)lock.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/lock/lock.c,v 1.8.2.1 2002/09/15 22:32:56 dd Exp $ - * $DragonFly: src/usr.bin/lock/lock.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/lock/lock.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */ /* @@ -79,9 +79,7 @@ int vtyunlock; /* Unlock flag and code. */ /*ARGSUSED*/ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct passwd *pw; struct timeval timval; @@ -233,7 +231,7 @@ main(argc, argv) static void -usage() +usage(void) { (void)fprintf(stderr, "usage: lock [-npv] [-t timeout]\n"); exit(1); diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 69777e2b01..af5cc6ffd8 100644 --- a/usr.bin/logger/logger.c +++ b/usr.bin/logger/logger.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)logger.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/logger/logger.c,v 1.5.2.3 2001/09/06 17:38:57 ru Exp $ - * $DragonFly: src/usr.bin/logger/logger.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/logger/logger.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include @@ -51,10 +51,10 @@ #define SYSLOG_NAMES #include -int decode __P((char *, CODE *)); -int pencode __P((char *)); -static void logmessage __P((int, char *, char *)); -static void usage __P((void)); +int decode(char *, CODE *); +int pencode(char *); +static void logmessage(int, char *, char *); +static void usage(void); struct socks { int sock; @@ -76,9 +76,7 @@ int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ * log. */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, logflags, pri; char *tag, *host, buf[1024]; @@ -227,8 +225,7 @@ logmessage(int pri, char *host, char *buf) * Decode a symbolic name to a numeric value */ int -pencode(s) - register char *s; +pencode(register char *s) { char *save; int fac, lev; @@ -252,9 +249,7 @@ pencode(s) } int -decode(name, codetab) - char *name; - CODE *codetab; +decode(char *name, CODE *codetab) { register CODE *c; @@ -269,7 +264,7 @@ decode(name, codetab) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: %s\n", "logger [-46Ais] [-f file] [-h host] [-p pri] [-t tag] [message ...]" diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 7773f938ca..1de008db8d 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -32,7 +32,7 @@ * * @(#)login.c 8.4 (Berkeley) 4/2/94 * $FreeBSD: src/usr.bin/login/login.c,v 1.51.2.15 2003/04/29 14:10:41 des Exp $ - * $DragonFly: src/usr.bin/login/login.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/login/login.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #if 0 @@ -143,9 +143,7 @@ char *term, *envinit[1], *hostname, *passwd_prompt, *prompt, *tty, *username; char full_hostname[MAXHOSTNAMELEN]; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { extern char **environ; struct group *gr; @@ -726,7 +724,7 @@ main(argc, argv) } static int -auth_traditional() +auth_traditional(void) { int rval; char *p; @@ -760,7 +758,7 @@ auth_traditional() * fall back to a different authentication mechanism. */ static int -auth_pam() +auth_pam(void) { const char *tmpl_user; const void *item; @@ -851,7 +849,7 @@ auth_pam() } static int -export_pam_environment() +export_pam_environment(void) { char **pp; @@ -871,8 +869,7 @@ export_pam_environment() * Solaris pam_putenv(3) man page. */ static int -ok_to_export(s) - const char *s; +ok_to_export(const char *s) { static const char *noexport[] = { "SHELL", "HOME", "LOGNAME", "MAIL", "CDPATH", @@ -895,7 +892,7 @@ ok_to_export(s) #endif /* USE_PAM */ static void -usage() +usage(void) { (void)fprintf(stderr, "usage: login [-fp] [-h hostname] [username]\n"); @@ -909,7 +906,7 @@ usage() #define NBUFSIZ UT_NAMESIZE + 64 void -getloginname() +getloginname(void) { int ch; char *p; @@ -939,8 +936,7 @@ getloginname() } int -rootterm(ttyn) - char *ttyn; +rootterm(char *ttyn) { struct ttyent *t; @@ -950,15 +946,13 @@ rootterm(ttyn) volatile int motdinterrupt; void -sigint(signo) - int signo __unused; +sigint(int signo __unused) { motdinterrupt = 1; } void -motd(motdfile) - char *motdfile; +motd(char *motdfile) { int fd, nchars; sig_t oldint; @@ -976,8 +970,7 @@ motd(motdfile) /* ARGSUSED */ void -timedout(signo) - int signo; +timedout(int signo) { longjmp(timeout_buf, signo); @@ -985,8 +978,7 @@ timedout(signo) void -dolastlog(quiet) - int quiet; +dolastlog(int quiet) { struct lastlog ll; int fd; @@ -1022,8 +1014,7 @@ dolastlog(quiet) } void -badlogin(name) - char *name; +badlogin(char *name) { if (failures == 0) @@ -1048,8 +1039,7 @@ badlogin(name) #define UNKNOWN "su" char * -stypeof(ttyid) - char *ttyid; +stypeof(char *ttyid) { struct ttyent *t; @@ -1062,10 +1052,7 @@ stypeof(ttyid) } void -refused(msg, rtype, lout) - char *msg; - char *rtype; - int lout; +refused(char *msg, char *rtype, int lout) { if (msg != NULL) @@ -1081,8 +1068,7 @@ refused(msg, rtype, lout) } void -sleepexit(eval) - int eval; +sleepexit(int eval) { (void)sleep(5); diff --git a/usr.bin/login/login_access.c b/usr.bin/login/login_access.c index cfb24d2e2e..7785adf792 100644 --- a/usr.bin/login/login_access.c +++ b/usr.bin/login/login_access.c @@ -5,6 +5,8 @@ * non-networked logins. Diagnostics are reported through syslog(3). * * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + * + * $DragonFly: src/usr.bin/login/login_access.c,v 1.2 2003/10/04 20:36:48 hmp Exp $ */ #ifdef LOGIN_ACCESS @@ -42,9 +44,7 @@ static int string_match(); /* login_access - match username/group and host/tty with access control file */ int -login_access(user, from) -char *user; -char *from; +login_access(char *user, char *from) { FILE *fp; char line[BUFSIZ]; @@ -103,10 +103,7 @@ char *from; /* list_match - match an item against a list of tokens with exceptions */ -static int list_match(list, item, match_fn) -char *list; -char *item; -int (*match_fn) (); +static int list_match(char *list, char *item, int (*match_fn)()) { char *tok; int match = NO; @@ -137,10 +134,7 @@ int (*match_fn) (); /* netgroup_match - match group against machine or user */ -static int netgroup_match(group, machine, user) -gid_t group; -char *machine; -char *user; +static int netgroup_match(gid_t group, char *machine, char *user) { #ifdef NIS static char *mydomain = 0; @@ -156,9 +150,7 @@ char *user; /* user_match - match a username against one token */ -static int user_match(tok, string) -char *tok; -char *string; +static int user_match(char *tok, char *string) { struct group *group; int i; @@ -183,9 +175,7 @@ char *string; /* from_match - match a host or tty against a list of tokens */ -static int from_match(tok, string) -char *tok; -char *string; +static int from_match(char *tok, char *string) { int tok_len; int str_len; @@ -219,9 +209,7 @@ char *string; /* string_match - match a string against one token */ -static int string_match(tok, string) -char *tok; -char *string; +static int string_match(char *tok, char *string) { /* diff --git a/usr.bin/login/login_fbtab.c b/usr.bin/login/login_fbtab.c index 93c88776a8..319019b28f 100644 --- a/usr.bin/login/login_fbtab.c +++ b/usr.bin/login/login_fbtab.c @@ -14,7 +14,7 @@ * merchantibility and fitness for any particular purpose. ************************************************************************/ /* $FreeBSD: src/usr.bin/login/login_fbtab.c,v 1.6.2.4 2001/12/14 10:58:18 rwatson Exp $ */ -/* $DragonFly: src/usr.bin/login/login_fbtab.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ */ +/* $DragonFly: src/usr.bin/login/login_fbtab.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* SYNOPSIS void login_fbtab(tty, uid, gid) @@ -71,18 +71,15 @@ #include #include "pathnames.h" -void login_protect __P((char *, char *, int, uid_t, gid_t)); -void login_fbtab __P((char *tty, uid_t uid, gid_t gid)); +void login_protect(char *, char *, int, uid_t, gid_t); +void login_fbtab(char *tty, uid_t uid, gid_t gid); #define WSPACE " \t\n" /* login_fbtab - apply protections specified in /etc/fbtab or logindevperm */ void -login_fbtab(tty, uid, gid) -char *tty; -uid_t uid; -gid_t gid; +login_fbtab(char *tty, uid_t uid, gid_t gid) { FILE *fp; char buf[BUFSIZ]; @@ -122,12 +119,7 @@ gid_t gid; /* login_protect - protect one device entry */ void -login_protect(table, pattern, mask, uid, gid) - char *table; - char *pattern; - int mask; - uid_t uid; - gid_t gid; +login_protect(char *table, char *pattern, int mask, uid_t uid, gid_t gid) { glob_t gl; char *path; diff --git a/usr.bin/logname/logname.c b/usr.bin/logname/logname.c index bae5d80644..5269cbcf03 100644 --- a/usr.bin/logname/logname.c +++ b/usr.bin/logname/logname.c @@ -32,6 +32,8 @@ * * @(#) Copyright (c) 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)logname.c 8.2 (Berkeley) 4/3/94 + * + * $DragonFly: src/usr.bin/logname/logname.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include @@ -41,12 +43,10 @@ #include #include -void usage __P((void)); +void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; char *p; @@ -67,7 +67,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: logname\n"); exit(1); diff --git a/usr.bin/look/look.c b/usr.bin/look/look.c index 0821a05fce..82c3a208b3 100644 --- a/usr.bin/look/look.c +++ b/usr.bin/look/look.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)look.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/look/look.c,v 1.11 1999/08/28 01:03:14 peter Exp $ - * $DragonFly: src/usr.bin/look/look.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/look/look.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -81,18 +81,16 @@ int dflag, fflag; -char *binary_search __P((unsigned char *, unsigned char *, unsigned char *)); -int compare __P((unsigned char *, unsigned char *, unsigned char *)); -char *linear_search __P((unsigned char *, unsigned char *, unsigned char *)); -int look __P((unsigned char *, unsigned char *, unsigned char *)); -void print_from __P((unsigned char *, unsigned char *, unsigned char *)); +char *binary_search(unsigned char *, unsigned char *, unsigned char *); +int compare(unsigned char *, unsigned char *, unsigned char *); +char *linear_search(unsigned char *, unsigned char *, unsigned char *); +int look(unsigned char *, unsigned char *, unsigned char *); +void print_from(unsigned char *, unsigned char *, unsigned char *); -static void usage __P((void)); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat sb; int ch, fd, termchar, match; @@ -148,8 +146,7 @@ main(argc, argv) } int -look(string, front, back) - unsigned char *string, *front, *back; +look(unsigned char *string, unsigned char *front, unsigned char *back) { register int ch; register unsigned char *readp, *writep; @@ -216,8 +213,8 @@ look(string, front, back) while (p < back && *p++ != '\n'); char * -binary_search(string, front, back) - register unsigned char *string, *front, *back; +binary_search(register unsigned char *string, register unsigned char *front, + register unsigned char *back) { register unsigned char *p; @@ -251,8 +248,7 @@ binary_search(string, front, back) * o front is before or at the first line to be printed. */ char * -linear_search(string, front, back) - unsigned char *string, *front, *back; +linear_search(unsigned char *string, unsigned char *front, unsigned char *back) { while (front < back) { switch (compare(string, front, back)) { @@ -274,8 +270,8 @@ linear_search(string, front, back) * Print as many lines as match string, starting at front. */ void -print_from(string, front, back) - register unsigned char *string, *front, *back; +print_from(register unsigned char *string, register unsigned char *front, + register unsigned char *back) { for (; front < back && compare(string, front, back) == EQUAL; ++front) { for (; front < back && *front != '\n'; ++front) @@ -300,8 +296,8 @@ print_from(string, front, back) * "back" terminated). */ int -compare(s1, s2, back) - register unsigned char *s1, *s2, *back; +compare(register unsigned char *s1, register unsigned char *s2, + register unsigned char *back) { register int ch; @@ -323,7 +319,7 @@ compare(s1, s2, back) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: look [-df] [-t char] string [file ...]\n"); exit(2); diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c index 487a947e1d..042c94c09b 100644 --- a/usr.bin/mail/aux.c +++ b/usr.bin/mail/aux.c @@ -32,7 +32,7 @@ * * @(#)aux.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/aux.c,v 1.4.6.4 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/aux.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/aux.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include @@ -52,8 +52,7 @@ static char *save2str(char *, char *); * Return a pointer to a dynamic copy of the argument. */ char * -savestr(str) - char *str; +savestr(char *str) { char *new; int size = strlen(str) + 1; @@ -67,8 +66,7 @@ savestr(str) * Make a copy of new argument incorporating old one. */ char * -save2str(str, old) - char *str, *old; +save2str(char *str, char *old) { char *new; int newsize = strlen(str) + 1; @@ -90,8 +88,7 @@ save2str(str, old) * back to the system mailbox on exit. */ void -touch(mp) - struct message *mp; +touch(struct message *mp) { mp->m_flag |= MTOUCH; @@ -104,8 +101,7 @@ touch(mp) * Return true if it is. */ int -isdir(name) - char name[]; +isdir(char *name) { struct stat sbuf; @@ -118,8 +114,7 @@ isdir(name) * Count the number of arguments in the given string raw list. */ int -argcount(argv) - char **argv; +argcount(char **argv) { char **ap; @@ -133,9 +128,7 @@ argcount(argv) * pointer (or NULL if the desired header field is not available). */ char * -hfield(field, mp) - const char *field; - struct message *mp; +hfield(const char *field, struct message *mp) { FILE *ibuf; char linebuf[LINESIZE]; @@ -164,11 +157,7 @@ hfield(field, mp) * Must deal with \ continuations & other such fraud. */ int -gethfield(f, linebuf, rem, colon) - FILE *f; - char linebuf[]; - int rem; - char **colon; +gethfield(FILE *f, char *linebuf, int rem, char **colon) { char line2[LINESIZE]; char *cp, *cp2; @@ -223,10 +212,7 @@ gethfield(f, linebuf, rem, colon) */ char* -ishfield(linebuf, colon, field) - char linebuf[]; - char *colon; - const char *field; +ishfield(char *linebuf, char *colon, const char *field) { char *cp = colon; @@ -246,10 +232,7 @@ ishfield(linebuf, colon, field) * dsize: space left in buffer (including space for NULL) */ void -istrncpy(dest, src, dsize) - char *dest; - const char *src; - size_t dsize; +istrncpy(char *dest, const char *src, size_t dsize) { strlcpy(dest, src, dsize); @@ -278,8 +261,7 @@ static struct sstack sstack[SSTACK_SIZE]; * that they are no longer reading from a tty (in all probability). */ int -source(arglist) - char **arglist; +source(char **arglist) { FILE *fi; char *cp; @@ -311,7 +293,7 @@ source(arglist) * Update the "sourcing" flag as appropriate. */ int -unstack() +unstack(void) { if (ssp <= 0) { printf("\"Source\" stack over-pop.\n"); @@ -335,8 +317,7 @@ unstack() * This is nifty for the shell. */ void -alter(name) - char *name; +alter(char *name) { struct stat sb; struct timeval tv[2]; @@ -355,9 +336,7 @@ alter(name) * before returning it. */ char * -nameof(mp, reptype) - struct message *mp; - int reptype; +nameof(struct message *mp, int reptype) { char *cp, *cp2; @@ -378,8 +357,7 @@ nameof(mp, reptype) * Ignore it. */ char * -skip_comment(cp) - char *cp; +skip_comment(char *cp) { int nesting = 1; @@ -405,8 +383,7 @@ skip_comment(cp) * of "host-phrase." */ char * -skin(name) - char *name; +skin(char *name) { char *nbuf, *bufend, *cp, *cp2; int c, gotlt, lastsp; @@ -516,9 +493,7 @@ skin(name) * 2 -- get sender's name for Reply */ char * -name1(mp, reptype) - struct message *mp; - int reptype; +name1(struct message *mp, int reptype) { char namebuf[LINESIZE]; char linebuf[LINESIZE]; @@ -577,9 +552,7 @@ newname: * Count the occurances of c in str */ int -charcount(str, c) - char *str; - int c; +charcount(char *str, int c) { char *cp; int i; @@ -594,9 +567,7 @@ charcount(str, c) * See if the given header field is supposed to be ignored. */ int -isign(field, ignore) - const char *field; - struct ignoretab ignore[2]; +isign(const char *field, struct ignoretab ignore[2]) { char realfld[LINESIZE]; @@ -614,9 +585,7 @@ isign(field, ignore) } int -member(realfield, table) - char *realfield; - struct ignoretab *table; +member(char *realfield, struct ignoretab *table) { struct ignore *igp; diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c index 0702d944e6..5d6340a45f 100644 --- a/usr.bin/mail/cmd1.c +++ b/usr.bin/mail/cmd1.c @@ -32,7 +32,7 @@ * * @(#)cmd1.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/cmd1.c,v 1.3.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/cmd1.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/cmd1.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -54,8 +54,7 @@ extern const struct cmd cmdtab[]; static int screen; int -headers(msgvec) - int *msgvec; +headers(int *msgvec) { int n, mesg, flag, size; struct message *mp; @@ -94,8 +93,7 @@ headers(msgvec) * Scroll to the next/previous screen */ int -scroll(arg) - char arg[]; +scroll(char *arg) { int s, size; int cur[1]; @@ -133,7 +131,7 @@ scroll(arg) * Compute screen size. */ int -screensize() +screensize(void) { int s; char *cp; @@ -148,8 +146,7 @@ screensize() * in the passed message list. */ int -from(msgvec) - int *msgvec; +from(int *msgvec) { int *ip; @@ -165,8 +162,7 @@ from(msgvec) * This is a slight improvement to the standard one. */ void -printhead(mesg) - int mesg; +printhead(int mesg) { struct message *mp; char headline[LINESIZE], wcount[LINESIZE], *subjline, dispc, curind; @@ -212,7 +208,7 @@ printhead(mesg) * Print out the value of dot. */ int -pdot() +pdot(void) { printf("%d\n", dot - &message[0] + 1); return (0); @@ -222,7 +218,7 @@ pdot() * Print out all the possible commands. */ int -pcmdlist() +pcmdlist(void) { const struct cmd *cp; int cc; @@ -246,8 +242,7 @@ pcmdlist() * Paginate messages, honor ignored fields. */ int -more(msgvec) - int *msgvec; +more(int *msgvec) { return (type1(msgvec, 1, 1)); @@ -257,8 +252,7 @@ more(msgvec) * Paginate messages, even printing ignored fields. */ int -More(msgvec) - int *msgvec; +More(int *msgvec) { return (type1(msgvec, 0, 1)); @@ -268,8 +262,7 @@ More(msgvec) * Type out messages, honor ignored fields. */ int -type(msgvec) - int *msgvec; +type(int *msgvec) { return (type1(msgvec, 1, 0)); @@ -279,8 +272,7 @@ type(msgvec) * Type out messages, even printing ignored fields. */ int -Type(msgvec) - int *msgvec; +Type(int *msgvec) { return (type1(msgvec, 0, 0)); @@ -291,9 +283,7 @@ Type(msgvec) */ jmp_buf pipestop; int -type1(msgvec, doign, page) - int *msgvec; - int doign, page; +type1(int *msgvec, int doign, int page) { int nlines, *ip; struct message *mp; @@ -354,8 +344,7 @@ close_pipe: */ /*ARGSUSED*/ void -brokpipe(signo) - int signo; +brokpipe(int signo) { longjmp(pipestop, 1); } @@ -366,8 +355,7 @@ brokpipe(signo) * and defaults to 5. */ int -top(msgvec) - int *msgvec; +top(int *msgvec) { int *ip; struct message *mp; @@ -408,8 +396,7 @@ top(msgvec) * get mboxed. */ int -stouch(msgvec) - int msgvec[]; +stouch(int *msgvec) { int *ip; @@ -425,8 +412,7 @@ stouch(msgvec) * Make sure all passed messages get mboxed. */ int -mboxit(msgvec) - int msgvec[]; +mboxit(int *msgvec) { int *ip; @@ -442,7 +428,7 @@ mboxit(msgvec) * List the folders the user currently has. */ int -folders() +folders(void) { char dirname[PATHSIZE]; char *cmd; @@ -462,8 +448,7 @@ folders() * come in since we started reading mail. */ int -inc(v) - void *v; +inc(void *v) { int nmsg, mdot; diff --git a/usr.bin/mail/cmd2.c b/usr.bin/mail/cmd2.c index 38ad38929f..3c392dc93c 100644 --- a/usr.bin/mail/cmd2.c +++ b/usr.bin/mail/cmd2.c @@ -32,7 +32,7 @@ * * @(#)cmd2.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/cmd2.c,v 1.5.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/cmd2.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/cmd2.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -53,8 +53,7 @@ extern int wait_status; * If given as first command with no arguments, print first message. */ int -next(msgvec) - int *msgvec; +next(int *msgvec) { struct message *mp; int *ip, *ip2, list[2], mdot; @@ -131,8 +130,7 @@ hitit: * so we can discard when the user quits. */ int -save(str) - char str[]; +save(char *str) { return (save1(str, 1, "save", saveignore)); @@ -142,8 +140,7 @@ save(str) * Copy a message to a file without affected its saved-ness */ int -copycmd(str) - char str[]; +copycmd(char *str) { return (save1(str, 0, "copy", saveignore)); @@ -154,11 +151,7 @@ copycmd(str) * If mark is true, mark the message "saved." */ int -save1(str, mark, cmd, ignore) - char str[]; - int mark; - const char *cmd; - struct ignoretab *ignore; +save1(char *str, int mark, const char *cmd, struct ignoretab *ignore) { struct message *mp; char *file; @@ -215,8 +208,7 @@ save1(str, mark, cmd, ignore) * file name, minus header and trailing blank line. */ int -swrite(str) - char str[]; +swrite(char *str) { return (save1(str, 1, "write", ignoreall)); @@ -232,9 +224,7 @@ swrite(str) */ char * -snarf(linebuf, flag) - char linebuf[]; - int *flag; +snarf(char *linebuf, int *flag) { char *cp; @@ -270,8 +260,7 @@ snarf(linebuf, flag) * Delete messages. */ int -delete(msgvec) - int msgvec[]; +delete(int *msgvec) { delm(msgvec); @@ -282,8 +271,7 @@ delete(msgvec) * Delete messages, then type the new dot. */ int -deltype(msgvec) - int msgvec[]; +deltype(int *msgvec) { int list[2]; int lastdot; @@ -308,8 +296,7 @@ deltype(msgvec) * Internal interface. */ int -delm(msgvec) - int *msgvec; +delm(int *msgvec) { struct message *mp; int *ip, last; @@ -346,8 +333,7 @@ delm(msgvec) * Undelete the indicated messages. */ int -undelete_messages(msgvec) - int *msgvec; +undelete_messages(int *msgvec) { struct message *mp; int *ip; @@ -365,7 +351,7 @@ undelete_messages(msgvec) * Interactively dump core on "core" */ int -core() +core(void) { int pid; @@ -391,8 +377,7 @@ core() * Clobber as many bytes of stack as the user requests. */ int -clobber(argv) - char **argv; +clobber(char **argv) { int times; @@ -408,8 +393,7 @@ clobber(argv) * Clobber the stack. */ void -clob1(n) - int n; +clob1(int n) { char buf[512]; char *cp; @@ -426,8 +410,7 @@ clob1(n) * If no arguments, print the current list of retained fields. */ int -retfield(list) - char *list[]; +retfield(char **list) { return (ignore1(list, ignore + 1, "retained")); @@ -438,34 +421,28 @@ retfield(list) * If no arguments, print the current list of ignored fields. */ int -igfield(list) - char *list[]; +igfield(char **list) { return (ignore1(list, ignore, "ignored")); } int -saveretfield(list) - char *list[]; +saveretfield(char **list) { return (ignore1(list, saveignore + 1, "retained")); } int -saveigfield(list) - char *list[]; +saveigfield(char **list) { return (ignore1(list, saveignore, "ignored")); } int -ignore1(list, tab, which) - char *list[]; - struct ignoretab *tab; - const char *which; +ignore1(char **list, struct ignoretab *tab, const char *which) { char field[LINESIZE]; int h; @@ -494,9 +471,7 @@ ignore1(list, tab, which) * Print out all currently retained fields. */ int -igshow(tab, which) - struct ignoretab *tab; - const char *which; +igshow(struct ignoretab *tab, const char *which) { int h; struct ignore *igp; @@ -522,8 +497,7 @@ igshow(tab, which) * Compare two names for sorting ignored field list. */ int -igcomp(l, r) - const void *l, *r; +igcomp(const void *l, const void *r) { return (strcmp(*(const char **)l, *(const char **)r)); diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c index 82fba04422..5b72c20fd3 100644 --- a/usr.bin/mail/cmd3.c +++ b/usr.bin/mail/cmd3.c @@ -32,7 +32,7 @@ * * @(#)cmd3.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/cmd3.c,v 1.4.6.4 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/cmd3.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/cmd3.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -49,8 +49,7 @@ * and forking a sh -c */ int -shell(str) - char *str; +shell(char *str) { sig_t sigint = signal(SIGINT, SIG_IGN); char *sh; @@ -73,8 +72,7 @@ shell(str) */ /*ARGSUSED*/ int -dosh(str) - char *str; +dosh(char *str) { sig_t sigint = signal(SIGINT, SIG_IGN); char *sh; @@ -92,9 +90,7 @@ dosh(str) * last issued command where possible. */ int -bangexp(str, strsize) - char *str; - size_t strsize; +bangexp(char *str, size_t strsize) { char bangbuf[BUFSIZ]; static char lastbang[BUFSIZ]; @@ -148,7 +144,7 @@ overf: */ int -help() +help(void) { int c; FILE *f; @@ -167,8 +163,7 @@ help() * Change user's working directory. */ int -schdir(arglist) - char **arglist; +schdir(char **arglist) { char *cp; @@ -187,8 +182,7 @@ schdir(arglist) } int -respond(msgvec) - int *msgvec; +respond(int *msgvec) { if (value("Replyall") == NULL && value("flipr") == NULL) return (dorespond(msgvec)); @@ -201,8 +195,7 @@ respond(msgvec) * message header and send them off to mail1() */ int -dorespond(msgvec) - int *msgvec; +dorespond(int *msgvec) { struct message *mp; char *cp, *rcv, *replyto; @@ -267,8 +260,7 @@ dorespond(msgvec) * it does not already. */ char * -reedit(subj) - char *subj; +reedit(char *subj) { char *newsubj; @@ -288,8 +280,7 @@ reedit(subj) * back to the system mailbox. */ int -preserve(msgvec) - int *msgvec; +preserve(int *msgvec) { int *ip, mesg; struct message *mp; @@ -312,8 +303,7 @@ preserve(msgvec) * Mark all given messages as unread. */ int -unread(msgvec) - int msgvec[]; +unread(int *msgvec) { int *ip; @@ -329,8 +319,7 @@ unread(msgvec) * Print the size of each message. */ int -messize(msgvec) - int *msgvec; +messize(int *msgvec) { struct message *mp; int *ip, mesg; @@ -348,8 +337,7 @@ messize(msgvec) * by returning an error. */ int -rexit(e) - int e; +rexit(int e) { if (sourcing) return (1); @@ -362,8 +350,7 @@ rexit(e) * of csh. */ int -set(arglist) - char **arglist; +set(char **arglist) { struct var *vp; char *cp, *cp2; @@ -409,8 +396,7 @@ set(arglist) * Unset a bunch of variable values. */ int -unset(arglist) - char **arglist; +unset(char **arglist) { struct var *vp, *vp2; int errs, h; @@ -449,8 +435,7 @@ unset(arglist) * Put add users to a group. */ int -group(argv) - char **argv; +group(char **argv) { struct grouphead *gh; struct group *gp; @@ -505,8 +490,7 @@ group(argv) * order. */ void -sort(list) - char **list; +sort(char **list) { char **ap; @@ -522,8 +506,7 @@ sort(list) * qsort. */ int -diction(a, b) - const void *a, *b; +diction(const void *a, const void *b) { return (strcmp(*(const char **)a, *(const char **)b)); } @@ -534,8 +517,7 @@ diction(a, b) /*ARGSUSED*/ int -null(e) - int e; +null(int e) { return (0); } @@ -545,8 +527,7 @@ null(e) * the current file. */ int -file(argv) - char **argv; +file(char **argv) { if (argv[0] == NULL) { @@ -563,8 +544,7 @@ file(argv) * Expand file names like echo */ int -echo(argv) - char **argv; +echo(char **argv) { char **ap, *cp; @@ -581,8 +561,7 @@ echo(argv) } int -Respond(msgvec) - int *msgvec; +Respond(int *msgvec) { if (value("Replyall") == NULL && value("flipr") == NULL) return (doRespond(msgvec)); @@ -596,8 +575,7 @@ Respond(msgvec) * reply. */ int -doRespond(msgvec) - int msgvec[]; +doRespond(int *msgvec) { struct header head; struct message *mp; @@ -634,8 +612,7 @@ doRespond(msgvec) * .mailrc and do some things if sending, others if receiving. */ int -ifcmd(argv) - char **argv; +ifcmd(char **argv) { char *cp; @@ -666,7 +643,7 @@ ifcmd(argv) * flip over the conditional flag. */ int -elsecmd() +elsecmd(void) { switch (cond) { @@ -694,7 +671,7 @@ elsecmd() * End of if statement. Just set cond back to anything. */ int -endifcmd() +endifcmd(void) { if (cond == CANY) { @@ -709,8 +686,7 @@ endifcmd() * Set the list of alternate names. */ int -alternates(namelist) - char **namelist; +alternates(char **namelist) { int c; char **ap, **ap2, *cp; diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c index 2e8927045f..576f3bdc88 100644 --- a/usr.bin/mail/collect.c +++ b/usr.bin/mail/collect.c @@ -32,7 +32,7 @@ * * @(#)collect.c 8.2 (Berkeley) 4/19/94 * $FreeBSD: src/usr.bin/mail/collect.c,v 1.4.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/collect.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/collect.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -70,9 +70,7 @@ static int colljmp_p; /* whether to long jump */ static jmp_buf collabort; /* To end collection with error */ FILE * -collect(hp, printheaders) - struct header *hp; - int printheaders; +collect(struct header *hp, int printheaders) { FILE *fbuf; int lc, cc, escape, eofcount, fd, c, t; @@ -495,10 +493,7 @@ out: * Write a file, ex-like if f set. */ int -exwrite(name, fp, f) - char name[]; - FILE *fp; - int f; +exwrite(char *name, FILE *fp, int f) { FILE *of; int c, lc; @@ -543,9 +538,7 @@ exwrite(name, fp, f) * On return, make the edit file the new temp file. */ void -mesedit(fp, c) - FILE *fp; - int c; +mesedit(FILE *fp, int c) { sig_t sigint = signal(SIGINT, SIG_IGN); FILE *nf = run_editor(fp, (off_t)-1, c, 0); @@ -565,9 +558,7 @@ mesedit(fp, c) * Sh -c must return 0 to accept the new message. */ void -mespipe(fp, cmd) - FILE *fp; - char cmd[]; +mespipe(FILE *fp, char *cmd) { FILE *nf; int fd; @@ -617,11 +608,7 @@ out: * should shift over and 'f' if not. */ int -forward(ms, fp, fn, f) - char ms[]; - FILE *fp; - char *fn; - int f; +forward(char *ms, FILE *fp, char *fn, int f) { int *msgvec; struct ignoretab *ig; @@ -665,8 +652,7 @@ forward(ms, fp, fn, f) */ /*ARGSUSED*/ void -collstop(s) - int s; +collstop(int s) { sig_t old_action = signal(s, SIG_DFL); sigset_t nset; @@ -690,8 +676,7 @@ collstop(s) */ /*ARGSUSED*/ void -collint(s) - int s; +collint(int s) { /* * the control flow is subtle, because we can be called from ~q. @@ -714,8 +699,7 @@ collint(s) /*ARGSUSED*/ void -collhup(s) - int s; +collhup(int s) { rewind(collf); savedeadletter(collf); @@ -727,8 +711,7 @@ collhup(s) } void -savedeadletter(fp) - FILE *fp; +savedeadletter(FILE *fp) { FILE *dbuf; int c; diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c index 3c9cd0baa0..f874b32a88 100644 --- a/usr.bin/mail/edit.c +++ b/usr.bin/mail/edit.c @@ -32,7 +32,7 @@ * * @(#)edit.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/edit.c,v 1.2.6.4 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/edit.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/edit.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -49,8 +49,7 @@ * Edit a message list. */ int -editor(msgvec) - int *msgvec; +editor(int *msgvec) { return (edit1(msgvec, 'e')); @@ -60,8 +59,7 @@ editor(msgvec) * Invoke the visual editor on a message list. */ int -visual(msgvec) - int *msgvec; +visual(int *msgvec) { return (edit1(msgvec, 'v')); @@ -73,9 +71,7 @@ visual(msgvec) * We get the editor from the stuff above. */ int -edit1(msgvec, type) - int *msgvec; - int type; +edit1(int *msgvec, int type) { int c, i; FILE *fp; @@ -137,10 +133,7 @@ edit1(msgvec, type) * "Type" is 'e' for _PATH_EX, 'v' for _PATH_VI. */ FILE * -run_editor(fp, size, type, readonly) - FILE *fp; - off_t size; - int type, readonly; +run_editor(FILE *fp, off_t size, int type, int readonly) { FILE *nf = NULL; int t; diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index cd83534e8b..5c743cf5c4 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -32,7 +32,7 @@ * * @(#)fio.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/fio.c,v 1.2.6.4 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/fio.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/fio.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -56,9 +56,7 @@ extern int wait_status; * Set up the input pointers while copying the mail file into /tmp. */ void -setptr(ibuf, offset) - FILE *ibuf; - off_t offset; +setptr(FILE *ibuf, off_t offset) { int c, count; char *cp, *cp2; @@ -163,10 +161,7 @@ setptr(ibuf, offset) * characters written, including the newline if requested. */ int -putline(obuf, linebuf, outlf) - FILE *obuf; - char *linebuf; - int outlf; +putline(FILE *obuf, char *linebuf, int outlf) { int c; @@ -187,10 +182,7 @@ putline(obuf, linebuf, outlf) * include the newline (or carriage return) at the end. */ int -readline(ibuf, linebuf, linesize) - FILE *ibuf; - char *linebuf; - int linesize; +readline(FILE *ibuf, char *linebuf, int linesize) { int n; @@ -210,8 +202,7 @@ readline(ibuf, linebuf, linesize) * passed message pointer. */ FILE * -setinput(mp) - struct message *mp; +setinput(struct message *mp) { (void)fflush(otf); @@ -226,9 +217,7 @@ setinput(mp) * a dynamically allocated message structure. */ void -makemessage(f, omsgCount) - FILE *f; - int omsgCount; +makemessage(FILE *f, int omsgCount) { size_t size; struct message *nmessage; @@ -258,9 +247,7 @@ makemessage(f, omsgCount) * If the write fails, return 1, else 0 */ int -append(mp, f) - struct message *mp; - FILE *f; +append(struct message *mp, FILE *f) { return (fwrite((char *)mp, sizeof(*mp), 1, f) != 1); } @@ -269,8 +256,7 @@ append(mp, f) * Delete a file, but only if the file is a plain file. */ int -rm(name) - char *name; +rm(char *name) { struct stat sb; @@ -289,7 +275,7 @@ static sigset_t nset, oset; * Hold signals SIGHUP, SIGINT, and SIGQUIT. */ void -holdsigs() +holdsigs(void) { if (sigdepth++ == 0) { @@ -305,7 +291,7 @@ holdsigs() * Release signals SIGHUP, SIGINT, and SIGQUIT. */ void -relsesigs() +relsesigs(void) { if (--sigdepth == 0) @@ -317,8 +303,7 @@ relsesigs() * the passed buffer. */ off_t -fsize(iob) - FILE *iob; +fsize(FILE *iob) { struct stat sbuf; @@ -339,8 +324,7 @@ fsize(iob) * Return the file name as a dynamic string. */ char * -expand(name) - char *name; +expand(char *name) { char xname[PATHSIZE]; char cmdbuf[PATHSIZE]; /* also used for file names */ @@ -432,9 +416,7 @@ expand(name) * Determine the current folder directory name. */ int -getfold(name, namelen) - char *name; - int namelen; +getfold(char *name, int namelen) { char *folder; int copylen; @@ -453,7 +435,7 @@ getfold(name, namelen) * Return the name of the dead.letter file. */ char * -getdeadletter() +getdeadletter(void) { char *cp; diff --git a/usr.bin/mail/getname.c b/usr.bin/mail/getname.c index 81eed3535b..8929de5213 100644 --- a/usr.bin/mail/getname.c +++ b/usr.bin/mail/getname.c @@ -32,7 +32,7 @@ * * @(#)getname.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/getname.c,v 1.1.1.1.14.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/getname.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/getname.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -45,8 +45,7 @@ * Search the passwd file for a uid. Return name on success, NULL on failure. */ char * -getname(uid) - int uid; +getname(int uid) { struct passwd *pw; @@ -60,8 +59,7 @@ getname(uid) * on error. */ int -getuserid(name) - char name[]; +getuserid(char *name) { struct passwd *pw; diff --git a/usr.bin/mail/head.c b/usr.bin/mail/head.c index c4145fae85..6020d42e0b 100644 --- a/usr.bin/mail/head.c +++ b/usr.bin/mail/head.c @@ -32,7 +32,7 @@ * * @(#)head.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/head.c,v 1.1.1.1.14.4 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/head.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/head.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -50,8 +50,7 @@ * accomodate all funny formats. */ int -ishead(linebuf) - char linebuf[]; +ishead(char *linebuf) { struct headline hl; char parbuf[BUFSIZ]; @@ -75,8 +74,7 @@ ishead(linebuf) /*ARGSUSED*/ void -fail(linebuf, reason) - const char *linebuf, *reason; +fail(const char *linebuf, const char *reason) { /* @@ -93,9 +91,7 @@ fail(linebuf, reason) * structure. Actually, it scans. */ void -parse(line, hl, pbuf) - char line[], pbuf[]; - struct headline *hl; +parse(char *line, struct headline *hl, char *pbuf) { char *cp, *sp; char word[LINESIZE]; @@ -127,9 +123,7 @@ parse(line, hl, pbuf) * the left string into it. */ char * -copyin(src, space) - char *src; - char **space; +copyin(char *src, char **space) { char *cp, *top; @@ -176,8 +170,7 @@ static char *date_formats[] = { }; int -isdate(date) - char date[]; +isdate(char *date) { int i; @@ -193,8 +186,7 @@ isdate(date) * Return 1 if they match, 0 if they don't */ int -cmatch(cp, tp) - char *cp, *tp; +cmatch(char *cp, char *tp) { while (*cp != '\0' && *tp != '\0') @@ -249,8 +241,7 @@ cmatch(cp, tp) * or NULL if none follow. */ char * -nextword(wp, wbuf) - char *wp, *wbuf; +nextword(char *wp, char *wbuf) { int c; diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index bd4c827cf7..91db230b2e 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -32,7 +32,7 @@ * * @(#)lex.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/lex.c,v 1.5.6.5 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/lex.c,v 1.3 2003/08/22 19:38:36 asmodai Exp $ + * $DragonFly: src/usr.bin/mail/lex.c,v 1.4 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -58,8 +58,7 @@ extern const char *version; * signficance for mbox and so forth. */ int -setfile(name) - char *name; +setfile(char *name) { FILE *ibuf; int i, fd; @@ -156,7 +155,7 @@ nomail: * started reading mail. */ int -incfile() +incfile(void) { off_t newsize; int omsgCount = msgCount; @@ -189,7 +188,7 @@ int reset_on_stop; /* do a reset() if stopped */ * print no prompt. */ void -commands() +commands(void) { int n, eofloop = 0; char linebuf[LINESIZE]; @@ -266,9 +265,7 @@ commands() * Contxt is non-zero if called while composing mail. */ int -execute(linebuf, contxt) - char linebuf[]; - int contxt; +execute(char *linebuf, int contxt) { char word[LINESIZE]; char *arglist[MAXARGC]; @@ -463,8 +460,7 @@ out: * lists to message list functions. */ void -setmsize(sz) - int sz; +setmsize(int sz) { if (msgvec != NULL) @@ -478,8 +474,7 @@ setmsize(sz) */ const struct cmd * -lex(word) - char word[]; +lex(char *word) { const struct cmd *cp; @@ -505,8 +500,7 @@ lex(word) * Return true if yep. */ int -isprefix(as1, as2) - const char *as1, *as2; +isprefix(const char *as1, const char *as2) { const char *s1, *s2; @@ -530,8 +524,7 @@ int inithdr; /* am printing startup headers */ /*ARGSUSED*/ void -intr(s) - int s; +intr(int s) { noreset = 0; @@ -555,8 +548,7 @@ intr(s) * When we wake up after ^Z, reprint the prompt. */ void -stop(s) - int s; +stop(int s) { sig_t old_action = signal(s, SIG_DFL); sigset_t nset; @@ -578,8 +570,7 @@ stop(s) */ /*ARGSUSED*/ void -hangup(s) - int s; +hangup(int s) { /* nothing to do? */ @@ -591,7 +582,7 @@ hangup(s) * give the message count, and print a header listing. */ void -announce() +announce(void) { int vec[2], mdot; @@ -611,8 +602,7 @@ announce() * Return a likely place to set dot. */ int -newfileinfo(omsgCount) - int omsgCount; +newfileinfo(int omsgCount) { struct message *mp; int u, n, mdot, d, s; @@ -674,8 +664,7 @@ newfileinfo(omsgCount) /*ARGSUSED*/ int -pversion(e) - int e; +pversion(int e) { printf("Version %s\n", version); @@ -686,8 +675,7 @@ pversion(e) * Load a file of user definitions. */ void -load(name) - char *name; +load(char *name) { FILE *in, *oldin; diff --git a/usr.bin/mail/list.c b/usr.bin/mail/list.c index 42cfb1f2d0..749e58f000 100644 --- a/usr.bin/mail/list.c +++ b/usr.bin/mail/list.c @@ -32,7 +32,7 @@ * * @(#)list.c 8.4 (Berkeley) 5/1/95 * $FreeBSD: src/usr.bin/mail/list.c,v 1.2.12.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/list.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/list.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -52,9 +52,7 @@ * Returns the count of messages picked up or -1 on error. */ int -getmsglist(buf, vector, flags) - char *buf; - int *vector, flags; +getmsglist(char *buf, int *vector, int flags) { int *ip; struct message *mp; @@ -111,9 +109,7 @@ struct coltab { static int lastcolmod; int -markall(buf, f) - char buf[]; - int f; +markall(char *buf, int f) { char **np; int i; @@ -343,8 +339,7 @@ number: * value. */ int -evalcol(col) - int col; +evalcol(int col) { struct coltab *colp; @@ -362,8 +357,7 @@ evalcol(col) * has to be undeleted. */ int -check(mesg, f) - int mesg, f; +check(int mesg, int f) { struct message *mp; @@ -384,10 +378,7 @@ check(mesg, f) * for a RAWLIST. */ int -getrawlist(line, argv, argc) - char line[]; - char **argv; - int argc; +getrawlist(char *line, char **argv, int argc) { char c, *cp, *cp2, quotec; int argn; @@ -511,8 +502,7 @@ struct lex { }; int -scan(sp) - char **sp; +scan(char **sp) { char *cp, *cp2; int c; @@ -613,8 +603,7 @@ scan(sp) * Unscan the named token by pushing it onto the regret stack. */ void -regret(token) - int token; +regret(int token) { if (++regretp >= REGDEP) errx(1, "Too many regrets"); @@ -628,7 +617,7 @@ regret(token) * Reset all the scanner global variables. */ void -scaninit() +scaninit(void) { regretp = -1; } @@ -638,8 +627,7 @@ scaninit() * its message number. */ int -first(f, m) - int f, m; +first(int f, int m) { struct message *mp; @@ -661,9 +649,7 @@ first(f, m) * if so. */ int -matchsender(str, mesg) - char *str; - int mesg; +matchsender(char *str, int mesg) { char *cp; @@ -683,9 +669,7 @@ matchsender(str, mesg) static char *to_fields[] = { "to", "cc", "bcc", NULL }; int -matchto(str, mesg) - char *str; - int mesg; +matchto(char *str, int mesg) { struct message *mp; char *cp, **to; @@ -721,9 +705,7 @@ matchto(str, mesg) char lastscan[STRINGLEN]; int -matchfield(str, mesg) - char *str; - int mesg; +matchfield(char *str, int mesg) { struct message *mp; char *cp, *cp2; @@ -761,8 +743,7 @@ matchfield(str, mesg) * Mark the named message by setting its mark bit. */ void -mark(mesg) - int mesg; +mark(int mesg) { int i; @@ -776,8 +757,7 @@ mark(mesg) * Unmark the named message. */ void -unmark(mesg) - int mesg; +unmark(int mesg) { int i; @@ -791,8 +771,7 @@ unmark(mesg) * Return the message number corresponding to the passed meta character. */ int -metamess(meta, f) - int meta, f; +metamess(int meta, int f) { int c, m; struct message *mp; diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c index 165c77fa9b..cd0c1804ec 100644 --- a/usr.bin/mail/main.c +++ b/usr.bin/mail/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.2 (Berkeley) 4/20/95 * $FreeBSD: src/usr.bin/mail/main.c,v 1.6.2.5 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/main.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/main.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -51,9 +51,7 @@ jmp_buf hdrjmp; extern const char *version; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int i; struct name *to, *cc, *bcc, *smopts; @@ -263,8 +261,7 @@ Usage: %s [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ */ /*ARGSUSED*/ void -hdrstop(signo) - int signo; +hdrstop(int signo) { (void)fflush(stdout); @@ -281,7 +278,7 @@ hdrstop(signo) * Width is either 80 or ws_col; */ void -setscreensize() +setscreensize(void) { struct termios tbuf; struct winsize ws; diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c index 7ebf81a7e3..c3b19f5295 100644 --- a/usr.bin/mail/names.c +++ b/usr.bin/mail/names.c @@ -32,7 +32,7 @@ * * @(#)names.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/names.c,v 1.4.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/names.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/names.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -51,9 +51,7 @@ * name and return it. */ struct name * -nalloc(str, ntype) - char str[]; - int ntype; +nalloc(char *str, int ntype) { struct name *np; @@ -69,8 +67,7 @@ nalloc(str, ntype) * Find the tail of a list and return it. */ struct name * -tailof(name) - struct name *name; +tailof(struct name *name) { struct name *np; @@ -88,9 +85,7 @@ tailof(name) * Return the list or NULL if none found. */ struct name * -extract(line, ntype) - char line[]; - int ntype; +extract(char *line, int ntype) { char *cp, *nbuf; struct name *top, *np, *t; @@ -119,9 +114,7 @@ extract(line, ntype) * Turn a list of names into a string of the same names. */ char * -detract(np, ntype) - struct name *np; - int ntype; +detract(struct name *np, int ntype) { int s, comma; char *cp, *top; @@ -165,8 +158,7 @@ detract(np, ntype) * Throw away things between ()'s, and take anything between <>. */ char * -yankword(ap, wbuf) - char *ap, wbuf[]; +yankword(char *ap, char *wbuf) { char *cp, *cp2; @@ -214,10 +206,7 @@ yankword(ap, wbuf) * program and removed. */ struct name * -outof(names, fo, hp) - struct name *names; - FILE *fo; - struct header *hp; +outof(struct name *names, FILE *fo, struct header *hp) { int c, ispipe; struct name *np, *top; @@ -367,8 +356,7 @@ cant: * be a filename. We cheat with .'s to allow path names like ./... */ int -isfileaddr(name) - char *name; +isfileaddr(char *name) { char *cp; @@ -391,8 +379,7 @@ isfileaddr(name) */ struct name * -usermap(names) - struct name *names; +usermap(struct name *names) { struct name *new, *np, *cp; struct grouphead *gh; @@ -426,10 +413,7 @@ usermap(names) */ struct name * -gexpand(nlist, gh, metoo, ntype) - struct name *nlist; - struct grouphead *gh; - int metoo, ntype; +gexpand(struct name *nlist, struct grouphead *gh, int metoo, int ntype) { struct group *gp; struct grouphead *ngh; @@ -473,8 +457,7 @@ skip: * Concatenate the two passed name lists, return the result. */ struct name * -cat(n1, n2) - struct name *n1, *n2; +cat(struct name *n1, struct name *n2) { struct name *tail; @@ -493,8 +476,7 @@ cat(n1, n2) * Return an error if the name list won't fit. */ char ** -unpack(np) - struct name *np; +unpack(struct name *np) { char **ap, **top; struct name *n; @@ -538,8 +520,7 @@ unpack(np) * Return the head of the new list. */ struct name * -elide(names) - struct name *names; +elide(struct name *names) { struct name *np, *t, *new; struct name *x; @@ -637,8 +618,7 @@ elide(names) * the list. */ struct name * -put(list, node) - struct name *list, *node; +put(struct name *list, struct name *node) { node->n_flink = list; node->n_blink = NULL; @@ -652,8 +632,7 @@ put(list, node) * a name list and return it. */ int -count(np) - struct name *np; +count(struct name *np) { int c; @@ -667,9 +646,7 @@ count(np) * Delete the given name from a namelist. */ struct name * -delname(np, name) - struct name *np; - char name[]; +delname(struct name *np, char *name) { struct name *p; @@ -699,8 +676,7 @@ delname(np, name) /* void -prettyprint(name) - struct name *name; +prettyprint(struct name *name) { struct name *np; diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c index db5a1c562b..769644dc44 100644 --- a/usr.bin/mail/popen.c +++ b/usr.bin/mail/popen.c @@ -32,7 +32,7 @@ * * @(#)popen.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/popen.c,v 1.2.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/popen.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/popen.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -64,8 +64,7 @@ static void delchild(struct child *); static int file_pid(FILE *); FILE * -Fopen(path, mode) - const char *path, *mode; +Fopen(const char *path, const char *mode) { FILE *fp; @@ -77,9 +76,7 @@ Fopen(path, mode) } FILE * -Fdopen(fd, mode) - int fd; - const char *mode; +Fdopen(int fd, const char *mode) { FILE *fp; @@ -91,17 +88,14 @@ Fdopen(fd, mode) } int -Fclose(fp) - FILE *fp; +Fclose(FILE *fp) { unregister_file(fp); return (fclose(fp)); } FILE * -Popen(cmd, mode) - char *cmd; - const char *mode; +Popen(char *cmd, const char *mode) { int p[2]; int myside, hisside, fd0, fd1; @@ -135,8 +129,7 @@ Popen(cmd, mode) } int -Pclose(ptr) - FILE *ptr; +Pclose(FILE *ptr) { int i; sigset_t nset, oset; @@ -154,7 +147,7 @@ Pclose(ptr) } void -close_all_files() +close_all_files(void) { while (fp_head != NULL) @@ -165,9 +158,7 @@ close_all_files() } void -register_file(fp, pipe, pid) - FILE *fp; - int pipe, pid; +register_file(FILE *fp, int pipe, int pid) { struct fp *fpp; @@ -181,8 +172,7 @@ register_file(fp, pipe, pid) } void -unregister_file(fp) - FILE *fp; +unregister_file(FILE *fp) { struct fp **pp, *p; @@ -197,8 +187,7 @@ unregister_file(fp) } int -file_pid(fp) - FILE *fp; +file_pid(FILE *fp) { struct fp *p; @@ -218,11 +207,8 @@ file_pid(fp) */ /*VARARGS4*/ int -run_command(cmd, mask, infd, outfd, a0, a1, a2) - char *cmd; - sigset_t *mask; - int infd, outfd; - char *a0, *a1, *a2; +run_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, char *a1, + char *a2) { int pid; @@ -233,11 +219,8 @@ run_command(cmd, mask, infd, outfd, a0, a1, a2) /*VARARGS4*/ int -start_command(cmd, mask, infd, outfd, a0, a1, a2) - char *cmd; - sigset_t *mask; - int infd, outfd; - char *a0, *a1, *a2; +start_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, + char *a1, char *a2) { int pid; @@ -262,9 +245,7 @@ start_command(cmd, mask, infd, outfd, a0, a1, a2) } void -prepare_child(nset, infd, outfd) - sigset_t *nset; - int infd, outfd; +prepare_child(sigset_t *nset, int infd, int outfd) { int i; sigset_t eset; @@ -287,8 +268,7 @@ prepare_child(nset, infd, outfd) } int -wait_command(pid) - int pid; +wait_command(int pid) { if (wait_child(pid) < 0) { @@ -299,8 +279,7 @@ wait_command(pid) } static struct child * -findchild(pid) - int pid; +findchild(int pid) { struct child **cpp; @@ -319,8 +298,7 @@ findchild(pid) } static void -delchild(cp) - struct child *cp; +delchild(struct child *cp) { struct child **cpp; @@ -332,8 +310,7 @@ delchild(cp) /*ARGSUSED*/ void -sigchild(signo) - int signo; +sigchild(int signo) { int pid; int status; @@ -356,8 +333,7 @@ int wait_status; * Wait for a specific child to die. */ int -wait_child(pid) - int pid; +wait_child(int pid) { sigset_t nset, oset; struct child *cp = findchild(pid); @@ -378,8 +354,7 @@ wait_child(pid) * Mark a child as don't care. */ void -free_child(pid) - int pid; +free_child(int pid) { sigset_t nset, oset; struct child *cp = findchild(pid); diff --git a/usr.bin/mail/quit.c b/usr.bin/mail/quit.c index f44482d76b..95ddcda3df 100644 --- a/usr.bin/mail/quit.c +++ b/usr.bin/mail/quit.c @@ -32,7 +32,7 @@ * * @(#)quit.c 8.2 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/mail/quit.c,v 1.2.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/quit.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/quit.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -49,7 +49,7 @@ * The "quit" command. */ int -quitcmd() +quitcmd(void) { /* * If we are sourcing, then return 1 so execute() can handle it. @@ -66,7 +66,7 @@ quitcmd() * Remove the system mailbox, if none saved there. */ void -quit() +quit(void) { int mcount, p, modify, autohold, anystat, holdbit, nohold; FILE *ibuf, *obuf, *fbuf, *rbuf, *readstat, *abuf; @@ -332,8 +332,7 @@ newmail: * Incorporate the any new mail that we found. */ int -writeback(res) - FILE *res; +writeback(FILE *res) { struct message *mp; int p, c; @@ -386,7 +385,7 @@ writeback(res) * file from the temporary. Save any new stuff appended to the file. */ void -edstop() +edstop(void) { int gotcha, c; struct message *mp; diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index 3310030a61..1529b853af 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -32,7 +32,7 @@ * * @(#)send.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/send.c,v 1.5.6.5 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/send.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/send.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -52,11 +52,8 @@ * prefix is a string to prepend to each output line. */ int -sendmessage(mp, obuf, doign, prefix) - struct message *mp; - FILE *obuf; - struct ignoretab *doign; - char *prefix; +sendmessage(struct message *mp, FILE *obuf, struct ignoretab *doign, + char *prefix) { long count; FILE *ibuf; @@ -227,10 +224,7 @@ sendmessage(mp, obuf, doign, prefix) * Output a reasonable looking status field. */ void -statusput(mp, obuf, prefix) - struct message *mp; - FILE *obuf; - char *prefix; +statusput(struct message *mp, FILE *obuf, char *prefix) { char statout[3]; char *cp = statout; @@ -250,9 +244,8 @@ statusput(mp, obuf, prefix) * which does all the dirty work. */ int -mail(to, cc, bcc, smopts, subject, replyto) - struct name *to, *cc, *bcc, *smopts; - char *subject, *replyto; +mail(struct name *to, struct name *cc, struct name *bcc, struct name *smopts, + char *subject, char *replyto) { struct header head; @@ -273,8 +266,7 @@ mail(to, cc, bcc, smopts, subject, replyto) * the mail routine below. */ int -sendmail(str) - char *str; +sendmail(char *str) { struct header head; @@ -294,9 +286,7 @@ sendmail(str) * in the passed header. (Internal interface). */ void -mail1(hp, printheaders) - struct header *hp; - int printheaders; +mail1(struct header *hp, int printheaders) { char *cp; int pid; @@ -409,9 +399,7 @@ out: * the distribution list into the appropriate fields. */ void -fixhead(hp, tolist) - struct header *hp; - struct name *tolist; +fixhead(struct header *hp, struct name *tolist) { struct name *np; @@ -439,9 +427,7 @@ fixhead(hp, tolist) * and return the new file. */ FILE * -infix(hp, fi) - struct header *hp; - FILE *fi; +infix(struct header *hp, FILE *fi) { FILE *nfo, *nfi; int c, fd; @@ -492,10 +478,7 @@ infix(hp, fi) * passed file buffer. */ int -puthead(hp, fo, w) - struct header *hp; - FILE *fo; - int w; +puthead(struct header *hp, FILE *fo, int w) { int gotcha; @@ -521,11 +504,7 @@ puthead(hp, fo, w) * Format the given header line to not exceed 72 characters. */ void -fmt(str, np, fo, comma) - const char *str; - struct name *np; - FILE *fo; - int comma; +fmt(const char *str, struct name *np, FILE *fo, int comma) { int col, len; @@ -557,9 +536,7 @@ fmt(str, np, fo, comma) /*ARGSUSED*/ int -savemail(name, fi) - char name[]; - FILE *fi; +savemail(char *name, FILE *fi) { FILE *fo; char buf[BUFSIZ]; diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c index 920f86467e..51183022cb 100644 --- a/usr.bin/mail/strings.c +++ b/usr.bin/mail/strings.c @@ -32,7 +32,7 @@ * * @(#)strings.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/strings.c,v 1.2.6.3 2003/01/06 05:46:03 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/strings.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/strings.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -55,8 +55,7 @@ */ char * -salloc(size) - int size; +salloc(int size) { char *t; int s, index; @@ -94,7 +93,7 @@ salloc(size) * since last reset. */ void -sreset() +sreset(void) { struct strings *sp; int index; @@ -116,7 +115,7 @@ sreset() * Meant to be called in main, after initialization. */ void -spreserve() +spreserve(void) { struct strings *sp; diff --git a/usr.bin/mail/temp.c b/usr.bin/mail/temp.c index 8fa1b1c079..24762586be 100644 --- a/usr.bin/mail/temp.c +++ b/usr.bin/mail/temp.c @@ -32,7 +32,7 @@ * * @(#)temp.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/temp.c,v 1.6.2.3 2003/01/06 05:46:04 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/temp.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/temp.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -47,7 +47,7 @@ char *tmpdir; void -tinit() +tinit(void) { char *cp; diff --git a/usr.bin/mail/tty.c b/usr.bin/mail/tty.c index 78724e7927..a57c376249 100644 --- a/usr.bin/mail/tty.c +++ b/usr.bin/mail/tty.c @@ -32,7 +32,7 @@ * * @(#)tty.c 8.2 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/tty.c,v 1.2.8.3 2003/01/06 05:46:04 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/tty.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/tty.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -57,9 +57,7 @@ static int ttyset; /* We must now do erase/kill */ */ int -grabh(hp, gflags) - struct header *hp; - int gflags; +grabh(struct header *hp, int gflags) { struct termios ttybuf; sig_t saveint; @@ -170,9 +168,7 @@ out: */ char * -readtty(pr, src) - const char *pr; - char src[]; +readtty(const char *pr, char *src) { char ch, canonb[BUFSIZ]; int c; @@ -272,8 +268,7 @@ redo: * Receipt continuation. */ void -ttystop(s) - int s; +ttystop(int s) { sig_t old_action = signal(s, SIG_DFL); sigset_t nset; @@ -289,8 +284,7 @@ ttystop(s) /*ARGSUSED*/ void -ttyint(s) - int s; +ttyint(int s) { longjmp(intjmp, 1); } diff --git a/usr.bin/mail/v7.local.c b/usr.bin/mail/v7.local.c index 56141d53ba..92ad375330 100644 --- a/usr.bin/mail/v7.local.c +++ b/usr.bin/mail/v7.local.c @@ -32,7 +32,7 @@ * * @(#)v7.local.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/v7.local.c,v 1.2.8.3 2003/01/06 05:46:04 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/v7.local.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/v7.local.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ /* @@ -52,9 +52,7 @@ * mail is queued). */ void -findmail(user, buf, buflen) - char *user, *buf; - int buflen; +findmail(char *user, char *buf, int buflen) { char *tmp = getenv("MAIL"); @@ -68,7 +66,7 @@ findmail(user, buf, buflen) * Get rid of the queued mail. */ void -demail() +demail(void) { if (value("keep") != NULL || rm(mailname) < 0) @@ -79,7 +77,7 @@ demail() * Discover user login name. */ char * -username() +username(void) { char *np; uid_t uid; diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c index bc40167fe7..8b0244314c 100644 --- a/usr.bin/mail/vars.c +++ b/usr.bin/mail/vars.c @@ -32,7 +32,7 @@ * * @(#)vars.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/mail/vars.c,v 1.1.1.1.14.3 2003/01/06 05:46:04 mikeh Exp $ - * $DragonFly: src/usr.bin/mail/vars.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/mail/vars.c,v 1.3 2003/10/04 20:36:48 hmp Exp $ */ #include "rcv.h" @@ -48,8 +48,7 @@ * Assign a value to a variable. */ void -assign(name, value) - const char *name, *value; +assign(const char *name, const char *value) { struct var *vp; int h; @@ -73,8 +72,7 @@ assign(name, value) * Thus, we cannot free same! */ void -vfree(cp) - char *cp; +vfree(char *cp) { if (*cp != '\0') (void)free(cp); @@ -86,8 +84,7 @@ vfree(cp) */ char * -vcopy(str) - const char *str; +vcopy(const char *str) { char *new; unsigned len; @@ -107,8 +104,7 @@ vcopy(str) */ char * -value(name) - const char *name; +value(const char *name) { struct var *vp; @@ -123,8 +119,7 @@ value(name) */ struct var * -lookup(name) - const char *name; +lookup(const char *name) { struct var *vp; @@ -139,8 +134,7 @@ lookup(name) */ struct grouphead * -findgroup(name) - char name[]; +findgroup(char *name) { struct grouphead *gh; @@ -154,8 +148,7 @@ findgroup(name) * Print a group out on stdout */ void -printgroup(name) - char name[]; +printgroup(char *name) { struct grouphead *gh; struct group *gp; @@ -175,8 +168,7 @@ printgroup(name) * the variable or group hash table. */ int -hash(name) - const char *name; +hash(const char *name) { int h = 0; diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 0386a37c53..bb4b6d3330 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -37,7 +37,7 @@ * * @(#)arch.c 8.2 (Berkeley) 1/2/94 * $FreeBSD: src/usr.bin/make/arch.c,v 1.15.2.1 2001/02/13 03:13:57 will Exp $ - * $DragonFly: src/usr.bin/make/arch.c,v 1.2 2003/06/17 04:29:28 dillon Exp $ + * $DragonFly: src/usr.bin/make/arch.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /*- @@ -135,8 +135,7 @@ static int ArchSVR4Entry __P((Arch *, char *, size_t, FILE *)); *----------------------------------------------------------------------- */ static void -ArchFree(ap) - ClientData ap; +ArchFree(ClientData ap) { Arch *a = (Arch *) ap; Hash_Search search; diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c index 560e62659a..f84a80af27 100644 --- a/usr.bin/mesg/mesg.c +++ b/usr.bin/mesg/mesg.c @@ -38,7 +38,7 @@ * @(#) Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)mesg.c 8.2 (Berkeley) 1/21/94 * $FreeBSD: src/usr.bin/mesg/mesg.c,v 1.4 1999/08/28 01:03:59 peter Exp $ - * $DragonFly: src/usr.bin/mesg/mesg.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/mesg/mesg.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -50,12 +50,10 @@ #include #include -static void usage __P((void)); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat sb; char *tty; @@ -100,7 +98,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mesg [y | n]\n"); exit(2); diff --git a/usr.bin/mkfifo/mkfifo.c b/usr.bin/mkfifo/mkfifo.c index 221fa558ad..5b0f5ddce3 100644 --- a/usr.bin/mkfifo/mkfifo.c +++ b/usr.bin/mkfifo/mkfifo.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)mkfifo.c 8.2 (Berkeley) 1/5/94 * $FreeBSD: src/usr.bin/mkfifo/mkfifo.c,v 1.5 1999/08/28 01:04:06 peter Exp $ - * $DragonFly: src/usr.bin/mkfifo/mkfifo.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/mkfifo/mkfifo.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -48,14 +48,12 @@ #define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \ S_IROTH | S_IWOTH -static void usage __P((void)); +static void usage(void); static int f_mode; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { char *modestr; void *modep; @@ -99,7 +97,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: mkfifo [-m mode] fifo_name ...\n"); exit(1); diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c index bfcbea0372..0e399183d4 100644 --- a/usr.bin/mktemp/mktemp.c +++ b/usr.bin/mktemp/mktemp.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/mktemp/mktemp.c,v 1.2.6.1 2000/10/15 11:37:43 alex Exp $ - * $DragonFly: src/usr.bin/mktemp/mktemp.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/mktemp/mktemp.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -43,7 +43,7 @@ #include #include -static void usage __P((void)); +static void usage(void); int main(int argc, char **argv) @@ -139,7 +139,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index 145066d372..980d47ee1f 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)msgs.c 8.2 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/msgs/msgs.c,v 1.15.2.2 2003/02/11 21:31:56 mike Exp $ - * $DragonFly: src/usr.bin/msgs/msgs.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/msgs/msgs.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -142,19 +142,18 @@ bool lastcmd = NO; jmp_buf tstpbuf; -void ask __P((char *)); -void gfrsub __P((FILE *)); -int linecnt __P((FILE *)); -int next __P((char *)); -char *nxtfld __P((unsigned char *)); -void onsusp __P((int)); -void onintr __P((int)); -void prmesg __P((int)); -static void usage __P((void)); +void ask(char *); +void gfrsub(FILE *); +int linecnt(FILE *); +int next(char *); +char *nxtfld(unsigned char *); +void onsusp(int); +void onintr(int); +void prmesg(int); +static void usage(void); int -main(argc, argv) -int argc; char *argv[]; +main(int argc, char **argv) { bool newrc, already; int rcfirst = 0; /* first message to print (from .rc) */ @@ -607,15 +606,14 @@ cmnd: } static void -usage() +usage(void) { fprintf(stderr, "usage: msgs [fhlopq] [[-]number]\n"); exit(1); } void -prmesg(length) -int length; +prmesg(int length) { FILE *outf; char *env_pager; @@ -662,8 +660,7 @@ int length; } void -onintr(unused) - int unused; +onintr(int unused) { signal(SIGINT, onintr); if (mailing) @@ -688,8 +685,7 @@ onintr(unused) * We have just gotten a susp. Suspend and prepare to resume. */ void -onsusp(unused) - int unused; +onsusp(int unused) { signal(SIGTSTP, SIG_DFL); sigsetmask(0); @@ -700,8 +696,7 @@ onsusp(unused) } int -linecnt(f) -FILE *f; +linecnt(FILE *f) { off_t oldpos = ftell(f); int l = 0; @@ -715,8 +710,7 @@ FILE *f; } int -next(buf) -char *buf; +next(char *buf) { int i; sscanf(buf, "%d", &i); @@ -725,8 +719,7 @@ char *buf; } void -ask(prompt) -char *prompt; +ask(char *prompt) { char inch; int n, cmsg, fd; @@ -812,8 +805,7 @@ char *prompt; } void -gfrsub(infile) -FILE *infile; +gfrsub(FILE *infile) { off_t frompos; int count; @@ -893,8 +885,7 @@ FILE *infile; } char * -nxtfld(s) -unsigned char *s; +nxtfld(unsigned char *s) { if (*s) while (*s && !isspace(*s)) s++; /* skip over this field */ if (*s) while (*s && isspace(*s)) s++; /* find start of next field */ diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c index 467bab38b0..3ce65f6e2e 100644 --- a/usr.bin/mt/mt.c +++ b/usr.bin/mt/mt.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)mt.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/mt/mt.c,v 1.26.2.3 2002/11/08 11:35:57 joerg Exp $ - * $DragonFly: src/usr.bin/mt/mt.c,v 1.2 2003/06/17 04:29:29 dillon Exp $ + * $DragonFly: src/usr.bin/mt/mt.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -122,9 +122,9 @@ struct commands { { NULL } }; -void printreg __P((char *, u_int, char *)); -void status __P((struct mtget *)); -void usage __P((void)); +void printreg(char *, u_int, char *); +void status(struct mtget *); +void usage(void); #if defined (__FreeBSD__) void st_status (struct mtget *); int stringtodens (const char *s); @@ -132,13 +132,11 @@ const char *denstostring (int d); int denstobp(int d, int bpi); u_int32_t stringtocomp(const char *s); const char * comptostring(u_int32_t comp); -void warn_eof __P((void)); +void warn_eof(void); #endif /* defined (__FreeBSD__) */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register struct commands *comp; struct mtget mt_status; @@ -388,8 +386,7 @@ struct tape_desc { * Interpret the status buffer returned */ void -status(bp) - register struct mtget *bp; +status(register struct mtget *bp) { register struct tape_desc *mt; @@ -420,10 +417,7 @@ status(bp) * Print a register a la the %b format of the kernel's printf. */ void -printreg(s, v, bits) - char *s; - register u_int v; - register char *bits; +printreg(char *s, register u_int v, register char *bits) { register int i, any = 0; register char c; @@ -453,7 +447,7 @@ printreg(s, v, bits) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mt [-f device] command [ count ]\n"); exit(1); diff --git a/usr.bin/ncplogin/ncplogin.c b/usr.bin/ncplogin/ncplogin.c index a656fbec45..3dfac2e684 100644 --- a/usr.bin/ncplogin/ncplogin.c +++ b/usr.bin/ncplogin/ncplogin.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ncplogin/ncplogin.c,v 1.1 1999/10/31 02:14:59 bp Exp $ - * $DragonFly: src/usr.bin/ncplogin/ncplogin.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/ncplogin/ncplogin.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include #include @@ -48,14 +48,14 @@ extern char *__progname; static void -login_usage() { +login_usage(void) { printf("usage: %s [-Dh] [-A host] [-BCN] [-I level] [-M mode] \n" " [-R retrycount] [-W timeout] /server:user\n", __progname); exit(1); } static void -logout_usage() { +logout_usage(void) { printf("usage: %s [-c handle] [-h] [/server:user]\n", __progname); exit(1); } diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 0c20ac189a..a4280923e6 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1988, 1993 Regents of the University of California. All rights reserved. * @(#)main.c 8.4 (Berkeley) 3/1/94 * $FreeBSD: src/usr.bin/netstat/main.c,v 1.34.2.12 2001/09/17 15:17:46 ru Exp $ - * $DragonFly: src/usr.bin/netstat/main.c,v 1.4 2003/08/24 23:16:53 hsu Exp $ + * $DragonFly: src/usr.bin/netstat/main.c,v 1.5 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -324,9 +324,7 @@ int unit; /* unit number for above */ int af; /* address family */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register struct protox *tp = NULL; /* for printing cblocks & stats */ int ch; @@ -588,9 +586,7 @@ main(argc, argv) * is not in the namelist, ignore this one. */ static void -printproto(tp, name) - register struct protox *tp; - char *name; +printproto(register struct protox *tp, char *name) { void (*pr)(u_long, char *, int); u_long off; diff --git a/usr.bin/newkey/generic.c b/usr.bin/newkey/generic.c index 009448648d..f4e5ca6c6b 100644 --- a/usr.bin/newkey/generic.c +++ b/usr.bin/newkey/generic.c @@ -29,7 +29,7 @@ * * @(#)generic.c 1.2 91/03/11 Copyr 1986 Sun Micro * $FreeBSD: src/usr.bin/newkey/generic.c,v 1.3.2.1 2001/07/04 22:32:20 kris Exp $ - * $DragonFly: src/usr.bin/newkey/generic.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/newkey/generic.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -43,7 +43,7 @@ #include #include -static int adjust __P(( char[], char * )); +static int adjust( char[], char * ); /* * Generate a seed */ @@ -63,10 +63,7 @@ getseed(seed, seedsize, pass) /* * Generate a random public/secret key pair */ -genkeys(public, secret, pass) - char *public; - char *secret; - char *pass; +genkeys(char *public, char *secret, char *pass) { int i; @@ -110,9 +107,7 @@ genkeys(public, secret, pass) * Adjust the input key so that it is 0-filled on the left */ static -adjust(keyout, keyin) - char keyout[HEXKEYBYTES+1]; - char *keyin; +adjust(char keyout[HEXKEYBYTES+1], char *keyin) { char *p; char *s; diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index b8787b9584..10b6848fb6 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -29,7 +29,7 @@ * * @(#)newkey.c 1.8 91/03/11 Copyr 1986 Sun Micro * $FreeBSD: src/usr.bin/newkey/newkey.c,v 1.3 1999/08/28 01:04:34 peter Exp $ - * $DragonFly: src/usr.bin/newkey/newkey.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/newkey/newkey.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -80,12 +80,10 @@ static char PKFILE[] = "/etc/publickey"; static char *err_string(); #endif /* YP */ -static void usage __P((void)); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { char name[MAXNETNAMELEN + 1]; char public[HEXKEYBYTES + 1]; @@ -159,7 +157,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: newkey [-u username]", @@ -170,10 +168,7 @@ usage() /* * Set the entry in the public key file */ -setpublicmap(name, public, secret) - char *name; - char *public; - char *secret; +setpublicmap(char *name, char *public, char *secret) { char pkent[1024]; @@ -194,8 +189,7 @@ setpublicmap(name, public, secret) * a success message. */ static char * -err_string(code) - int code; +err_string(int code) { char *pmesg; diff --git a/usr.bin/newkey/update.c b/usr.bin/newkey/update.c index eea68c8046..07a8844fd5 100644 --- a/usr.bin/newkey/update.c +++ b/usr.bin/newkey/update.c @@ -29,7 +29,7 @@ * * @(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro * $FreeBSD: src/usr.bin/newkey/update.c,v 1.5 1999/08/28 01:04:35 peter Exp $ - * $DragonFly: src/usr.bin/newkey/update.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/newkey/update.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ /* @@ -74,21 +74,15 @@ static char PKFILE[] = "/etc/publickey"; #endif /* YP */ #ifdef YP -static int _openchild __P(( char *, FILE **, FILE ** )); +static int _openchild( char *, FILE **, FILE ** ); /* * Determine if requester is allowed to update the given map, * and update it if so. Returns the yp status, which is zero * if there is no access violation. */ -mapupdate(requester, mapname, op, keylen, key, datalen, data) - char *requester; - char *mapname; - u_int op; - u_int keylen; - char *key; - u_int datalen; - char *data; +mapupdate(char *requester, char *mapname, u_int op, u_int keylen, char *key, + u_int datalen, char *data) { char updater[MAXMAPNAMELEN + 40]; FILE *childargs; @@ -146,10 +140,7 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data) * returns pid, or -1 for failure */ static -_openchild(command, fto, ffrom) - char *command; - FILE **fto; - FILE **ffrom; +_openchild(char *command, FILE **fto, FILE **ffrom) { int i; pid_t pid; @@ -236,7 +227,7 @@ basename(path) #define ERR_DBASE 5 #define ERR_KEY 6 -static int match __P(( char * , char * )); +static int match( char * , char * ); /* * Determine if requester is allowed to update the given map, @@ -244,14 +235,12 @@ static int match __P(( char * , char * )); * if there is no access violation. This function updates * the local file and then shuts up. */ -localupdate(name, filename, op, keylen, key, datalen, data) - char *name; /* Name of the requestor */ - char *filename; - u_int op; - u_int keylen; /* Not used */ - char *key; - u_int datalen; /* Not used */ - char *data; +localupdate(char *name, /* Name of the requestor */ + char *filename, u_int op, + u_int keylen, /* Not used */ + char *key, + u_int datalen, /* Not used */ + char *data) { char line[256]; FILE *rf; @@ -337,9 +326,7 @@ localupdate(name, filename, op, keylen, key, datalen, data) } static -match(line, name) - char *line; - char *name; +match(char *line, char *name) { int len; diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index 5f8d3fee8c..cd0cdf94e2 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1983, 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)nfsstat.c 8.2 (Berkeley) 3/31/95 * $FreeBSD: src/usr.bin/nfsstat/nfsstat.c,v 1.15.2.3 2001/06/06 20:25:58 tmm Exp $ - * $DragonFly: src/usr.bin/nfsstat/nfsstat.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/nfsstat/nfsstat.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -70,18 +70,16 @@ kvm_t *kd; static int deadkernel = 0; static int widemode = 0; -void intpr __P((int, int)); -void printhdr __P((int, int)); -void sidewaysintpr __P((u_int, int, int)); -void usage __P((void)); -char *sperc1 __P((int, int)); -char *sperc2 __P((int, int)); +void intpr(int, int); +void printhdr(int, int); +void sidewaysintpr(u_int, int, int); +void usage(void); +char *sperc1(int, int); +char *sperc2(int, int); #define DELTA(field) (nfsstats.field - lastst.field) -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { u_int interval; int clientOnly = -1; @@ -158,8 +156,7 @@ main(argc, argv) * for dead ones. */ void -readstats(stp) - struct nfsstats *stp; +readstats(struct nfsstats *stp) { if(deadkernel) { if(kvm_read(kd, (u_long)nl[N_NFSSTAT].n_value, stp, @@ -426,7 +423,7 @@ printhdr(int clientOnly, int serverOnly) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: nfsstat [-csW] [-M core] [-N system] [-w interval]\n"); diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c index a3dfc00ab4..71f4ea3bec 100644 --- a/usr.bin/nice/nice.c +++ b/usr.bin/nice/nice.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)nice.c 8.2 (Berkeley) 4/16/94 * $FreeBSD: src/usr.bin/nice/nice.c,v 1.4.2.1 2002/06/18 08:40:28 tjr Exp $ - * $DragonFly: src/usr.bin/nice/nice.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/nice/nice.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -54,9 +54,7 @@ void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { long niceness = DEFNICE; int ch; @@ -98,7 +96,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: nice [-n incr] utility [arguments]\n"); diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c index b5e6f9fbc8..86d8784e2d 100644 --- a/usr.bin/nl/nl.c +++ b/usr.bin/nl/nl.c @@ -35,7 +35,7 @@ * * @(#) Copyright (c) 1999 The NetBSD Foundation, Inc. All rights reserved. * $FreeBSD: src/usr.bin/nl/nl.c,v 1.2.2.2 2002/07/15 06:18:43 tjr Exp $ - * $DragonFly: src/usr.bin/nl/nl.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/nl/nl.c,v 1.3 2003/10/04 20:36:49 hmp Exp $ */ #include @@ -136,9 +136,7 @@ static int width = 6; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int c; long val; @@ -271,7 +269,7 @@ main(argc, argv) } static void -filter() +filter(void) { int line; /* logical line number */ int section; /* logical page section */ @@ -355,9 +353,7 @@ nextline: */ static void -parse_numbering(argstr, section) - const char *argstr; - int section; +parse_numbering(const char *argstr, int section) { int error; char errorbuf[NL_TEXTMAX]; @@ -399,7 +395,7 @@ parse_numbering(argstr, section) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: nl [-p] [-b type] [-d delim] [-f type] \ diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c index 6d643caa06..b459975ae9 100644 --- a/usr.bin/nm/nm.c +++ b/usr.bin/nm/nm.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)nm.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/nm/nm.c,v 1.13.2.1 2001/03/04 08:54:10 kris Exp $ - * $DragonFly: src/usr.bin/nm/Attic/nm.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/nm/Attic/nm.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -71,12 +71,12 @@ int (*sfunc)() = fname; #define SYMBOL_BIND(x) (((x) >> 4) & 0xf) void *emalloc(); -static void usage __P(( void )); -int process_file __P(( char * )); -int show_archive __P(( char *, FILE * )); -int show_objfile __P(( char *, FILE * )); -void print_symbol __P(( char *, struct nlist * )); -char typeletter __P((u_char)); +static void usage( void ); +int process_file( char * ); +int show_archive( char *, FILE * ); +int show_objfile( char *, FILE * ); +void print_symbol( char *, struct nlist * ); +char typeletter(u_char); /* * main() @@ -84,9 +84,7 @@ char typeletter __P((u_char)); * specified on the command line. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, errors; @@ -150,8 +148,7 @@ main(argc, argv) * object files as input. */ int -process_file(fname) - char *fname; +process_file(char *fname) { struct exec exec_head; FILE *fp; @@ -212,9 +209,7 @@ static char *scat(char *dest, char *src) * show symbols in the given archive file */ int -show_archive(fname, fp) - char *fname; - FILE *fp; +show_archive(char *fname, FILE *fp) { struct ar_hdr ar_head; struct exec exec_head; @@ -329,9 +324,7 @@ skip: if (fseek(fp, last_ar_off + even(atol(ar_head.ar_size)), * header. */ int -show_objfile(objname, fp) - char *objname; - FILE *fp; +show_objfile(char *objname, FILE *fp) { register struct nlist *names, *np; register int i, nnames, nrawnames; @@ -455,9 +448,7 @@ show_objfile(objname, fp) * show one symbol */ void -print_symbol(objname, sym) - char *objname; - register struct nlist *sym; +print_symbol(char *objname, register struct nlist *sym) { char *typestring(); @@ -523,8 +514,7 @@ print_symbol(objname, sym) * return the a description string for an STAB entry */ char * -typestring(type) - register u_char type; +typestring(register u_char type) { switch(type) { case N_BCOMM: @@ -578,8 +568,7 @@ typestring(type) * external, lower case for internal symbols. */ char -typeletter(type) - u_char type; +typeletter(u_char type) { switch(SYMBOL_TYPE(type)) { case N_ABS: @@ -604,8 +593,7 @@ typeletter(type) } int -fname(a0, b0) - void *a0, *b0; +fname(void *a0, void *b0) { struct nlist *a = a0, *b = b0; @@ -613,8 +601,7 @@ fname(a0, b0) } int -rname(a0, b0) - void *a0, *b0; +rname(void *a0, void *b0) { struct nlist *a = a0, *b = b0; @@ -622,8 +609,7 @@ rname(a0, b0) } int -value(a0, b0) - void *a0, *b0; +value(void *a0, void *b0) { register struct nlist *a = a0, *b = b0; @@ -646,8 +632,7 @@ value(a0, b0) } void * -emalloc(size) - size_t size; +emalloc(size_t size) { char *p; diff --git a/usr.bin/nohup/nohup.c b/usr.bin/nohup/nohup.c index 2c81e0ad92..3fec4e0adc 100644 --- a/usr.bin/nohup/nohup.c +++ b/usr.bin/nohup/nohup.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)nohup.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/nohup/nohup.c,v 1.4.2.2 2001/08/02 01:45:45 obrien Exp $ - * $DragonFly: src/usr.bin/nohup/nohup.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/nohup/nohup.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -48,8 +48,8 @@ #include #include -static void dofile __P((void)); -static void usage __P((void)); +static void dofile(void); +static void usage(void); #define FILENAME "nohup.out" /* @@ -62,9 +62,7 @@ static void usage __P((void)); #define EXIT_MISC 127 int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int exit_status; @@ -89,7 +87,7 @@ main(argc, argv) } static void -dofile() +dofile(void) { int fd; char path[MAXPATHLEN]; @@ -123,7 +121,7 @@ dupit: } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: nohup [--] command [arguments]\n"); exit(EXIT_MISC); diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 6db3a8a9a3..b1f241a374 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/passwd/local_passwd.c,v 1.24.2.3 2002/03/24 09:00:11 cjc Exp $ - * $DragonFly: src/usr.bin/passwd/local_passwd.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/passwd/local_passwd.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ * * @(#)local_passwd.c 8.3 (Berkeley) 4/2/94 */ @@ -77,10 +77,7 @@ static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; void -to64(s, v, n) - char *s; - long v; - int n; +to64(char *s, long v, long n) { while (--n >= 0) { *s++ = itoa64[v&0x3f]; @@ -89,9 +86,7 @@ to64(s, v, n) } char * -getnewpasswd(pw, nis) - struct passwd *pw; - int nis; +getnewpasswd(struct passwd *pw, int nis) { int tries, min_length = 6; int force_mix_case = 1; @@ -191,8 +186,7 @@ getnewpasswd(pw, nis) } int -local_passwd(uname) - char *uname; +local_passwd(char *uname) { struct passwd *pw; int pfd, tfd; diff --git a/usr.bin/passwd/passwd.c b/usr.bin/passwd/passwd.c index 84d1f22fdf..819a068b68 100644 --- a/usr.bin/passwd/passwd.c +++ b/usr.bin/passwd/passwd.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)passwd.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/usr.bin/passwd/passwd.c,v 1.16.2.1 2001/03/12 10:48:08 assar Exp $ - * $DragonFly: src/usr.bin/passwd/passwd.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/passwd/passwd.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -52,7 +52,7 @@ #include int __use_yp = 0; int yp_errno = YP_TRUE; -extern int yp_passwd __P(( char * )); +extern int yp_passwd( char * ); #endif #ifdef KERBEROS @@ -61,14 +61,12 @@ extern int yp_passwd __P(( char * )); #include "extern.h" -static void usage __P((void)); +static void usage(void); int use_local_passwd = 0; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch; char *uname; @@ -217,7 +215,7 @@ main(argc, argv) } static void -usage() +usage(void) { #ifdef YP diff --git a/usr.bin/pr/egetopt.c b/usr.bin/pr/egetopt.c index 687e1e327f..7416e66b64 100644 --- a/usr.bin/pr/egetopt.c +++ b/usr.bin/pr/egetopt.c @@ -35,6 +35,8 @@ * SUCH DAMAGE. * * @(#)egetopt.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/pr/egetopt.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -65,10 +67,7 @@ char *eoptarg; /* argument associated with option */ #define EMSG "" int -egetopt(nargc, nargv, ostr) - int nargc; - char * const *nargv; - const char *ostr; +egetopt(int nargc, char * const *nargv, const char *ostr) { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index e27b88bef0..e4b25ba827 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/pr/pr.c,v 1.9.2.4 2002/04/15 17:16:57 jmallett Exp $ - * $DragonFly: src/usr.bin/pr/pr.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/pr/pr.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ * * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)pr.c 8.2 (Berkeley) 4/16/94 @@ -105,9 +105,7 @@ int errcnt; /* error count on file processing */ char digs[] = "0123456789"; /* page number translation map */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ret_val; @@ -139,8 +137,7 @@ main(argc, argv) * carriage return on /dev/tty. */ void -ttypause(pagecnt) - int pagecnt; +ttypause(int pagecnt) { int pch; FILE *ttyfp; @@ -161,9 +158,7 @@ ttypause(pagecnt) * Line length is unlimited. */ int -onecol(argc, argv) - int argc; - char *argv[]; +onecol(int argc, char **argv) { register int cnt = -1; register int off; @@ -308,9 +303,7 @@ onecol(argc, argv) * vertcol: print files with more than one column of output down a page */ int -vertcol(argc, argv) - int argc; - char *argv[]; +vertcol(int argc, char **argv) { register char *ptbf; register char **lstdat; @@ -631,9 +624,7 @@ vertcol(argc, argv) * horzcol: print files with more than one column of output across a page */ int -horzcol(argc, argv) - int argc; - char *argv[]; +horzcol(int argc, char **argv) { register char *ptbf; register int pln; @@ -776,9 +767,7 @@ horzcol(argc, argv) * more than one file concurrently */ int -mulfile(argc, argv) - int argc; - char *argv[]; +mulfile(int argc, char **argv) { register char *ptbf; register int j; @@ -992,13 +981,7 @@ mulfile(argc, argv) * mor: set if more data in line (not truncated) */ int -inln(inf, buf, lim, cps, trnc, mor) - FILE *inf; - char *buf; - register int lim; - int *cps; - int trnc; - int *mor; +inln(FILE *inf, char *buf, register int lim, int *cps, int trnc, int *mor) { register int col; register int gap = ingap; @@ -1103,12 +1086,7 @@ inln(inf, buf, lim, cps, trnc, mor) * 1 is more, 0 is complete, -1 is no \n's */ int -otln(buf, cnt, svips, svops, mor) - register char *buf; - int cnt; - int *svops; - int *svips; - int mor; +otln(register char *buf, int cnt, int *svips, int *svops, int mor) { register int ops; /* last col output */ register int ips; /* last col in buf examined */ @@ -1245,10 +1223,7 @@ otln(buf, cnt, svips, svops, mor) * lncnt number of lines per page */ int -inskip(inf, pgcnt, lncnt) - FILE *inf; - register int pgcnt; - register int lncnt; +inskip(FILE *inf, register int pgcnt, register int lncnt) { register int c; register int cnt; @@ -1276,12 +1251,7 @@ inskip(inf, pgcnt, lncnt) * dt if set skips the date processing (used with -m) */ FILE * -nxtfile(argc, argv, fname, buf, dt) - int argc; - char **argv; - char **fname; - char *buf; - int dt; +nxtfile(int argc, char **argv, char **fname, char *buf, int dt) { FILE *inf = NULL; struct timeval tv; @@ -1417,10 +1387,7 @@ nxtfile(argc, argv, fname, buf, dt) * numbers as part of the column so spaces may be replaced. */ void -addnum(buf, wdth, line) - register char *buf; - register int wdth; - register int line; +addnum(register char *buf, register int wdth, register int line) { register char *pt = buf + wdth; @@ -1445,10 +1412,7 @@ addnum(buf, wdth, line) * pagcnt page number */ int -prhead(buf, fname, pagcnt) - char *buf; - char *fname; - int pagcnt; +prhead(char *buf, char *fname, int pagcnt) { int ips = 0; int ops = 0; @@ -1483,9 +1447,7 @@ prhead(buf, fname, pagcnt) * incomp was a '\n' missing from last line output */ int -prtail(cnt, incomp) - register int cnt; - int incomp; +prtail(register int cnt, int incomp) { if (nohead) { /* @@ -1545,8 +1507,7 @@ prtail(cnt, incomp) * terminate(): when a SIGINT is recvd */ void -terminate(which_sig) - int which_sig; +terminate(int which_sig) { flsh_errs(); exit(1); @@ -1558,7 +1519,7 @@ terminate(which_sig) * processing has completed */ void -flsh_errs() +flsh_errs(void) { char buf[BUFSIZ]; @@ -1572,19 +1533,19 @@ flsh_errs() } void -mfail() +mfail(void) { (void)fputs("pr: memory allocation failed\n", err); } void -pfail() +pfail(void) { (void)fprintf(err, "pr: write failure, %s\n", strerror(errno)); } void -usage() +usage(void) { (void)fputs( "usage: pr [+page] [-col] [-adFfmprt] [-e[ch][gap]] [-h header]\n", @@ -1600,9 +1561,7 @@ usage() * checks on options */ int -setup(argc, argv) - register int argc; - register char **argv; +setup(register int argc, register char **argv) { register int c; int d_first; diff --git a/usr.bin/printenv/printenv.c b/usr.bin/printenv/printenv.c index ecbdea6d2a..1a2029e967 100644 --- a/usr.bin/printenv/printenv.c +++ b/usr.bin/printenv/printenv.c @@ -32,6 +32,8 @@ * * @(#) Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)printenv.c 8.2 (Berkeley) 5/4/95 + * + * $DragonFly: src/usr.bin/printenv/printenv.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -41,7 +43,7 @@ #include #include -void usage __P((void)); +void usage(void); /* * printenv @@ -50,9 +52,7 @@ void usage __P((void)); * February, 1979 */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { extern char **environ; register char *cp, **ep; @@ -86,7 +86,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: printenv [name]\n"); exit(1); diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 9bf022024c..cbfa31d6e3 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)printf.c 8.1 (Berkeley) 7/20/93 * $FreeBSD: src/usr.bin/printf/printf.c,v 1.12.6.6 2002/04/29 16:45:16 jmallett Exp $ - * $DragonFly: src/usr.bin/printf/printf.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/printf/printf.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -92,12 +92,10 @@ static char **gargv; int #ifdef BUILTIN -progprintf(argc, argv) +progprintf(int argc, char **argv) #else -main(argc, argv) +main(int argc, char **argv) #endif - int argc; - char *argv[]; { static const char *skip1, *skip2; int ch, chopped, end, fieldwidth, precision, rval; @@ -279,9 +277,7 @@ next: for (start = fmt;; ++fmt) { } static char * -mkquad(str, ch) - char *str; - int ch; +mkquad(char *str, int ch) { static char *copy; static size_t copy_size; @@ -312,8 +308,7 @@ mkquad(str, ch) } static int -escape(fmt) - register char *fmt; +escape(register char *fmt) { register char *store; register int value, c; @@ -377,7 +372,7 @@ escape(fmt) } static int -getchr() +getchr(void) { if (!*gargv) return ('\0'); @@ -385,7 +380,7 @@ getchr() } static const char * -getstr() +getstr(void) { if (!*gargv) return (""); @@ -393,8 +388,7 @@ getstr() } static int -getint(ip) - int *ip; +getint(int *ip) { quad_t val; u_quad_t uval; @@ -412,10 +406,7 @@ getint(ip) } static int -getquads(qp, uqp, signedconv) - quad_t *qp; - u_quad_t *uqp; - int signedconv; +getquads(quad_t *qp, u_quad_t *uqp, int signedconv) { char *ep; int rval; @@ -454,8 +445,7 @@ getquads(qp, uqp, signedconv) } static int -getdouble(dp) - double *dp; +getdouble(double *dp) { char *ep; int rval; @@ -485,7 +475,7 @@ getdouble(dp) } static int -asciicode() +asciicode(void) { register int ch; @@ -497,7 +487,7 @@ asciicode() } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: printf format [arg ...]\n"); } diff --git a/usr.bin/sasc/sasc.c b/usr.bin/sasc/sasc.c index 4e92a240b7..071736217a 100644 --- a/usr.bin/sasc/sasc.c +++ b/usr.bin/sasc/sasc.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/sasc/sasc.c,v 1.7.2.1 2000/06/30 09:47:52 ps Exp $ - * $DragonFly: src/usr.bin/sasc/sasc.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/sasc/sasc.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -48,10 +48,10 @@ #endif #define FAIL -1 -static void usage __P((void)); +static void usage(void); static void -usage() +usage(void) { fprintf(stderr, "usage: sasc [-sq] [-f file] [-r dpi] [-w width] [-h height] \ diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 21b5347723..7d5b544308 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)script.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/script/script.c,v 1.11.2.1 2000/07/20 10:35:21 kris Exp $ - * $DragonFly: src/usr.bin/script/script.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/script/script.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -62,17 +62,15 @@ int qflg; struct termios tt; -void done __P((int)) __dead2; -void dooutput __P((void)); -void doshell __P((char **)); -void fail __P((void)); -void finish __P((void)); -static void usage __P((void)); +void done(int) __dead2; +void dooutput(void); +void doshell(char **); +void fail(void); +void finish(void); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int cc; struct termios rtt, stt; @@ -191,7 +189,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: script [-a] [-q] [-k] [-t time] [file] [command]\n"); @@ -199,7 +197,7 @@ usage() } void -finish() +finish(void) { int die, e, pid; union wait status; @@ -221,8 +219,7 @@ finish() } void -doshell(av) - char **av; +doshell(char **av) { char *shell; @@ -244,15 +241,14 @@ doshell(av) } void -fail() +fail(void) { (void)kill(0, SIGTERM); done(1); } void -done(eno) - int eno; +done(int eno) { time_t tvec; diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 8325fc36f4..02ebd21605 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -36,7 +36,7 @@ * * @(#)compile.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/sed/compile.c,v 1.13.2.8 2002/08/17 05:47:06 tjr Exp $ - * $DragonFly: src/usr.bin/sed/compile.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/sed/compile.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -129,7 +129,7 @@ struct s_command *prog; * Initialise appends. */ void -compile() +compile(void) { *compile_stream(&prog) = NULL; fixuplabel(prog, NULL); @@ -150,8 +150,7 @@ compile() } while (0) static struct s_command ** -compile_stream(link) - struct s_command **link; +compile_stream(struct s_command **link) { char *p; static char lbuf[_POSIX2_LINE_MAX + 1]; /* To save stack */ @@ -360,8 +359,7 @@ nonsel: /* Now parse the command */ * with the processed string. */ static char * -compile_delimited(p, d) - char *p, *d; +compile_delimited(char *p, char *d) { char c; @@ -401,9 +399,7 @@ compile_delimited(p, d) /* compile_ccl: expand a POSIX character class */ static char * -compile_ccl(sp, t) - char **sp; - char *t; +compile_ccl(char **sp, char *t) { int c, d; char *s = *sp; @@ -434,9 +430,7 @@ compile_ccl(sp, t) * Cflags are passed to regcomp. */ static char * -compile_re(p, repp) - char *p; - regex_t **repp; +compile_re(char *p, regex_t **repp) { int eval; char re[_POSIX2_LINE_MAX + 1]; @@ -462,9 +456,7 @@ compile_re(p, repp) * expressions. */ static char * -compile_subst(p, s) - char *p; - struct s_subst *s; +compile_subst(char *p, struct s_subst *s) { static char lbuf[_POSIX2_LINE_MAX + 1]; int asize, size; @@ -551,9 +543,7 @@ compile_subst(p, s) * Compile the flags of the s command */ static char * -compile_flags(p, s) - char *p; - struct s_subst *s; +compile_flags(char *p, struct s_subst *s) { int gn; /* True if we have seen g or n */ char wfile[_POSIX2_LINE_MAX + 1], *q; @@ -626,9 +616,7 @@ compile_flags(p, s) * Compile a translation set of strings into a lookup table. */ static char * -compile_tr(p, transtab) - char *p; - char **transtab; +compile_tr(char *p, char **transtab) { int i; char *lt, *op, *np; @@ -666,7 +654,7 @@ compile_tr(p, transtab) * Compile the text following an a or i command. */ static char * -compile_text() +compile_text(void) { int asize, esc_nl, size; char *text, *p, *op, *s; @@ -707,9 +695,7 @@ compile_text() * it. Fill the structure pointed to according to the address. */ static char * -compile_addr(p, a) - char *p; - struct s_addr *a; +compile_addr(char *p, struct s_addr *a) { char *end; @@ -744,9 +730,7 @@ compile_addr(p, a) * Return a copy of all the characters up to \n or \0. */ static char * -duptoeol(s, ctype) - char *s; - const char *ctype; +duptoeol(char *s, const char *ctype) { size_t len; int ws; @@ -772,8 +756,7 @@ duptoeol(s, ctype) * TODO: Remove } nodes */ static void -fixuplabel(cp, end) - struct s_command *cp, *end; +fixuplabel(struct s_command *cp, struct s_command *end) { for (; cp != end; cp = cp->next) @@ -804,8 +787,7 @@ fixuplabel(cp, end) * Associate the given command label for later lookup. */ static void -enterlabel(cp) - struct s_command *cp; +enterlabel(struct s_command *cp) { struct labhash **lhp, *lh; u_char *p; @@ -831,8 +813,7 @@ enterlabel(cp) * list cp. L is excluded from the search. Return NULL if not found. */ static struct s_command * -findlabel(name) - char *name; +findlabel(char *name) { struct labhash *lh; u_char *p; @@ -854,7 +835,7 @@ findlabel(name) * table space. */ static void -uselabel() +uselabel(void) { struct labhash *lh, *next; int i; diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index beb0807356..6b234f49c6 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.2 (Berkeley) 1/3/94 * $FreeBSD: src/usr.bin/sed/main.c,v 1.9.2.7 2002/08/06 10:03:29 fanf Exp $ - * $DragonFly: src/usr.bin/sed/main.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/sed/main.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -108,9 +108,7 @@ static int inplace_edit(char **); static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int c, fflag; char *temp_arg; @@ -175,7 +173,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: sed script [-Ean] [-i extension] [file ...]", @@ -188,10 +186,7 @@ usage() * together. Empty strings and files are ignored. */ char * -cu_fgets(buf, n, more) - char *buf; - int n; - int *more; +cu_fgets(char *buf, int n, int *more) { static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF; static FILE *f; /* Current open file */ @@ -287,9 +282,7 @@ again: * Set len to the length of the line. */ int -mf_fgets(sp, spflag) - SPACE *sp; - enum e_spflag spflag; +mf_fgets(SPACE *sp, enum e_spflag spflag) { size_t len; char *p; @@ -365,9 +358,7 @@ mf_fgets(sp, spflag) * Add a compilation unit to the linked list */ static void -add_compunit(type, s) - enum e_cut type; - char *s; +add_compunit(enum e_cut type, char *s) { struct s_compunit *cu; @@ -384,8 +375,7 @@ add_compunit(type, s) * Add a file to the linked list */ static void -add_file(s) - char *s; +add_file(char *s) { struct s_flist *fp; @@ -401,8 +391,7 @@ add_file(s) * Modify a pointer to a filename for inplace editing and reopen stdout */ static int -inplace_edit(filename) - char **filename; +inplace_edit(char **filename) { struct stat orig; char backup[MAXPATHLEN]; diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c index f0592a4f92..559325e6f4 100644 --- a/usr.bin/sed/misc.c +++ b/usr.bin/sed/misc.c @@ -36,7 +36,7 @@ * * @(#)misc.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/sed/misc.c,v 1.3.2.2 2002/07/17 09:35:56 tjr Exp $ - * $DragonFly: src/usr.bin/sed/misc.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/sed/misc.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -56,9 +56,7 @@ * the buffer). */ char * -strregerror(errcode, preg) - int errcode; - regex_t *preg; +strregerror(int errcode, regex_t *preg) { static char *oe; size_t s; diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 04768553da..4f45cdc2ec 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -36,7 +36,7 @@ * * @(#)process.c 8.6 (Berkeley) 4/20/94 * $FreeBSD: src/usr.bin/sed/process.c,v 1.10.2.10 2003/06/13 07:32:08 fanf Exp $ - * $DragonFly: src/usr.bin/sed/process.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/sed/process.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -86,7 +86,7 @@ regmatch_t *match; #define OUT(s) { fwrite(s, sizeof(u_char), psl, stdout); putchar('\n'); } void -process() +process(void) { struct s_command *cp; SPACE tspace; @@ -273,8 +273,7 @@ new: if (!nflag && !pd) * flag to process ranges. Interprets the non-select (``!'') flag. */ static __inline int -applies(cp) - struct s_command *cp; +applies(struct s_command *cp) { int r; @@ -315,8 +314,7 @@ applies(cp) * and then swap them. */ static int -substitute(cp) - struct s_command *cp; +substitute(struct s_command *cp) { SPACE tspace; regex_t *re; @@ -427,7 +425,7 @@ substitute(cp) * therefore it also resets the substitution done (sdone) flag. */ static void -flush_appends() +flush_appends(void) { FILE *f; int count, i; @@ -461,8 +459,7 @@ flush_appends() } static void -lputs(s) - char *s; +lputs(char *s) { int count; const char *escapes; @@ -511,11 +508,8 @@ lputs(s) } static __inline int -regexec_e(preg, string, eflags, nomatch, slen) - regex_t *preg; - const char *string; - int eflags, nomatch; - size_t slen; +regexec_e(regex_t *preg, const char *string, int eflags, int nomatch, + size_t slen) { int eval; @@ -546,9 +540,7 @@ regexec_e(preg, string, eflags, nomatch, slen) * Based on a routine by Henry Spencer */ static void -regsub(sp, string, src) - SPACE *sp; - char *string, *src; +regsub(SPACE *sp, char *string, char *src) { int len, no; char c, *dst; @@ -594,11 +586,7 @@ regsub(sp, string, src) * space as necessary. */ void -cspace(sp, p, len, spflag) - SPACE *sp; - const char *p; - size_t len; - enum e_spflag spflag; +cspace(SPACE *sp, const char *p, size_t len, enum e_spflag spflag) { size_t tlen; @@ -623,8 +611,7 @@ cspace(sp, p, len, spflag) * Close all cached opened files and report any errors */ void -cfclose(cp, end) - struct s_command *cp, *end; +cfclose(struct s_command *cp, struct s_command *end) { for (; cp != end; cp = cp->next) diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c index 44593f4f1b..e0ceb8c174 100644 --- a/usr.bin/showmount/showmount.c +++ b/usr.bin/showmount/showmount.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993, 1995 The Regents of the University of California. All rights reserved. * @(#)showmount.c 8.3 (Berkeley) 3/29/95 * $FreeBSD: src/usr.bin/showmount/showmount.c,v 1.8 1999/08/28 01:05:43 peter Exp $ - * $DragonFly: src/usr.bin/showmount/showmount.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/showmount/showmount.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -86,14 +86,14 @@ static struct mountlist *mntdump; static struct exportslist *exports; static int type = 0; -void print_dump __P((struct mountlist *)); -static void usage __P((void)); -int xdr_mntdump __P((XDR *, struct mountlist **)); -int xdr_exports __P((XDR *, struct exportslist **)); -int tcp_callrpc __P((char *host, - int prognum, int versnum, int procnum, - xdrproc_t inproc, char *in, - xdrproc_t outproc, char *out)); +void print_dump(struct mountlist *); +static void usage(void); +int xdr_mntdump(XDR *, struct mountlist **); +int xdr_exports(XDR *, struct exportslist **); +int tcp_callrpc(char *host, + int prognum, int versnum, int procnum, + xdrproc_t inproc, char *in, + xdrproc_t outproc, char *out); /* * This command queries the NFS mount daemon for it's mount list and/or @@ -103,9 +103,7 @@ int tcp_callrpc __P((char *host, * for detailed information on the protocol. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register struct exportslist *exp; register struct grouplist *grp; @@ -208,15 +206,8 @@ main(argc, argv) */ int -tcp_callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) - char *host; - int prognum; - int versnum; - int procnum; - xdrproc_t inproc; - char *in; - xdrproc_t outproc; - char *out; +tcp_callrpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, + char *in, xdrproc_t outproc, char *out) { struct hostent *hp; struct sockaddr_in server_addr; @@ -271,9 +262,7 @@ tcp_callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) * Xdr routine for retrieving the mount dump list */ int -xdr_mntdump(xdrsp, mlp) - XDR *xdrsp; - struct mountlist **mlp; +xdr_mntdump(XDR *xdrsp, struct mountlist **mlp) { register struct mountlist *mp; register struct mountlist *tp; @@ -353,9 +342,7 @@ next: * Xdr routine to retrieve exports list */ int -xdr_exports(xdrsp, exp) - XDR *xdrsp; - struct exportslist **exp; +xdr_exports(XDR *xdrsp, struct exportslist **exp) { register struct exportslist *ep; register struct grouplist *gp; @@ -396,7 +383,7 @@ xdr_exports(xdrsp, exp) } static void -usage() +usage(void) { fprintf(stderr, "usage: showmount [-ade3] host\n"); exit(1); @@ -406,8 +393,7 @@ usage() * Print the binary tree in inorder so that output is sorted. */ void -print_dump(mp) - struct mountlist *mp; +print_dump(struct mountlist *mp) { if (mp == NULL) diff --git a/usr.bin/size/size.c b/usr.bin/size/size.c index 3d60d7af86..1413f44f20 100644 --- a/usr.bin/size/size.c +++ b/usr.bin/size/size.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)size.c 8.2 (Berkeley) 12/9/93 * $FreeBSD: src/usr.bin/size/size.c,v 1.5 1999/08/28 01:05:44 peter Exp $ - * $DragonFly: src/usr.bin/size/Attic/size.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/size/Attic/size.c,v 1.3 2003/10/04 20:36:50 hmp Exp $ */ #include @@ -45,13 +45,11 @@ #include #include -int show __P((int, char *)); -static void usage __P((void)); +int show(int, char *); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, eval; @@ -75,9 +73,7 @@ main(argc, argv) } int -show(count, name) - int count; - char *name; +show(int count, char *name) { static int first = 1; struct exec head; @@ -109,7 +105,7 @@ show(count, name) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: size [file ...]\n"); exit(1); diff --git a/usr.bin/soelim/soelim.c b/usr.bin/soelim/soelim.c index f04840d24f..310f1dc33c 100644 --- a/usr.bin/soelim/soelim.c +++ b/usr.bin/soelim/soelim.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)soelim.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/soelim/soelim.c,v 1.3.2.2 2001/07/30 10:16:46 dd Exp $ - * $DragonFly: src/usr.bin/soelim/soelim.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/soelim/soelim.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -58,12 +58,10 @@ */ #define STDIN_NAME "-" -int process __P((char *)); +int process(char *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { argc--; @@ -81,8 +79,7 @@ main(argc, argv) } int -process(file) - char *file; +process(char *file) { register char *cp; register int c; diff --git a/usr.bin/strings/strings.c b/usr.bin/strings/strings.c index e9cf1abb64..f15012061c 100644 --- a/usr.bin/strings/strings.c +++ b/usr.bin/strings/strings.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)strings.c 8.2 (Berkeley) 1/28/94 * $FreeBSD: src/usr.bin/strings/strings.c,v 1.8.2.1 2001/03/04 09:05:54 kris Exp $ - * $DragonFly: src/usr.bin/strings/Attic/strings.c,v 1.2 2003/06/17 04:29:31 dillon Exp $ + * $DragonFly: src/usr.bin/strings/Attic/strings.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -61,13 +61,11 @@ static int hcnt, /* head count */ read_len; /* length to read */ static u_char hbfr[sizeof(EXEC)]; /* buffer for struct exec */ -int getch __P((void)); -static void usage __P((void)); +int getch(void); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int ch, cnt; register u_char *C; @@ -190,7 +188,7 @@ nextfile: ; * get next character from wherever */ int -getch() +getch(void) { ++foff; if (head_len) { @@ -204,7 +202,7 @@ getch() } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: strings [-afo] [-n length] [file ... ]\n"); diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c index a0483f320e..353128dc88 100644 --- a/usr.bin/strip/strip.c +++ b/usr.bin/strip/strip.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)strip.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/strip/strip.c,v 1.12 1999/08/28 01:05:53 peter Exp $ - * $DragonFly: src/usr.bin/strip/Attic/strip.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/strip/Attic/strip.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -55,17 +55,15 @@ typedef struct nlist NLIST; #define strx n_un.n_strx -void s_stab __P((const char *, int, EXEC *)); -void s_sym __P((const char *, int, EXEC *)); -static void usage __P((void)); +void s_stab(const char *, int, EXEC *); +void s_sym(const char *, int, EXEC *); +static void usage(void); int xflag = 0; int err_val = 0; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int fd, nb; EXEC head; @@ -119,10 +117,7 @@ main(argc, argv) } void -s_sym(fn, fd, ep) - const char *fn; - int fd; - register EXEC *ep; +s_sym(const char *fn, int fd, register EXEC *ep) { register off_t fsize; @@ -148,10 +143,7 @@ s_sym(fn, fd, ep) } void -s_stab(fn, fd, ep) - const char *fn; - int fd; - EXEC *ep; +s_stab(const char *fn, int fd, EXEC *ep) { register int cnt, len; register char *nstr, *nstrbase, *p, *strbase; @@ -250,7 +242,7 @@ s_stab(fn, fd, ep) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: strip [-dx] file ...\n"); exit(1); diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 2c532712a3..27d7f286d7 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)su.c 8.3 (Berkeley) 4/2/94 * $FreeBSD: src/usr.bin/su/su.c,v 1.34.2.4 2002/06/16 21:04:15 nectar Exp $ - * $DragonFly: src/usr.bin/su/su.c,v 1.3 2003/08/05 07:45:44 asmodai Exp $ + * $DragonFly: src/usr.bin/su/su.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -86,14 +86,12 @@ int use_kerberos5 = 1; #define COMMON_ARG(x) x #define ARGSTR "-" COMMON_ARG("flm") LOGIN_CAP_ARG("c:") KERBEROS_ARG("K") -char *ontty __P((void)); -int chshell __P((char *)); -static void usage __P((void)); +char *ontty(void); +int chshell(char *); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { extern char **environ; struct passwd *pwd; @@ -423,7 +421,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: su [-] [-%s] %s[login [args]]\n", KERBEROS_ARG("K") COMMON_ARG("flm"), @@ -437,8 +435,7 @@ usage() } int -chshell(sh) - char *sh; +chshell(char *sh) { int r = 0; char *cp; @@ -451,7 +448,7 @@ chshell(sh) } char * -ontty() +ontty(void) { char *p; static char buf[MAXPATHLEN + 4]; diff --git a/usr.bin/symorder/symorder.c b/usr.bin/symorder/symorder.c index fea0950c61..2e9ef2659b 100644 --- a/usr.bin/symorder/symorder.c +++ b/usr.bin/symorder/symorder.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980 The Regents of the University of California. All rights reserved. * @(#)symorder.c 5.8 (Berkeley) 4/1/91 * $FreeBSD: src/usr.bin/symorder/symorder.c,v 1.15 1999/08/28 01:05:57 peter Exp $ - * $DragonFly: src/usr.bin/symorder/symorder.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/symorder/symorder.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -68,17 +68,15 @@ off_t sa; int nexclude, nsym, strtabsize, symfound, symkept, small, missing, clean; char *kfile, *newstrings, *strings, asym[BUFSIZ]; -void badfmt __P((char *)); -int excluded __P((struct nlist *)); -int inlist __P((struct nlist *)); -void reorder __P((struct nlist *, struct nlist *, int)); -int savesymb __P((struct nlist *)); -static void usage __P((void)); +void badfmt(char *); +int excluded(struct nlist *); +int inlist(struct nlist *); +void reorder(struct nlist *, struct nlist *, int); +int savesymb(struct nlist *); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register struct nlist *p, *symp; register FILE *f, *xfile; @@ -256,8 +254,7 @@ main(argc, argv) } int -savesymb(s) - register struct nlist *s; +savesymb(register struct nlist *s) { if ((s->n_type & N_EXT) != N_EXT) return 0; @@ -271,9 +268,7 @@ savesymb(s) } void -reorder(st1, st2, entries) - register struct nlist *st1, *st2; - int entries; +reorder(register struct nlist *st1, register struct nlist *st2, int entries) { register struct nlist *p; register int i, n; @@ -294,8 +289,7 @@ reorder(st1, st2, entries) } int -inlist(p) - register struct nlist *p; +inlist(register struct nlist *p) { register char *nam; register struct nlist *op; @@ -315,8 +309,7 @@ inlist(p) } int -excluded(p) - register struct nlist *p; +excluded(register struct nlist *p) { register char *nam; register int x; @@ -333,14 +326,13 @@ excluded(p) } void -badfmt(why) - char *why; +badfmt(char *why) { errx(ERREXIT, "%s: %s: %s", kfile, why, strerror(EFTYPE)); } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: symorder [-c] [-m] [-t] [-x excludelist] symlist file\n"); diff --git a/usr.bin/systat/cmds.c b/usr.bin/systat/cmds.c index e23a6396e6..e89362fb4a 100644 --- a/usr.bin/systat/cmds.c +++ b/usr.bin/systat/cmds.c @@ -32,7 +32,7 @@ * * @(#)cmds.c 8.2 (Berkeley) 4/29/95 * $FreeBSD: src/usr.bin/systat/cmds.c,v 1.3 1999/08/28 01:05:58 peter Exp $ - * $DragonFly: src/usr.bin/systat/cmds.c,v 1.3 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/cmds.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -44,8 +44,7 @@ #include "extern.h" void -command(cmd) - char *cmd; +command(char *cmd) { register struct cmdtab *p; register char *cp; @@ -143,8 +142,7 @@ done: } struct cmdtab * -lookup(name) - register char *name; +lookup(register char *name) { register char *p, *q; register struct cmdtab *c, *found; @@ -172,7 +170,7 @@ lookup(name) } void -status() +status(void) { error("Showing %s, refresh every %3.2f seconds.", @@ -180,8 +178,7 @@ status() } int -prefix(s1, s2) - register char *s1, *s2; +prefix(register char *s1, register char *s2) { while (*s1 == *s2) { diff --git a/usr.bin/systat/devs.c b/usr.bin/systat/devs.c index f6128cad5e..acec13b5cf 100644 --- a/usr.bin/systat/devs.c +++ b/usr.bin/systat/devs.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/systat/devs.c,v 1.4 1999/08/28 01:05:59 peter Exp $ - * $DragonFly: src/usr.bin/systat/devs.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/devs.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ /* * Some code and ideas taken from the old disks.c. @@ -191,7 +191,7 @@ dscmd(char *cmd, char *args, int maxshowdevs, struct statinfo *s1) static int dsmatchselect(char *args, devstat_select_mode select_mode, int maxshowdevs, - struct statinfo *s1) + struct statinfo *s1) { char **tempstr; char *tstr[100]; diff --git a/usr.bin/systat/fetch.c b/usr.bin/systat/fetch.c index 75d0153c46..1f834d5f3b 100644 --- a/usr.bin/systat/fetch.c +++ b/usr.bin/systat/fetch.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)fetch.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/systat/fetch.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -38,9 +40,7 @@ #include "extern.h" int -kvm_ckread(a, b, l) - void *a, *b; - int l; +kvm_ckread(void *a, void *b, int l) { if (kvm_read(kd, (u_long)a, b, l) != l) { if (verbose) diff --git a/usr.bin/systat/icmp.c b/usr.bin/systat/icmp.c index c03b048c55..7585d4ebd6 100644 --- a/usr.bin/systat/icmp.c +++ b/usr.bin/systat/icmp.c @@ -32,7 +32,7 @@ * * @(#)mbufs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/icmp.c,v 1.2 1999/08/28 01:06:01 peter Exp $ - * $DragonFly: src/usr.bin/systat/icmp.c,v 1.3 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/icmp.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -88,8 +88,7 @@ openicmp(void) } void -closeicmp(w) - WINDOW *w; +closeicmp(WINDOW *w) { if (w == NULL) return; diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index f63cf89cb0..0f6b8f8d3e 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/systat/iostat.c,v 1.9.2.1 2000/07/02 10:03:17 ps Exp $ - * $DragonFly: src/usr.bin/systat/iostat.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/iostat.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ * * @(#)iostat.c 8.1 (Berkeley) 6/6/93 */ @@ -99,21 +99,20 @@ static double etime; static int numbers = 0; /* default display bar graphs */ static int kbpt = 0; /* default ms/seek shown */ -static int barlabels __P((int)); -static void histogram __P((long double, int, double)); -static int numlabels __P((int)); -static int devstats __P((int, int, int)); -static void stat1 __P((int, int)); +static int barlabels(int); +static void histogram(long double, int, double); +static int numlabels(int); +static int devstats(int, int, int); +static void stat1(int, int); WINDOW * -openiostat() +openiostat(void) { return (subwin(stdscr, LINES-1-5, 0, 5, 0)); } void -closeiostat(w) - WINDOW *w; +closeiostat(WINDOW *w) { if (w == NULL) return; @@ -123,7 +122,7 @@ closeiostat(w) } int -initiostat() +initiostat(void) { if (num_devices = getnumdevs() < 0) return(0); @@ -149,7 +148,7 @@ initiostat() } void -fetchiostat() +fetchiostat(void) { struct devinfo *tmp_dinfo; @@ -185,7 +184,7 @@ fetchiostat() #define INSET 10 void -labeliostat() +labeliostat(void) { int row; @@ -205,8 +204,7 @@ labeliostat() } static int -numlabels(row) - int row; +numlabels(int row) { int i, col, regions, ndrives; char tmpstr[10]; @@ -247,8 +245,7 @@ numlabels(row) } static int -barlabels(row) - int row; +barlabels(int row) { int i; char tmpstr[10]; @@ -273,7 +270,7 @@ barlabels(row) void -showiostat() +showiostat(void) { register long t; register int i, row, col; @@ -322,8 +319,7 @@ showiostat() } static int -devstats(row, col, dn) - int row, col, dn; +devstats(int row, int col, int dn) { long double transfers_per_second; long double kb_per_transfer, mb_per_second; @@ -360,8 +356,7 @@ devstats(row, col, dn) } static void -stat1(row, o) - int row, o; +stat1(int row, int o) { register int i; double time; @@ -377,10 +372,7 @@ stat1(row, o) } static void -histogram(val, colwidth, scale) - long double val; - int colwidth; - double scale; +histogram(long double val, int colwidth, double scale) { char buf[10]; register int k; @@ -401,8 +393,7 @@ histogram(val, colwidth, scale) } int -cmdiostat(cmd, args) - char *cmd, *args; +cmdiostat(char *cmd, char *args) { if (prefix(cmd, "kbpt")) diff --git a/usr.bin/systat/ip.c b/usr.bin/systat/ip.c index 0e9e190611..bc37eb0a19 100644 --- a/usr.bin/systat/ip.c +++ b/usr.bin/systat/ip.c @@ -32,7 +32,7 @@ * * @(#)mbufs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/ip.c,v 1.3.2.1 2001/04/25 12:42:18 ru Exp $ - * $DragonFly: src/usr.bin/systat/ip.c,v 1.3 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/ip.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -94,8 +94,7 @@ openip(void) } void -closeip(w) - WINDOW *w; +closeip(WINDOW *w) { if (w == NULL) return; diff --git a/usr.bin/systat/keyboard.c b/usr.bin/systat/keyboard.c index b42528458f..fe7666dcd1 100644 --- a/usr.bin/systat/keyboard.c +++ b/usr.bin/systat/keyboard.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)keyboard.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/systat/keyboard.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -41,7 +43,7 @@ #include "extern.h" int -keyboard() +keyboard(void) { char ch, line[80]; int oldmask; diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index db50f489f6..2fcfaa10e8 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/main.c,v 1.11.2.1 2001/06/06 20:26:01 tmm Exp $ - * $DragonFly: src/usr.bin/systat/main.c,v 1.3 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/main.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -77,9 +77,7 @@ int CMDLINE; static WINDOW *wload; /* one line window for load average */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX]; @@ -157,7 +155,7 @@ main(argc, argv) } void -labels() +labels(void) { if (curcmd->c_flags & CF_LOADAV) { mvaddstr(2, 20, @@ -172,8 +170,7 @@ labels() } void -display(signo) - int signo; +display(int signo) { register int i, j; struct itimerval ctv; @@ -213,7 +210,7 @@ display(signo) } void -load() +load(void) { (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); @@ -223,8 +220,7 @@ load() } void -die(signo) - int signo; +die(int signo) { move(CMDLINE, 0); clrtoeol(); @@ -233,30 +229,15 @@ die(signo) exit(0); } -#if __STDC__ #include -#else -#include -#endif -#if __STDC__ void error(const char *fmt, ...) -#else -void -error(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; char buf[255]; int oy, ox; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif if (wnd) { getyx(stdscr, oy, ox); @@ -275,8 +256,7 @@ error(fmt, va_alist) } void -nlisterr(namelist) - struct nlist namelist[]; +nlisterr(struct nlist *namelist) { int i, n; diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c index a3f95c26e5..a0224eae8c 100644 --- a/usr.bin/systat/mbufs.c +++ b/usr.bin/systat/mbufs.c @@ -32,7 +32,7 @@ * * @(#)mbufs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/mbufs.c,v 1.10.2.1 2000/08/26 09:36:55 ps Exp $ - * $DragonFly: src/usr.bin/systat/mbufs.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/mbufs.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -66,14 +66,13 @@ static struct mtnames { #define NNAMES (sizeof (mtnames) / sizeof (mtnames[0])) WINDOW * -openmbufs() +openmbufs(void) { return (subwin(stdscr, LINES-5-1, 0, 5, 0)); } void -closembufs(w) - WINDOW *w; +closembufs(WINDOW *w) { if (w == NULL) return; @@ -83,7 +82,7 @@ closembufs(w) } void -labelmbufs() +labelmbufs(void) { wmove(wnd, 0, 0); wclrtoeol(wnd); mvwaddstr(wnd, 0, 10, @@ -91,7 +90,7 @@ labelmbufs() } void -showmbufs() +showmbufs(void) { register int i, j, max, index; char buf[10]; @@ -155,7 +154,7 @@ showmbufs() } int -initmbufs() +initmbufs(void) { size_t len, mbtypeslen; @@ -181,7 +180,7 @@ initmbufs() } void -fetchmbufs() +fetchmbufs(void) { size_t len; diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c index e4d60ea6dd..edf8a3edee 100644 --- a/usr.bin/systat/netcmds.c +++ b/usr.bin/systat/netcmds.c @@ -32,7 +32,7 @@ * * @(#)netcmds.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/netcmds.c,v 1.9 1999/08/28 01:06:04 peter Exp $ - * $DragonFly: src/usr.bin/systat/netcmds.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/netcmds.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -67,17 +67,16 @@ static struct hitem { int nports, nhosts, protos; -static void changeitems __P((char *, int)); -static int selectproto __P((char *)); -static void showprotos __P((void)); -static int selectport __P((long, int)); -static void showports __P((void)); -static int selecthost __P((struct in_addr *, int)); -static void showhosts __P((void)); +static void changeitems(char *, int); +static int selectproto(char *); +static void showprotos(void); +static int selectport(long, int); +static void showports(void); +static int selecthost(struct in_addr *, int); +static void showhosts(void); int -netcmd(cmd, args) - char *cmd, *args; +netcmd(char *cmd, char *args) { if (prefix(cmd, "proto")) { @@ -123,9 +122,7 @@ netcmd(cmd, args) static void -changeitems(args, onoff) - char *args; - int onoff; +changeitems(char *args, int onoff) { register char *cp; struct servent *sp; @@ -166,8 +163,7 @@ changeitems(args, onoff) } static int -selectproto(proto) - char *proto; +selectproto(char *proto) { if (proto == 0 || streq(proto, "all")) @@ -183,7 +179,7 @@ selectproto(proto) } static void -showprotos() +showprotos(void) { if ((protos&TCP) == 0) @@ -200,9 +196,7 @@ static struct pitem { } *ports; static int -selectport(port, onoff) - long port; - int onoff; +selectport(long port, int onoff) { register struct pitem *p; @@ -229,8 +223,7 @@ selectport(port, onoff) } int -checkport(inp) - register struct inpcb *inp; +checkport(register struct inpcb *inp) { register struct pitem *p; @@ -242,7 +235,7 @@ checkport(inp) } static void -showports() +showports(void) { register struct pitem *p; struct servent *sp; @@ -260,9 +253,7 @@ showports() } static int -selecthost(in, onoff) - struct in_addr *in; - int onoff; +selecthost(struct in_addr *in, int onoff) { register struct hitem *p; @@ -289,8 +280,7 @@ selecthost(in, onoff) } int -checkhost(inp) - register struct inpcb *inp; +checkhost(register struct inpcb *inp) { register struct hitem *p; @@ -303,7 +293,7 @@ checkhost(inp) } static void -showhosts() +showhosts(void) { register struct hitem *p; struct hostent *hp; diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index ff45486e57..f2ef4b592c 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -32,7 +32,7 @@ * * @(#)netstat.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/netstat.c,v 1.13 1999/08/30 08:18:08 peter Exp $ - * $DragonFly: src/usr.bin/systat/netstat.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/netstat.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -72,15 +72,15 @@ #include "systat.h" #include "extern.h" -static void enter __P((struct inpcb *, struct socket *, int, char *)); -static char *inetname __P((struct in_addr)); -static void inetprint __P((struct in_addr *, int, char *)); +static void enter(struct inpcb *, struct socket *, int, char *); +static char *inetname(struct in_addr); +static void inetprint(struct in_addr *, int, char *); #define streq(a,b) (strcmp(a,b)==0) #define YMAX(w) ((w)->_maxy-1) WINDOW * -opennetstat() +opennetstat(void) { sethostent(1); setnetent(1); @@ -115,8 +115,7 @@ static void enter(), inetprint(); static char *inetname(); void -closenetstat(w) - WINDOW *w; +closenetstat(WINDOW *w) { register struct netinfo *p; @@ -145,7 +144,7 @@ static struct nlist namelist[] = { }; int -initnetstat() +initnetstat(void) { if (kvm_nlist(kd, namelist)) { nlisterr(namelist); @@ -161,7 +160,7 @@ initnetstat() } void -fetchnetstat() +fetchnetstat(void) { register struct inpcb *next; register struct netinfo *p; @@ -213,11 +212,8 @@ again: } static void -enter(inp, so, state, proto) - register struct inpcb *inp; - register struct socket *so; - int state; - char *proto; +enter(register struct inpcb *inp, register struct socket *so, int state, + char *proto) { register struct netinfo *p; @@ -271,7 +267,7 @@ enter(inp, so, state, proto) void -labelnetstat() +labelnetstat(void) { if (namelist[X_TCB].n_type == 0) return; @@ -285,7 +281,7 @@ labelnetstat() } void -shownetstat() +shownetstat(void) { register struct netinfo *p, *q; @@ -361,10 +357,7 @@ shownetstat() * If the nflag was specified, use numbers instead of names. */ static void -inetprint(in, port, proto) - register struct in_addr *in; - int port; - char *proto; +inetprint(register struct in_addr *in, int port, char *proto) { struct servent *sp = 0; char line[80], *cp, *index(); @@ -393,8 +386,7 @@ inetprint(in, port, proto) * numeric value, otherwise try for symbolic name. */ static char * -inetname(in) - struct in_addr in; +inetname(struct in_addr in) { char *cp = 0; static char line[50]; @@ -430,8 +422,7 @@ inetname(in) } int -cmdnetstat(cmd, args) - char *cmd, *args; +cmdnetstat(char *cmd, char *args) { register struct netinfo *p; diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index 77dbb1d1d3..d89444d403 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)pigs.c 8.2 (Berkeley) 9/23/93 + * + * $DragonFly: src/usr.bin/systat/pigs.c,v 1.7 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -53,7 +55,7 @@ #include "extern.h" #include "systat.h" -int compar __P((const void *, const void *)); +int compar(const void *, const void *); static int nproc; static struct p_times { @@ -66,14 +68,13 @@ static long fscale; static double lccpu; WINDOW * -openpigs() +openpigs(void) { return (subwin(stdscr, LINES-5-1, 0, 5, 0)); } void -closepigs(w) - WINDOW *w; +closepigs(WINDOW *w) { if (w == NULL) return; @@ -84,7 +85,7 @@ closepigs(w) void -showpigs() +showpigs(void) { register int i, j, y, k; struct eproc *ep; @@ -152,7 +153,7 @@ static struct nlist namelist[] = { }; int -initpigs() +initpigs(void) { fixpt_t ccpu; @@ -175,7 +176,7 @@ initpigs() } void -fetchpigs() +fetchpigs(void) { int i; float time; @@ -233,7 +234,7 @@ fetchpigs() } void -labelpigs() +labelpigs(void) { wmove(wnd, 0, 0); wclrtoeol(wnd); diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index 2fde778479..070a768ba6 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -32,7 +32,7 @@ * * @(#)swap.c 8.3 (Berkeley) 4/29/95 * $FreeBSD: src/usr.bin/systat/swap.c,v 1.12.2.2 2001/07/04 22:54:14 kris Exp $ - * $DragonFly: src/usr.bin/systat/swap.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/systat/swap.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -55,8 +55,8 @@ #include "systat.h" #include "extern.h" -extern char *getbsize __P((int *headerlenp, long *blocksizep)); -void showspace __P((char *header, int hlen, long blocksize)); +extern char *getbsize(int *headerlenp, long *blocksizep); +void showspace(char *header, int hlen, long blocksize); kvm_t *kd; @@ -64,14 +64,13 @@ static long blocksize; static int hlen; WINDOW * -openswap() +openswap(void) { return (subwin(stdscr, LINES-5-1, 0, 5, 0)); } void -closeswap(w) - WINDOW *w; +closeswap(WINDOW *w) { if (w == NULL) return; @@ -87,7 +86,7 @@ closeswap(w) */ int -initswap() +initswap(void) { int i; char msgbuf[BUFSIZ]; @@ -113,7 +112,7 @@ static struct kvm_swap kvmsw[16]; static int kvnsw; void -fetchswap() +fetchswap(void) { kvnsw = kvm_getswapinfo(kd, kvmsw, 16, 0); } @@ -139,7 +138,7 @@ labelswap() } void -showswap() +showswap(void) { int i; int pagesize = getpagesize(); diff --git a/usr.bin/systat/tcp.c b/usr.bin/systat/tcp.c index c2e0f9c711..ea62784d4c 100644 --- a/usr.bin/systat/tcp.c +++ b/usr.bin/systat/tcp.c @@ -32,7 +32,7 @@ * * @(#)mbufs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/tcp.c,v 1.3 1999/08/28 01:06:06 peter Exp $ - * $DragonFly: src/usr.bin/systat/tcp.c,v 1.3 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/tcp.c,v 1.4 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -91,8 +91,7 @@ opentcp(void) } void -closetcp(w) - WINDOW *w; +closetcp(WINDOW *w) { if (w == NULL) return; diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 1de4c969a0..6bed3a4fa4 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -32,7 +32,7 @@ * * @(#)vmstat.c 8.2 (Berkeley) 1/12/94 * $FreeBSD: src/usr.bin/systat/vmstat.c,v 1.38.2.4 2002/03/12 19:50:23 phantom Exp $ - * $DragonFly: src/usr.bin/systat/vmstat.c,v 1.4 2003/07/12 03:09:50 dillon Exp $ + * $DragonFly: src/usr.bin/systat/vmstat.c,v 1.5 2003/10/04 20:36:51 hmp Exp $ */ /* @@ -95,15 +95,15 @@ struct statinfo cur, last, run; static enum state { BOOT, TIME, RUN } state = TIME; -static void allocinfo __P((struct Info *)); -static void copyinfo __P((struct Info *, struct Info *)); -static float cputime __P((int)); -static void dinfo __P((int, int, struct statinfo *, struct statinfo *)); -static void getinfo __P((struct Info *, enum state)); -static void putint __P((int, int, int, int)); -static void putfloat __P((double, int, int, int, int, int)); -static void putlongdouble __P((long double, int, int, int, int, int)); -static int ucount __P((void)); +static void allocinfo(struct Info *); +static void copyinfo(struct Info *, struct Info *); +static float cputime(int); +static void dinfo(int, int, struct statinfo *, struct statinfo *); +static void getinfo(struct Info *, enum state); +static void putint(int, int, int, int); +static void putfloat(double, int, int, int, int, int); +static void putlongdouble(long double, int, int, int, int, int); +static int ucount(void); static int ncpu; static int ut; @@ -120,7 +120,7 @@ struct utmp utmp; WINDOW * -openkre() +openkre(void) { ut = open(_PATH_UTMP, O_RDONLY); @@ -130,8 +130,7 @@ openkre() } void -closekre(w) - WINDOW *w; +closekre(WINDOW *w) { (void) close(ut); @@ -197,7 +196,7 @@ static struct nlist namelist[] = { #define MAXDRIVES DRIVESPACE /* max # to display */ int -initkre() +initkre(void) { char *intrnamebuf, *cp; int i; @@ -264,7 +263,7 @@ initkre() } void -fetchkre() +fetchkre(void) { time_t now; struct tm *tp; @@ -281,7 +280,7 @@ fetchkre() } void -labelkre() +labelkre(void) { register int i, j; @@ -390,7 +389,7 @@ static char cpuorder[CPUSTATES] = { CP_SYS, CP_INTR, CP_USER, CP_NICE, CP_IDLE }; void -showkre() +showkre(void) { float f1, f2; int psiz, inttotal; @@ -563,8 +562,7 @@ showkre() } int -cmdkre(cmd, args) - char *cmd, *args; +cmdkre(char *cmd, char *args) { int retval; @@ -628,7 +626,7 @@ cmdkre(cmd, args) /* calculate number of users on the system */ static int -ucount() +ucount(void) { register int nusers = 0; @@ -643,8 +641,7 @@ ucount() } static float -cputime(indx) - int indx; +cputime(int indx) { double t; register int i; @@ -658,8 +655,7 @@ cputime(indx) } static void -putint(n, l, c, w) - int n, l, c, w; +putint(int n, int l, int c, int w) { char b[128]; @@ -679,9 +675,7 @@ putint(n, l, c, w) } static void -putfloat(f, l, c, w, d, nz) - double f; - int l, c, w, d, nz; +putfloat(double f, int l, int c, int w, int d, int nz) { char b[128]; @@ -703,9 +697,7 @@ putfloat(f, l, c, w, d, nz) } static void -putlongdouble(f, l, c, w, d, nz) - long double f; - int l, c, w, d, nz; +putlongdouble(long double f, int l, int c, int w, int d, int nz) { char b[128]; @@ -727,9 +719,7 @@ putlongdouble(f, l, c, w, d, nz) } static void -getinfo(s, st) - struct Info *s; - enum state st; +getinfo(struct Info *s, enum state st) { struct devinfo *tmp_dinfo; size_t size; @@ -784,8 +774,7 @@ getinfo(s, st) } static void -allocinfo(s) - struct Info *s; +allocinfo(struct Info *s) { s->intrcnt = (long *) calloc(nintr, sizeof(long)); @@ -794,8 +783,7 @@ allocinfo(s) } static void -copyinfo(from, to) - register struct Info *from, *to; +copyinfo(register struct Info *from, register struct Info *to) { long *intrcnt; @@ -811,9 +799,7 @@ copyinfo(from, to) } static void -dinfo(dn, c, now, then) - int dn, c; - struct statinfo *now, *then; +dinfo(int dn, int c, struct statinfo *now, struct statinfo *then) { long double transfers_per_second; long double kb_per_transfer, mb_per_second; diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index e019b77873..6e2bb5fc56 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -35,7 +35,7 @@ * * @(#)forward.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tail/forward.c,v 1.11.6.7 2003/01/07 05:26:22 tjr Exp $ - * $DragonFly: src/usr.bin/tail/forward.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tail/forward.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -54,7 +54,7 @@ #include #include "extern.h" -static void rlines __P((FILE *, off_t, struct stat *)); +static void rlines(FILE *, off_t, struct stat *); /* defines for inner loop actions */ #define USE_SLEEP 0 @@ -84,11 +84,7 @@ static void rlines __P((FILE *, off_t, struct stat *)); * NOREG cyclically read lines into a wrap-around array of buffers */ void -forward(fp, style, off, sbp) - FILE *fp; - enum STYLE style; - off_t off; - struct stat *sbp; +forward(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) { int ch, n, kq = -1; int action = USE_SLEEP; @@ -265,10 +261,7 @@ forward(fp, style, off, sbp) * rlines -- display the last offset lines of the file. */ static void -rlines(fp, off, sbp) - FILE *fp; - off_t off; - struct stat *sbp; +rlines(FILE *fp, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size; diff --git a/usr.bin/tail/misc.c b/usr.bin/tail/misc.c index b7dc4ccf48..82e87823d7 100644 --- a/usr.bin/tail/misc.c +++ b/usr.bin/tail/misc.c @@ -35,7 +35,7 @@ * * @(#)misc.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tail/misc.c,v 1.4.8.2 2001/04/18 09:32:08 dwmalone Exp $ - * $DragonFly: src/usr.bin/tail/misc.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tail/misc.c,v 1.3 2003/10/04 20:36:51 hmp Exp $ */ #include @@ -50,14 +50,14 @@ #include "extern.h" void -ierr() +ierr(void) { warn("%s", fname); rval = 1; } void -oerr() +oerr(void) { err(1, "stdout"); } @@ -67,9 +67,7 @@ oerr() * absolute file offset `startoff'. May move map window. */ int -mapprint(mip, startoff, len) - struct mapinfo *mip; - off_t startoff, len; +mapprint(struct mapinfo *mip, off_t startoff, off_t len) { int n; @@ -95,9 +93,7 @@ mapprint(mip, startoff, len) * aligned. */ int -maparound(mip, offset) - struct mapinfo *mip; - off_t offset; +maparound(struct mapinfo *mip, off_t offset) { if (mip->start != NULL && munmap(mip->start, mip->maplen) != 0) diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c index 0862952362..95061bd3f4 100644 --- a/usr.bin/tail/read.c +++ b/usr.bin/tail/read.c @@ -35,7 +35,7 @@ * * @(#)read.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tail/read.c,v 1.6.8.1 2001/01/24 08:41:14 ru Exp $ - * $DragonFly: src/usr.bin/tail/read.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tail/read.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -60,9 +60,7 @@ * the end. */ int -bytes(fp, off) - FILE *fp; - off_t off; +bytes(FILE *fp, off_t off) { int ch, len, tlen; char *ep, *p, *t; @@ -128,9 +126,7 @@ bytes(fp, off) * the end. */ int -lines(fp, off) - FILE *fp; - off_t off; +lines(FILE *fp, off_t off) { struct { u_int blen; diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 9ef28d7e5c..d8a0d62f14 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -35,7 +35,7 @@ * * @(#)reverse.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tail/reverse.c,v 1.9.2.3 2001/12/19 20:29:31 iedowse Exp $ - * $DragonFly: src/usr.bin/tail/reverse.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tail/reverse.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -51,8 +51,8 @@ #include #include "extern.h" -static void r_buf __P((FILE *)); -static void r_reg __P((FILE *, enum STYLE, off_t, struct stat *)); +static void r_buf(FILE *); +static void r_reg(FILE *, enum STYLE, off_t, struct stat *); /* * reverse -- display input in reverse order by line. @@ -73,11 +73,7 @@ static void r_reg __P((FILE *, enum STYLE, off_t, struct stat *)); * NOREG cyclically read input into a linked list of buffers */ void -reverse(fp, style, off, sbp) - FILE *fp; - enum STYLE style; - off_t off; - struct stat *sbp; +reverse(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) { if (style != REVERSE && off == 0) return; @@ -104,11 +100,7 @@ reverse(fp, style, off, sbp) * r_reg -- display a regular file in reverse order by line. */ static void -r_reg(fp, style, off, sbp) - FILE *fp; - enum STYLE style; - off_t off; - struct stat *sbp; +r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) { struct mapinfo map; off_t curoff, size, lineend; @@ -188,8 +180,7 @@ typedef struct bf { * user warned). */ static void -r_buf(fp) - FILE *fp; +r_buf(FILE *fp) { BF *mark, *tl, *tr; int ch, len, llen; diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index c8446f21b8..2a5dcb32e2 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)tail.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tail/tail.c,v 1.6.2.2 2001/12/19 20:29:31 iedowse Exp $ - * $DragonFly: src/usr.bin/tail/tail.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tail/tail.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -52,13 +52,11 @@ int Fflag, fflag, rflag, rval; char *fname; -static void obsolete __P((char **)); -static void usage __P((void)); +static void obsolete(char **); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat sb; FILE *fp; @@ -211,8 +209,7 @@ main(argc, argv) * the option argument for a -b, -c or -n option gets converted. */ static void -obsolete(argv) - char *argv[]; +obsolete(char **argv) { char *ap, *p, *t; size_t len; @@ -295,7 +292,7 @@ obsolete(argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: tail [-F | -f | -r] [-b # | -c # | -n #] [file ...]\n"); diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c index e97f0da282..162554dce8 100644 --- a/usr.bin/talk/ctl.c +++ b/usr.bin/talk/ctl.c @@ -32,7 +32,7 @@ * * @(#)ctl.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/ctl.c,v 1.6 1999/08/28 01:06:10 peter Exp $ - * $DragonFly: src/usr.bin/talk/ctl.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/ctl.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* @@ -62,7 +62,7 @@ int invitation_waiting = 0; CTL_MSG msg; void -open_sockt() +open_sockt(void) { int length; @@ -80,7 +80,7 @@ open_sockt() /* open the ctl socket */ void -open_ctl() +open_ctl(void) { int length; @@ -100,8 +100,7 @@ open_ctl() /* print_addr is a debug print routine */ void -print_addr(addr) - struct sockaddr_in addr; +print_addr(struct sockaddr_in addr) { int i; diff --git a/usr.bin/talk/ctl_transact.c b/usr.bin/talk/ctl_transact.c index 249b8e1d37..ec43699986 100644 --- a/usr.bin/talk/ctl_transact.c +++ b/usr.bin/talk/ctl_transact.c @@ -32,7 +32,7 @@ * * @(#)ctl_transact.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/ctl_transact.c,v 1.5 1999/08/28 01:06:11 peter Exp $ - * $DragonFly: src/usr.bin/talk/ctl_transact.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/ctl_transact.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -48,11 +48,7 @@ * of time */ void -ctl_transact(target, msg, type, rp) - struct in_addr target; - CTL_MSG msg; - int type; - CTL_RESPONSE *rp; +ctl_transact(struct in_addr target, CTL_MSG msg, int type, CTL_RESPONSE *rp) { fd_set read_mask, ctl_mask; int nready = 0, cc; diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c index d4497cefe1..06c95d624b 100644 --- a/usr.bin/talk/display.c +++ b/usr.bin/talk/display.c @@ -32,7 +32,7 @@ * * @(#)display.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/display.c,v 1.7 1999/08/28 01:06:11 peter Exp $ - * $DragonFly: src/usr.bin/talk/display.c,v 1.3 2003/08/24 15:51:45 drhodus Exp $ + * $DragonFly: src/usr.bin/talk/display.c,v 1.4 2003/10/04 20:36:52 hmp Exp $ */ /* @@ -53,8 +53,7 @@ int curses_initialized = 0; * an argument of the form --foo at least once. */ int -max(a,b) - int a, b; +max(int a, int b) { return (a > b ? a : b); @@ -65,10 +64,7 @@ max(a,b) * characters while we are at it. */ void -display(win, text, size) - xwin_t *win; - char *text; - int size; +display(xwin_t *win, char *text, int size) { int i; char cch; @@ -175,10 +171,7 @@ display(win, text, size) * Read the character at the indicated position in win */ int -readwin(win, line, col) - WINDOW *win; - int line; - int col; +readwin(WINDOW *win, int line, int col) { int oldline, oldcol; int c; diff --git a/usr.bin/talk/get_addrs.c b/usr.bin/talk/get_addrs.c index d6ad939e96..eb545bee1b 100644 --- a/usr.bin/talk/get_addrs.c +++ b/usr.bin/talk/get_addrs.c @@ -32,7 +32,7 @@ * * @(#)get_addrs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/get_addrs.c,v 1.4 1999/08/28 01:06:11 peter Exp $ - * $DragonFly: src/usr.bin/talk/get_addrs.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/get_addrs.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -42,8 +42,7 @@ #include "talk_ctl.h" void -get_addrs(my_machine_name, his_machine_name) - char *my_machine_name, *his_machine_name; +get_addrs(char *my_machine_name, char *his_machine_name) { struct hostent *hp; struct servent *sp; diff --git a/usr.bin/talk/get_iface.c b/usr.bin/talk/get_iface.c index e8626994ea..b267128739 100644 --- a/usr.bin/talk/get_iface.c +++ b/usr.bin/talk/get_iface.c @@ -30,7 +30,7 @@ * Id: find_interface.c,v 1.1 1995/08/14 16:08:39 wollman Exp * * $FreeBSD: src/usr.bin/talk/get_iface.c,v 1.7 1999/08/28 01:06:12 peter Exp $ - * $DragonFly: src/usr.bin/talk/get_iface.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/get_iface.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -43,9 +43,7 @@ */ int -get_iface(dst, iface) - struct in_addr *dst; - struct in_addr *iface; +get_iface(struct in_addr *dst, struct in_addr *iface) { static struct sockaddr_in local; struct sockaddr_in remote; diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index 502f677ac8..f8844252bf 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -32,7 +32,7 @@ * * @(#)get_names.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/get_names.c,v 1.6.2.1 2001/07/30 10:31:29 dd Exp $ - * $DragonFly: src/usr.bin/talk/get_names.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/get_names.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -55,9 +55,7 @@ usage(void) * Determine the local and remote user, tty, and machines */ void -get_names(argc, argv) - int argc; - char *argv[]; +get_names(int argc, char **argv) { char hostname[MAXHOSTNAMELEN]; char *his_name, *my_name; diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c index 5c2d630e31..50bd3b8884 100644 --- a/usr.bin/talk/init_disp.c +++ b/usr.bin/talk/init_disp.c @@ -32,7 +32,7 @@ * * @(#)init_disp.c 8.2 (Berkeley) 2/16/94 * $FreeBSD: src/usr.bin/talk/init_disp.c,v 1.11.2.1 2001/07/30 10:31:29 dd Exp $ - * $DragonFly: src/usr.bin/talk/init_disp.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/init_disp.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* @@ -52,7 +52,7 @@ * Make sure the callee can write to the screen */ void -check_writeable() +check_writeable(void) { char *tty; struct stat sb; @@ -70,7 +70,7 @@ check_writeable() * and build the various windows. */ void -init_display() +init_display(void) { struct sigaction sa; @@ -119,7 +119,7 @@ init_display() * connection are the three edit characters. */ void -set_edit_chars() +set_edit_chars(void) { char buf[3]; int cc; @@ -151,8 +151,7 @@ set_edit_chars() /* ARGSUSED */ void -sig_sent(signo) - int signo; +sig_sent(int signo) { message("Connection closing. Exiting"); @@ -163,7 +162,7 @@ sig_sent(signo) * All done talking...hang up the phone and reset terminal thingy's */ void -quit() +quit(void) { if (curses_initialized) { diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c index 3565b671c6..2b1624c588 100644 --- a/usr.bin/talk/invite.c +++ b/usr.bin/talk/invite.c @@ -32,7 +32,7 @@ * * @(#)invite.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/invite.c,v 1.6.2.1 2000/10/05 17:40:38 ru Exp $ - * $DragonFly: src/usr.bin/talk/invite.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/invite.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -61,7 +61,7 @@ int local_id, remote_id; jmp_buf invitebuf; void -invite_remote() +invite_remote(void) { int nfd, read_mask, template, new_sockt; struct itimerval itimer; @@ -118,8 +118,7 @@ invite_remote() */ /* ARGSUSED */ void -re_invite(signo) - int signo; +re_invite(int signo) { message("Ringing your party again"); @@ -149,7 +148,7 @@ static char *answers[] = { * Transmit the invitation and process the response */ void -announce_invite() +announce_invite(void) { CTL_RESPONSE response; @@ -171,7 +170,7 @@ announce_invite() * Tell the daemon to remove your invitation */ void -send_delete() +send_delete(void) { msg.type = DELETE; diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c index 64634ecd27..36a5e88c48 100644 --- a/usr.bin/talk/io.c +++ b/usr.bin/talk/io.c @@ -32,7 +32,7 @@ * * @(#)io.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/io.c,v 1.9.2.2 2001/10/15 13:42:07 dd Exp $ - * $DragonFly: src/usr.bin/talk/io.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/io.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* @@ -55,7 +55,7 @@ * The routine to do the actual talking */ void -talk() +talk(void) { struct hostent *hp, *hp2; int nb; @@ -140,8 +140,7 @@ talk() * on the screen and then exits. (i.e. a curses version of perror) */ void -p_error(string) - char *string; +p_error(char *string) { wmove(my_win.x_win, current_line, 0); wprintw(my_win.x_win, "[%s : %s (%d)]\n", @@ -156,8 +155,7 @@ p_error(string) * Display string in the standard location */ void -message(string) - char *string; +message(char *string) { wmove(my_win.x_win, current_line, 0); wprintw(my_win.x_win, "[%s]\n", string); diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c index 23e18db562..440e277db3 100644 --- a/usr.bin/talk/look_up.c +++ b/usr.bin/talk/look_up.c @@ -32,7 +32,7 @@ * * @(#)look_up.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/look_up.c,v 1.5 1999/08/28 01:06:14 peter Exp $ - * $DragonFly: src/usr.bin/talk/look_up.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/look_up.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -46,7 +46,7 @@ * See if the local daemon has an invitation for us. */ int -check_local() +check_local(void) { CTL_RESPONSE response; register CTL_RESPONSE *rp = &response; @@ -96,8 +96,7 @@ check_local() * Look for an invitation on 'machine' */ int -look_for_invite(rp) - CTL_RESPONSE *rp; +look_for_invite(CTL_RESPONSE *rp) { struct in_addr machine_addr; diff --git a/usr.bin/talk/msgs.c b/usr.bin/talk/msgs.c index f75592d503..cc82d128e7 100644 --- a/usr.bin/talk/msgs.c +++ b/usr.bin/talk/msgs.c @@ -32,7 +32,7 @@ * * @(#)msgs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/msgs.c,v 1.5 1999/08/28 01:06:14 peter Exp $ - * $DragonFly: src/usr.bin/talk/msgs.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/msgs.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* @@ -50,14 +50,13 @@ int current_line = 0; /* ARGSUSED */ void -disp_msg(signo) - int signo; +disp_msg(int signo) { message(current_state); } void -start_msgs() +start_msgs(void) { struct itimerval itimer; @@ -69,7 +68,7 @@ start_msgs() } void -end_msgs() +end_msgs(void) { struct itimerval itimer; diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c index 156544eee3..0294ac0728 100644 --- a/usr.bin/talk/talk.c +++ b/usr.bin/talk/talk.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)talk.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/talk/talk.c,v 1.7 1999/08/28 01:06:15 peter Exp $ - * $DragonFly: src/usr.bin/talk/talk.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/talk/talk.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include "talk.h" @@ -54,12 +54,10 @@ * Fixed to not run with unwriteable terminals MRVM 28/12/94 */ -int main __P((int, char **)); +int main(int, char **); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { (void) setlocale(LC_CTYPE, ""); diff --git a/usr.bin/tconv/quit.c b/usr.bin/tconv/quit.c index f30fb5008d..92de609ec6 100644 --- a/usr.bin/tconv/quit.c +++ b/usr.bin/tconv/quit.c @@ -7,6 +7,7 @@ * * quit with a diagnostic message printed on stderr * + * $DragonFly: src/usr.bin/tconv/Attic/quit.c,v 1.2 2003/10/04 20:36:52 hmp Exp $ */ #define NOTLIB @@ -26,33 +27,12 @@ void (*cleanup)(); /* PRINTFLIKE2 */ noreturn -#ifdef USE_STDARG -#ifdef USE_PROTOTYPES void quit(int e, char *fmt, ...) -#else -void quit(e, fmt) -int e; -char *fmt; -#endif -#else -void quit(va_alist) -va_dcl -#endif { -#ifndef USE_STDARG - int e; - char *fmt; -#endif va_list ap; -#ifdef USE_STDARG va_start(ap, fmt); -#else - va_start(ap); - e = va_arg(ap, int); - fmt = va_arg(ap, char *); -#endif (*cleanup)(e); diff --git a/usr.bin/tconv/tconv.c b/usr.bin/tconv/tconv.c index 925f5be821..2fbd6d07aa 100644 --- a/usr.bin/tconv/tconv.c +++ b/usr.bin/tconv/tconv.c @@ -34,7 +34,7 @@ * * @(#) mytinfo tconv.c 3.2 92/02/01 public domain, By Ross Ridge * $FreeBSD: src/usr.bin/tconv/tconv.c,v 1.5.2.1 2001/03/04 09:07:50 kris Exp $ - * $DragonFly: src/usr.bin/tconv/Attic/tconv.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tconv/Attic/tconv.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #define NOTLIB @@ -83,7 +83,7 @@ int lineno = 0; /* current line number */ /* print the first part of a warning message */ void -warn() { +warn(void) { if (lineno == 0) fprintf(stderr, "warning: "); else @@ -95,8 +95,8 @@ warn() { * at the right margin. */ void -putstr(s) -char *s; { +putstr(char *s) +{ static pos = 0; int l; @@ -149,7 +149,8 @@ char *dp; /* pointer to the end of the converted string */ /* push onstack on to the stack */ void -push() { +push(void) +{ if (stackptr > MAX_PUSHED) { warn(); fprintf(stderr, "string to complex to convert\n"); @@ -159,7 +160,8 @@ push() { /* pop the top of the stack into onstack */ void -pop() { +pop(void) +{ if (stackptr == 0) if (onstack == 0) { warn(); @@ -173,8 +175,8 @@ pop() { /* convert a character to a terminfo push */ static int -cvtchar(sp) -register char *sp; { +cvtchar(register char *sp) +{ char c; int l; @@ -228,9 +230,8 @@ register char *sp; { /* push n copies of param on the terminfo stack if not already there */ void -getparm(parm, n) -int parm; -int n; { +getparm(int parm, int n) +{ if (seenr) { if (parm == 1) parm = 2; @@ -270,9 +271,8 @@ int n; { /* convert a string to terminfo format */ char * -convstr(s, i) -register char *s; -int i; { +convstr(register char *s, int i) +{ static char line[MAX_LINE]; register char *cap; int nocode = 0; @@ -555,9 +555,8 @@ int i; { #define MSB(n) (((unsigned) (n) >> 8) & 0377) void -writebin(fd, name) -int fd; -char *name; { +writebin(int fd, char *name) +{ static char bin[MAX_BUF + 1]; register char *s; register char *d; @@ -657,7 +656,8 @@ toobig: } void -find_directory() { +find_directory(void) +{ struct term_path *p; struct stat st; @@ -679,8 +679,8 @@ find_directory() { /* convert a terminal name to a binary filename */ char * -binfile(name) -char *name; { +binfile(char *name) +{ static char line[MAX_LINE+1]; sprintf(line, "%s/%c/%s", directory, *name, name); @@ -688,8 +688,8 @@ char *name; { } char * -bindir(name) -char *name; { +bindir(char *name) +{ static char line[MAX_LINE+1]; sprintf(line, "%s/%c", directory, *name); @@ -697,8 +697,8 @@ char *name; { } int -badname(name) -char *name; { +badname(char *name) +{ while(*name) { if (*name == '/' || !isgraph(*name)) return 1; @@ -709,8 +709,8 @@ char *name; { /* output a terminfo binary */ void -outputbin(name) -char *name; { +outputbin(char *name) +{ register char *s, *d, *last; char tmp[MAX_LINE+1]; char line[MAX_LINE+1]; @@ -819,8 +819,8 @@ char *name; { /* output an entry in terminfo source format */ void -outputinfo(name) -char *name; { +outputinfo(char *name) +{ int i; char line[MAX_LINE]; @@ -856,7 +856,8 @@ char *name; { /* convert a terminfo entry to binary format */ void -convtinfo() { +convtinfo(void) +{ int i, r; termcap = 0; @@ -889,7 +890,8 @@ convtinfo() { /* convert a terminfo binary to terminfo source */ void -convtbin() { +convtbin(void) +{ int i, r; termcap = 0; @@ -920,7 +922,8 @@ convtbin() { /* convert a termcap entry to terminfo format */ void -convtcap() { +convtcap(void) +{ int i, r; char *name; @@ -968,8 +971,8 @@ convtcap() { } void -convbinfile(file) -char *file; { +convbinfile(char *file) +{ register FILE *f; int r; @@ -987,8 +990,8 @@ char *file; { /* convert a termcap file to terminfo format */ void -convtcfile(file) -char *file; { +convtcfile(char *file) +{ int nocolon; register int c; register char *d; @@ -1073,10 +1076,8 @@ char *file; { } static int -getln(f, buf, len) -FILE *f; -register char *buf; -int len; { +getln(FILE *f, register char *buf, int len) +{ register int c, i = 0; while((c = getc(f)) == '#') { @@ -1117,8 +1118,8 @@ int len; { } void -convtifile(file) -char *file; { +convtifile(char *file) +{ static char line[MAX_LINE+1]; int l; int n; @@ -1176,16 +1177,16 @@ char *file; { /* dummy routine for quit */ /* ARGSUSED */ void -do_cleanup(e) -int e; { +do_cleanup(int e) +{ return; } /* print out usage, called by quit */ /* ARGSUSED */ void -usage(e) -int e; { +usage(int e) +{ fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: tconv [-b] [-c [-OUGd]] [-i] [-B [-D dir]] [-I] [-k] [-V]", " [-t term] [file]", @@ -1195,9 +1196,8 @@ int e; { } int -main(argc, argv) -int argc; -char **argv; { +main(int argc, char **argv) +{ char *term = NULL; char *file = NULL; int r; diff --git a/usr.bin/tcopy/tcopy.c b/usr.bin/tcopy/tcopy.c index fe962b2c97..01506f7c84 100644 --- a/usr.bin/tcopy/tcopy.c +++ b/usr.bin/tcopy/tcopy.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1985, 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)tcopy.c 8.2 (Berkeley) 4/17/94 * $FreeBSD: src/usr.bin/tcopy/tcopy.c,v 1.7.2.1 2002/11/07 17:54:42 imp Exp $ - * $DragonFly: src/usr.bin/tcopy/tcopy.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tcopy/tcopy.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -59,17 +59,15 @@ int filen, guesslen, maxblk = MAXREC; u_int64_t lastrec, record, size, tsize; FILE *msg; -void *getspace __P((int)); -void intr __P((int)); -static void usage __P((void)); -void verify __P((int, int, char *)); -void writeop __P((int, int)); +void *getspace(int); +void intr(int); +static void usage(void); +void verify(int, int, char *); +void writeop(int, int); void rewind_tape(int); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register int lastnread, nread, nw, inp, outp; enum {READ, VERIFY, COPY, COPYVERIFY} op = READ; @@ -217,9 +215,7 @@ r1: guesslen = 0; } void -verify(inp, outp, outb) - register int inp, outp; - register char *outb; +verify(register int inp, register int outp, register char *outb) { register int eot, inmaxblk, inn, outmaxblk, outn; register char *inb; @@ -271,8 +267,7 @@ r2: if (inn != outn) { } void -intr(signo) - int signo; +intr(int signo) { if (record) { if (record - lastrec > 1) @@ -286,8 +281,7 @@ intr(signo) } void * -getspace(blk) - int blk; +getspace(int blk) { void *bp; @@ -297,8 +291,7 @@ getspace(blk) } void -writeop(fd, type) - int fd, type; +writeop(int fd, int type) { struct mtop op; @@ -309,7 +302,7 @@ writeop(fd, type) } static void -usage() +usage(void) { fprintf(stderr, "usage: tcopy [-cvx] [-s maxblk] [src [dest]]\n"); exit(1); diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c index d4e5a99ece..3d7852aa71 100644 --- a/usr.bin/tee/tee.c +++ b/usr.bin/tee/tee.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)tee.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tee/tee.c,v 1.4 1999/08/28 01:06:21 peter Exp $ - * $DragonFly: src/usr.bin/tee/tee.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tee/tee.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -53,13 +53,11 @@ typedef struct _list { } LIST; LIST *head; -void add __P((int, char *)); -static void usage __P((void)); +void add(int, char *); +static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register LIST *p; register int n, fd, rval, wval; @@ -116,16 +114,14 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: tee [-ai] [file ...]\n"); exit(1); } void -add(fd, name) - int fd; - char *name; +add(int fd, char *name) { LIST *p; diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 153cadda7c..a8fe8912be 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -32,7 +32,7 @@ * * @(#)commands.c 8.4 (Berkeley) 5/30/95 * $FreeBSD: src/usr.bin/telnet/commands.c,v 1.21.2.6 2002/11/30 05:35:13 eric Exp $ - * $DragonFly: src/usr.bin/telnet/commands.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/telnet/commands.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -406,8 +406,7 @@ send_docmd(char *name) } static int -send_dontcmd(name) - char *name; +send_dontcmd(char *name) { return(send_tncmd(send_dont, "dont", name)); } diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 3643e86c94..b6ae8e9bac 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tftp/main.c,v 1.8.2.3 2002/05/14 22:08:07 bsd Exp $ - * $DragonFly: src/usr.bin/tftp/main.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tftp/main.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* Many bug fixes are from Jim Guyton */ @@ -79,34 +79,34 @@ jmp_buf toplevel; volatile int txrx_error; void intr(); -void get __P((int, char **)); -void help __P((int, char **)); -void modecmd __P((int, char **)); -void put __P((int, char **)); -void quit __P((int, char **)); -void setascii __P((int, char **)); -void setbinary __P((int, char **)); -void setpeer0 __P((char *, char *)); -void setpeer __P((int, char **)); -void setrexmt __P((int, char **)); -void settimeout __P((int, char **)); -void settrace __P((int, char **)); -void setverbose __P((int, char **)); -void status __P((int, char **)); - -static void command __P((void)) __dead2; - -static void getusage __P((char *)); -static void makeargv __P((void)); -static void putusage __P((char *)); -static void settftpmode __P((char *)); +void get(int, char **); +void help(int, char **); +void modecmd(int, char **); +void put(int, char **); +void quit(int, char **); +void setascii(int, char **); +void setbinary(int, char **); +void setpeer0(char *, char *); +void setpeer(int, char **); +void setrexmt(int, char **); +void settimeout(int, char **); +void settrace(int, char **); +void setverbose(int, char **); +void status(int, char **); + +static void command(void) __dead2; + +static void getusage(char *); +static void makeargv(void); +static void putusage(char *); +static void settftpmode(char *); #define HELPINDENT (sizeof("connect")) struct cmd { char *name; char *help; - void (*handler) __P((int, char **)); + void (*handler)(int, char **); }; char vhelp[] = "toggle verbose mode"; @@ -144,9 +144,7 @@ struct cmd *getcmd(); char *tail(); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { f = -1; strcpy(mode, "netascii"); @@ -164,9 +162,7 @@ main(argc, argv) char hostname[MAXHOSTNAMELEN]; void -setpeer0(host, port) - char *host; - char *port; +setpeer0(char *host, char *port) { struct addrinfo hints, *res0, *res; int error; @@ -232,9 +228,7 @@ setpeer0(host, port) } void -setpeer(argc, argv) - int argc; - char *argv[]; +setpeer(int argc, char **argv) { if (argc < 2) { @@ -269,9 +263,7 @@ struct modes { }; void -modecmd(argc, argv) - int argc; - char *argv[]; +modecmd(int argc, char **argv) { register struct modes *p; char *sep; @@ -304,26 +296,21 @@ modecmd(argc, argv) } void -setbinary(argc, argv) - int argc; - char *argv[]; +setbinary(int argc, char **argv) { settftpmode("octet"); } void -setascii(argc, argv) - int argc; - char *argv[]; +setascii(int argc, char **argv) { settftpmode("netascii"); } static void -settftpmode(newmode) - char *newmode; +settftpmode(char *newmode) { strcpy(mode, newmode); if (verbose) @@ -335,9 +322,7 @@ settftpmode(newmode) * Send file(s). */ void -put(argc, argv) - int argc; - char *argv[]; +put(int argc, char **argv) { int fd; register int n; @@ -409,8 +394,7 @@ put(argc, argv) } static void -putusage(s) - char *s; +putusage(char *s) { printf("usage: %s file ... host:target, or\n", s); printf(" %s file ... target (when already connected)\n", s); @@ -420,9 +404,7 @@ putusage(s) * Receive file(s). */ void -get(argc, argv) - int argc; - char *argv[]; +get(int argc, char **argv) { int fd; register int n; @@ -491,8 +473,7 @@ get(argc, argv) } static void -getusage(s) - char *s; +getusage(char *s) { printf("usage: %s host:file host:file ... file, or\n", s); printf(" %s file file ... file if connected\n", s); @@ -501,9 +482,7 @@ getusage(s) int rexmtval = TIMEOUT; void -setrexmt(argc, argv) - int argc; - char *argv[]; +setrexmt(int argc, char **argv) { int t; @@ -529,9 +508,7 @@ setrexmt(argc, argv) int maxtimeout = 5 * TIMEOUT; void -settimeout(argc, argv) - int argc; - char *argv[]; +settimeout(int argc, char **argv) { int t; @@ -555,9 +532,7 @@ settimeout(argc, argv) } void -status(argc, argv) - int argc; - char *argv[]; +status(int argc, char **argv) { if (connected) printf("Connected to %s.\n", hostname); @@ -570,7 +545,7 @@ status(argc, argv) } void -intr() +intr(void) { signal(SIGALRM, SIG_IGN); @@ -579,8 +554,7 @@ intr() } char * -tail(filename) - char *filename; +tail(char *filename) { register char *s; @@ -599,7 +573,7 @@ tail(filename) * Command parser. */ static void -command() +command(void) { register struct cmd *c; char *cp; @@ -634,8 +608,7 @@ command() } struct cmd * -getcmd(name) - register char *name; +getcmd(register char *name) { register char *p, *q; register struct cmd *c, *found; @@ -666,7 +639,7 @@ getcmd(name) * Slice a string up into argc/argv. */ static void -makeargv() +makeargv(void) { register char *cp; register char **argp = margv; @@ -691,9 +664,7 @@ makeargv() } void -quit(argc, argv) - int argc; - char *argv[]; +quit(int argc, char **argv) { exit(txrx_error); @@ -703,9 +674,7 @@ quit(argc, argv) * Help command. */ void -help(argc, argv) - int argc; - char *argv[]; +help(int argc, char **argv) { register struct cmd *c; @@ -729,18 +698,14 @@ help(argc, argv) } void -settrace(argc, argv) - int argc; - char **argv; +settrace(int argc, char **argv) { trace = !trace; printf("Packet tracing %s.\n", trace ? "on" : "off"); } void -setverbose(argc, argv) - int argc; - char **argv; +setverbose(int argc, char **argv) { verbose = !verbose; printf("Verbose mode %s.\n", verbose ? "on" : "off"); diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c index 97586e3d66..12aed3bf4e 100644 --- a/usr.bin/tftp/tftp.c +++ b/usr.bin/tftp/tftp.c @@ -32,7 +32,7 @@ * * @(#)tftp.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tftp/tftp.c,v 1.5.2.3 2002/05/14 22:08:07 bsd Exp $ - * $DragonFly: src/usr.bin/tftp/tftp.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tftp/tftp.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* Many bug fixes are from Jim Guyton */ @@ -74,23 +74,20 @@ int timeout; jmp_buf toplevel; jmp_buf timeoutbuf; -static void nak __P((int, struct sockaddr *)); -static int makerequest __P((int, const char *, struct tftphdr *, const char *)); -static void printstats __P((const char *, unsigned long)); -static void startclock __P((void)); -static void stopclock __P((void)); -static void timer __P((int)); -static void tpacket __P((const char *, struct tftphdr *, int)); -static int cmpport __P((struct sockaddr *, struct sockaddr *)); +static void nak(int, struct sockaddr *); +static int makerequest(int, const char *, struct tftphdr *, const char *); +static void printstats(const char *, unsigned long); +static void startclock(void); +static void stopclock(void); +static void timer(int); +static void tpacket(const char *, struct tftphdr *, int); +static int cmpport(struct sockaddr *, struct sockaddr *); /* * Send the requested file. */ void -xmitfile(fd, name, mode) - int fd; - char *name; - char *mode; +xmitfile(int fd, char *name, char *mode) { register struct tftphdr *ap; /* data and ack packets */ struct tftphdr *r_init(), *dp; @@ -205,10 +202,7 @@ abort: * Receive a file. */ void -recvfile(fd, name, mode) - int fd; - char *name; - char *mode; +recvfile(int fd, char *name, char *mode) { register struct tftphdr *ap; struct tftphdr *dp, *w_init(); @@ -327,11 +321,7 @@ abort: /* ok to ack, since user */ } static int -makerequest(request, name, tp, mode) - int request; - const char *name; - struct tftphdr *tp; - const char *mode; +makerequest(int request, const char *name, struct tftphdr *tp, const char *mode) { register char *cp; @@ -368,9 +358,7 @@ struct errmsg { * offset by 100. */ static void -nak(error, peer) - int error; - struct sockaddr *peer; +nak(int error, struct sockaddr *peer) { register struct errmsg *pe; register struct tftphdr *tp; @@ -396,10 +384,7 @@ nak(error, peer) } static void -tpacket(s, tp, n) - const char *s; - struct tftphdr *tp; - int n; +tpacket(const char *s, struct tftphdr *tp, int n) { static char *opcodes[] = { "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" }; @@ -439,23 +424,21 @@ struct timeval tstart; struct timeval tstop; static void -startclock() +startclock(void) { (void)gettimeofday(&tstart, NULL); } static void -stopclock() +stopclock(void) { (void)gettimeofday(&tstop, NULL); } static void -printstats(direction, amount) - const char *direction; - unsigned long amount; +printstats(const char *direction, unsigned long amount) { double delta; /* compute delta in 1/10's second units */ @@ -469,8 +452,7 @@ printstats(direction, amount) } static void -timer(sig) - int sig; +timer(int sig) { timeout += rexmtval; @@ -483,9 +465,7 @@ timer(sig) } static int -cmpport(sa, sb) - struct sockaddr *sa; - struct sockaddr *sb; +cmpport(struct sockaddr *sa, struct sockaddr *sb) { char a[NI_MAXSERV], b[NI_MAXSERV]; diff --git a/usr.bin/tftp/tftpsubs.c b/usr.bin/tftp/tftpsubs.c index 7d5ecf3d60..a64300a9d8 100644 --- a/usr.bin/tftp/tftpsubs.c +++ b/usr.bin/tftp/tftpsubs.c @@ -32,7 +32,7 @@ * * @(#)tftpsubs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tftp/tftpsubs.c,v 1.3.2.1 2002/04/26 17:22:43 ume Exp $ - * $DragonFly: src/usr.bin/tftp/tftpsubs.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tftp/tftpsubs.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ /* Simple minded read-ahead/write-behind subroutines for tftp user and @@ -82,8 +82,8 @@ struct tftphdr *w_init() { return rw_init(0); } /* write-behind */ struct tftphdr *r_init() { return rw_init(1); } /* read-ahead */ static struct tftphdr * -rw_init(x) /* init for either read-ahead or write-behind */ - int x; /* zero for write-behind, one for read-head */ +rw_init(int x /* zero for write-behind, one for read-head */ + ) /* init for either read-ahead or write-behind */ { newline = 0; /* init crlf flag */ prevchar = -1; @@ -99,10 +99,10 @@ rw_init(x) /* init for either read-ahead or write-behind */ Free it and return next buffer filled with data. */ int -readit(file, dpp, convert) - FILE *file; /* file opened for read */ - struct tftphdr **dpp; - int convert; /* if true, convert to ascii */ +readit(FILE *file, /* file opened for read */ + struct tftphdr **dpp, + int convert /* if true, convert to ascii */ + ) { struct bf *b; @@ -122,9 +122,7 @@ readit(file, dpp, convert) * conversions are lf -> cr,lf and cr -> cr, nul */ void -read_ahead(file, convert) - FILE *file; /* file opened for read */ - int convert; /* if true, convert to ascii */ +read_ahead(FILE *file, int convert) { register int i; register char *p; @@ -171,10 +169,7 @@ read_ahead(file, convert) available. */ int -writeit(file, dpp, ct, convert) - FILE *file; - struct tftphdr **dpp; - int ct, convert; +writeit(FILE *file, struct tftphdr **dpp, int ct, int convert) { bfs[current].counter = ct; /* set size of data to write */ current = !current; /* switch to other buffer */ @@ -192,9 +187,7 @@ writeit(file, dpp, ct, convert) * CR followed by anything else. In this case we leave it alone. */ int -write_behind(file, convert) - FILE *file; - int convert; +write_behind(FILE *file, int convert) { char *buf; int count; @@ -251,8 +244,7 @@ skipit: */ int -synchnet(f) - int f; /* socket to flush */ +synchnet(int f) { int i, j = 0; char rbuf[PKTSIZE]; diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index 9ebcfe15e1..b1882793f8 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1987, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)time.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/time/time.c,v 1.14.2.5 2002/06/28 08:35:15 tjr Exp $ - * $DragonFly: src/usr.bin/time/time.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/time/time.c,v 1.3 2003/10/04 20:36:52 hmp Exp $ */ #include @@ -59,9 +59,7 @@ static void usage(void); static char decimal_point; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int pid; int aflag, ch, hflag, lflag, status, pflag; @@ -214,7 +212,7 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: time [-al] [-h|-p] [-o file] utility [argument ...]\n"); @@ -225,7 +223,7 @@ usage() * Return the frequency of the kernel's statistics clock. */ static int -getstathz() +getstathz(void) { struct clockinfo clockrate; int mib[2]; @@ -240,10 +238,7 @@ getstathz() } static void -humantime(out, sec, usec) - FILE *out; - long sec; - long usec; +humantime(FILE *out, long sec, long usec) { long days, hrs, mins; diff --git a/usr.bin/tip/tip/cmds.c b/usr.bin/tip/tip/cmds.c index 9ee1e43bfe..f52e70f288 100644 --- a/usr.bin/tip/tip/cmds.c +++ b/usr.bin/tip/tip/cmds.c @@ -32,7 +32,7 @@ * * @(#)cmds.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tip/tip/cmds.c,v 1.11.2.2 2000/07/01 12:24:23 ps Exp $ - * $DragonFly: src/usr.bin/tip/tip/cmds.c,v 1.2 2003/06/17 04:29:32 dillon Exp $ + * $DragonFly: src/usr.bin/tip/tip/cmds.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include "tipconf.h" @@ -62,31 +62,31 @@ void timeout(); /* timeout function called on alarm */ static void stopsnd(); /* SIGINT handler during file transfers */ static void intcopy(); /* interrupt routine for file transfers */ -void suspend __P((char)); -void genbrk __P((void)); -void variable __P((void)); -void finish __P((void)); -void tipabort __P((char *)); -void chdirectory __P((void)); -void shell __P((void)); -void cu_put __P((char)); -void sendfile __P((char)); -void pipefile __P((void)); -void cu_take __P((char)); -void getfl __P((char)); - -static int anyof __P((char *, char *)); -static void tandem __P((char *)); -static void prtime __P((char *, time_t)); -static int args __P((char *, char **, int)); -static void execute __P((char *)); -static void send __P((char)); -static void transmit __P((FILE *, char *, char *)); -static void transfer __P((char *, int, char *)); -static void xfer __P((char *, int, char *)); +void suspend(char); +void genbrk(void); +void variable(void); +void finish(void); +void tipabort(char *); +void chdirectory(void); +void shell(void); +void cu_put(char); +void sendfile(char); +void pipefile(void); +void cu_take(char); +void getfl(char); + +static int anyof(char *, char *); +static void tandem(char *); +static void prtime(char *, time_t); +static int args(char *, char **, int); +static void execute(char *); +static void send(char); +static void transmit(FILE *, char *, char *); +static void transfer(char *, int, char *); +static void xfer(char *, int, char *); void -usedefchars () +usedefchars (void) { #if HAVE_TERMIOS int cnt; @@ -101,7 +101,7 @@ usedefchars () } void -usetchars () +usetchars (void) { #if HAVE_TERMIOS tcsetattr (0, TCSANOW, &ctermios); @@ -111,7 +111,7 @@ usetchars () } void -flush_remote () +flush_remote (void) { #ifdef TIOCFLUSH int cmd = 0; @@ -128,8 +128,7 @@ flush_remote () * get a file from the remote host */ void -getfl(c) - char c; +getfl(char c) { char buf[256], *cp, *expand(); @@ -159,8 +158,7 @@ getfl(c) * Cu-like take command */ void -cu_take(cc) - char cc; +cu_take(char cc) { int fd, argc; char line[BUFSIZ], *expand(), *cp; @@ -185,8 +183,7 @@ cu_take(cc) static jmp_buf intbuf; static void -xfer(buf, fd, eofchars) - char *buf, *eofchars; +xfer(char *buf, int fd, char *eofchars) { int ct; char c, *match; @@ -271,8 +268,7 @@ xfer(buf, fd, eofchars) * used by getfl(), cu_take(), and pipefile() */ static void -transfer(buf, fd, eofchars) - char *buf, *eofchars; +transfer(char *buf, int fd, char *eofchars) { register int ct; char c; @@ -340,7 +336,7 @@ transfer(buf, fd, eofchars) * send remote input to local process via pipe */ void -pipefile() +pipefile(void) { int cpid, pdes[2]; char buf[256]; @@ -386,7 +382,7 @@ pipefile() * Interrupt service routine for FTP */ void -stopsnd() +stopsnd(void) { stop = 1; @@ -399,8 +395,7 @@ stopsnd() * terminate transmission with pseudo EOF sequence */ void -sendfile(cc) - char cc; +sendfile(char cc) { FILE *fd; char *fnamex; @@ -432,9 +427,7 @@ sendfile(cc) * used by sendfile() and cu_put() */ static void -transmit(fd, eofchars, command) - FILE *fd; - char *eofchars, *command; +transmit(FILE *fd, char *eofchars, char *command) { char *pc, lastc; int c, ccount, lcount; @@ -528,8 +521,7 @@ out: * Cu-like put command */ void -cu_put(cc) - char cc; +cu_put(char cc) { FILE *fd; char line[BUFSIZ]; @@ -559,8 +551,7 @@ cu_put(cc) static int -nap(msec) - int msec; /* milliseconds */ +nap(int msec) { if (usleep(msec*1000) != 0) { fprintf ( stderr, "warning: ldelay or cdelay interrupted, " @@ -577,8 +568,7 @@ nap(msec) * wait for echo & handle timeout */ static void -send(c) - char c; +send(char c) { char cc; int retry = 0; @@ -607,7 +597,7 @@ tryagain: } void -timeout() +timeout(void) { signal(SIGALRM, timeout); timedout = 1; @@ -618,7 +608,7 @@ timeout() * Identical to consh() except for where stdout goes. */ void -pipeout(c) +pipeout(int c) { char buf[256]; int cpid, status, p; @@ -722,7 +712,7 @@ tiplink (char *cmd, unsigned int flags) * 2 <-> local tty out */ int -consh(c) +consh(int c) { char buf[256]; putchar(c); @@ -737,7 +727,7 @@ consh(c) * Escape to local shell */ void -shell() +shell(void) { int shpid, status; char *cp; @@ -772,7 +762,7 @@ shell() * initiate the conversation with TIPOUT */ void -setscript() +setscript(void) { char c; /* @@ -795,7 +785,7 @@ setscript() * local portion of tip */ void -chdirectory() +chdirectory(void) { char dirname[PATH_MAX]; register char *cp = dirname; @@ -811,8 +801,7 @@ chdirectory() } void -tipabort(msg) - char *msg; +tipabort(char *msg) { kill(pid, SIGTERM); @@ -827,7 +816,7 @@ tipabort(msg) } void -finish() +finish(void) { char *abortmsg = NOSTR, *dismsg; @@ -843,7 +832,7 @@ finish() } void -intcopy() +intcopy(void) { raw(); quit = 1; @@ -851,8 +840,7 @@ intcopy() } static void -execute(s) - char *s; +execute(char *s) { register char *cp; @@ -865,9 +853,7 @@ execute(s) } static int -args(buf, a, num) - char *buf, *a[]; - int num; +args(char *buf, char **a, int num) { register char *p = buf, *start; register char **parg = a; @@ -890,9 +876,7 @@ args(buf, a, num) } static void -prtime(s, a) - char *s; - time_t a; +prtime(char *s, time_t a) { register i; int nums[3]; @@ -910,7 +894,7 @@ prtime(s, a) } void -variable() +variable(void) { char buf[256]; @@ -957,8 +941,7 @@ variable() * Turn tandem mode on or off for remote tty. */ static void -tandem(option) - char *option; +tandem(char *option) { #if HAVE_TERMIOS struct termios ttermios; @@ -993,7 +976,7 @@ tandem(option) * Send a break. */ void -genbrk() +genbrk(void) { ioctl(FD, TIOCSBRK, NULL); @@ -1005,8 +988,7 @@ genbrk() * Suspend tip */ void -suspend(c) - char c; +suspend(char c) { unraw(); @@ -1019,8 +1001,7 @@ suspend(c) */ char * -expand(name) - char name[]; +expand(char *name) { static char xname[BUFSIZ]; char cmdbuf[BUFSIZ]; @@ -1090,8 +1071,7 @@ expand(name) */ static int -anyof(s1, s2) - register char *s1, *s2; +anyof(register char *s1, register char *s2) { register int c; diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 0237ad78bf..3c8d7c2de5 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -20,7 +20,7 @@ * Wolfram Schneider * * $FreeBSD: src/usr.bin/top/machine.c,v 1.29.2.2 2001/07/31 20:27:05 tmm Exp $ - * $DragonFly: src/usr.bin/top/machine.c,v 1.8 2003/07/25 05:28:54 dillon Exp $ + * $DragonFly: src/usr.bin/top/machine.c,v 1.9 2003/10/04 20:36:53 hmp Exp $ */ @@ -55,10 +55,10 @@ #include "top.h" #include "machine.h" -static int check_nlist __P((struct nlist *)); -static int getkval __P((unsigned long, int *, int, char *)); -extern char* printable __P((char *)); -int swapmode __P((int *retavail, int *retfree)); +static int check_nlist(struct nlist *); +static int getkval(unsigned long, int *, int, char *); +extern char* printable(char *); +int swapmode(int *retavail, int *retfree); static int smpmode; static int namelength; static int cmdlength; @@ -218,10 +218,7 @@ char *ordernames[] = { #endif int -machine_init(statics) - -struct statics *statics; - +machine_init(struct statics *statics) { register int i = 0; register int pagesize; @@ -304,10 +301,7 @@ struct statics *statics; return(0); } -char *format_header(uname_field) - -register char *uname_field; - +char *format_header(register char *uname_field) { register char *ptr; static char Header[128]; @@ -325,10 +319,7 @@ static int swappgsout = -1; extern struct timeval timeout; void -get_system_info(si) - -struct system_info *si; - +get_system_info(struct system_info *si) { long total; load_avg avenrun[3]; @@ -457,12 +448,8 @@ struct system_info *si; static struct handle handle; -caddr_t get_process_info(si, sel, compare) - -struct system_info *si; -struct process_select *sel; -int (*compare)(); - +caddr_t get_process_info(struct system_info *si, struct process_select *sel, + int (*compare)()) { register int i; register int total_procs; @@ -544,11 +531,7 @@ int (*compare)(); char fmt[128]; /* static area where result is built */ -char *format_next_process(handle, get_userid) - -caddr_t handle; -char *(*get_userid)(); - +char *format_next_process(caddr_t handle, char *(*get_userid)()) { struct kinfo_proc *pp; long cputime; @@ -665,10 +648,7 @@ char *(*get_userid)(); * number of symbols NOT found. */ -static int check_nlist(nlst) - -register struct nlist *nlst; - +static int check_nlist(register struct nlist *nlst) { register int i; @@ -704,13 +684,7 @@ register struct nlist *nlst; * */ -static int getkval(offset, ptr, size, refstr) - -unsigned long offset; -int *ptr; -int size; -char *refstr; - +static int getkval(unsigned long offset, int *ptr, int size, char *refstr) { if (kvm_read(kd, offset, (char *) ptr, size) != size) { @@ -780,14 +754,10 @@ static unsigned char sorted_state[] = int #ifdef ORDER -compare_cpu(pp1, pp2) +compare_cpu(struct proc **pp1, struct proc **pp2) #else -proc_compare(pp1, pp2) +proc_compare(struct proc **pp1, struct proc **pp2) #endif - -struct proc **pp1; -struct proc **pp2; - { register struct kinfo_proc *p1; register struct kinfo_proc *p2; @@ -825,11 +795,7 @@ int (*proc_compares[])() = { /* compare_size - the comparison function for sorting by total memory usage */ int -compare_size(pp1, pp2) - -struct proc **pp1; -struct proc **pp2; - +compare_size(struct proc **pp1, struct proc **pp2) { register struct kinfo_proc *p1; register struct kinfo_proc *p2; @@ -854,11 +820,7 @@ struct proc **pp2; /* compare_res - the comparison function for sorting by resident set size */ int -compare_res(pp1, pp2) - -struct proc **pp1; -struct proc **pp2; - +compare_res(struct proc **pp1, struct proc **pp2) { register struct kinfo_proc *p1; register struct kinfo_proc *p2; @@ -883,11 +845,7 @@ struct proc **pp2; /* compare_time - the comparison function for sorting by total cpu time */ int -compare_time(pp1, pp2) - -struct proc **pp1; -struct proc **pp2; - +compare_time(struct proc **pp1, struct proc **pp2) { register struct kinfo_proc *p1; register struct kinfo_proc *p2; @@ -912,11 +870,7 @@ struct proc **pp2; /* compare_prio - the comparison function for sorting by cpu percentage */ int -compare_prio(pp1, pp2) - -struct proc **pp1; -struct proc **pp2; - +compare_prio(struct proc **pp1, struct proc **pp2) { register struct kinfo_proc *p1; register struct kinfo_proc *p2; @@ -949,10 +903,7 @@ struct proc **pp2; * and "renice" commands. */ -int proc_owner(pid) - -int pid; - +int proc_owner(int pid) { register int cnt; register struct kinfo_proc **prefp; @@ -995,9 +946,7 @@ int pid; int -swapmode(retavail, retfree) - int *retavail; - int *retfree; +swapmode(int *retavail, int *retfree) { int n; int pagesize = getpagesize(); diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index 0c75f75130..f74280d3ab 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)touch.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/touch/touch.c,v 1.11.2.2 2002/07/28 06:52:15 eric Exp $ - * $DragonFly: src/usr.bin/touch/touch.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/touch/touch.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -49,16 +49,14 @@ #include #include -int rw __P((char *, struct stat *, int)); -void stime_arg1 __P((char *, struct timeval *)); -void stime_arg2 __P((char *, int, struct timeval *)); -void stime_file __P((char *, struct timeval *)); -void usage __P((void)); +int rw(char *, struct stat *, int); +void stime_arg1(char *, struct timeval *); +void stime_arg2(char *, int, struct timeval *); +void stime_file(char *, struct timeval *); +void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat sb; struct timeval tv[2]; @@ -179,9 +177,7 @@ main(argc, argv) #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; void -stime_arg1(arg, tvp) - char *arg; - struct timeval *tvp; +stime_arg1(char *arg, struct timeval *tvp) { time_t now; struct tm *t; @@ -242,10 +238,7 @@ terr: errx(1, } void -stime_arg2(arg, year, tvp) - char *arg; - int year; - struct timeval *tvp; +stime_arg2(char *arg, int year, struct timeval *tvp) { time_t now; struct tm *t; @@ -275,9 +268,7 @@ stime_arg2(arg, year, tvp) } void -stime_file(fname, tvp) - char *fname; - struct timeval *tvp; +stime_file(char *fname, struct timeval *tvp) { struct stat sb; @@ -288,10 +279,7 @@ stime_file(fname, tvp) } int -rw(fname, sbp, force) - char *fname; - struct stat *sbp; - int force; +rw(char *fname, struct stat *sbp, int force) { int fd, needed_chmod, rval; u_char byte; @@ -340,7 +328,7 @@ err: rval = 1; } void -usage() +usage(void) { (void)fprintf(stderr, "usage: touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...\n"); exit(1); diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c index 6a58e7eb47..6c93959a14 100644 --- a/usr.bin/tput/tput.c +++ b/usr.bin/tput/tput.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)tput.c 8.2 (Berkeley) 3/19/94 * $FreeBSD: src/usr.bin/tput/tput.c,v 1.7.6.3 2002/08/17 14:52:50 tjr Exp $ - * $DragonFly: src/usr.bin/tput/tput.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tput/tput.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -48,14 +48,12 @@ #undef putchar #define outc putchar -static void prlongname __P((char *)); -static void usage __P((void)); -static char **process __P((char *, char *, char **)); +static void prlongname(char *); +static void usage(void); +static char **process(char *, char *, char **); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, exitval, n; char *cptr, *p, *term, buf[1024], tbuf[1024]; @@ -110,8 +108,7 @@ errx(2, "no terminal type specified and no TERM environmental variable."); } static void -prlongname(buf) - char *buf; +prlongname(char *buf) { int savech; char *p, *savep; @@ -124,8 +121,7 @@ prlongname(buf) } static char ** -process(cap, str, argv) - char *cap, *str, **argv; +process(char *cap, char *str, char **argv) { static char errfew[] = "not enough arguments (%d) for capability `%s'"; @@ -200,7 +196,7 @@ process(cap, str, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: tput [-T term] attribute ...\n"); exit(1); diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c index 10f98cac13..dc170d5fe5 100644 --- a/usr.bin/tr/str.c +++ b/usr.bin/tr/str.c @@ -32,7 +32,7 @@ * * @(#)str.c 8.2 (Berkeley) 4/28/95 * $FreeBSD: src/usr.bin/tr/str.c,v 1.10.2.2 2002/07/29 12:59:33 tjr Exp $ - * $DragonFly: src/usr.bin/tr/str.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tr/str.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -56,8 +56,7 @@ static int genrange(STR *); static void genseq(STR *); int -next(s) - STR *s; +next(STR *s) { int ch; @@ -114,8 +113,7 @@ next(s) } static int -bracket(s) - STR *s; +bracket(STR *s) { char *p; @@ -185,8 +183,7 @@ static CLASS classes[] = { }; static void -genclass(s) - STR *s; +genclass(STR *s) { int cnt, (*func)(int); CLASS *cp, tmp; @@ -211,15 +208,13 @@ genclass(s) } static int -c_class(a, b) - const void *a, *b; +c_class(const void *a, const void *b) { return (strcmp(((const CLASS *)a)->name, ((const CLASS *)b)->name)); } static void -genequiv(s) - STR *s; +genequiv(STR *s) { int i, p, pri; char src[2], dst[3]; @@ -263,8 +258,7 @@ genequiv(s) } static int -genrange(s) - STR *s; +genrange(STR *s) { int stopval; char *savestart; @@ -282,8 +276,7 @@ genrange(s) } static void -genseq(s) - STR *s; +genseq(STR *s) { char *ep; @@ -325,8 +318,7 @@ genseq(s) * an escape code or a literal character. */ static int -backslash(s) - STR *s; +backslash(STR *s) { int ch, cnt, val; diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 77ad99351c..6bc784cfd6 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)tr.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/tr/tr.c,v 1.8.2.2 2002/07/29 12:59:33 tjr Exp $ - * $DragonFly: src/usr.bin/tr/tr.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tr/tr.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -89,9 +89,7 @@ static void setup(int *, char *, STR *, int); static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, cnt, lastch, *p; int cflag, dflag, sflag, isstring2; @@ -236,11 +234,7 @@ main(argc, argv) } static void -setup(string, arg, str, cflag) - int *string; - char *arg; - STR *str; - int cflag; +setup(int *string, char *arg, STR *str, int cflag) { int cnt, *p; @@ -254,7 +248,7 @@ setup(string, arg, str, cflag) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: tr [-csu] string1 string2", diff --git a/usr.bin/true/true.c b/usr.bin/true/true.c index 24bcc03a52..ed6b01208c 100644 --- a/usr.bin/true/true.c +++ b/usr.bin/true/true.c @@ -32,9 +32,12 @@ * * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)true.c 8.1 (Berkeley) 6/9/93 + * + * $DragonFly: src/usr.bin/true/true.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ -main() +int +main(void) { exit(0); } diff --git a/usr.bin/truncate/truncate.c b/usr.bin/truncate/truncate.c index 33aafaf19c..7cf8d0ce7f 100644 --- a/usr.bin/truncate/truncate.c +++ b/usr.bin/truncate/truncate.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/truncate/truncate.c,v 1.6.2.1 2000/08/04 08:05:52 sheldonh Exp $ - * $DragonFly: src/usr.bin/truncate/truncate.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/truncate/truncate.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -37,8 +37,8 @@ #include #include -static off_t parselength __P((char *, off_t *)); -static void usage __P((void)); +static off_t parselength(char *, off_t *); +static void usage(void); static int no_create; static int do_relative; diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c index decd0ddd9e..e99e90d8d2 100644 --- a/usr.bin/truss/i386-linux.c +++ b/usr.bin/truss/i386-linux.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/truss/i386-linux.c,v 1.7.2.4 2002/02/15 11:43:51 des Exp $ - * $DragonFly: src/usr.bin/truss/i386-linux.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/truss/i386-linux.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ /* @@ -77,7 +77,7 @@ static struct linux_syscall { } lsc; static inline void -clear_lsc() { +clear_lsc(void) { if (lsc.s_args) { int i; for (i = 0; i < lsc.nargs; i++) diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c index 529b1bbdc2..b44eaa0b63 100644 --- a/usr.bin/tset/map.c +++ b/usr.bin/tset/map.c @@ -32,7 +32,7 @@ * * @(#)map.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/tset/map.c,v 1.7 1999/08/30 08:27:30 peter Exp $ - * $DragonFly: src/usr.bin/tset/map.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/map.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -69,8 +69,7 @@ MAP *cur, *maplist; * The baud rate tests are: >, <, @, =, ! */ void -add_mapping(port, arg) - char *port, *arg; +add_mapping(char *port, char *arg) { MAP *mapp; char *copy, *p, *termp; @@ -183,8 +182,7 @@ badmopt: errx(1, "illegal -m option format: %s", copy); * 'type'. */ char * -mapped(type) - char *type; +mapped(char *type) { MAP *mapp; int match; @@ -232,8 +230,7 @@ SPEEDS speeds[] = { }; speed_t -tset_baudrate(rate) - char *rate; +tset_baudrate(char *rate) { SPEEDS *sp; speed_t speed; diff --git a/usr.bin/tset/misc.c b/usr.bin/tset/misc.c index d2368e2e60..219da2f637 100644 --- a/usr.bin/tset/misc.c +++ b/usr.bin/tset/misc.c @@ -32,7 +32,7 @@ * * @(#)misc.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/tset/misc.c,v 1.4 1999/08/28 01:06:58 peter Exp $ - * $DragonFly: src/usr.bin/tset/misc.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/misc.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -44,8 +44,7 @@ #include "extern.h" void -cat(file) - char *file; +cat(char *file) { register int fd, nr, nw; char buf[1024]; @@ -62,8 +61,7 @@ cat(file) } int -outc(c) - int c; +outc(int c) { return putc(c, stderr); } diff --git a/usr.bin/tset/set.c b/usr.bin/tset/set.c index 9c30994b8e..7ec76dfa97 100644 --- a/usr.bin/tset/set.c +++ b/usr.bin/tset/set.c @@ -32,7 +32,7 @@ * * @(#)set.c 8.2 (Berkeley) 2/28/94 * $FreeBSD: src/usr.bin/tset/set.c,v 1.7.2.1 2000/11/12 07:48:29 dg Exp $ - * $DragonFly: src/usr.bin/tset/set.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/set.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -42,14 +42,14 @@ #define CHK(val, dft) (val <= 0 ? dft : val) -int set_tabs __P((void)); +int set_tabs(void); /* * Reset the terminal mode bits to a sensible state. Very useful after * a child program dies in raw mode. */ void -reset_mode() +reset_mode(void) { tcgetattr(STDERR_FILENO, &mode); @@ -150,7 +150,7 @@ reset_mode() * entry and command line and update their values in 'mode'. */ void -set_control_chars() +set_control_chars(void) { char *bp, *p, bs_char, buf[1024]; @@ -187,8 +187,7 @@ set_control_chars() * uppercase to internal lowercase. */ void -set_conversions(usingupper) - int usingupper; +set_conversions(int usingupper) { if (tgetflag("UC") || usingupper) { #ifdef IUCLC @@ -233,7 +232,7 @@ set_conversions(usingupper) /* Output startup string. */ void -set_init() +set_init(void) { char *bp, buf[1024]; int settle; @@ -277,7 +276,7 @@ set_init() * Return nonzero if we set any tab stops, zero if not. */ int -set_tabs() +set_tabs(void) { int c; char *capsp, *clear_tabs; diff --git a/usr.bin/tset/term.c b/usr.bin/tset/term.c index 274c56eb55..0b28fd5be3 100644 --- a/usr.bin/tset/term.c +++ b/usr.bin/tset/term.c @@ -32,7 +32,7 @@ * * @(#)term.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/tset/term.c,v 1.4 1999/08/28 01:06:58 peter Exp $ - * $DragonFly: src/usr.bin/tset/term.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/term.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -47,16 +47,15 @@ char tbuf[1024]; /* Termcap entry. */ -char *askuser __P((char *)); -char *ttys __P((char *)); +char *askuser(char *); +char *ttys(char *); /* * Figure out what kind of terminal we're dealing with, and then read in * its termcap entry. */ char * -get_termcap_entry(userarg, tcapbufp) - char *userarg, **tcapbufp; +get_termcap_entry(char *userarg, char **tcapbufp) { struct ttyent *t; int rval; @@ -120,8 +119,7 @@ found: if ((p = getenv("TERMCAP")) != NULL && *p != '/') /* Prompt the user for a terminal type. */ char * -askuser(dflt) - char *dflt; +askuser(char *dflt) { static char answer[256]; char *p; diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index 748a27b029..5964501514 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)tset.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/tset/tset.c,v 1.14.2.1 2000/11/12 07:48:29 dg Exp $ - * $DragonFly: src/usr.bin/tset/tset.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/tset.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -47,9 +47,9 @@ #include #include "extern.h" -void obsolete __P((char *[])); -void report __P((char *, int, u_int)); -void usage __P((void)); +void obsolete(char *[]); +void report(char *, int, u_int); +void usage(void); struct termios mode, oldmode; @@ -61,9 +61,7 @@ int Lines, Columns; /* window size */ speed_t Ospeed; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { #ifdef TIOCGWINSZ struct winsize win; @@ -230,10 +228,7 @@ main(argc, argv) * Tell the user if a control key has been changed from the default value. */ void -report(name, which, def) - char *name; - int which; - u_int def; +report(char *name, int which, u_int def) { u_int old, new; @@ -261,8 +256,7 @@ report(name, which, def) * This means that -e, -i and -k get default arguments supplied for them. */ void -obsolete(argv) - char *argv[]; +obsolete(char **argv) { for (; *argv; ++argv) { if (argv[0][0] != '-' || (argv[1] && argv[1][0] != '-') || @@ -284,7 +278,7 @@ obsolete(argv) } void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: tset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]", diff --git a/usr.bin/tset/wrterm.c b/usr.bin/tset/wrterm.c index ac0343d91e..4cd290d677 100644 --- a/usr.bin/tset/wrterm.c +++ b/usr.bin/tset/wrterm.c @@ -32,7 +32,7 @@ * * @(#)wrterm.c 8.1 (Berkeley) 6/9/93 * $FreeBSD: src/usr.bin/tset/wrterm.c,v 1.3 1999/08/28 01:06:59 peter Exp $ - * $DragonFly: src/usr.bin/tset/wrterm.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tset/wrterm.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include @@ -47,8 +47,7 @@ * shell problems and omitting empty fields. */ void -wrtermcap(bp) - char *bp; +wrtermcap(char *bp) { register int ch; register char *p; diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c index fb666af0da..604c4f193b 100644 --- a/usr.bin/tsort/tsort.c +++ b/usr.bin/tsort/tsort.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/tsort/tsort.c,v 1.10.2.1 2001/03/04 09:18:23 kris Exp $ - * $DragonFly: src/usr.bin/tsort/tsort.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tsort/tsort.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ * * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)tsort.c 8.3 (Berkeley) 5/4/95 @@ -97,18 +97,16 @@ DB *db; NODE *graph, **cycle_buf, **longest_cycle; int debug, longest, quiet; -void add_arc __P((char *, char *)); -int find_cycle __P((NODE *, NODE *, int, int)); -NODE *get_node __P((char *)); -void *grow_buf __P((void *, int)); -void remove_node __P((NODE *)); -void tsort __P((void)); -void usage __P((void)); +void add_arc(char *, char *); +int find_cycle(NODE *, NODE *, int, int); +NODE *get_node(char *); +void *grow_buf(void *, int); +void remove_node(NODE *); +void tsort(void); +void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register BUF *b; register int c, n; @@ -183,9 +181,7 @@ main(argc, argv) /* double the size of oldbuf and return a pointer to the new buffer. */ void * -grow_buf(bp, size) - void *bp; - int size; +grow_buf(void *bp, int size) { if ((bp = realloc(bp, (u_int)size)) == NULL) err(1, NULL); @@ -197,8 +193,7 @@ grow_buf(bp, size) * the graph, then add them. */ void -add_arc(s1, s2) - char *s1, *s2; +add_arc(char *s1, char *s2) { register NODE *n1; NODE *n2; @@ -233,8 +228,7 @@ add_arc(s1, s2) /* Find a node in the graph (insert if not found) and return a pointer to it. */ NODE * -get_node(name) - char *name; +get_node(char *name) { DBT data, key; NODE *n; @@ -286,7 +280,7 @@ get_node(name) * Clear the NODEST flag from all nodes. */ void -clear_cycle() +clear_cycle(void) { NODE *n; @@ -296,7 +290,7 @@ clear_cycle() /* do topological sort on graph */ void -tsort() +tsort(void) { register NODE *n, *next; register int cnt, i; @@ -359,8 +353,7 @@ tsort() /* print node and remove from graph (does not actually free node) */ void -remove_node(n) - register NODE *n; +remove_node(register NODE *n) { register NODE **np; register int i; @@ -377,9 +370,7 @@ remove_node(n) /* look for the longest? cycle from node from to node to. */ int -find_cycle(from, to, longest_len, depth) - NODE *from, *to; - int depth, longest_len; +find_cycle(NODE *from, NODE *to, int longest_len, int depth) { register NODE **np; register int i, len; @@ -425,7 +416,7 @@ find_cycle(from, to, longest_len, depth) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: tsort [-dlq] [file]\n"); exit(1); diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c index 03eb285ed3..d804f82834 100644 --- a/usr.bin/tty/tty.c +++ b/usr.bin/tty/tty.c @@ -33,19 +33,17 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)tty.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/tty/tty.c,v 1.4.2.1 2001/07/30 10:16:47 dd Exp $ - * $DragonFly: src/usr.bin/tty/tty.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/tty/tty.c,v 1.3 2003/10/04 20:36:53 hmp Exp $ */ #include #include #include -static void usage __P((void)); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, sflag; char *t, *ttyname(); @@ -68,7 +66,7 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: tty [-s]\n"); exit(2); diff --git a/usr.bin/uac/uac.c b/usr.bin/uac/uac.c index 4ed650d7fe..5f39c05614 100644 --- a/usr.bin/uac/uac.c +++ b/usr.bin/uac/uac.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/uac/uac.c,v 1.1 2000/01/19 09:47:19 obrien Exp $ - * $DragonFly: src/usr.bin/uac/Attic/uac.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/uac/Attic/uac.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -88,9 +88,7 @@ print_uac(u_int64_t uac) } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c; u_int64_t uac; @@ -128,7 +126,7 @@ main(argc, argv) } static void -usage () +usage(void) { fprintf(stderr, "usage: uac [-fprs]\n"); diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c index 7d52e3d602..30e4a6a3e7 100644 --- a/usr.bin/ul/ul.c +++ b/usr.bin/ul/ul.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)ul.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/ul/ul.c,v 1.6.2.1 2000/08/23 08:49:49 kris Exp $ - * $DragonFly: src/usr.bin/ul/ul.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/ul/ul.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -75,25 +75,23 @@ int halfpos; int upln; int iflag; -static void usage __P((void)); -void setnewmode __P((int)); -void initcap __P((void)); -void reverse __P((void)); -int outchar __P((int)); -void fwd __P((void)); -void initbuf __P((void)); -void iattr __P((void)); -void overstrike __P((void)); -void flushln __P((void)); -void filter __P((FILE *)); -void outc __P((int)); +static void usage(void); +void setnewmode(int); +void initcap(void); +void reverse(void); +int outchar(int); +void fwd(void); +void initbuf(void); +void iattr(void); +void overstrike(void); +void flushln(void); +void filter(FILE *); +void outc(int); #define PRINT(s) if (s == NULL) /* void */; else tputs(s, 1, outchar) int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c; char *termtype; @@ -149,15 +147,14 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: ul [-i] [-t terminal] file...\n"); exit(1); } void -filter(f) - FILE *f; +filter(FILE *f) { register c; @@ -267,7 +264,7 @@ filter(f) } void -flushln() +flushln(void) { register lastmode; register i; @@ -307,7 +304,7 @@ flushln() * We don't do anything with halfline ups and downs, or Greek. */ void -overstrike() +overstrike(void) { register int i; char lbuf[256]; @@ -345,7 +342,7 @@ overstrike() } void -iattr() +iattr(void) { register int i; char lbuf[256]; @@ -369,7 +366,7 @@ iattr() } void -initbuf() +initbuf(void) { bzero((char *)obuf, sizeof (obuf)); /* depends on NORMAL == 0 */ @@ -379,7 +376,7 @@ initbuf() } void -fwd() +fwd(void) { register oldcol, oldmax; @@ -391,7 +388,7 @@ fwd() } void -reverse() +reverse(void) { upln++; fwd(); @@ -401,7 +398,7 @@ reverse() } void -initcap() +initcap(void) { static char tcapbuf[512]; char *bp = tcapbuf; @@ -454,8 +451,7 @@ initcap() } int -outchar(c) - int c; +outchar(int c) { return(putchar(c & 0177)); } @@ -463,8 +459,7 @@ outchar(c) static int curmode = 0; void -outc(c) - int c; +outc(int c) { putchar(c); if (must_use_uc && (curmode&UNDERL)) { @@ -474,8 +469,7 @@ outc(c) } void -setnewmode(newmode) - int newmode; +setnewmode(int newmode) { if (!iflag) { if (curmode != NORMAL && newmode != NORMAL) diff --git a/usr.bin/unexpand/unexpand.c b/usr.bin/unexpand/unexpand.c index 6e879d3c7f..f8b20c4ed5 100644 --- a/usr.bin/unexpand/unexpand.c +++ b/usr.bin/unexpand/unexpand.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)unexpand.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/unexpand/unexpand.c,v 1.5.2.3 2002/10/11 11:33:23 tjr Exp $ - * $DragonFly: src/usr.bin/unexpand/unexpand.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/unexpand/unexpand.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ /* @@ -57,9 +57,7 @@ static void usage(void); static void tabify(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, failed; char *filename; @@ -101,14 +99,14 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: unexpand [-a] [-t tablist] [file ...]\n"); exit(1); } static void -tabify() +tabify(void) { int ch, dcol, doneline, limit, n, ocol; @@ -191,8 +189,7 @@ tabify() } static void -getstops(cp) - const char *cp; +getstops(const char *cp) { int i; diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index cc385cef46..fb29fb4ecc 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)uniq.c 8.3 (Berkeley) 5/4/95 * $FreeBSD: src/usr.bin/uniq/uniq.c,v 1.11.2.3 2002/06/28 08:02:19 tjr Exp $ - * $DragonFly: src/usr.bin/uniq/uniq.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/uniq/uniq.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -62,9 +62,7 @@ static void usage(void); int stricoll(char *, char*); int -main (argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { register char *t1, *t2; FILE *ifp, *ofp; @@ -184,9 +182,7 @@ getline(char *buf, size_t buflen, FILE *fp) * of the line. */ void -show(ofp, str) - FILE *ofp; - char *str; +show(FILE *ofp, char *str) { if (cflag && *str) @@ -196,8 +192,7 @@ show(ofp, str) } char * -skip(str) - register char *str; +skip(register char *str) { register int nchars, nfields; @@ -212,8 +207,7 @@ skip(str) } FILE * -file(name, mode) - const char *name, *mode; +file(const char *name, const char *mode) { FILE *fp; @@ -223,8 +217,7 @@ file(name, mode) } void -obsolete(argv) - char *argv[]; +obsolete(char **argv) { int len; char *ap, *p, *start; @@ -253,7 +246,7 @@ obsolete(argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: uniq [-c | -d | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); @@ -261,8 +254,7 @@ usage() } int -stricoll(s1, s2) - char *s1, *s2; +stricoll(char *s1, char *s2) { char *p, line1[MAXLINELEN], line2[MAXLINELEN]; diff --git a/usr.bin/unvis/unvis.c b/usr.bin/unvis/unvis.c index 55ff3b7a37..114906b454 100644 --- a/usr.bin/unvis/unvis.c +++ b/usr.bin/unvis/unvis.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)unvis.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/unvis/unvis.c,v 1.5.2.1 2001/07/30 10:16:49 dd Exp $ - * $DragonFly: src/usr.bin/unvis/unvis.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/unvis/unvis.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -42,12 +42,11 @@ #include #include -void process __P((FILE *, char *)); -static void usage __P((void)); +void process(FILE *, char *); +static void usage(void); int -main(argc, argv) - char *argv[]; +main(int argc, char **argv) { FILE *fp; int ch; @@ -75,16 +74,14 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: unvis [file ...]\n"); exit(1); } void -process(fp, filename) - FILE *fp; - char *filename; +process(FILE *fp, char *filename) { register int offset = 0, c, ret; int state = 0; diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c index 7e53618e25..50f3b6859c 100644 --- a/usr.bin/users/users.c +++ b/usr.bin/users/users.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)users.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/users/users.c,v 1.5 1999/08/28 01:07:14 peter Exp $ - * $DragonFly: src/usr.bin/users/users.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/users/users.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -46,13 +46,11 @@ typedef char namebuf[UT_NAMESIZE]; -int scmp __P((const void *, const void *)); -static void usage __P((void)); +int scmp(const void *, const void *); +static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { namebuf *names = NULL; int ncnt = 0; @@ -98,15 +96,14 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: users\n"); exit(1); } int -scmp(p, q) - const void *p, *q; +scmp(const void *p, const void *q) { return(strncmp((char *)p, (char *)q, UT_NAMESIZE)); } diff --git a/usr.bin/vgrind/regexp.c b/usr.bin/vgrind/regexp.c index 123b0a134d..ff4b06c318 100644 --- a/usr.bin/vgrind/regexp.c +++ b/usr.bin/vgrind/regexp.c @@ -33,6 +33,8 @@ * * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)regexp.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/vgrind/regexp.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -44,7 +46,7 @@ #define TRUE !(FALSE) #define NIL 0 -static void expconv __P((void)); +static void expconv(void); boolean _escaped; /* true if we are currently _escaped */ char *s_start; /* start of string */ @@ -58,9 +60,7 @@ boolean l_onecase; /* true if upper and lower equivalent */ */ int -STRNCMP(s1, s2, len) - register char *s1,*s2; - register int len; +STRNCMP(register char *s1, register char *s2, register int len) { if (l_onecase) { do @@ -139,9 +139,9 @@ STRNCMP(s1, s2, len) static char *ccre; /* pointer to current position in converted exp*/ static char *ure; /* pointer current position in unconverted exp */ +/* re: unconverted irregular expression */ char * -convexp(re) - char *re; /* unconverted irregular expression */ +convexp(char *re) { register char *cre; /* pointer to converted regular expression */ @@ -166,7 +166,7 @@ convexp(re) } static void -expconv() +expconv(void) { register char *cs; /* pointer to current symbol in converted exp */ register char c; /* character being processed */ @@ -336,11 +336,13 @@ expconv() * character matched. */ +/* +s: string to check for a match in +re: a converted irregular expression +mstring: where to put whatever matches a \p +*/ char * -expmatch (s, re, mstring) - register char *s; /* string to check for a match in */ - register char *re; /* a converted irregular expression */ - register char *mstring; /* where to put whatever matches a \p */ +expmatch(register char *s, register char *re, register char *mstring) { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ diff --git a/usr.bin/vgrind/vfontedpr.c b/usr.bin/vgrind/vfontedpr.c index c96d819b9d..e0fe928891 100644 --- a/usr.bin/vgrind/vfontedpr.c +++ b/usr.bin/vgrind/vfontedpr.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)vfontedpr.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/vgrind/vfontedpr.c,v 1.12 1999/08/28 01:07:21 peter Exp $ - * $DragonFly: src/usr.bin/vgrind/vfontedpr.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/vgrind/vfontedpr.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -64,13 +64,13 @@ #define PNAMELEN 40 /* length of a function/procedure name */ #define PSMAX 20 /* size of procedure name stacking */ -static int iskw __P((char *)); -static boolean isproc __P((char *)); -static void putKcp __P((char *, char *, boolean)); -static void putScp __P((char *)); -static void putcp __P((int)); -static int tabs __P((char *, char *)); -static int width __P((char *, char *)); +static int iskw(char *); +static boolean isproc(char *); +static void putKcp(char *, char *, boolean); +static void putScp(char *); +static void putcp(int); +static int tabs(char *, char *); +static int width(char *, char *); /* * The state variables @@ -123,9 +123,7 @@ char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { char *fname = ""; struct stat stbuf; @@ -344,8 +342,7 @@ main(argc, argv) #define isidchr(c) (isalnum(c) || (c) == '_') static void -putScp(os) - char *os; +putScp(char *os) { register char *s = os; /* pointer to unmatched string */ char dummy[BUFSIZ]; /* dummy to be used by expmatch */ @@ -537,11 +534,9 @@ skip: } while (*s); } +/* force: true if we should force nokeyw */ static void -putKcp (start, end, force) - char *start; /* start of string to write */ - char *end; /* end of string to write */ - boolean force; /* true if we should force nokeyw */ +putKcp(char *start, char *end, boolean force) { int i; int xfld = 0; @@ -588,16 +583,14 @@ putKcp (start, end, force) static int -tabs(s, os) - char *s, *os; +tabs(char *s, char *os) { return (width(s, os) / 8); } static int -width(s, os) - register char *s, *os; +width(register char *s, register char *os) { register int i = 0; @@ -617,8 +610,7 @@ width(s, os) } static void -putcp(c) - register int c; +putcp(register int c) { switch(c) { @@ -685,8 +677,7 @@ putcp(c) * look for a process beginning on this line */ static boolean -isproc(s) - char *s; +isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) @@ -701,8 +692,7 @@ isproc(s) */ static int -iskw(s) - register char *s; +iskw(register char *s) { register char **ss = l_keywds; register int i = 1; diff --git a/usr.bin/vgrind/vgrindefs.c b/usr.bin/vgrind/vgrindefs.c index 314399d444..6f01c12655 100644 --- a/usr.bin/vgrind/vgrindefs.c +++ b/usr.bin/vgrind/vgrindefs.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)vgrindefs.c 8.1 (Berkeley) 6/6/93 + * + * $DragonFly: src/usr.bin/vgrind/vgrindefs.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #define BUFSIZ 1024 @@ -65,8 +67,8 @@ char *getenv(); * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -tgetent(bp, name, file) - char *bp, *name, *file; +int +tgetent(char *bp, char *name, char *file) { register char *cp; register int c; @@ -125,7 +127,8 @@ tgetent(bp, name, file) * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ -tnchktc() +int +tnchktc(void) { register char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -172,8 +175,8 @@ tnchktc() * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -tnamatch(np) - char *np; +int +tnamatch(char *np) { register char *Np, *Bp; @@ -199,8 +202,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - register char *bp; +tskip(register char *bp) { while (*bp && *bp != ':') @@ -218,8 +220,8 @@ tskip(bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -tgetnum(id) - char *id; +int +tgetnum(char *id) { register int i, base; register char *bp = tbuf; @@ -251,8 +253,8 @@ tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -tgetflag(id) - char *id; +int +tgetflag(char *id) { register char *bp = tbuf; @@ -278,8 +280,7 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { register char *bp = tbuf; @@ -303,9 +304,7 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(register char *str, char **area) { register char *cp; register int c; diff --git a/usr.bin/vis/foldit.c b/usr.bin/vis/foldit.c index 26253aa062..803355c127 100644 --- a/usr.bin/vis/foldit.c +++ b/usr.bin/vis/foldit.c @@ -32,14 +32,13 @@ * * @(#)foldit.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/vis/foldit.c,v 1.4 1999/08/28 01:07:25 peter Exp $ - * $DragonFly: src/usr.bin/vis/foldit.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/vis/foldit.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include int -foldit(chunk, col, max) - char *chunk; +foldit(char *chunk, int col, int max) { register char *cp; diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c index d2c850eb49..56ce959966 100644 --- a/usr.bin/vis/vis.c +++ b/usr.bin/vis/vis.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)vis.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/vis/vis.c,v 1.6 1999/08/28 01:07:25 peter Exp $ - * $DragonFly: src/usr.bin/vis/vis.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/vis/vis.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -45,13 +45,12 @@ int eflags, fold, foldwidth=80, none, markeol, debug; -void process __P((FILE *, char *filename)); -static void usage __P((void)); -extern int foldit __P((char *, int, int)); +void process(FILE *, char *filename); +static void usage(void); +extern int foldit(char *, int, int); int -main(argc, argv) - char *argv[]; +main(int argc, char **argv) { FILE *fp; int ch; @@ -118,7 +117,7 @@ main(argc, argv) static void -usage() +usage(void) { #ifdef DEBUG fprintf(stderr, "usage: vis [-cbflnostwd] [-F foldwidth] [file ...]\n"); @@ -129,9 +128,7 @@ usage() } void -process(fp, filename) - FILE *fp; - char *filename; +process(FILE *fp, char *filename) { static int col = 0; register char *cp = "\0"+1; /* so *(cp-1) starts out != '\n' */ diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 4c523d4671..befd7cee36 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1986, 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)vmstat.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/vmstat/vmstat.c,v 1.38.2.4 2001/07/31 19:52:41 tmm Exp $ - * $DragonFly: src/usr.bin/vmstat/vmstat.c,v 1.6 2003/08/29 17:09:33 hmp Exp $ + * $DragonFly: src/usr.bin/vmstat/vmstat.c,v 1.7 2003/10/04 20:36:54 hmp Exp $ */ #define _KERNEL_STRUCTURES @@ -147,13 +147,11 @@ void dovmstat(), kread(), usage(); #ifdef notyet void dotimes(), doforkst(); #endif -void printhdr __P((void)); +void printhdr(void); static void devstats(); int -main(argc, argv) - register int argc; - register char **argv; +main(register int argc, register char **argv) { register int c, todo; u_int interval; @@ -309,8 +307,7 @@ main(argc, argv) } char ** -getdrivedata(argv) - char **argv; +getdrivedata(char **argv) { if ((num_devices = getnumdevs()) < 0) errx(1, "%s", devstat_errbuf); @@ -375,7 +372,7 @@ getdrivedata(argv) } long -getuptime() +getuptime(void) { static time_t now, boottime; time_t uptime; @@ -392,9 +389,7 @@ getuptime() int hz, hdrcnt; void -dovmstat(interval, reps) - u_int interval; - int reps; +dovmstat(u_int interval, int reps) { struct vmtotal total; time_t uptime, halfuptime; @@ -521,7 +516,7 @@ dovmstat(interval, reps) } void -printhdr() +printhdr(void) { int i, num_shown; @@ -547,15 +542,14 @@ printhdr() * Force a header to be prepended to the next output. */ void -needhdr() +needhdr(void) { hdrcnt = 1; } long -pct(top, bot) - long top, bot; +pct(long top, long bot) { long ans; @@ -568,7 +562,7 @@ pct(top, bot) #define PCT(top, bot) pct((long)(top), (long)(bot)) void -dosum() +dosum(void) { struct nchstats nchstats; long nchtotal; @@ -640,7 +634,7 @@ dosum() #ifdef notyet void -doforkst() +doforkst(void) { struct forkstat fks; @@ -653,7 +647,7 @@ doforkst() #endif static void -devstats() +devstats(void) { register int dn, state; long double transfers_per_second; @@ -689,7 +683,7 @@ devstats() } void -cpustats() +cpustats(void) { register int state; double pct, total; @@ -709,7 +703,7 @@ cpustats() } void -dointr() +dointr(void) { register u_long *intrcnt, uptime; register u_int64_t inttotal; @@ -743,7 +737,7 @@ dointr() #define MAX_KMSTATS 200 void -domem() +domem(void) { register struct kmembuckets *kp; register struct malloc_type *ks; @@ -862,7 +856,7 @@ domem() } void -dozmem() +dozmem(void) { char *buf; size_t bufsize; @@ -887,10 +881,7 @@ dozmem() * kread reads something from the kernel, given its nlist index. */ void -kread(nlx, addr, size) - int nlx; - void *addr; - size_t size; +kread(int nlx, void *addr, size_t size) { char *sym; @@ -909,7 +900,7 @@ kread(nlx, addr, size) } void -usage() +usage(void) { (void)fprintf(stderr, "%s%s", "usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n", diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 69c88b8fda..3d07d4ba58 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -32,7 +32,7 @@ * * @(#)pr_time.c 8.2 (Berkeley) 4/4/94 * $FreeBSD: src/usr.bin/w/pr_time.c,v 1.14.2.1 2002/03/12 19:51:51 phantom Exp $ - * $DragonFly: src/usr.bin/w/pr_time.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/w/pr_time.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -48,8 +48,7 @@ * Print the time since the user logged in. */ void -pr_attime(started, now) - time_t *started, *now; +pr_attime(time_t *started, time_t *now) { static char buf[256]; struct tm tp, tm; @@ -88,8 +87,7 @@ pr_attime(started, now) * Returns number of excess characters that were used for long idle time. */ int -pr_idle(idle) - time_t idle; +pr_idle(time_t idle) { /* If idle more than 36 hours, print as a number of days. */ if (idle >= 36 * 3600) { diff --git a/usr.bin/w/proc_compare.c b/usr.bin/w/proc_compare.c index 60bf0a358b..4216c5be58 100644 --- a/usr.bin/w/proc_compare.c +++ b/usr.bin/w/proc_compare.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)proc_compare.c 8.2 (Berkeley) 9/23/93 + * + * $DragonFly: src/usr.bin/w/proc_compare.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ #include @@ -65,8 +67,7 @@ #define BOTH 3 int -proc_compare(p1, p2) - register struct proc *p1, *p2; +proc_compare(register struct proc *p1, register struct proc *p2) { if (p1 == NULL) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 8ce626f490..efb83ce453 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)w.c 8.4 (Berkeley) 4/16/94 * $FreeBSD: src/usr.bin/w/w.c,v 1.38.2.6 2002/03/12 19:51:51 phantom Exp $ - * $DragonFly: src/usr.bin/w/w.c,v 1.3 2003/07/13 05:45:17 dillon Exp $ + * $DragonFly: src/usr.bin/w/w.c,v 1.4 2003/10/04 20:36:54 hmp Exp $ */ /* @@ -111,17 +111,15 @@ struct entry { #define debugproc(p) *((struct kinfo_proc **)&(p)->kp_eproc.e_spare[0]) -static void pr_header __P((time_t *, int)); -static struct stat *ttystat __P((char *, int)); -static void usage __P((int)); -static int this_is_uptime __P((const char *s)); +static void pr_header(time_t *, int); +static struct stat *ttystat(char *, int); +static void usage(int); +static int this_is_uptime(const char *s); -char *fmt_argv __P((char **, char *, int)); /* ../../bin/ps/fmt.c */ +char *fmt_argv(char **, char *, int); /* ../../bin/ps/fmt.c */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct kinfo_proc *kp; struct kinfo_proc *dkp; @@ -418,9 +416,7 @@ main(argc, argv) } static void -pr_header(nowp, nusers) - time_t *nowp; - int nusers; +pr_header(time_t *nowp, int nusers) { double avenrun[3]; time_t uptime; @@ -488,9 +484,7 @@ pr_header(nowp, nusers) } static struct stat * -ttystat(line, sz) - char *line; - int sz; +ttystat(char *line, int sz) { static struct stat sb; char ttybuf[MAXPATHLEN]; @@ -504,8 +498,7 @@ ttystat(line, sz) } static void -usage(wcmd) - int wcmd; +usage(int wcmd) { if (wcmd) (void)fprintf(stderr, @@ -516,8 +509,7 @@ usage(wcmd) } static int -this_is_uptime(s) - const char *s; +this_is_uptime(const char *s) { const char *u; diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 013e79f741..5ef618002a 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)wall.c 8.2 (Berkeley) 11/16/93 * $FreeBSD: src/usr.bin/wall/wall.c,v 1.13.2.6 2001/10/18 08:08:17 des Exp $ - * $DragonFly: src/usr.bin/wall/wall.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/wall/wall.c,v 1.3 2003/10/04 20:36:54 hmp Exp $ */ /* @@ -166,7 +166,7 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: wall [-g group] [file]\n"); exit(1); diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index 29b48dea19..190351de4c 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1987, 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)wc.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/wc/wc.c,v 1.11.2.1 2002/08/25 02:47:04 tjr Exp $ - * $DragonFly: src/usr.bin/wc/wc.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/wc/wc.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -56,9 +56,7 @@ static int cnt(const char *); static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, errors, total; @@ -120,8 +118,7 @@ main(argc, argv) } static int -cnt(file) - const char *file; +cnt(const char *file) { struct stat sb; u_quad_t linect, wordct, charct; @@ -248,7 +245,7 @@ word: gotsp = 1; } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: wc [-clmw] [file ...]\n"); exit(1); diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c index 9f4373299c..f9c24039ef 100644 --- a/usr.bin/what/what.c +++ b/usr.bin/what/what.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)what.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/what/what.c,v 1.5.2.1 2000/07/01 12:32:35 ps Exp $ - * $DragonFly: src/usr.bin/what/what.c,v 1.2 2003/06/17 04:29:33 dillon Exp $ + * $DragonFly: src/usr.bin/what/what.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -44,16 +44,14 @@ static int sflag; static int found; -void search __P((void)); -static void usage __P((void)); +void search(void); +static void usage(void); /* * what */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c; @@ -81,14 +79,14 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: what [-s] file ...\n"); exit(1); } void -search() +search(void) { register int c; diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index e17694673e..b519b1aabb 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)write.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/write/write.c,v 1.12 1999/08/28 01:07:48 peter Exp $ - * $DragonFly: src/usr.bin/write/write.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/write/write.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -54,18 +54,16 @@ #include #include -void done __P((int)); -void do_write __P((char *, char *, uid_t)); -static void usage __P((void)); -int term_chk __P((char *, int *, time_t *, int)); -void wr_fputs __P((unsigned char *s)); -void search_utmp __P((char *, char *, char *, uid_t)); -int utmp_chk __P((char *, char *)); +void done(int); +void do_write(char *, char *, uid_t); +static void usage(void); +int term_chk(char *, int *, time_t *, int); +void wr_fputs(unsigned char *s); +void search_utmp(char *, char *, char *, uid_t); +int utmp_chk(char *, char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register char *cp; time_t atime; @@ -120,7 +118,7 @@ main(argc, argv) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: write user [tty]\n"); exit(1); @@ -131,8 +129,7 @@ usage() * the given tty */ int -utmp_chk(user, tty) - char *user, *tty; +utmp_chk(char *user, char *tty) { struct utmp u; int ufd; @@ -163,9 +160,7 @@ utmp_chk(user, tty) * writing from, unless that's the only terminal with messages enabled. */ void -search_utmp(user, tty, mytty, myuid) - char *user, *tty, *mytty; - uid_t myuid; +search_utmp(char *user, char *tty, char *mytty, uid_t myuid) { struct utmp u; time_t bestatime, atime; @@ -217,10 +212,7 @@ search_utmp(user, tty, mytty, myuid) * and the access time */ int -term_chk(tty, msgsokP, atimeP, showerror) - char *tty; - int *msgsokP, showerror; - time_t *atimeP; +term_chk(char *tty, int *msgsokP, time_t *atimeP, int showerror) { struct stat s; char path[MAXPATHLEN]; @@ -240,9 +232,7 @@ term_chk(tty, msgsokP, atimeP, showerror) * do_write - actually make the connection */ void -do_write(tty, mytty, myuid) - char *tty, *mytty; - uid_t myuid; +do_write(char *tty, char *mytty, uid_t myuid) { register char *login, *nows; register struct passwd *pwd; @@ -281,8 +271,7 @@ do_write(tty, mytty, myuid) * done - cleanup and exit */ void -done(n) -int n; /* signal number */ +done(int n) { (void)printf("EOF\r\n"); exit(0); @@ -293,8 +282,7 @@ int n; /* signal number */ * turns \n into \r\n */ void -wr_fputs(s) - register unsigned char *s; +wr_fputs(register unsigned char *s) { #define PUTC(c) if (putchar(c) == EOF) err(1, NULL); diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 474893b411..6538b69168 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)xinstall.c 8.1 (Berkeley) 7/21/93 * $FreeBSD: src/usr.bin/xinstall/xinstall.c,v 1.38.2.8 2002/08/07 16:29:48 ru Exp $ - * $DragonFly: src/usr.bin/xinstall/xinstall.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/xinstall/xinstall.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -90,9 +90,7 @@ int trymmap(int); void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct stat from_sb, to_sb; mode_t *set; @@ -228,8 +226,7 @@ main(argc, argv) } u_long -numeric_id(name, type) - const char *name, *type; +numeric_id(const char *name, const char *type) { u_long val; char *ep; @@ -252,10 +249,7 @@ numeric_id(name, type) * build a path name and install the file */ void -install(from_name, to_name, fset, flags) - const char *from_name, *to_name; - u_long fset; - u_int flags; +install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; struct utimbuf utb; @@ -565,10 +559,7 @@ compare(int from_fd, const char *from_name __unused, size_t from_len, * create a temporary file based on path and open it */ int -create_tempfile(path, temp, tsize) - const char *path; - char *temp; - size_t tsize; +create_tempfile(const char *path, char *temp, size_t tsize) { char *p; @@ -588,10 +579,7 @@ create_tempfile(path, temp, tsize) * create a new file, overwriting an existing one if necessary */ int -create_newfile(path, target, sbp) - const char *path; - int target; - struct stat *sbp; +create_newfile(const char *path, int target, struct stat *sbp) { char backup[MAXPATHLEN]; @@ -628,10 +616,8 @@ create_newfile(path, target, sbp) * copy from one file to another */ void -copy(from_fd, from_name, to_fd, to_name, size) - register int from_fd, to_fd; - const char *from_name, *to_name; - off_t size; +copy(register int from_fd, const char *from_name, register int to_fd, + const char *to_name, off_t size) { register int nr, nw; int serrno; @@ -683,8 +669,7 @@ copy(from_fd, from_name, to_fd, to_name, size) * use strip(1) to strip the target file */ void -strip(to_name) - const char *to_name; +strip(const char *to_name) { const char *stripbin; int serrno, status; @@ -716,8 +701,7 @@ strip(to_name) * build directory heirarchy */ void -install_dir(path) - char *path; +install_dir(char *path) { register char *p; struct stat sb; @@ -751,7 +735,7 @@ install_dir(path) * print a usage message and die */ void -usage() +usage(void) { (void)fprintf(stderr, "\ usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n\ @@ -768,8 +752,7 @@ usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n\ * return true (1) if mmap should be tried, false (0) if not. */ int -trymmap(fd) - int fd; +trymmap(int fd) { /* * The ifdef is for bootstrapping - f_fstypename doesn't exist in diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c index 9a842113d8..540f4533d7 100644 --- a/usr.bin/yacc/closure.c +++ b/usr.bin/yacc/closure.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/closure.c,v 1.6 1999/08/28 01:07:58 peter Exp $ - * $DragonFly: src/usr.bin/yacc/closure.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/closure.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)closure.c 5.3 (Berkeley) 5/24/93 */ @@ -46,11 +46,11 @@ short *itemset; short *itemsetend; unsigned *ruleset; -static void set_EFF __P((void)); +static void set_EFF(void); #ifdef DEBUG -static void print_closure __P((int)); -static void print_EFF __P(()); -static void print_first_derives __P(()); +static void print_closure(int); +static void print_EFF(); +static void print_first_derives(); #endif static unsigned *first_derives; @@ -58,7 +58,7 @@ static unsigned *EFF; static void -set_EFF() +set_EFF(void) { register unsigned *row; register int symbol; @@ -95,7 +95,7 @@ set_EFF() void -set_first_derives() +set_first_derives(void) { register unsigned *rrow; register unsigned *vrow; @@ -151,9 +151,7 @@ set_first_derives() void -closure(nucleus, n) -short *nucleus; -int n; +closure(short *nucleus, int n) { register int ruleno; register unsigned word; @@ -222,7 +220,7 @@ int n; void -finalize_closure() +finalize_closure(void) { FREE(itemset); FREE(ruleset); @@ -233,8 +231,7 @@ finalize_closure() #ifdef DEBUG static void -print_closure(n) -int n; +print_closure(int n) { register short *isp; @@ -245,7 +242,7 @@ int n; static void -print_EFF() +print_EFF(void) { register int i, j; register unsigned *rowp; @@ -277,7 +274,7 @@ print_EFF() static void -print_first_derives() +print_first_derives(void) { register int i; register int j; diff --git a/usr.bin/yacc/error.c b/usr.bin/yacc/error.c index 4934f6bc54..b634acb794 100644 --- a/usr.bin/yacc/error.c +++ b/usr.bin/yacc/error.c @@ -35,18 +35,17 @@ * * @(#)error.c 5.3 (Berkeley) 6/1/90 * $FreeBSD: src/usr.bin/yacc/error.c,v 1.7 1999/08/28 01:07:59 peter Exp $ - * $DragonFly: src/usr.bin/yacc/error.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/error.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ /* routines for printing error messages */ #include "defs.h" -static void print_pos __P((char *, char *)); +static void print_pos(char *, char *); void -fatal(msg) -char *msg; +fatal(char *msg) { warnx("f - %s", msg); done(2); @@ -54,7 +53,7 @@ char *msg; void -no_space() +no_space(void) { warnx("f - out of space"); done(2); @@ -62,8 +61,7 @@ no_space() void -open_error(filename) -char *filename; +open_error(char *filename) { warnx("f - cannot open \"%s\"", filename); done(2); @@ -71,7 +69,7 @@ char *filename; void -unexpected_EOF() +unexpected_EOF(void) { warnx("e - line %d of \"%s\", unexpected end-of-file", lineno, input_file_name); @@ -80,9 +78,7 @@ unexpected_EOF() static void -print_pos(st_line, st_cptr) -char *st_line; -char *st_cptr; +print_pos(char *st_line, char *st_cptr) { register char *s; @@ -108,10 +104,7 @@ char *st_cptr; void -syntax_error(st_lineno, st_line, st_cptr) -int st_lineno; -char *st_line; -char *st_cptr; +syntax_error(int st_lineno, char *st_line, char *st_cptr) { warnx("e - line %d of \"%s\", syntax error", st_lineno, input_file_name); @@ -121,10 +114,7 @@ char *st_cptr; void -unterminated_comment(c_lineno, c_line, c_cptr) -int c_lineno; -char *c_line; -char *c_cptr; +unterminated_comment(int c_lineno, char *c_line, char *c_cptr) { warnx("e - line %d of \"%s\", unmatched /*", c_lineno, input_file_name); @@ -134,10 +124,7 @@ char *c_cptr; void -unterminated_string(s_lineno, s_line, s_cptr) -int s_lineno; -char *s_line; -char *s_cptr; +unterminated_string(int s_lineno, char *s_line, char *s_cptr) { warnx("e - line %d of \"%s\", unterminated string", s_lineno, input_file_name); @@ -147,10 +134,7 @@ char *s_cptr; void -unterminated_text(t_lineno, t_line, t_cptr) -int t_lineno; -char *t_line; -char *t_cptr; +unterminated_text(int t_lineno, char *t_line, char *t_cptr) { warnx("e - line %d of \"%s\", unmatched %%{", t_lineno, input_file_name); @@ -160,10 +144,7 @@ char *t_cptr; void -unterminated_union(u_lineno, u_line, u_cptr) -int u_lineno; -char *u_line; -char *u_cptr; +unterminated_union(int u_lineno, char *u_line, char *u_cptr) { warnx("e - line %d of \"%s\", unterminated %%union declaration", u_lineno, input_file_name); @@ -173,8 +154,7 @@ char *u_cptr; void -over_unionized(u_cptr) -char *u_cptr; +over_unionized(char *u_cptr) { warnx("e - line %d of \"%s\", too many %%union declarations", lineno, input_file_name); @@ -184,10 +164,7 @@ char *u_cptr; void -illegal_tag(t_lineno, t_line, t_cptr) -int t_lineno; -char *t_line; -char *t_cptr; +illegal_tag(int t_lineno, char *t_line, char *t_cptr) { warnx("e - line %d of \"%s\", illegal tag", t_lineno, input_file_name); print_pos(t_line, t_cptr); @@ -196,8 +173,7 @@ char *t_cptr; void -illegal_character(c_cptr) -char *c_cptr; +illegal_character(char *c_cptr) { warnx("e - line %d of \"%s\", illegal character", lineno, input_file_name); print_pos(line, c_cptr); @@ -206,8 +182,7 @@ char *c_cptr; void -used_reserved(s) -char *s; +used_reserved(char *s) { warnx("e - line %d of \"%s\", illegal use of reserved symbol %s", lineno, input_file_name, s); @@ -216,8 +191,7 @@ char *s; void -tokenized_start(s) -char *s; +tokenized_start(char *s) { warnx("e - line %d of \"%s\", the start symbol %s cannot be \ declared to be a token", lineno, input_file_name, s); @@ -226,8 +200,7 @@ declared to be a token", lineno, input_file_name, s); void -retyped_warning(s) -char *s; +retyped_warning(char *s) { warnx("w - line %d of \"%s\", the type of %s has been redeclared", lineno, input_file_name, s); @@ -235,8 +208,7 @@ char *s; void -reprec_warning(s) -char *s; +reprec_warning(char *s) { warnx("w - line %d of \"%s\", the precedence of %s has been redeclared", lineno, input_file_name, s); @@ -244,8 +216,7 @@ char *s; void -revalued_warning(s) -char *s; +revalued_warning(char *s) { warnx("w - line %d of \"%s\", the value of %s has been redeclared", lineno, input_file_name, s); @@ -253,8 +224,7 @@ char *s; void -terminal_start(s) -char *s; +terminal_start(char *s) { warnx("e - line %d of \"%s\", the start symbol %s is a token", lineno, input_file_name, s); @@ -263,7 +233,7 @@ char *s; void -restarted_warning() +restarted_warning(void) { warnx("w - line %d of \"%s\", the start symbol has been redeclared", lineno, input_file_name); @@ -271,7 +241,7 @@ restarted_warning() void -no_grammar() +no_grammar(void) { warnx("e - line %d of \"%s\", no grammar has been specified", lineno, input_file_name); @@ -280,8 +250,7 @@ no_grammar() void -terminal_lhs(s_lineno) -int s_lineno; +terminal_lhs(int s_lineno) { warnx("e - line %d of \"%s\", a token appears on the lhs of a production", s_lineno, input_file_name); @@ -290,7 +259,7 @@ int s_lineno; void -prec_redeclared() +prec_redeclared(void) { warnx("w - line %d of \"%s\", conflicting %%prec specifiers", lineno, input_file_name); @@ -298,10 +267,7 @@ prec_redeclared() void -unterminated_action(a_lineno, a_line, a_cptr) -int a_lineno; -char *a_line; -char *a_cptr; +unterminated_action(int a_lineno, char *a_line, char *a_cptr) { warnx("e - line %d of \"%s\", unterminated action", a_lineno, input_file_name); @@ -311,9 +277,7 @@ char *a_cptr; void -dollar_warning(a_lineno, i) -int a_lineno; -int i; +dollar_warning(int a_lineno, int i) { warnx("w - line %d of \"%s\", $%d references beyond the \ end of the current rule", a_lineno, input_file_name, i); @@ -321,10 +285,7 @@ end of the current rule", a_lineno, input_file_name, i); void -dollar_error(a_lineno, a_line, a_cptr) -int a_lineno; -char *a_line; -char *a_cptr; +dollar_error(int a_lineno, char *a_line, char *a_cptr) { warnx("e - line %d of \"%s\", illegal $-name", a_lineno, input_file_name); print_pos(a_line, a_cptr); @@ -333,7 +294,7 @@ char *a_cptr; void -untyped_lhs() +untyped_lhs(void) { warnx("e - line %d of \"%s\", $$ is untyped", lineno, input_file_name); done(1); @@ -341,9 +302,7 @@ untyped_lhs() void -untyped_rhs(i, s) -int i; -char *s; +untyped_rhs(int i, char *s) { warnx("e - line %d of \"%s\", $%d (%s) is untyped", lineno, input_file_name, i, s); @@ -352,8 +311,7 @@ char *s; void -unknown_rhs(i) -int i; +unknown_rhs(int i) { warnx("e - line %d of \"%s\", $%d is untyped", lineno, input_file_name, i); done(1); @@ -361,7 +319,7 @@ int i; void -default_action_warning() +default_action_warning(void) { warnx("w - line %d of \"%s\", the default action assigns an \ undefined value to $$", lineno, input_file_name); @@ -369,8 +327,7 @@ undefined value to $$", lineno, input_file_name); void -undefined_goal(s) -char *s; +undefined_goal(char *s) { warnx("e - the start symbol %s is undefined", s); done(1); @@ -378,8 +335,7 @@ char *s; void -undefined_symbol_warning(s) -char *s; +undefined_symbol_warning(char *s) { warnx("w - the symbol %s is undefined", s); } diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c index e83026d3dd..f606cb26d2 100644 --- a/usr.bin/yacc/lalr.c +++ b/usr.bin/yacc/lalr.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/lalr.c,v 1.7 1999/08/28 01:07:59 peter Exp $ - * $DragonFly: src/usr.bin/yacc/lalr.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/lalr.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)lalr.c 5.3 (Berkeley) 6/1/90 */ @@ -62,22 +62,22 @@ short *goto_map; short *from_state; short *to_state; -static void add_lookback_edge __P((int, int, int)); -static void build_relations __P((void)); -static void compute_FOLLOWS __P((void)); -static void compute_lookaheads __P((void)); -static void digraph __P((short **)); -static void initialize_F __P((void)); -static void initialize_LA __P((void)); -static int map_goto __P((int, int)); -static void set_accessing_symbol __P((void)); -static void set_goto_map __P((void)); -static void set_maxrhs __P((void)); -static void set_reduction_table __P((void)); -static void set_shift_table __P((void)); -static void set_state_table __P((void)); -static short **transpose __P((short **, int)); -static void traverse __P((register int)); +static void add_lookback_edge(int, int, int); +static void build_relations(void); +static void compute_FOLLOWS(void); +static void compute_lookaheads(void); +static void digraph(short **); +static void initialize_F(void); +static void initialize_LA(void); +static int map_goto(int, int); +static void set_accessing_symbol(void); +static void set_goto_map(void); +static void set_maxrhs(void); +static void set_reduction_table(void); +static void set_shift_table(void); +static void set_state_table(void); +static short **transpose(short **, int); +static void traverse(register int); static int infinity; static int maxrhs; @@ -92,7 +92,7 @@ static int top; void -lalr() +lalr(void) { tokensetsize = WORDSIZE(ntokens); @@ -112,7 +112,7 @@ lalr() static void -set_state_table() +set_state_table(void) { register core *sp; @@ -124,7 +124,7 @@ set_state_table() static void -set_accessing_symbol() +set_accessing_symbol(void) { register core *sp; @@ -136,7 +136,7 @@ set_accessing_symbol() static void -set_shift_table() +set_shift_table(void) { register shifts *sp; @@ -148,7 +148,7 @@ set_shift_table() static void -set_reduction_table() +set_reduction_table(void) { register reductions *rp; @@ -160,7 +160,7 @@ set_reduction_table() static void -set_maxrhs() +set_maxrhs(void) { register short *itemp; register short *item_end; @@ -189,7 +189,7 @@ set_maxrhs() static void -initialize_LA() +initialize_LA(void) { register int i, j, k; register reductions *rp; @@ -227,7 +227,7 @@ initialize_LA() static void -set_goto_map() +set_goto_map(void) { register shifts *sp; register int i; @@ -297,9 +297,7 @@ set_goto_map() /* Map_goto maps a state/symbol pair into its numeric representation. */ static int -map_goto(state, symbol) -int state; -int symbol; +map_goto(int state, int symbol) { register int high; register int low; @@ -326,7 +324,7 @@ int symbol; static void -initialize_F() +initialize_F(void) { register int i; register int j; @@ -404,7 +402,7 @@ initialize_F() static void -build_relations() +build_relations(void) { register int i; register int j; @@ -497,8 +495,7 @@ build_relations() static void -add_lookback_edge(stateno, ruleno, gotono) -int stateno, ruleno, gotono; +add_lookback_edge(int stateno, int ruleno, int gotono) { register int i, k; register int found; @@ -525,9 +522,7 @@ int stateno, ruleno, gotono; static short ** -transpose(R, n) -short **R; -int n; +transpose(short **R, int n) { register short **new_R; register short **temp_R; @@ -583,14 +578,14 @@ int n; static void -compute_FOLLOWS() +compute_FOLLOWS(void) { digraph(includes); } static void -compute_lookaheads() +compute_lookaheads(void) { register int i, n; register unsigned *fp1, *fp2, *fp3; @@ -625,8 +620,7 @@ compute_lookaheads() static void -digraph(relation) -short **relation; +digraph(short **relation) { register int i; @@ -653,8 +647,7 @@ short **relation; static void -traverse(i) -register int i; +traverse(register int i) { register unsigned *fp1; register unsigned *fp2; diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c index ca9359885d..fb0366e309 100644 --- a/usr.bin/yacc/lr0.c +++ b/usr.bin/yacc/lr0.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/lr0.c,v 1.6 1999/08/28 01:08:00 peter Exp $ - * $DragonFly: src/usr.bin/yacc/lr0.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/lr0.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)lr0.c 5.3 (Berkeley) 1/20/91 */ @@ -51,22 +51,22 @@ core *first_state; shifts *first_shift; reductions *first_reduction; -static void allocate_itemsets __P((void)); -static void allocate_storage __P((void)); -static void append_states __P((void)); -static void free_storage __P((void)); -static void generate_states __P((void)); -static int get_state __P((int)); -static void initialize_states __P((void)); -static void new_itemsets __P((void)); -static core *new_state __P((int)); +static void allocate_itemsets(void); +static void allocate_storage(void); +static void append_states(void); +static void free_storage(void); +static void generate_states(void); +static int get_state(int); +static void initialize_states(void); +static void new_itemsets(void); +static core *new_state(int); #ifdef DEBUG -static void print_derives __P((void)); +static void print_derives(void); #endif -static void save_reductions __P((void)); -static void save_shifts __P((void)); -static void set_derives __P((void)); -static void set_nullable __P((void)); +static void save_reductions(void); +static void save_shifts(void); +static void set_derives(void); +static void set_nullable(void); static core **state_set; static core *this_state; @@ -86,7 +86,7 @@ static short *kernel_items; static void -allocate_itemsets() +allocate_itemsets(void) { register short *itemp; register short *item_end; @@ -129,7 +129,7 @@ allocate_itemsets() static void -allocate_storage() +allocate_storage(void) { allocate_itemsets(); shiftset = NEW2(nsyms, short); @@ -139,7 +139,7 @@ allocate_storage() static void -append_states() +append_states(void) { register int i; register int j; @@ -169,7 +169,7 @@ append_states() static void -free_storage() +free_storage(void) { FREE(shift_symbol); FREE(redset); @@ -183,7 +183,7 @@ free_storage() static void -generate_states() +generate_states(void) { allocate_storage(); itemset = NEW2(nitems, short); @@ -211,8 +211,7 @@ generate_states() static int -get_state(symbol) -int symbol; +get_state(int symbol) { register int key; register short *isp1; @@ -276,7 +275,7 @@ int symbol; static void -initialize_states() +initialize_states(void) { register int i; register short *start_derives; @@ -304,7 +303,7 @@ initialize_states() static void -new_itemsets() +new_itemsets(void) { register int i; register int shiftcount; @@ -341,8 +340,7 @@ new_itemsets() static core * -new_state(symbol) -int symbol; +new_state(int symbol) { register int n; register core *p; @@ -382,7 +380,7 @@ int symbol; #if 0 /* show_cores is used for debugging */ -show_cores() +show_cores(void) { core *p; int i, j, k, n; @@ -417,7 +415,7 @@ show_cores() /* show_ritems is used for debugging */ -show_ritems() +show_ritems(void) { int i; @@ -427,7 +425,7 @@ show_ritems() /* show_rrhs is used for debugging */ -show_rrhs() +show_rrhs(void) { int i; @@ -438,7 +436,7 @@ show_rrhs() /* show_shifts is used for debugging */ -show_shifts() +show_shifts(void) { shifts *p; int i, j, k; @@ -458,7 +456,7 @@ show_shifts() static void -save_shifts() +save_shifts(void) { register shifts *p; register short *sp1; @@ -493,7 +491,7 @@ save_shifts() static void -save_reductions() +save_reductions(void) { register short *isp; register short *rp1; @@ -543,7 +541,7 @@ save_reductions() static void -set_derives() +set_derives(void) { register int i, k; register int lhs; @@ -574,7 +572,7 @@ set_derives() } #if 0 -free_derives() +free_derives(void) { FREE(derives[start_symbol]); FREE(derives); @@ -583,7 +581,7 @@ free_derives() #ifdef DEBUG static void -print_derives() +print_derives(void) { register int i; register short *sp; @@ -606,7 +604,7 @@ print_derives() static void -set_nullable() +set_nullable(void) { register int i, j; register int empty; @@ -656,7 +654,7 @@ set_nullable() #if 0 -free_nullable() +free_nullable(void) { FREE(nullable); } @@ -664,7 +662,7 @@ free_nullable() void -lr0() +lr0(void) { set_derives(); set_nullable(); diff --git a/usr.bin/yacc/main.c b/usr.bin/yacc/main.c index 119ddd890a..2fd1678b6d 100644 --- a/usr.bin/yacc/main.c +++ b/usr.bin/yacc/main.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989 The Regents of the University of California. All rights reserved. * @(#)main.c 5.5 (Berkeley) 5/24/93 * $FreeBSD: src/usr.bin/yacc/main.c,v 1.12 2000/01/10 20:26:24 kris Exp $ - * $DragonFly: src/usr.bin/yacc/main.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/main.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -100,17 +100,16 @@ char *rassoc; short **derives; char *nullable; -static void create_file_names __P((void)); -static void getargs __P((int, char **)); -static void onintr __P((int)); -static void open_files __P((void)); -static void set_signals __P((void)); -static void usage __P((void)); +static void create_file_names(void); +static void getargs(int, char **); +static void onintr(int); +static void open_files(void); +static void set_signals(void); +static void usage(void); void -done(k) -int k; +done(int k) { if (action_file) { fclose(action_file); unlink(action_file_name); } if (text_file) { fclose(text_file); unlink(text_file_name); } @@ -120,15 +119,14 @@ int k; static void -onintr(signo) - int signo; +onintr(int signo) { done(1); } static void -set_signals() +set_signals(void) { #ifdef SIGINT if (signal(SIGINT, SIG_IGN) != SIG_IGN) @@ -146,7 +144,7 @@ set_signals() static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]", @@ -156,9 +154,7 @@ usage() static void -getargs(argc, argv) -int argc; -char *argv[]; +getargs(int argc, char **argv) { register int i; register char *s; @@ -270,8 +266,7 @@ no_more_options:; char * -allocate(n) -unsigned n; +allocate(unsigned n) { register char *p; @@ -286,7 +281,7 @@ unsigned n; static void -create_file_names() +create_file_names(void) { int i, len; char *tmpdir; @@ -406,7 +401,7 @@ create_file_names() static void -open_files() +open_files(void) { int fd; @@ -475,9 +470,7 @@ open_files() int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char **argv) { set_signals(); getargs(argc, argv); diff --git a/usr.bin/yacc/mkpar.c b/usr.bin/yacc/mkpar.c index 19c3e143d8..79b0a7d329 100644 --- a/usr.bin/yacc/mkpar.c +++ b/usr.bin/yacc/mkpar.c @@ -35,7 +35,7 @@ * * @(#)mkpar.c 5.3 (Berkeley) 1/20/91 * $FreeBSD: src/usr.bin/yacc/mkpar.c,v 1.10 1999/08/28 01:08:01 peter Exp $ - * $DragonFly: src/usr.bin/yacc/mkpar.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/mkpar.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -55,21 +55,21 @@ short final_state; static int SRcount; static int RRcount; -static action *add_reduce __P((action *, int, int)); -static action *add_reductions __P((int, action *)); -static void defreds __P((void)); -static void find_final_state __P((void)); -static void free_action_row __P((action *)); -static action *get_shifts __P((int)); -static action *parse_actions __P((int)); -static void remove_conflicts __P((void)); -static int sole_reduction __P((int)); -static void total_conflicts __P((void)); -static void unused_rules __P((void)); +static action *add_reduce(action *, int, int); +static action *add_reductions(int, action *); +static void defreds(void); +static void find_final_state(void); +static void free_action_row(action *); +static action *get_shifts(int); +static action *parse_actions(int); +static void remove_conflicts(void); +static int sole_reduction(int); +static void total_conflicts(void); +static void unused_rules(void); void -make_parser() +make_parser(void) { register int i; @@ -86,8 +86,7 @@ make_parser() static action * -parse_actions(stateno) -register int stateno; +parse_actions(register int stateno) { register action *actions; @@ -98,8 +97,7 @@ register int stateno; static action * -get_shifts(stateno) -int stateno; +get_shifts(int stateno) { register action *actions, *temp; register shifts *sp; @@ -133,9 +131,7 @@ int stateno; } static action * -add_reductions(stateno, actions) -int stateno; -register action *actions; +add_reductions(int stateno, register action *actions) { register int i, j, m, n; register int ruleno, tokensetsize; @@ -159,9 +155,7 @@ register action *actions; static action * -add_reduce(actions, ruleno, symbol) -register action *actions; -register int ruleno, symbol; +add_reduce(register action *actions, register int ruleno, register int symbol) { register action *temp, *prev, *next; @@ -200,7 +194,7 @@ register int ruleno, symbol; static void -find_final_state() +find_final_state(void) { register int goal, i; register short *to_state; @@ -218,7 +212,7 @@ find_final_state() static void -unused_rules() +unused_rules(void) { register int i; register action *p; @@ -252,7 +246,7 @@ unused_rules() static void -remove_conflicts() +remove_conflicts(void) { register int i; register int symbol; @@ -328,7 +322,7 @@ remove_conflicts() static void -total_conflicts() +total_conflicts(void) { /* Warn if s/r != expect or if any r/r */ if ((SRtotal != SRexpect) || RRtotal) @@ -347,8 +341,7 @@ total_conflicts() static int -sole_reduction(stateno) -int stateno; +sole_reduction(int stateno) { register int count, ruleno; register action *p; @@ -376,7 +369,7 @@ int stateno; static void -defreds() +defreds(void) { register int i; @@ -386,8 +379,7 @@ defreds() } static void -free_action_row(p) -register action *p; +free_action_row(register action *p) { register action *q; @@ -400,7 +392,7 @@ register action *p; } void -free_parser() +free_parser(void) { register int i; diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c index e5351521ab..26be39c5fe 100644 --- a/usr.bin/yacc/output.c +++ b/usr.bin/yacc/output.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/output.c,v 1.13.2.3 2001/10/05 03:03:14 obrien Exp $ - * $DragonFly: src/usr.bin/yacc/output.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/output.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)output.c 5.7 (Berkeley) 5/24/93 */ @@ -43,32 +43,32 @@ #include #include "defs.h" -static int default_goto __P((int)); -static void free_itemsets __P((void)); -static void free_reductions __P((void)); -static void free_shifts __P((void)); -static void goto_actions __P((void)); -static int is_C_identifier __P((char *)); -static int matching_vector __P((int)); -static void output_actions __P((void)); -static void output_base __P((void)); -static void output_check __P((void)); -static void output_debug __P((void)); -static void output_defines __P((void)); -static void output_prefix __P((void)); -static void output_rule_data __P((void)); -static void output_semantic_actions __P((void)); -static void output_stored_text __P((void)); -static void output_stype __P((void)); -static void output_table __P((void)); -static void output_trailing_text __P((void)); -static void output_yydefred __P((void)); -static void pack_table __P((void)); -static int pack_vector __P((int)); -static void save_column __P((int, int)); -static void sort_actions __P((void)); -static void token_actions __P((void)); -static int increase_maxtable __P((int)); +static int default_goto(int); +static void free_itemsets(void); +static void free_reductions(void); +static void free_shifts(void); +static void goto_actions(void); +static int is_C_identifier(char *); +static int matching_vector(int); +static void output_actions(void); +static void output_base(void); +static void output_check(void); +static void output_debug(void); +static void output_defines(void); +static void output_prefix(void); +static void output_rule_data(void); +static void output_semantic_actions(void); +static void output_stored_text(void); +static void output_stype(void); +static void output_table(void); +static void output_trailing_text(void); +static void output_yydefred(void); +static void pack_table(void); +static int pack_vector(int); +static void save_column(int, int); +static void sort_actions(void); +static void token_actions(void); +static int increase_maxtable(int); static const char line_format[] = "#line %d \"%s\"\n"; static int nvectors; @@ -89,7 +89,7 @@ static int high; void -output() +output(void) { free_itemsets(); free_shifts(); @@ -113,7 +113,7 @@ output() static void -output_prefix() +output_prefix(void) { if (symbol_prefix == NULL) symbol_prefix = "yy"; @@ -178,7 +178,7 @@ output_prefix() static void -output_rule_data() +output_rule_data(void) { register int i; register int j; @@ -226,7 +226,7 @@ output_rule_data() static void -output_yydefred() +output_yydefred(void) { register int i, j; @@ -254,7 +254,7 @@ output_yydefred() static void -output_actions() +output_actions(void) { nvectors = 2*nstates + nvars; @@ -283,7 +283,7 @@ output_actions() static void -token_actions() +token_actions(void) { register int i, j; register int shiftcount, reducecount; @@ -368,7 +368,7 @@ token_actions() } static void -goto_actions() +goto_actions(void) { register int i, j, k; @@ -401,8 +401,7 @@ goto_actions() } static int -default_goto(symbol) -int symbol; +default_goto(int symbol) { register int i; register int m; @@ -438,9 +437,7 @@ int symbol; static void -save_column(symbol, default_state) -int symbol; -int default_state; +save_column(int symbol, int default_state) { register int i; register int m; @@ -481,7 +478,7 @@ int default_state; } static void -sort_actions() +sort_actions(void) { register int i; register int j; @@ -517,7 +514,7 @@ sort_actions() static void -pack_table() +pack_table(void) { register int i; register int place; @@ -580,8 +577,7 @@ pack_table() /* order. */ static int -matching_vector(vector) -int vector; +matching_vector(int vector) { register int i; register int j; @@ -621,8 +617,7 @@ int vector; static int -pack_vector(vector) -int vector; +pack_vector(int vector) { register int i, j, k, l; register int t; @@ -698,7 +693,7 @@ int vector; static void -output_base() +output_base(void) { register int i, j; @@ -766,7 +761,7 @@ output_base() static void -output_table() +output_table(void) { register int i; register int j; @@ -799,7 +794,7 @@ output_table() static void -output_check() +output_check(void) { register int i; register int j; @@ -829,8 +824,7 @@ output_check() static int -is_C_identifier(name) -char *name; +is_C_identifier(char *name) { register char *s; register int c; @@ -862,7 +856,7 @@ char *name; static void -output_defines() +output_defines(void) { register int c, i; register char *s; @@ -921,7 +915,7 @@ output_defines() static void -output_stored_text() +output_stored_text(void) { register int c; register FILE *in, *out; @@ -949,7 +943,7 @@ output_stored_text() static void -output_debug() +output_debug(void) { register int i, j, k, max; char **symnam, *s; @@ -1165,7 +1159,7 @@ output_debug() static void -output_stype() +output_stype(void) { if (!unionized && ntags == 0) { @@ -1176,7 +1170,7 @@ output_stype() static void -output_trailing_text() +output_trailing_text(void) { register int c, last; register FILE *in, *out; @@ -1234,7 +1228,7 @@ output_trailing_text() static void -output_semantic_actions() +output_semantic_actions(void) { register int c, last; register FILE *out; @@ -1272,7 +1266,7 @@ output_semantic_actions() static void -free_itemsets() +free_itemsets(void) { register core *cp, *next; @@ -1286,7 +1280,7 @@ free_itemsets() static void -free_shifts() +free_shifts(void) { register shifts *sp, *next; @@ -1301,7 +1295,7 @@ free_shifts() static void -free_reductions() +free_reductions(void) { register reductions *rp, *next; diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c index b173b13682..3e57c300fe 100644 --- a/usr.bin/yacc/reader.c +++ b/usr.bin/yacc/reader.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/reader.c,v 1.8.2.1 2001/10/05 03:00:44 obrien Exp $ - * $DragonFly: src/usr.bin/yacc/reader.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/reader.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)reader.c 5.7 (Berkeley) 1/20/91 */ @@ -76,46 +76,45 @@ char *name_pool; static const char line_format[] = "#line %d \"%s\"\n"; -static void add_symbol __P((void)); -static void advance_to_start __P((void)); -static void cachec __P((int)); -static void check_symbols __P((void)); -static void copy_action __P((void)); -static void copy_ident __P((void)); -static void copy_text __P((void)); -static void copy_union __P((void)); -static void declare_start __P((void)); -static void declare_tokens __P((int)); -static void declare_types __P((void)); -static char *dup_line __P((void)); -static void end_rule __P((void)); -static void expand_items __P((void)); -static void expand_rules __P((void)); -static void free_tags __P((void)); -static void get_line __P((void)); -static bucket *get_literal __P((void)); -static bucket *get_name __P((void)); -static int get_number __P((void)); -static char *get_tag __P((void)); -static int hexval __P((int)); -static void initialize_grammar __P((void)); -static void insert_empty_rule __P((void)); -static int is_reserved __P((char *)); -static int keyword __P((void)); -static int mark_symbol __P((void)); -static int nextc __P((void)); -static void pack_grammar __P((void)); -static void pack_names __P((void)); -static void pack_symbols __P((void)); -static void print_grammar __P((void)); -static void read_declarations __P((void)); -static void read_grammar __P((void)); -static void skip_comment __P((void)); -static void start_rule __P((bucket *, int)); +static void add_symbol(void); +static void advance_to_start(void); +static void cachec(int); +static void check_symbols(void); +static void copy_action(void); +static void copy_ident(void); +static void copy_text(void); +static void copy_union(void); +static void declare_start(void); +static void declare_tokens(int); +static void declare_types(void); +static char *dup_line(void); +static void end_rule(void); +static void expand_items(void); +static void expand_rules(void); +static void free_tags(void); +static void get_line(void); +static bucket *get_literal(void); +static bucket *get_name(void); +static int get_number(void); +static char *get_tag(void); +static int hexval(int); +static void initialize_grammar(void); +static void insert_empty_rule(void); +static int is_reserved(char *); +static int keyword(void); +static int mark_symbol(void); +static int nextc(void); +static void pack_grammar(void); +static void pack_names(void); +static void pack_symbols(void); +static void print_grammar(void); +static void read_declarations(void); +static void read_grammar(void); +static void skip_comment(void); +static void start_rule(bucket *, int); static void -cachec(c) -int c; +cachec(int c) { assert(cinc >= 0); if (cinc >= cache_size) @@ -130,7 +129,7 @@ int c; static void -get_line() +get_line(void) { register FILE *f = input_file; register int c; @@ -177,7 +176,7 @@ get_line() static char * -dup_line() +dup_line(void) { register char *p, *s, *t; @@ -195,7 +194,7 @@ dup_line() static void -skip_comment() +skip_comment(void) { register char *s; @@ -226,7 +225,7 @@ skip_comment() static int -nextc() +nextc(void) { register char *s; @@ -288,7 +287,7 @@ nextc() static int -keyword() +keyword(void) { register int c; char *t_cptr = cptr; @@ -354,7 +353,7 @@ keyword() static void -copy_ident() +copy_ident(void) { register int c; register FILE *f = output_file; @@ -384,7 +383,7 @@ copy_ident() static void -copy_text() +copy_text(void) { register int c; int quote; @@ -516,7 +515,7 @@ loop: static void -copy_union() +copy_union(void) { register int c; int quote; @@ -657,8 +656,7 @@ loop: static int -hexval(c) -int c; +hexval(int c) { if (c >= '0' && c <= '9') return (c - '0'); @@ -671,7 +669,7 @@ int c; static bucket * -get_literal() +get_literal(void) { register int c, quote; register int i; @@ -810,8 +808,7 @@ get_literal() static int -is_reserved(name) -char *name; +is_reserved(char *name) { char *s; @@ -832,7 +829,7 @@ char *name; static bucket * -get_name() +get_name(void) { register int c; @@ -848,7 +845,7 @@ get_name() static int -get_number() +get_number(void) { register int c; register int n; @@ -862,7 +859,7 @@ get_number() static char * -get_tag() +get_tag(void) { register int c; register int i; @@ -913,8 +910,7 @@ get_tag() static void -declare_tokens(assoc) -int assoc; +declare_tokens(int assoc) { register int c; register bucket *bp; @@ -981,8 +977,7 @@ int assoc; * grammar only a flag for yacc proper. */ static void -declare_expect(assoc) -int assoc; +declare_expect(int assoc) { register int c; @@ -1021,7 +1016,7 @@ int assoc; static void -declare_types() +declare_types(void) { register int c; register bucket *bp; @@ -1050,7 +1045,7 @@ declare_types() static void -declare_start() +declare_start(void) { register int c; register bucket *bp; @@ -1069,7 +1064,7 @@ declare_start() static void -read_declarations() +read_declarations(void) { register int c, k; @@ -1123,7 +1118,7 @@ read_declarations() static void -initialize_grammar() +initialize_grammar(void) { nitems = 4; maxitems = 300; @@ -1155,7 +1150,7 @@ initialize_grammar() static void -expand_items() +expand_items(void) { maxitems += 300; pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *)); @@ -1164,7 +1159,7 @@ expand_items() static void -expand_rules() +expand_rules(void) { maxrules += 100; plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *)); @@ -1177,7 +1172,7 @@ expand_rules() static void -advance_to_start() +advance_to_start(void) { register int c; register bucket *bp; @@ -1228,9 +1223,7 @@ advance_to_start() static void -start_rule(bp, s_lineno) -register bucket *bp; -int s_lineno; +start_rule(register bucket *bp, int s_lineno) { if (bp->class == TERM) terminal_lhs(s_lineno); @@ -1244,7 +1237,7 @@ int s_lineno; static void -end_rule() +end_rule(void) { register int i; @@ -1264,7 +1257,7 @@ end_rule() static void -insert_empty_rule() +insert_empty_rule(void) { register bucket *bp, **bpp; @@ -1294,7 +1287,7 @@ insert_empty_rule() static void -add_symbol() +add_symbol(void) { register int c; register bucket *bp; @@ -1326,7 +1319,7 @@ add_symbol() static void -copy_action() +copy_action(void) { register int c; register int i, n; @@ -1550,7 +1543,7 @@ loop: static int -mark_symbol() +mark_symbol(void) { register int c; register bucket *bp = NULL; @@ -1594,7 +1587,7 @@ mark_symbol() static void -read_grammar() +read_grammar(void) { register int c; @@ -1628,7 +1621,7 @@ read_grammar() static void -free_tags() +free_tags(void) { register int i; @@ -1644,7 +1637,7 @@ free_tags() static void -pack_names() +pack_names(void) { register bucket *bp; register char *p, *s, *t; @@ -1670,7 +1663,7 @@ pack_names() static void -check_symbols() +check_symbols(void) { register bucket *bp; @@ -1689,7 +1682,7 @@ check_symbols() static void -pack_symbols() +pack_symbols(void) { register bucket *bp; register bucket **v; @@ -1814,7 +1807,7 @@ pack_symbols() static void -pack_grammar() +pack_grammar(void) { register int i, j; int assoc, prec; @@ -1874,7 +1867,7 @@ pack_grammar() static void -print_grammar() +print_grammar(void) { register int i, j, k; int spacing = 0; @@ -1911,7 +1904,7 @@ print_grammar() void -reader() +reader(void) { write_section(banner); create_symbol_table(); diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c index b6aceef2f5..f84c4d968f 100644 --- a/usr.bin/yacc/skeleton.c +++ b/usr.bin/yacc/skeleton.c @@ -36,7 +36,7 @@ * @(#)skeleton.c 5.8 (Berkeley) 4/29/95 * * $FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28.2.1 2001/07/19 05:46:39 peter Exp $ - * $DragonFly: src/usr.bin/yacc/skeleton.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/skeleton.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include "defs.h" @@ -390,8 +390,7 @@ char *trailer[] = void -write_section(section) -char *section[]; +write_section(char **section) { register int c; register int i; diff --git a/usr.bin/yacc/symtab.c b/usr.bin/yacc/symtab.c index 484791fbbb..72ee2274f1 100644 --- a/usr.bin/yacc/symtab.c +++ b/usr.bin/yacc/symtab.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/symtab.c,v 1.6 1999/08/28 01:08:03 peter Exp $ - * $DragonFly: src/usr.bin/yacc/symtab.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/symtab.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)symtab.c 5.3 (Berkeley) 6/1/90 */ @@ -48,7 +48,7 @@ #define TABLE_SIZE 1024 -static int hash __P((char *)); +static int hash(char *); bucket **symbol_table; bucket *first_symbol; @@ -56,8 +56,7 @@ bucket *last_symbol; static int -hash(name) -char *name; +hash(char *name) { register char *s; register int c, k; @@ -73,8 +72,7 @@ char *name; bucket * -make_bucket(name) -char *name; +make_bucket(char *name) { register bucket *bp; @@ -100,8 +98,7 @@ char *name; bucket * -lookup(name) -char *name; +lookup(char *name) { register bucket *bp, **bpp; @@ -124,7 +121,7 @@ char *name; void -create_symbol_table() +create_symbol_table(void) { register int i; register bucket *bp; @@ -145,7 +142,7 @@ create_symbol_table() void -free_symbol_table() +free_symbol_table(void) { FREE(symbol_table); symbol_table = 0; @@ -153,7 +150,7 @@ free_symbol_table() void -free_symbols() +free_symbols(void) { register bucket *p, *q; diff --git a/usr.bin/yacc/verbose.c b/usr.bin/yacc/verbose.c index fccbef1420..8da86cdb98 100644 --- a/usr.bin/yacc/verbose.c +++ b/usr.bin/yacc/verbose.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/verbose.c,v 1.6 1999/08/28 01:08:03 peter Exp $ - * $DragonFly: src/usr.bin/yacc/verbose.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/verbose.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)verbose.c 5.3 (Berkeley) 1/20/91 */ @@ -42,21 +42,21 @@ #include #include "defs.h" -static void log_unused __P((void)); -static void log_conflicts __P((void)); -static void print_actions __P((int)); -static void print_conflicts __P((int)); -static void print_core __P((int)); -static void print_gotos __P((int)); -static void print_nulls __P((int)); -static void print_reductions __P((register action *, register int)); -static void print_shifts __P((register action *)); -static void print_state __P((int)); +static void log_unused(void); +static void log_conflicts(void); +static void print_actions(int); +static void print_conflicts(int); +static void print_core(int); +static void print_gotos(int); +static void print_nulls(int); +static void print_reductions(register action *, register int); +static void print_shifts(register action *); +static void print_state(int); static short *null_rules; void -verbose() +verbose(void) { register int i; @@ -81,7 +81,7 @@ verbose() static void -log_unused() +log_unused(void) { register int i; register short *p; @@ -101,7 +101,7 @@ log_unused() static void -log_conflicts() +log_conflicts(void) { register int i; @@ -130,8 +130,7 @@ log_conflicts() static void -print_state(state) -int state; +print_state(int state) { if (state) fprintf(verbose_file, "\n\n"); @@ -145,8 +144,7 @@ int state; static void -print_conflicts(state) -int state; +print_conflicts(int state) { register int symbol, act = 0, number = 0; register action *p; @@ -194,8 +192,7 @@ int state; static void -print_core(state) -int state; +print_core(int state) { register int i; register int k; @@ -231,8 +228,7 @@ int state; static void -print_nulls(state) -int state; +print_nulls(int state) { register action *p; register int i, j, k, nnulls; @@ -276,8 +272,7 @@ int state; static void -print_actions(stateno) -int stateno; +print_actions(int stateno) { register action *p; register shifts *sp; @@ -304,8 +299,7 @@ int stateno; static void -print_shifts(p) -register action *p; +print_shifts(register action *p) { register int count; register action *q; @@ -330,9 +324,7 @@ register action *p; static void -print_reductions(p, defred) -register action *p; -register int defred; +print_reductions(register action *p, register int defred) { register int k, anyreds; register action *q; @@ -369,8 +361,7 @@ register int defred; static void -print_gotos(stateno) -int stateno; +print_gotos(int stateno) { register int i, k; register int as; diff --git a/usr.bin/yacc/warshall.c b/usr.bin/yacc/warshall.c index 036f67b8f0..9acf064ab8 100644 --- a/usr.bin/yacc/warshall.c +++ b/usr.bin/yacc/warshall.c @@ -34,19 +34,17 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/yacc/warshall.c,v 1.6 1999/08/28 01:08:04 peter Exp $ - * $DragonFly: src/usr.bin/yacc/warshall.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yacc/warshall.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ * * @(#)warshall.c 5.4 (Berkeley) 5/24/93 */ #include "defs.h" -static void transitive_closure __P((unsigned *, int)); +static void transitive_closure(unsigned *, int); static void -transitive_closure(R, n) -unsigned *R; -int n; +transitive_closure(unsigned *R, int n) { register int rowsize; register unsigned i; @@ -97,9 +95,7 @@ int n; } void -reflexive_transitive_closure(R, n) -unsigned *R; -int n; +reflexive_transitive_closure(unsigned *R, int n) { register int rowsize; register unsigned i; diff --git a/usr.bin/yes/yes.c b/usr.bin/yes/yes.c index db367e9b2a..f2ec61eef7 100644 --- a/usr.bin/yes/yes.c +++ b/usr.bin/yes/yes.c @@ -33,15 +33,13 @@ * @(#) Copyright (c) 1987, 1993 The Regents of the University of California. All rights reserved. * @(#)yes.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/yes/yes.c,v 1.1.1.1.14.1 2000/06/08 06:24:44 kris Exp $ - * $DragonFly: src/usr.bin/yes/yes.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/yes/yes.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { if (argc > 1) for(;;) diff --git a/usr.bin/ypcat/ypcat.c b/usr.bin/ypcat/ypcat.c index 41c1faaf74..c0c564f51e 100644 --- a/usr.bin/ypcat/ypcat.c +++ b/usr.bin/ypcat/ypcat.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ypcat/ypcat.c,v 1.4.2.2 2002/02/15 00:46:56 des Exp $ - * $DragonFly: src/usr.bin/ypcat/ypcat.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/ypcat/ypcat.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -62,7 +62,7 @@ struct ypalias { int key; static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: ypcat [-k] [-d domainname] [-t] mapname", @@ -71,13 +71,8 @@ usage() } int -printit(instatus, inkey, inkeylen, inval, invallen, indata) -int instatus; -char *inkey; -int inkeylen; -char *inval; -int invallen; -char *indata; +printit(int instatus, char *inkey, int inkeylen, char *inval, int invallen, + char *indata) { if (instatus != YP_TRUE) return (instatus); @@ -88,8 +83,7 @@ char *indata; } int -main(argc, argv) -char **argv; +main(int argc, char **argv) { char *domainname = NULL; struct ypall_callback ypcb; diff --git a/usr.bin/ypmatch/ypmatch.c b/usr.bin/ypmatch/ypmatch.c index c4ec7a1f9a..2d7cca0695 100644 --- a/usr.bin/ypmatch/ypmatch.c +++ b/usr.bin/ypmatch/ypmatch.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ypmatch/ypmatch.c,v 1.7.2.2 2002/02/15 00:46:56 des Exp $ - * $DragonFly: src/usr.bin/ypmatch/ypmatch.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/ypmatch/ypmatch.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -60,7 +60,7 @@ struct ypalias { }; static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: ypmatch [-d domain] [-t] [-k] key [key ...] mname", @@ -69,8 +69,7 @@ usage() } int -main(argc, argv) -char **argv; +main(int argc, char **argv) { char *domainname = NULL; char *inkey, *inmap, *outbuf; diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c index de595dc680..c3d2c2b3d8 100644 --- a/usr.bin/ypwhich/ypwhich.c +++ b/usr.bin/ypwhich/ypwhich.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/ypwhich/ypwhich.c,v 1.11.2.1 2002/02/15 00:46:56 des Exp $ - * $DragonFly: src/usr.bin/ypwhich/ypwhich.c,v 1.2 2003/06/17 04:29:34 dillon Exp $ + * $DragonFly: src/usr.bin/ypwhich/ypwhich.c,v 1.3 2003/10/04 20:36:55 hmp Exp $ */ #include @@ -71,7 +71,7 @@ struct ypalias { }; static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: ypwhich [-d domain] [[-t] -m [mname] | host]", @@ -84,9 +84,7 @@ usage() * Like yp_bind except can query a specific host */ int -bind_host(dom, sin) -char *dom; -struct sockaddr_in *sin; +bind_host(char *dom, struct sockaddr_in *sin) { struct hostent *hent = NULL; struct ypbind_resp ypbr; @@ -133,8 +131,7 @@ struct sockaddr_in *sin; } int -main(argc, argv) -char **argv; +main(int argc, char **argv) { char *domainname = NULL, *master, *map = NULL; struct ypmaplist *ypml, *y; -- 2.41.0