diff options
111 files changed, 733 insertions, 2161 deletions
diff --git a/usr.bin/vi/catalog/dump.c b/usr.bin/vi/catalog/dump.c index 6897dbec609..24b228bcbcb 100644 --- a/usr.bin/vi/catalog/dump.c +++ b/usr.bin/vi/catalog/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: dump.c,v 1.7 2014/11/12 04:28:40 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,8 +33,7 @@ #include <stdio.h> static void -parse(fp) - FILE *fp; +parse(FILE *fp) { int ch, s1, s2, s3; diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c index 04a6fcfa233..01ccc324427 100644 --- a/usr.bin/vi/cl/cl_funcs.c +++ b/usr.bin/vi/cl/cl_funcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_funcs.c,v 1.15 2014/11/06 10:48:52 bentley Exp $ */ +/* $OpenBSD: cl_funcs.c,v 1.16 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -37,10 +37,7 @@ * PUBLIC: int cl_addstr(SCR *, const char *, size_t); */ int -cl_addstr(sp, str, len) - SCR *sp; - const char *str; - size_t len; +cl_addstr(SCR *sp, const char *str, size_t len) { size_t oldy, oldx; int iv; @@ -72,10 +69,7 @@ cl_addstr(sp, str, len) * PUBLIC: int cl_attr(SCR *, scr_attr_t, int); */ int -cl_attr(sp, attribute, on) - SCR *sp; - scr_attr_t attribute; - int on; +cl_attr(SCR *sp, scr_attr_t attribute, int on) { CL_PRIVATE *clp; @@ -160,9 +154,7 @@ cl_attr(sp, attribute, on) * PUBLIC: int cl_baud(SCR *, u_long *); */ int -cl_baud(sp, ratep) - SCR *sp; - u_long *ratep; +cl_baud(SCR *sp, u_long *ratep) { CL_PRIVATE *clp; @@ -203,8 +195,7 @@ cl_baud(sp, ratep) * PUBLIC: int cl_bell(SCR *); */ int -cl_bell(sp) - SCR *sp; +cl_bell(SCR *sp) { if (F_ISSET(sp, SC_EX | SC_SCR_EXWROTE)) (void)write(STDOUT_FILENO, "\07", 1); /* \a */ @@ -235,8 +226,7 @@ cl_bell(sp) * PUBLIC: int cl_clrtoeol(SCR *); */ int -cl_clrtoeol(sp) - SCR *sp; +cl_clrtoeol(SCR *sp) { return (clrtoeol() == ERR); } @@ -248,9 +238,7 @@ cl_clrtoeol(sp) * PUBLIC: int cl_cursor(SCR *, size_t *, size_t *); */ int -cl_cursor(sp, yp, xp) - SCR *sp; - size_t *yp, *xp; +cl_cursor(SCR *sp, size_t *yp, size_t *xp) { /* * The curses screen support splits a single underlying curses screen @@ -271,8 +259,7 @@ cl_cursor(sp, yp, xp) * PUBLIC: int cl_deleteln(SCR *); */ int -cl_deleteln(sp) - SCR *sp; +cl_deleteln(SCR *sp) { #ifndef mvchgat CHAR_T ch; @@ -336,9 +323,7 @@ cl_deleteln(sp) * PUBLIC: int cl_ex_adjust(SCR *, exadj_t); */ int -cl_ex_adjust(sp, action) - SCR *sp; - exadj_t action; +cl_ex_adjust(SCR *sp, exadj_t action) { CL_PRIVATE *clp; int cnt; @@ -393,8 +378,7 @@ cl_ex_adjust(sp, action) * PUBLIC: int cl_insertln(SCR *); */ int -cl_insertln(sp) - SCR *sp; +cl_insertln(SCR *sp) { /* * The current line is expected to be blank after this operation, @@ -410,11 +394,7 @@ cl_insertln(sp) * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *); */ int -cl_keyval(sp, val, chp, dnep) - SCR *sp; - scr_keyval_t val; - CHAR_T *chp; - int *dnep; +cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep) { CL_PRIVATE *clp; @@ -452,9 +432,7 @@ cl_keyval(sp, val, chp, dnep) * PUBLIC: int cl_move(SCR *, size_t, size_t); */ int -cl_move(sp, lno, cno) - SCR *sp; - size_t lno, cno; +cl_move(SCR *sp, size_t lno, size_t cno) { /* See the comment in cl_cursor. */ if (move(RLNO(sp, lno), cno) == ERR) { @@ -472,9 +450,7 @@ cl_move(sp, lno, cno) * PUBLIC: int cl_refresh(SCR *, int); */ int -cl_refresh(sp, repaint) - SCR *sp; - int repaint; +cl_refresh(SCR *sp, int repaint) { CL_PRIVATE *clp; @@ -507,10 +483,7 @@ cl_refresh(sp, repaint) * PUBLIC: int cl_rename(SCR *, char *, int); */ int -cl_rename(sp, name, on) - SCR *sp; - char *name; - int on; +cl_rename(SCR *sp, char *name, int on) { GS *gp; CL_PRIVATE *clp; @@ -548,9 +521,7 @@ cl_rename(sp, name, on) * PUBLIC: int cl_suspend(SCR *, int *); */ int -cl_suspend(sp, allowedp) - SCR *sp; - int *allowedp; +cl_suspend(SCR *sp, int *allowedp) { struct termios t; CL_PRIVATE *clp; diff --git a/usr.bin/vi/cl/cl_main.c b/usr.bin/vi/cl/cl_main.c index f9737f9c32b..1a404cbf7df 100644 --- a/usr.bin/vi/cl/cl_main.c +++ b/usr.bin/vi/cl/cl_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_main.c,v 1.21 2014/11/10 21:34:13 tedu Exp $ */ +/* $OpenBSD: cl_main.c,v 1.22 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -141,8 +141,7 @@ main(int argc, char *argv[]) * Create and partially initialize the GS structure. */ static GS * -gs_init(name) - char *name; +gs_init(char *name) { GS *gp; char *p; @@ -166,8 +165,7 @@ gs_init(name) * Create and partially initialize the CL structure. */ static CL_PRIVATE * -cl_init(gp) - GS *gp; +cl_init(GS *gp) { CL_PRIVATE *clp; int fd; @@ -215,8 +213,7 @@ tcfail: perr(gp->progname, "tcgetattr"); * Initialize terminal information. */ static void -term_init(name, ttype) - char *name, *ttype; +term_init(char *name, char *ttype) { int err; @@ -237,8 +234,7 @@ term_init(name, ttype) #define GLOBAL_CLP \ CL_PRIVATE *clp = GCLP(__global_list); static void -h_hup(signo) - int signo; +h_hup(int signo) { GLOBAL_CLP; @@ -247,8 +243,7 @@ h_hup(signo) } static void -h_int(signo) - int signo; +h_int(int signo) { GLOBAL_CLP; @@ -256,8 +251,7 @@ h_int(signo) } static void -h_term(signo) - int signo; +h_term(int signo) { GLOBAL_CLP; @@ -266,8 +260,7 @@ h_term(signo) } static void -h_winch(signo) - int signo; +h_winch(int signo) { GLOBAL_CLP; @@ -282,9 +275,7 @@ h_winch(signo) * PUBLIC: int sig_init(GS *, SCR *); */ int -sig_init(gp, sp) - GS *gp; - SCR *sp; +sig_init(GS *gp, SCR *sp) { CL_PRIVATE *clp; @@ -326,10 +317,7 @@ sig_init(gp, sp) * Set a signal handler. */ static int -setsig(signo, oactp, handler) - int signo; - struct sigaction *oactp; - void (*handler)(int); +setsig(int signo, struct sigaction *oactp, void (*handler)(int)) { struct sigaction act; @@ -360,8 +348,7 @@ setsig(signo, oactp, handler) * End signal setup. */ static void -sig_end(gp) - GS *gp; +sig_end(GS *gp) { CL_PRIVATE *clp; @@ -379,8 +366,7 @@ sig_end(gp) * Initialize the standard curses functions. */ static void -cl_func_std(gp) - GS *gp; +cl_func_std(GS *gp) { gp->scr_addstr = cl_addstr; gp->scr_attr = cl_attr; @@ -410,8 +396,7 @@ cl_func_std(gp) * Print system error. */ static void -perr(name, msg) - char *name, *msg; +perr(char *name, char *msg) { (void)fprintf(stderr, "%s:", name); if (msg != NULL) diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c index dfd27de60d0..a2c1cadb2ef 100644 --- a/usr.bin/vi/cl/cl_read.c +++ b/usr.bin/vi/cl/cl_read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_read.c,v 1.18 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: cl_read.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -42,11 +42,7 @@ static int cl_resize(SCR *, size_t, size_t); * PUBLIC: int cl_event(SCR *, EVENT *, u_int32_t, int); */ int -cl_event(sp, evp, flags, ms) - SCR *sp; - EVENT *evp; - u_int32_t flags; - int ms; +cl_event(SCR *sp, EVENT *evp, u_int32_t flags, int ms) { struct timeval t, *tp; CL_PRIVATE *clp; @@ -127,13 +123,8 @@ retest: if (LF_ISSET(EC_INTERRUPT) || F_ISSET(clp, CL_SIGINT)) { * Read characters from the input. */ static input_t -cl_read(sp, flags, bp, blen, nrp, tp) - SCR *sp; - u_int32_t flags; - CHAR_T *bp; - size_t blen; - int *nrp; - struct timeval *tp; +cl_read(SCR *sp, u_int32_t flags, CHAR_T *bp, size_t blen, int *nrp, + struct timeval *tp) { struct termios term1, term2; CL_PRIVATE *clp; @@ -283,9 +274,7 @@ err: if (errno == EINTR) * Reset the options for a resize event. */ static int -cl_resize(sp, lines, columns) - SCR *sp; - size_t lines, columns; +cl_resize(SCR *sp, size_t lines, size_t columns) { ARGS *argv[2], a, b; char b1[1024]; diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c index 4fc553cdb56..59d7f4c0c08 100644 --- a/usr.bin/vi/cl/cl_screen.c +++ b/usr.bin/vi/cl/cl_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_screen.c,v 1.20 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: cl_screen.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -42,9 +42,7 @@ static int cl_putenv(char *, char *, u_long); * PUBLIC: int cl_screen(SCR *, u_int32_t); */ int -cl_screen(sp, flags) - SCR *sp; - u_int32_t flags; +cl_screen(SCR *sp, u_int32_t flags) { CL_PRIVATE *clp; GS *gp; @@ -126,8 +124,7 @@ cl_screen(sp, flags) * PUBLIC: int cl_quit(GS *); */ int -cl_quit(gp) - GS *gp; +cl_quit(GS *gp) { CL_PRIVATE *clp; int rval; @@ -177,8 +174,7 @@ cl_quit(gp) * Initialize the curses vi screen. */ static int -cl_vi_init(sp) - SCR *sp; +cl_vi_init(SCR *sp) { CL_PRIVATE *clp; char *o_cols, *o_lines, *o_term, *ttype; @@ -379,8 +375,7 @@ err: (void)cl_vi_end(sp->gp); * Shutdown the vi screen. */ static int -cl_vi_end(gp) - GS *gp; +cl_vi_end(GS *gp) { CL_PRIVATE *clp; @@ -423,8 +418,7 @@ cl_vi_end(gp) * Initialize the ex screen. */ static int -cl_ex_init(sp) - SCR *sp; +cl_ex_init(SCR *sp) { CL_PRIVATE *clp; @@ -498,8 +492,7 @@ fast: if (tcsetattr(STDIN_FILENO, TCSADRAIN | TCSASOFT, &clp->ex_enter)) { * Shutdown the ex screen. */ static int -cl_ex_end(gp) - GS *gp; +cl_ex_end(GS *gp) { CL_PRIVATE *clp; @@ -517,9 +510,7 @@ cl_ex_end(gp) * PUBLIC: int cl_getcap(SCR *, char *, char **); */ int -cl_getcap(sp, name, elementp) - SCR *sp; - char *name, **elementp; +cl_getcap(SCR *sp, char *name, char **elementp) { size_t len; char *t; @@ -537,8 +528,7 @@ cl_getcap(sp, name, elementp) * Free any allocated termcap/terminfo strings. */ static void -cl_freecap(clp) - CL_PRIVATE *clp; +cl_freecap(CL_PRIVATE *clp) { if (clp->el != NULL) { free(clp->el); @@ -567,10 +557,7 @@ cl_freecap(clp) * Put a value into the environment. */ static int -cl_putenv(name, str, value) - char *name, *str; - u_long value; - +cl_putenv(char *name, char *str, u_long value) { char buf[40]; diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c index db64b6b68da..40c46368bd4 100644 --- a/usr.bin/vi/cl/cl_term.c +++ b/usr.bin/vi/cl/cl_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_term.c,v 1.17 2014/11/06 10:48:52 bentley Exp $ */ +/* $OpenBSD: cl_term.c,v 1.18 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -79,8 +79,7 @@ static TKLIST const m2_tklist[] = { /* Input mappings (set or delete). */ * PUBLIC: int cl_term_init(SCR *); */ int -cl_term_init(sp) - SCR *sp; +cl_term_init(SCR *sp) { KEYLIST *kp; SEQ *qp; @@ -154,8 +153,7 @@ cl_term_init(sp) * PUBLIC: int cl_term_end(GS *); */ int -cl_term_end(gp) - GS *gp; +cl_term_end(GS *gp) { SEQ *qp, *nqp; @@ -175,11 +173,8 @@ cl_term_end(gp) * PUBLIC: int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); */ int -cl_fmap(sp, stype, from, flen, to, tlen) - SCR *sp; - seq_t stype; - CHAR_T *from, *to; - size_t flen, tlen; +cl_fmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, + size_t tlen) { /* Ignore until the screen is running, do the real work then. */ if (F_ISSET(sp, SC_VI) && !F_ISSET(sp, SC_SCR_VI)) @@ -195,11 +190,8 @@ cl_fmap(sp, stype, from, flen, to, tlen) * Map a function key (private version). */ static int -cl_pfmap(sp, stype, from, flen, to, tlen) - SCR *sp; - seq_t stype; - CHAR_T *from, *to; - size_t flen, tlen; +cl_pfmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, + size_t tlen) { size_t nlen; char *p, key_name[64]; @@ -228,11 +220,7 @@ cl_pfmap(sp, stype, from, flen, to, tlen) * PUBLIC: int cl_optchange(SCR *, int, char *, u_long *); */ int -cl_optchange(sp, opt, str, valp) - SCR *sp; - int opt; - char *str; - u_long *valp; +cl_optchange(SCR *sp, int opt, char *str, u_long *valp) { CL_PRIVATE *clp; @@ -279,10 +267,7 @@ cl_optchange(sp, opt, str, valp) * PUBLIC: int cl_omesg(SCR *, CL_PRIVATE *, int); */ int -cl_omesg(sp, clp, on) - SCR *sp; - CL_PRIVATE *clp; - int on; +cl_omesg(SCR *sp, CL_PRIVATE *clp, int on) { struct stat sb; char *tty; @@ -328,11 +313,7 @@ cl_omesg(sp, clp, on) * PUBLIC: int cl_ssize(SCR *, int, size_t *, size_t *, int *); */ int -cl_ssize(sp, sigwinch, rowp, colp, changedp) - SCR *sp; - int sigwinch; - size_t *rowp, *colp; - int *changedp; +cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t *colp, int *changedp) { #ifdef TIOCGWINSZ struct winsize win; @@ -454,8 +435,7 @@ noterm: if (row == 0) * PUBLIC: int cl_putchar(int); */ int -cl_putchar(ch) - int ch; +cl_putchar(int ch) { return (putchar(ch)); } diff --git a/usr.bin/vi/common/api.c b/usr.bin/vi/common/api.c index e87bc1a1824..70545ee626f 100644 --- a/usr.bin/vi/common/api.c +++ b/usr.bin/vi/common/api.c @@ -1,4 +1,4 @@ -/* $OpenBSD: api.c,v 1.15 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: api.c,v 1.16 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -37,9 +37,7 @@ extern GS *__global_list; /* XXX */ * PUBLIC: SCR *api_fscreen(int, char *); */ SCR * -api_fscreen(id, name) - int id; - char *name; +api_fscreen(int id, char *name) { GS *gp; SCR *tsp; @@ -71,11 +69,7 @@ api_fscreen(id, name) * PUBLIC: int api_aline(SCR *, recno_t, char *, size_t); */ int -api_aline(sp, lno, line, len) - SCR *sp; - recno_t lno; - char *line; - size_t len; +api_aline(SCR *sp, recno_t lno, char *line, size_t len) { return (db_append(sp, 1, lno, line, len)); } @@ -87,9 +81,7 @@ api_aline(sp, lno, line, len) * PUBLIC: int api_dline(SCR *, recno_t); */ int -api_dline(sp, lno) - SCR *sp; - recno_t lno; +api_dline(SCR *sp, recno_t lno) { return (db_delete(sp, lno)); } @@ -101,11 +93,7 @@ api_dline(sp, lno) * PUBLIC: int api_gline(SCR *, recno_t, char **, size_t *); */ int -api_gline(sp, lno, linepp, lenp) - SCR *sp; - recno_t lno; - char **linepp; - size_t *lenp; +api_gline(SCR *sp, recno_t lno, char **linepp, size_t *lenp) { int isempty; @@ -124,11 +112,7 @@ api_gline(sp, lno, linepp, lenp) * PUBLIC: int api_iline(SCR *, recno_t, char *, size_t); */ int -api_iline(sp, lno, line, len) - SCR *sp; - recno_t lno; - char *line; - size_t len; +api_iline(SCR *sp, recno_t lno, char *line, size_t len) { return (db_insert(sp, lno, line, len)); } @@ -140,9 +124,7 @@ api_iline(sp, lno, line, len) * PUBLIC: int api_lline(SCR *, recno_t *); */ int -api_lline(sp, lnop) - SCR *sp; - recno_t *lnop; +api_lline(SCR *sp, recno_t *lnop) { return (db_last(sp, lnop)); } @@ -154,11 +136,7 @@ api_lline(sp, lnop) * PUBLIC: int api_sline(SCR *, recno_t, char *, size_t); */ int -api_sline(sp, lno, line, len) - SCR *sp; - recno_t lno; - char *line; - size_t len; +api_sline(SCR *sp, recno_t lno, char *line, size_t len) { return (db_set(sp, lno, line, len)); } @@ -170,10 +148,7 @@ api_sline(sp, lno, line, len) * PUBLIC: int api_getmark(SCR *, int, MARK *); */ int -api_getmark(sp, markname, mp) - SCR *sp; - int markname; - MARK *mp; +api_getmark(SCR *sp, int markname, MARK *mp) { return (mark_get(sp, (ARG_CHAR_T)markname, mp, M_ERR)); } @@ -185,10 +160,7 @@ api_getmark(sp, markname, mp) * PUBLIC: int api_setmark(SCR *, int, MARK *); */ int -api_setmark(sp, markname, mp) - SCR *sp; - int markname; - MARK *mp; +api_setmark(SCR *sp, int markname, MARK *mp) { return (mark_set(sp, (ARG_CHAR_T)markname, mp, 1)); } @@ -201,10 +173,7 @@ api_setmark(sp, markname, mp) * PUBLIC: int api_nextmark(SCR *, int, char *); */ int -api_nextmark(sp, next, namep) - SCR *sp; - int next; - char *namep; +api_nextmark(SCR *sp, int next, char *namep) { LMARK *mp; @@ -228,9 +197,7 @@ api_nextmark(sp, next, namep) * PUBLIC: int api_getcursor(SCR *, MARK *); */ int -api_getcursor(sp, mp) - SCR *sp; - MARK *mp; +api_getcursor(SCR *sp, MARK *mp) { mp->lno = sp->lno; mp->cno = sp->cno; @@ -244,9 +211,7 @@ api_getcursor(sp, mp) * PUBLIC: int api_setcursor(SCR *, MARK *); */ int -api_setcursor(sp, mp) - SCR *sp; - MARK *mp; +api_setcursor(SCR *sp, MARK *mp) { size_t len; @@ -270,9 +235,7 @@ api_setcursor(sp, mp) * PUBLIC: void api_emessage(SCR *, char *); */ void -api_emessage(sp, text) - SCR *sp; - char *text; +api_emessage(SCR *sp, char *text) { msgq(sp, M_ERR, "%s", text); } @@ -284,9 +247,7 @@ api_emessage(sp, text) * PUBLIC: void api_imessage(SCR *, char *); */ void -api_imessage(sp, text) - SCR *sp; - char *text; +api_imessage(SCR *sp, char *text) { msgq(sp, M_INFO, "%s", text); } @@ -299,11 +260,7 @@ api_imessage(sp, text) * PUBLIC: int api_edit(SCR *, char *, SCR **, int); */ int -api_edit(sp, file, spp, newscreen) - SCR *sp; - char *file; - SCR **spp; - int newscreen; +api_edit(SCR *sp, char *file, SCR **spp, int newscreen) { ARGS *ap[2], a; EXCMD cmd; @@ -328,8 +285,7 @@ api_edit(sp, file, spp, newscreen) * PUBLIC: int api_escreen(SCR *); */ int -api_escreen(sp) - SCR *sp; +api_escreen(SCR *sp) { EXCMD cmd; @@ -349,8 +305,7 @@ api_escreen(sp) * PUBLIC: int api_swscreen(SCR *, SCR *); */ int -api_swscreen(sp, new) - SCR *sp, *new; +api_swscreen(SCR *sp, SCR *new) { /* * XXX @@ -370,10 +325,7 @@ api_swscreen(sp, new) * PUBLIC: int api_map(SCR *, char *, char *, size_t); */ int -api_map(sp, name, map, len) - SCR *sp; - char *name, *map; - size_t len; +api_map(SCR *sp, char *name, char *map, size_t len) { ARGS *ap[3], a, b; EXCMD cmd; @@ -391,9 +343,7 @@ api_map(sp, name, map, len) * PUBLIC: int api_unmap(SCR *, char *); */ int -api_unmap(sp, name) - SCR *sp; - char *name; +api_unmap(SCR *sp, char *name) { ARGS *ap[2], a; EXCMD cmd; @@ -412,10 +362,7 @@ api_unmap(sp, name) * PUBLIC: int api_opts_get(SCR *, char *, char **, int *); */ int -api_opts_get(sp, name, value, boolvalue) - SCR *sp; - char *name, **value; - int *boolvalue; +api_opts_get(SCR *sp, char *name, char **value, int *boolvalue) { OPTLIST const *op; int offset; @@ -466,11 +413,8 @@ api_opts_get(sp, name, value, boolvalue) * PUBLIC: int api_opts_set(SCR *, char *, char *, u_long, int); */ int -api_opts_set(sp, name, str_value, num_value, bool_value) - SCR *sp; - char *name, *str_value; - u_long num_value; - int bool_value; +api_opts_set(SCR *sp, char *name, char *str_value, u_long num_value, + int bool_value) { ARGS *ap[2], a, b; OPTLIST const *op; @@ -523,9 +467,7 @@ api_opts_set(sp, name, str_value, num_value, bool_value) * PUBLIC: int api_run_str(SCR *, char *); */ int -api_run_str(sp, cmd) - SCR *sp; - char *cmd; +api_run_str(SCR *sp, char *cmd) { return (ex_run_str(sp, NULL, cmd, strlen(cmd), 0, 0)); } diff --git a/usr.bin/vi/common/cut.c b/usr.bin/vi/common/cut.c index a5d7eea4417..0b9c77d4da9 100644 --- a/usr.bin/vi/common/cut.c +++ b/usr.bin/vi/common/cut.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cut.c,v 1.12 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: cut.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -62,11 +62,7 @@ static void cb_rotate(SCR *); * PUBLIC: int cut(SCR *, CHAR_T *, MARK *, MARK *, int); */ int -cut(sp, namep, fm, tm, flags) - SCR *sp; - CHAR_T *namep; - MARK *fm, *tm; - int flags; +cut(SCR *sp, CHAR_T *namep, MARK *fm, MARK *tm, int flags) { CB *cbp; CHAR_T name = '1'; /* default numeric buffer */ @@ -187,8 +183,7 @@ cut_line_err: * Rotate the numbered buffers up one. */ static void -cb_rotate(sp) - SCR *sp; +cb_rotate(SCR *sp) { CB *cbp, *del_cbp; @@ -237,11 +232,7 @@ cb_rotate(sp) * PUBLIC: int cut_line(SCR *, recno_t, size_t, size_t, CB *); */ int -cut_line(sp, lno, fcno, clen, cbp) - SCR *sp; - recno_t lno; - size_t fcno, clen; - CB *cbp; +cut_line(SCR *sp, recno_t lno, size_t fcno, size_t clen, CB *cbp) { TEXT *tp; size_t len; @@ -280,8 +271,7 @@ cut_line(sp, lno, fcno, clen, cbp) * PUBLIC: void cut_close(GS *); */ void -cut_close(gp) - GS *gp; +cut_close(GS *gp) { CB *cbp; @@ -306,10 +296,7 @@ cut_close(gp) * PUBLIC: TEXT *text_init(SCR *, const char *, size_t, size_t); */ TEXT * -text_init(sp, p, len, total_len) - SCR *sp; - const char *p; - size_t len, total_len; +text_init(SCR *sp, const char *p, size_t len, size_t total_len) { TEXT *tp; @@ -337,8 +324,7 @@ text_init(sp, p, len, total_len) * PUBLIC: void text_lfree(TEXTH *); */ void -text_lfree(headp) - TEXTH *headp; +text_lfree(TEXTH *headp) { TEXT *tp; @@ -355,8 +341,7 @@ text_lfree(headp) * PUBLIC: void text_free(TEXT *); */ void -text_free(tp) - TEXT *tp; +text_free(TEXT *tp) { if (tp->lb != NULL) free(tp->lb); diff --git a/usr.bin/vi/common/delete.c b/usr.bin/vi/common/delete.c index b580e93d4e7..52dedcbffaa 100644 --- a/usr.bin/vi/common/delete.c +++ b/usr.bin/vi/common/delete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: delete.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: delete.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,10 +30,7 @@ * PUBLIC: int del(SCR *, MARK *, MARK *, int); */ int -del(sp, fm, tm, lmode) - SCR *sp; - MARK *fm, *tm; - int lmode; +del(SCR *sp, MARK *fm, MARK *tm, int lmode) { recno_t lno; size_t blen, len, nlen, tlen; diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index d6ab1ca5249..5576c3a8418 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.29 2014/11/10 21:31:42 tedu Exp $ */ +/* $OpenBSD: exf.c,v 1.30 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -57,9 +57,7 @@ static int file_spath(SCR *, FREF *, struct stat *, int *); * PUBLIC: FREF *file_add(SCR *, CHAR_T *); */ FREF * -file_add(sp, name) - SCR *sp; - CHAR_T *name; +file_add(SCR *sp, CHAR_T *name) { GS *gp; FREF *frp, *tfrp; @@ -119,11 +117,7 @@ file_add(sp, name) * PUBLIC: int file_init(SCR *, FREF *, char *, int); */ int -file_init(sp, frp, rcv_name, flags) - SCR *sp; - FREF *frp; - char *rcv_name; - int flags; +file_init(SCR *sp, FREF *frp, char *rcv_name, int flags) { EXF *ep; RECNOINFO oinfo; @@ -452,11 +446,7 @@ oerr: if (F_ISSET(ep, F_RCV_ON)) * try and open. */ static int -file_spath(sp, frp, sbp, existsp) - SCR *sp; - FREF *frp; - struct stat *sbp; - int *existsp; +file_spath(SCR *sp, FREF *frp, struct stat *sbp, int *existsp) { CHAR_T savech; size_t len; @@ -521,8 +511,7 @@ file_spath(sp, frp, sbp, existsp) * Set up the initial cursor position. */ static void -file_cinit(sp) - SCR *sp; +file_cinit(SCR *sp) { GS *gp; MARK m; @@ -630,10 +619,7 @@ file_cinit(sp) * PUBLIC: int file_end(SCR *, EXF *, int); */ int -file_end(sp, ep, force) - SCR *sp; - EXF *ep; - int force; +file_end(SCR *sp, EXF *ep, int force) { FREF *frp; @@ -742,11 +728,7 @@ file_end(sp, ep, force) * PUBLIC: int file_write(SCR *, MARK *, MARK *, char *, int); */ int -file_write(sp, fm, tm, name, flags) - SCR *sp; - MARK *fm, *tm; - char *name; - int flags; +file_write(SCR *sp, MARK *fm, MARK *tm, char *name, int flags) { enum { NEWFILE, OLDFILE } mtype; struct stat sb; @@ -993,9 +975,7 @@ file_write(sp, fm, tm, name, flags) * recreate the file. So, let's not risk it. */ static int -file_backup(sp, name, bname) - SCR *sp; - char *name, *bname; +file_backup(SCR *sp, char *name, char *bname) { struct dirent *dp; struct stat sb; @@ -1177,8 +1157,7 @@ err: if (rfd != -1) * Skip the first comment. */ static void -file_comment(sp) - SCR *sp; +file_comment(SCR *sp) { recno_t lno; size_t len; @@ -1225,9 +1204,7 @@ file_comment(sp) * PUBLIC: int file_m1(SCR *, int, int); */ int -file_m1(sp, force, flags) - SCR *sp; - int force, flags; +file_m1(SCR *sp, int force, int flags) { EXF *ep; @@ -1266,9 +1243,7 @@ file_m1(sp, force, flags) * PUBLIC: int file_m2(SCR *, int); */ int -file_m2(sp, force) - SCR *sp; - int force; +file_m2(SCR *sp, int force) { EXF *ep; @@ -1298,9 +1273,7 @@ file_m2(sp, force) * PUBLIC: int file_m3(SCR *, int); */ int -file_m3(sp, force) - SCR *sp; - int force; +file_m3(SCR *sp, int force) { EXF *ep; @@ -1334,9 +1307,7 @@ file_m3(sp, force) * PUBLIC: int file_aw(SCR *, int); */ int -file_aw(sp, flags) - SCR *sp; - int flags; +file_aw(SCR *sp, int flags) { if (!F_ISSET(sp->ep, F_MODIFIED)) return (0); @@ -1395,9 +1366,7 @@ file_aw(sp, flags) * PUBLIC: void set_alt_name(SCR *, char *); */ void -set_alt_name(sp, name) - SCR *sp; - char *name; +set_alt_name(SCR *sp, char *name) { if (sp->alt_name != NULL) free(sp->alt_name); @@ -1431,10 +1400,7 @@ set_alt_name(sp, name) * PUBLIC: lockr_t file_lock(SCR *, char *, int *, int, int); */ lockr_t -file_lock(sp, name, fdp, fd, iswrite) - SCR *sp; - char *name; - int *fdp, fd, iswrite; +file_lock(SCR *sp, char *name, int *fdp, int fd, int iswrite) { if (!O_ISSET(sp, O_LOCKFILES)) return (LOCK_SUCCESS); diff --git a/usr.bin/vi/common/key.c b/usr.bin/vi/common/key.c index fbcc22a9190..dd3101c9bd1 100644 --- a/usr.bin/vi/common/key.c +++ b/usr.bin/vi/common/key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.12 2014/11/10 21:31:42 tedu Exp $ */ +/* $OpenBSD: key.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -98,8 +98,7 @@ static int nkeylist = * PUBLIC: int v_key_init(SCR *); */ int -v_key_init(sp) - SCR *sp; +v_key_init(SCR *sp) { u_int ch; GS *gp; @@ -154,10 +153,7 @@ v_key_init(sp) * in the table, so we check for that first. */ static void -v_keyval(sp, val, name) - SCR *sp; - int val; - scr_keyval_t name; +v_keyval(SCR *sp, int val, scr_keyval_t name) { KEYLIST *kp; CHAR_T ch; @@ -191,8 +187,7 @@ v_keyval(sp, val, name) * PUBLIC: void v_key_ilookup(SCR *); */ void -v_key_ilookup(sp) - SCR *sp; +v_key_ilookup(SCR *sp) { CHAR_T ch, *p, *t; GS *gp; @@ -212,9 +207,7 @@ v_key_ilookup(sp) * PUBLIC: size_t v_key_len(SCR *, ARG_CHAR_T); */ size_t -v_key_len(sp, ch) - SCR *sp; - ARG_CHAR_T ch; +v_key_len(SCR *sp, ARG_CHAR_T ch) { (void)v_key_name(sp, ch); return (sp->clen); @@ -228,9 +221,7 @@ v_key_len(sp, ch) * PUBLIC: CHAR_T *v_key_name(SCR *, ARG_CHAR_T); */ CHAR_T * -v_key_name(sp, ach) - SCR *sp; - ARG_CHAR_T ach; +v_key_name(SCR *sp, ARG_CHAR_T ach) { static const CHAR_T hexdigit[] = "0123456789abcdef"; static const CHAR_T octdigit[] = "01234567"; @@ -309,9 +300,7 @@ done: sp->cname[sp->clen = len] = '\0'; * PUBLIC: int v_key_val(SCR *, ARG_CHAR_T); */ int -v_key_val(sp, ch) - SCR *sp; - ARG_CHAR_T ch; +v_key_val(SCR *sp, ARG_CHAR_T ch) { KEYLIST k, *kp; @@ -333,12 +322,7 @@ v_key_val(sp, ch) * PUBLIC: int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int); */ int -v_event_push(sp, p_evp, p_s, nitems, flags) - SCR *sp; - EVENT *p_evp; /* Push event. */ - CHAR_T *p_s; /* Push characters. */ - size_t nitems; /* Number of items to push. */ - u_int flags; /* CH_* flags. */ +v_event_push(SCR *sp, EVENT *p_evp, CHAR_T *p_s, size_t nitems, u_int flags) { EVENT *evp; GS *gp; @@ -387,9 +371,7 @@ copy: gp->i_cnt += nitems; * Append events onto the tail of the buffer. */ static int -v_event_append(sp, argp) - SCR *sp; - EVENT *argp; +v_event_append(SCR *sp, EVENT *argp) { CHAR_T *s; /* Characters. */ EVENT *evp; @@ -514,11 +496,7 @@ v_event_append(sp, argp) * PUBLIC: int v_event_get(SCR *, EVENT *, int, u_int32_t); */ int -v_event_get(sp, argp, timeout, flags) - SCR *sp; - EVENT *argp; - int timeout; - u_int32_t flags; +v_event_get(SCR *sp, EVENT *argp, int timeout, u_int32_t flags) { EVENT *evp, ev; GS *gp; @@ -732,9 +710,7 @@ not_digit: argp->e_c = CH_NOT_DIGIT; * Walk the screen lists, sync'ing files to their backup copies. */ static void -v_sync(sp, flags) - SCR *sp; - int flags; +v_sync(SCR *sp, int flags) { GS *gp; @@ -752,9 +728,7 @@ v_sync(sp, flags) * PUBLIC: void v_event_err(SCR *, EVENT *); */ void -v_event_err(sp, evp) - SCR *sp; - EVENT *evp; +v_event_err(SCR *sp, EVENT *evp) { switch (evp->e_event) { case E_CHARACTER: @@ -808,9 +782,7 @@ v_event_err(sp, evp) * PUBLIC: int v_event_flush(SCR *, u_int); */ int -v_event_flush(sp, flags) - SCR *sp; - u_int flags; +v_event_flush(SCR *sp, u_int flags) { GS *gp; int rval; @@ -826,9 +798,7 @@ v_event_flush(sp, flags) * Grow the terminal queue. */ static int -v_event_grow(sp, add) - SCR *sp; - int add; +v_event_grow(SCR *sp, int add) { GS *gp; size_t new_nelem, olen; @@ -846,8 +816,7 @@ v_event_grow(sp, add) * Compare two keys for sorting. */ static int -v_key_cmp(ap, bp) - const void *ap, *bp; +v_key_cmp(const void *ap, const void *bp) { return (((KEYLIST *)ap)->ch - ((KEYLIST *)bp)->ch); } diff --git a/usr.bin/vi/common/line.c b/usr.bin/vi/common/line.c index e81019e0242..d4cfe3d7092 100644 --- a/usr.bin/vi/common/line.c +++ b/usr.bin/vi/common/line.c @@ -1,4 +1,4 @@ -/* $OpenBSD: line.c,v 1.12 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: line.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,12 +33,7 @@ static int scr_update(SCR *, recno_t, lnop_t, int); * PUBLIC: int db_eget(SCR *, recno_t, char **, size_t *, int *); */ int -db_eget(sp, lno, pp, lenp, isemptyp) - SCR *sp; - recno_t lno; /* Line number. */ - char **pp; /* Pointer store. */ - size_t *lenp; /* Length store. */ - int *isemptyp; +db_eget(SCR *sp, recno_t lno, char **pp, size_t *lenp, int *isemptyp) { recno_t l1; @@ -77,12 +72,7 @@ db_eget(sp, lno, pp, lenp, isemptyp) * PUBLIC: int db_get(SCR *, recno_t, u_int32_t, char **, size_t *); */ int -db_get(sp, lno, flags, pp, lenp) - SCR *sp; - recno_t lno; /* Line number. */ - u_int32_t flags; - char **pp; /* Pointer store. */ - size_t *lenp; /* Length store. */ +db_get(SCR *sp, recno_t lno, u_int32_t flags, char **pp, size_t *lenp) { DBT data, key; EXF *ep; @@ -187,9 +177,7 @@ err3: if (lenp != NULL) * PUBLIC: int db_delete(SCR *, recno_t); */ int -db_delete(sp, lno) - SCR *sp; - recno_t lno; +db_delete(SCR *sp, recno_t lno) { DBT key; EXF *ep; @@ -245,12 +233,7 @@ db_delete(sp, lno) * PUBLIC: int db_append(SCR *, int, recno_t, char *, size_t); */ int -db_append(sp, update, lno, p, len) - SCR *sp; - int update; - recno_t lno; - char *p; - size_t len; +db_append(SCR *sp, int update, recno_t lno, char *p, size_t len) { DBT data, key; EXF *ep; @@ -319,11 +302,7 @@ db_append(sp, update, lno, p, len) * PUBLIC: int db_insert(SCR *, recno_t, char *, size_t); */ int -db_insert(sp, lno, p, len) - SCR *sp; - recno_t lno; - char *p; - size_t len; +db_insert(SCR *sp, recno_t lno, char *p, size_t len) { DBT data, key; EXF *ep; @@ -384,11 +363,7 @@ db_insert(sp, lno, p, len) * PUBLIC: int db_set(SCR *, recno_t, char *, size_t); */ int -db_set(sp, lno, p, len) - SCR *sp; - recno_t lno; - char *p; - size_t len; +db_set(SCR *sp, recno_t lno, char *p, size_t len) { DBT data, key; EXF *ep; @@ -443,9 +418,7 @@ db_set(sp, lno, p, len) * PUBLIC: int db_exist(SCR *, recno_t); */ int -db_exist(sp, lno) - SCR *sp; - recno_t lno; +db_exist(SCR *sp, recno_t lno) { EXF *ep; @@ -478,9 +451,7 @@ db_exist(sp, lno) * PUBLIC: int db_last(SCR *, recno_t *); */ int -db_last(sp, lnop) - SCR *sp; - recno_t *lnop; +db_last(SCR *sp, recno_t *lnop) { DBT data, key; EXF *ep; @@ -539,9 +510,7 @@ db_last(sp, lnop) * PUBLIC: void db_err(SCR *, recno_t); */ void -db_err(sp, lno) - SCR *sp; - recno_t lno; +db_err(SCR *sp, recno_t lno) { msgq(sp, M_ERR, "008|Error: unable to retrieve line %lu", (u_long)lno); @@ -553,11 +522,7 @@ db_err(sp, lno) * just changed. */ static int -scr_update(sp, lno, op, current) - SCR *sp; - recno_t lno; - lnop_t op; - int current; +scr_update(SCR *sp, recno_t lno, lnop_t op, int current) { EXF *ep; SCR *tsp; diff --git a/usr.bin/vi/common/log.c b/usr.bin/vi/common/log.c index 830d7d87a29..a830f2946c7 100644 --- a/usr.bin/vi/common/log.c +++ b/usr.bin/vi/common/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: log.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -79,9 +79,7 @@ static void log_trace(SCR *, char *, recno_t, u_char *); * PUBLIC: int log_init(SCR *, EXF *); */ int -log_init(sp, ep) - SCR *sp; - EXF *ep; +log_init(SCR *sp, EXF *ep) { /* * !!! @@ -115,9 +113,7 @@ log_init(sp, ep) * PUBLIC: int log_end(SCR *, EXF *); */ int -log_end(sp, ep) - SCR *sp; - EXF *ep; +log_end(SCR *sp, EXF *ep) { /* * !!! @@ -145,8 +141,7 @@ log_end(sp, ep) * PUBLIC: int log_cursor(SCR *); */ int -log_cursor(sp) - SCR *sp; +log_cursor(SCR *sp) { EXF *ep; @@ -173,9 +168,7 @@ log_cursor(sp) * Actually push a cursor record out. */ static int -log_cursor1(sp, type) - SCR *sp; - int type; +log_cursor1(SCR *sp, int type) { DBT data, key; EXF *ep; @@ -210,10 +203,7 @@ log_cursor1(sp, type) * PUBLIC: int log_line(SCR *, recno_t, u_int); */ int -log_line(sp, lno, action) - SCR *sp; - recno_t lno; - u_int action; +log_line(SCR *sp, recno_t lno, u_int action) { DBT data, key; EXF *ep; @@ -310,9 +300,7 @@ log_line(sp, lno, action) * PUBLIC: int log_mark(SCR *, LMARK *); */ int -log_mark(sp, lmp) - SCR *sp; - LMARK *lmp; +log_mark(SCR *sp, LMARK *lmp) { DBT data, key; EXF *ep; @@ -356,9 +344,7 @@ log_mark(sp, lmp) * PUBLIC: int log_backward(SCR *, MARK *); */ int -log_backward(sp, rp) - SCR *sp; - MARK *rp; +log_backward(SCR *sp, MARK *rp) { DBT key, data; EXF *ep; @@ -462,8 +448,7 @@ err: F_CLR(ep, F_NOLOG); * PUBLIC: int log_setline(SCR *); */ int -log_setline(sp) - SCR *sp; +log_setline(SCR *sp) { DBT key, data; EXF *ep; @@ -549,9 +534,7 @@ err: F_CLR(ep, F_NOLOG); * PUBLIC: int log_forward(SCR *, MARK *); */ int -log_forward(sp, rp) - SCR *sp; - MARK *rp; +log_forward(SCR *sp, MARK *rp) { DBT key, data; EXF *ep; @@ -648,10 +631,7 @@ err: F_CLR(ep, F_NOLOG); * Try and restart the log on failure, i.e. if we run out of memory. */ static void -log_err(sp, file, line) - SCR *sp; - char *file; - int line; +log_err(SCR *sp, char *file, int line) { EXF *ep; @@ -664,11 +644,7 @@ log_err(sp, file, line) #if defined(DEBUG) && 0 static void -log_trace(sp, msg, rno, p) - SCR *sp; - char *msg; - recno_t rno; - u_char *p; +log_trace(SCR *sp, char *msg, recno_t rno, u_char *p) { LMARK lm; MARK m; diff --git a/usr.bin/vi/common/main.c b/usr.bin/vi/common/main.c index d7e407f2fdc..b7a77ef5c90 100644 --- a/usr.bin/vi/common/main.c +++ b/usr.bin/vi/common/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.22 2013/12/01 20:22:34 krw Exp $ */ +/* $OpenBSD: main.c,v 1.23 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -42,10 +42,7 @@ static int v_obsolete(char *, char *[]); * PUBLIC: int editor(GS *, int, char *[]); */ int -editor(gp, argc, argv) - GS *gp; - int argc; - char *argv[]; +editor(GS *gp, int argc, char *argv[]) { extern int optind; extern char *optarg; @@ -445,8 +442,7 @@ err: rval = 1; * PUBLIC: void v_end(GS *); */ void -v_end(gp) - GS *gp; +v_end(GS *gp) { MSGS *mp; SCR *sp; @@ -533,8 +529,7 @@ v_end(gp) * Convert historic arguments into something getopt(3) will like. */ static int -v_obsolete(name, argv) - char *name, *argv[]; +v_obsolete(char *name, char *argv[]) { size_t len; char *p; @@ -586,8 +581,7 @@ nomem: v_estr(name, errno, NULL); #ifdef DEBUG static void -attach(gp) - GS *gp; +attach(GS *gp) { int fd; char ch; @@ -612,9 +606,7 @@ attach(gp) #endif static void -v_estr(name, eno, msg) - char *name, *msg; - int eno; +v_estr(char *name, int eno, char *msg) { (void)fprintf(stderr, "%s", name); if (msg != NULL) diff --git a/usr.bin/vi/common/mark.c b/usr.bin/vi/common/mark.c index ee0203c7715..b845e47647a 100644 --- a/usr.bin/vi/common/mark.c +++ b/usr.bin/vi/common/mark.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mark.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: mark.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -63,9 +63,7 @@ static LMARK *mark_find(SCR *, ARG_CHAR_T); * PUBLIC: int mark_init(SCR *, EXF *); */ int -mark_init(sp, ep) - SCR *sp; - EXF *ep; +mark_init(SCR *sp, EXF *ep) { /* * !!! @@ -84,9 +82,7 @@ mark_init(sp, ep) * PUBLIC: int mark_end(SCR *, EXF *); */ int -mark_end(sp, ep) - SCR *sp; - EXF *ep; +mark_end(SCR *sp, EXF *ep) { LMARK *lmp; @@ -108,11 +104,7 @@ mark_end(sp, ep) * PUBLIC: int mark_get(SCR *, ARG_CHAR_T, MARK *, mtype_t); */ int -mark_get(sp, key, mp, mtype) - SCR *sp; - ARG_CHAR_T key; - MARK *mp; - mtype_t mtype; +mark_get(SCR *sp, ARG_CHAR_T key, MARK *mp, mtype_t mtype) { LMARK *lmp; @@ -153,11 +145,7 @@ mark_get(sp, key, mp, mtype) * PUBLIC: int mark_set(SCR *, ARG_CHAR_T, MARK *, int); */ int -mark_set(sp, key, value, userset) - SCR *sp; - ARG_CHAR_T key; - MARK *value; - int userset; +mark_set(SCR *sp, ARG_CHAR_T key, MARK *value, int userset) { LMARK *lmp, *lmt; @@ -195,9 +183,7 @@ mark_set(sp, key, value, userset) * where it would go. */ static LMARK * -mark_find(sp, key) - SCR *sp; - ARG_CHAR_T key; +mark_find(SCR *sp, ARG_CHAR_T key) { LMARK *lmp, *lastlmp; @@ -219,10 +205,7 @@ mark_find(sp, key) * PUBLIC: int mark_insdel(SCR *, lnop_t, recno_t); */ int -mark_insdel(sp, op, lno) - SCR *sp; - lnop_t op; - recno_t lno; +mark_insdel(SCR *sp, lnop_t op, recno_t lno) { LMARK *lmp; recno_t lline; diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c index 3466c710526..834dd293fd4 100644 --- a/usr.bin/vi/common/msg.c +++ b/usr.bin/vi/common/msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msg.c,v 1.19 2013/11/26 17:48:01 pelikan Exp $ */ +/* $OpenBSD: msg.c,v 1.20 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -348,10 +348,7 @@ alloc_err: * PUBLIC: void msgq_str(SCR *, mtype_t, char *, char *); */ void -msgq_str(sp, mtype, str, fmt) - SCR *sp; - mtype_t mtype; - char *str, *fmt; +msgq_str(SCR *sp, mtype_t mtype, char *str, char *fmt) { int nf, sv_errno; char *p; @@ -390,8 +387,7 @@ msgq_str(sp, mtype, str, fmt) * PUBLIC: void mod_rpt(SCR *); */ void -mod_rpt(sp) - SCR *sp; +mod_rpt(SCR *sp) { static char * const action[] = { "293|added", @@ -500,10 +496,7 @@ alloc_err: * PUBLIC: void msgq_status(SCR *, recno_t, u_int); */ void -msgq_status(sp, lno, flags) - SCR *sp; - recno_t lno; - u_int flags; +msgq_status(SCR *sp, recno_t lno, u_int flags) { recno_t last; size_t blen, len; @@ -667,9 +660,7 @@ alloc_err: * PUBLIC: int msg_open(SCR *, char *); */ int -msg_open(sp, file) - SCR *sp; - char *file; +msg_open(SCR *sp, char *file) { /* * !!! @@ -738,8 +729,7 @@ msg_open(sp, file) * PUBLIC: void msg_close(GS *); */ void -msg_close(gp) - GS *gp; +msg_close(GS *gp) { if (gp->msg != NULL) (void)gp->msg->close(gp->msg); @@ -752,10 +742,7 @@ msg_close(gp) * PUBLIC: const char *msg_cmsg(SCR *, cmsg_t, size_t *); */ const char * -msg_cmsg(sp, which, lenp) - SCR *sp; - cmsg_t which; - size_t *lenp; +msg_cmsg(SCR *sp, cmsg_t which, size_t *lenp) { switch (which) { case CMSG_CONF: @@ -790,10 +777,7 @@ msg_cmsg(sp, which, lenp) * PUBLIC: const char *msg_cat(SCR *, const char *, size_t *); */ const char * -msg_cat(sp, str, lenp) - SCR *sp; - const char *str; - size_t *lenp; +msg_cat(SCR *sp, const char *str, size_t *lenp) { GS *gp; DBT data, key; @@ -840,10 +824,7 @@ msg_cat(sp, str, lenp) * PUBLIC: char *msg_print(SCR *, const char *, int *); */ char * -msg_print(sp, s, needfree) - SCR *sp; - const char *s; - int *needfree; +msg_print(SCR *sp, const char *s, int *needfree) { size_t blen, nlen; const char *cp; diff --git a/usr.bin/vi/common/options.c b/usr.bin/vi/common/options.c index a1b203d5724..9bbc32680c2 100644 --- a/usr.bin/vi/common/options.c +++ b/usr.bin/vi/common/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.16 2011/07/10 13:20:25 millert Exp $ */ +/* $OpenBSD: options.c,v 1.17 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -280,9 +280,7 @@ static OABBREV const abbrev[] = { * PUBLIC: int opts_init(SCR *, int *); */ int -opts_init(sp, oargs) - SCR *sp; - int *oargs; +opts_init(SCR *sp, int *oargs) { ARGS *argv[2], a, b; OPTLIST const *op; @@ -446,10 +444,7 @@ err: msgq(sp, M_ERR, * PUBLIC: int opts_set(SCR *, ARGS *[], char *); */ int -opts_set(sp, argv, usage) - SCR *sp; - ARGS *argv[]; - char *usage; +opts_set(SCR *sp, ARGS *argv[], char *usage) { enum optdisp disp; enum nresult nret; @@ -750,12 +745,7 @@ badnum: p = msg_print(sp, name, &nf); * PUBLIC: int o_set(SCR *, int, u_int, char *, u_long); */ int -o_set(sp, opt, flags, str, val) - SCR *sp; - int opt; - u_int flags; - char *str; - u_long val; +o_set(SCR *sp, int opt, u_int flags, char *str, u_long val) { OPTION *op; @@ -794,9 +784,7 @@ o_set(sp, opt, flags, str, val) * PUBLIC: int opts_empty(SCR *, int, int); */ int -opts_empty(sp, off, silent) - SCR *sp; - int off, silent; +opts_empty(SCR *sp, int off, int silent) { char *p; @@ -816,9 +804,7 @@ opts_empty(sp, off, silent) * PUBLIC: void opts_dump(SCR *, enum optdisp); */ void -opts_dump(sp, type) - SCR *sp; - enum optdisp type; +opts_dump(SCR *sp, enum optdisp type) { OPTLIST const *op; int base, b_num, cnt, col, colwidth, curlen, s_num; @@ -950,9 +936,7 @@ opts_dump(sp, type) * Print out an option. */ static int -opts_print(sp, op) - SCR *sp; - OPTLIST const *op; +opts_print(SCR *sp, OPTLIST const *op) { int curlen, offset; @@ -982,9 +966,7 @@ opts_print(sp, op) * PUBLIC: int opts_save(SCR *, FILE *); */ int -opts_save(sp, fp) - SCR *sp; - FILE *fp; +opts_save(SCR *sp, FILE *fp) { OPTLIST const *op; int ch, cnt; @@ -1039,8 +1021,7 @@ opts_save(sp, fp) * PUBLIC: OPTLIST const *opts_search(char *); */ OPTLIST const * -opts_search(name) - char *name; +opts_search(char *name) { OPTLIST const *op, *found; OABBREV atmp, *ap; @@ -1085,24 +1066,20 @@ opts_search(name) * PUBLIC: void opts_nomatch(SCR *, char *); */ void -opts_nomatch(sp, name) - SCR *sp; - char *name; +opts_nomatch(SCR *sp, char *name) { msgq_str(sp, M_ERR, name, "033|set: no %s option: 'set all' gives all option values"); } static int -opts_abbcmp(a, b) - const void *a, *b; +opts_abbcmp(const void *a, const void *b) { return(strcmp(((OABBREV *)a)->name, ((OABBREV *)b)->name)); } static int -opts_cmp(a, b) - const void *a, *b; +opts_cmp(const void *a, const void *b) { return(strcmp(((OPTLIST *)a)->name, ((OPTLIST *)b)->name)); } @@ -1114,8 +1091,7 @@ opts_cmp(a, b) * PUBLIC: int opts_copy(SCR *, SCR *); */ int -opts_copy(orig, sp) - SCR *orig, *sp; +opts_copy(SCR *orig, SCR *sp) { int cnt, rval; @@ -1161,8 +1137,7 @@ nomem: msgq(orig, M_SYSERR, NULL); * PUBLIC: void opts_free(SCR *); */ void -opts_free(sp) - SCR *sp; +opts_free(SCR *sp) { int cnt; diff --git a/usr.bin/vi/common/options_f.c b/usr.bin/vi/common/options_f.c index 6eb8ea7c881..86d90cf3731 100644 --- a/usr.bin/vi/common/options_f.c +++ b/usr.bin/vi/common/options_f.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options_f.c,v 1.8 2014/10/08 00:53:45 dlg Exp $ */ +/* $OpenBSD: options_f.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -30,11 +30,7 @@ * PUBLIC: int f_altwerase(SCR *, OPTION *, char *, u_long *); */ int -f_altwerase(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_altwerase(SCR *sp, OPTION *op, char *str, u_long *valp) { if (!*valp) O_CLR(sp, O_TTYWERASE); @@ -45,11 +41,7 @@ f_altwerase(sp, op, str, valp) * PUBLIC: int f_columns(SCR *, OPTION *, char *, u_long *); */ int -f_columns(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_columns(SCR *sp, OPTION *op, char *str, u_long *valp) { /* Validate the number. */ if (*valp < MINIMUM_SCREEN_COLS) { @@ -79,11 +71,7 @@ f_columns(sp, op, str, valp) * PUBLIC: int f_lines(SCR *, OPTION *, char *, u_long *); */ int -f_lines(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_lines(SCR *sp, OPTION *op, char *str, u_long *valp) { /* Validate the number. */ if (*valp < MINIMUM_SCREEN_ROWS) { @@ -136,11 +124,7 @@ f_lines(sp, op, str, valp) * PUBLIC: int f_lisp(SCR *, OPTION *, char *, u_long *); */ int -f_lisp(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_lisp(SCR *sp, OPTION *op, char *str, u_long *valp) { msgq(sp, M_ERR, "044|The lisp option is not implemented"); return (0); @@ -150,11 +134,7 @@ f_lisp(sp, op, str, valp) * PUBLIC: int f_msgcat(SCR *, OPTION *, char *, u_long *); */ int -f_msgcat(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_msgcat(SCR *sp, OPTION *op, char *str, u_long *valp) { (void)msg_open(sp, str); return (0); @@ -164,11 +144,7 @@ f_msgcat(sp, op, str, valp) * PUBLIC: int f_paragraph(SCR *, OPTION *, char *, u_long *); */ int -f_paragraph(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_paragraph(SCR *sp, OPTION *op, char *str, u_long *valp) { if (strlen(str) & 1) { msgq(sp, M_ERR, @@ -182,11 +158,7 @@ f_paragraph(sp, op, str, valp) * PUBLIC: int f_print(SCR *, OPTION *, char *, u_long *); */ int -f_print(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_print(SCR *sp, OPTION *op, char *str, u_long *valp) { /* Reinitialize the key fast lookup table. */ v_key_ilookup(sp); @@ -200,11 +172,7 @@ f_print(sp, op, str, valp) * PUBLIC: int f_readonly(SCR *, OPTION *, char *, u_long *); */ int -f_readonly(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_readonly(SCR *sp, OPTION *op, char *str, u_long *valp) { /* * !!! @@ -221,11 +189,7 @@ f_readonly(sp, op, str, valp) * PUBLIC: int f_recompile(SCR *, OPTION *, char *, u_long *); */ int -f_recompile(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_recompile(SCR *sp, OPTION *op, char *str, u_long *valp) { if (F_ISSET(sp, SC_RE_SEARCH)) { regfree(&sp->re_c); @@ -242,11 +206,7 @@ f_recompile(sp, op, str, valp) * PUBLIC: int f_reformat(SCR *, OPTION *, char *, u_long *); */ int -f_reformat(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_reformat(SCR *sp, OPTION *op, char *str, u_long *valp) { F_SET(sp, SC_SCR_REFORMAT); return (0); @@ -256,11 +216,7 @@ f_reformat(sp, op, str, valp) * PUBLIC: int f_section(SCR *, OPTION *, char *, u_long *); */ int -f_section(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_section(SCR *sp, OPTION *op, char *str, u_long *valp) { if (strlen(str) & 1) { msgq(sp, M_ERR, @@ -274,11 +230,7 @@ f_section(sp, op, str, valp) * PUBLIC: int f_ttywerase(SCR *, OPTION *, char *, u_long *); */ int -f_ttywerase(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_ttywerase(SCR *sp, OPTION *op, char *str, u_long *valp) { if (!*valp) O_CLR(sp, O_ALTWERASE); @@ -289,11 +241,7 @@ f_ttywerase(sp, op, str, valp) * PUBLIC: int f_w300(SCR *, OPTION *, char *, u_long *); */ int -f_w300(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_w300(SCR *sp, OPTION *op, char *str, u_long *valp) { u_long v; @@ -310,11 +258,7 @@ f_w300(sp, op, str, valp) * PUBLIC: int f_w1200(SCR *, OPTION *, char *, u_long *); */ int -f_w1200(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_w1200(SCR *sp, OPTION *op, char *str, u_long *valp) { u_long v; @@ -331,11 +275,7 @@ f_w1200(sp, op, str, valp) * PUBLIC: int f_w9600(SCR *, OPTION *, char *, u_long *); */ int -f_w9600(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_w9600(SCR *sp, OPTION *op, char *str, u_long *valp) { u_long v; @@ -352,11 +292,7 @@ f_w9600(sp, op, str, valp) * PUBLIC: int f_window(SCR *, OPTION *, char *, u_long *); */ int -f_window(sp, op, str, valp) - SCR *sp; - OPTION *op; - char *str; - u_long *valp; +f_window(SCR *sp, OPTION *op, char *str, u_long *valp) { if (*valp >= O_VAL(sp, O_LINES) - 1 && (*valp = O_VAL(sp, O_LINES) - 1) == 0) diff --git a/usr.bin/vi/common/put.c b/usr.bin/vi/common/put.c index dccd3bb8f3d..48e760c17cf 100644 --- a/usr.bin/vi/common/put.c +++ b/usr.bin/vi/common/put.c @@ -1,4 +1,4 @@ -/* $OpenBSD: put.c,v 1.12 2013/11/26 13:16:06 otto Exp $ */ +/* $OpenBSD: put.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,12 +30,7 @@ * PUBLIC: int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int); */ int -put(sp, cbp, namep, cp, rp, append) - SCR *sp; - CB *cbp; - CHAR_T *namep; - MARK *cp, *rp; - int append; +put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *rp, int append) { CHAR_T name; TEXT *ltp, *tp; diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c index 1b5b154b787..3f935eb290c 100644 --- a/usr.bin/vi/common/recover.c +++ b/usr.bin/vi/common/recover.c @@ -1,4 +1,4 @@ -/* $OpenBSD: recover.c,v 1.16 2014/11/10 21:31:42 tedu Exp $ */ +/* $OpenBSD: recover.c,v 1.17 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -120,10 +120,7 @@ static int rcv_mktemp(SCR *, char *, char *, int); * PUBLIC: int rcv_tmp(SCR *, EXF *, char *); */ int -rcv_tmp(sp, ep, name) - SCR *sp; - EXF *ep; - char *name; +rcv_tmp(SCR *sp, EXF *ep, char *name) { struct stat sb; int fd; @@ -184,8 +181,7 @@ err: msgq(sp, M_ERR, * PUBLIC: int rcv_init(SCR *); */ int -rcv_init(sp) - SCR *sp; +rcv_init(SCR *sp) { EXF *ep; recno_t lno; @@ -247,9 +243,7 @@ err: msgq(sp, M_ERR, * PUBLIC: int rcv_sync(SCR *, u_int); */ int -rcv_sync(sp, flags) - SCR *sp; - u_int flags; +rcv_sync(SCR *sp, u_int flags) { EXF *ep; int fd, rval; @@ -325,10 +319,7 @@ err: rval = 1; * Build the file to mail to the user. */ static int -rcv_mailfile(sp, issync, cp_path) - SCR *sp; - int issync; - char *cp_path; +rcv_mailfile(SCR *sp, int issync, char *cp_path) { EXF *ep; GS *gp; @@ -478,8 +469,7 @@ err: if (!issync) * PUBLIC: int rcv_list(SCR *); */ int -rcv_list(sp) - SCR *sp; +rcv_list(SCR *sp) { struct dirent *dp; struct stat sb; @@ -581,9 +571,7 @@ next: (void)fclose(fp); * PUBLIC: int rcv_read(SCR *, FREF *); */ int -rcv_read(sp, frp) - SCR *sp; - FREF *frp; +rcv_read(SCR *sp, FREF *frp) { struct dirent *dp; struct stat sb; @@ -767,10 +755,7 @@ next: (void)close(fd); * Copy a recovery file. */ static int -rcv_copy(sp, wfd, fname) - SCR *sp; - int wfd; - char *fname; +rcv_copy(SCR *sp, int wfd, char *fname) { int nr, nw, off, rfd; char buf[8 * 1024]; @@ -793,10 +778,7 @@ err: msgq_str(sp, M_SYSERR, fname, "%s"); * Fgets(3) for a file descriptor. */ static char * -rcv_gets(buf, len, fd) - char *buf; - size_t len; - int fd; +rcv_gets(char *buf, size_t len, int fd) { int nr; char *p; @@ -815,10 +797,7 @@ rcv_gets(buf, len, fd) * Paranoid make temporary file routine. */ static int -rcv_mktemp(sp, path, dname, perms) - SCR *sp; - char *path, *dname; - int perms; +rcv_mktemp(SCR *sp, char *path, char *dname, int perms) { int fd; @@ -847,9 +826,7 @@ rcv_mktemp(sp, path, dname, perms) * Send email. */ static void -rcv_email(sp, fname) - SCR *sp; - char *fname; +rcv_email(SCR *sp, char *fname) { struct stat sb; char buf[MAXPATHLEN * 2 + 20]; diff --git a/usr.bin/vi/common/screen.c b/usr.bin/vi/common/screen.c index 91c79c9596f..af385093656 100644 --- a/usr.bin/vi/common/screen.c +++ b/usr.bin/vi/common/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.10 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: screen.c,v 1.11 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -33,9 +33,7 @@ * PUBLIC: int screen_init(GS *, SCR *, SCR **); */ int -screen_init(gp, orig, spp) - GS *gp; - SCR *orig, **spp; +screen_init(GS *gp, SCR *orig, SCR **spp) { SCR *sp; size_t len; @@ -127,8 +125,7 @@ err: screen_end(sp); * PUBLIC: int screen_end(SCR *); */ int -screen_end(sp) - SCR *sp; +screen_end(SCR *sp) { int rval; SCR *tsp; @@ -216,8 +213,7 @@ screen_end(sp) * PUBLIC: SCR *screen_next(SCR *); */ SCR * -screen_next(sp) - SCR *sp; +screen_next(SCR *sp) { GS *gp; SCR *next; diff --git a/usr.bin/vi/common/search.c b/usr.bin/vi/common/search.c index a41ac2102b3..0e52e3490ce 100644 --- a/usr.bin/vi/common/search.c +++ b/usr.bin/vi/common/search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: search.c,v 1.9 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: search.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -35,12 +35,8 @@ static int search_init(SCR *, dir_t, char *, size_t, char **, u_int); * Set up a search. */ static int -search_init(sp, dir, ptrn, plen, epp, flags) - SCR *sp; - dir_t dir; - char *ptrn, **epp; - size_t plen; - u_int flags; +search_init(SCR *sp, dir_t dir, char *ptrn, size_t plen, char **epp, + u_int flags) { recno_t lno; int delim; @@ -141,12 +137,8 @@ prev: if (sp->re == NULL) { * PUBLIC: int f_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int); */ int -f_search(sp, fm, rm, ptrn, plen, eptrn, flags) - SCR *sp; - MARK *fm, *rm; - char *ptrn, **eptrn; - size_t plen; - u_int flags; +f_search(SCR *sp, MARK *fm, MARK *rm, char *ptrn, size_t plen, char **eptrn, + u_int flags) { busy_t btype; recno_t lno; @@ -284,12 +276,8 @@ f_search(sp, fm, rm, ptrn, plen, eptrn, flags) * PUBLIC: int b_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int); */ int -b_search(sp, fm, rm, ptrn, plen, eptrn, flags) - SCR *sp; - MARK *fm, *rm; - char *ptrn, **eptrn; - size_t plen; - u_int flags; +b_search(SCR *sp, MARK *fm, MARK *rm, char *ptrn, size_t plen, char **eptrn, + u_int flags) { busy_t btype; recno_t lno; @@ -443,9 +431,7 @@ err: if (LF_ISSET(SEARCH_MSG)) * Display one of the search messages. */ static void -search_msg(sp, msg) - SCR *sp; - smsg_t msg; +search_msg(SCR *sp, smsg_t msg) { switch (msg) { case S_EMPTY: @@ -480,9 +466,7 @@ search_msg(sp, msg) * PUBLIC: void search_busy(SCR *, busy_t); */ void -search_busy(sp, btype) - SCR *sp; - busy_t btype; +search_busy(SCR *sp, busy_t btype) { sp->gp->scr_busy(sp, "078|Searching...", btype); } diff --git a/usr.bin/vi/common/seq.c b/usr.bin/vi/common/seq.c index b16c7bf2f1c..183b11fe517 100644 --- a/usr.bin/vi/common/seq.c +++ b/usr.bin/vi/common/seq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seq.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: seq.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,12 +32,8 @@ * PUBLIC: size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int); */ int -seq_set(sp, name, nlen, input, ilen, output, olen, stype, flags) - SCR *sp; - CHAR_T *name, *input, *output; - size_t nlen, ilen, olen; - seq_t stype; - int flags; +seq_set(SCR *sp, CHAR_T *name, size_t nlen, CHAR_T *input, size_t ilen, + CHAR_T *output, size_t olen, seq_t stype, int flags) { CHAR_T *p; SEQ *lastqp, *qp; @@ -132,11 +128,7 @@ mem1: errno = sv_errno; * PUBLIC: int seq_delete(SCR *, CHAR_T *, size_t, seq_t); */ int -seq_delete(sp, input, ilen, stype) - SCR *sp; - CHAR_T *input; - size_t ilen; - seq_t stype; +seq_delete(SCR *sp, CHAR_T *input, size_t ilen, seq_t stype) { SEQ *qp; @@ -152,8 +144,7 @@ seq_delete(sp, input, ilen, stype) * PUBLIC: int seq_mdel(SEQ *); */ int -seq_mdel(qp) - SEQ *qp; +seq_mdel(SEQ *qp) { LIST_REMOVE(qp, q); if (qp->name != NULL) @@ -174,14 +165,8 @@ seq_mdel(qp) * PUBLIC:(SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *); */ SEQ * -seq_find(sp, lastqp, e_input, c_input, ilen, stype, ispartialp) - SCR *sp; - SEQ **lastqp; - EVENT *e_input; - CHAR_T *c_input; - size_t ilen; - seq_t stype; - int *ispartialp; +seq_find(SCR *sp, SEQ **lastqp, EVENT *e_input, CHAR_T *c_input, size_t ilen, + seq_t stype, int *ispartialp) { SEQ *lqp, *qp; int diff; @@ -259,8 +244,7 @@ seq_find(sp, lastqp, e_input, c_input, ilen, stype, ispartialp) * PUBLIC: void seq_close(GS *); */ void -seq_close(gp) - GS *gp; +seq_close(GS *gp) { SEQ *qp; @@ -283,10 +267,7 @@ seq_close(gp) * PUBLIC: int seq_dump(SCR *, seq_t, int); */ int -seq_dump(sp, stype, isname) - SCR *sp; - seq_t stype; - int isname; +seq_dump(SCR *sp, seq_t stype, int isname) { CHAR_T *p; GS *gp; @@ -331,11 +312,7 @@ seq_dump(sp, stype, isname) * PUBLIC: int seq_save(SCR *, FILE *, char *, seq_t); */ int -seq_save(sp, fp, prefix, stype) - SCR *sp; - FILE *fp; - char *prefix; - seq_t stype; +seq_save(SCR *sp, FILE *fp, char *prefix, seq_t stype) { CHAR_T *p; SEQ *qp; @@ -377,10 +354,7 @@ seq_save(sp, fp, prefix, stype) * PUBLIC: int e_memcmp(CHAR_T *, EVENT *, size_t); */ int -e_memcmp(p1, ep, n) - CHAR_T *p1; - EVENT *ep; - size_t n; +e_memcmp(CHAR_T *p1, EVENT *ep, size_t n) { if (n != 0) { do { diff --git a/usr.bin/vi/common/util.c b/usr.bin/vi/common/util.c index 3d5f298d88d..d69bbbc0bae 100644 --- a/usr.bin/vi/common/util.c +++ b/usr.bin/vi/common/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -31,10 +31,7 @@ * PUBLIC: void *binc(SCR *, void *, size_t *, size_t); */ void * -binc(sp, bp, bsizep, min) - SCR *sp; /* sp MAY BE NULL!!! */ - void *bp; - size_t *bsizep, min; +binc(SCR *sp, void *bp, size_t *bsizep, size_t min) { size_t csize; @@ -71,10 +68,7 @@ binc(sp, bp, bsizep, min) * PUBLIC: int nonblank(SCR *, recno_t, size_t *); */ int -nonblank(sp, lno, cnop) - SCR *sp; - recno_t lno; - size_t *cnop; +nonblank(SCR *sp, recno_t lno, size_t *cnop) { char *p; size_t cnt, len, off; @@ -107,8 +101,7 @@ nonblank(sp, lno, cnop) * PUBLIC: char *tail(char *); */ char * -tail(path) - char *path; +tail(char *path) { char *p; @@ -124,10 +117,7 @@ tail(path) * PUBLIC: CHAR_T *v_strdup(SCR *, const CHAR_T *, size_t); */ CHAR_T * -v_strdup(sp, str, len) - SCR *sp; - const CHAR_T *str; - size_t len; +v_strdup(SCR *sp, const CHAR_T *str, size_t len) { CHAR_T *copy; @@ -146,11 +136,7 @@ v_strdup(sp, str, len) * PUBLIC: enum nresult nget_uslong(u_long *, const char *, char **, int); */ enum nresult -nget_uslong(valp, p, endp, base) - u_long *valp; - const char *p; - char **endp; - int base; +nget_uslong(u_long *valp, const char *p, char **endp, int base) { errno = 0; *valp = strtoul(p, endp, base); @@ -168,11 +154,7 @@ nget_uslong(valp, p, endp, base) * PUBLIC: enum nresult nget_slong(long *, const char *, char **, int); */ enum nresult -nget_slong(valp, p, endp, base) - long *valp; - const char *p; - char **endp; - int base; +nget_slong(long *valp, const char *p, char **endp, int base) { errno = 0; *valp = strtol(p, endp, base); diff --git a/usr.bin/vi/ex/ex.c b/usr.bin/vi/ex/ex.c index 13ba98b61ab..392fec40aa7 100644 --- a/usr.bin/vi/ex/ex.c +++ b/usr.bin/vi/ex/ex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex.c,v 1.18 2013/12/01 13:42:42 krw Exp $ */ +/* $OpenBSD: ex.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -46,8 +46,7 @@ static void ex_unknown(SCR *, char *, size_t); * PUBLIC: int ex(SCR **); */ int -ex(spp) - SCR **spp; +ex(SCR **spp) { GS *gp; MSGS *mp; @@ -188,8 +187,7 @@ ex(spp) * PUBLIC: int ex_cmd(SCR *); */ int -ex_cmd(sp) - SCR *sp; +ex_cmd(SCR *sp) { enum nresult nret; EX_PRIVATE *exp; @@ -1605,10 +1603,7 @@ rsuccess: tmp = 0; * PUBLIC: int ex_range(SCR *, EXCMD *, int *); */ int -ex_range(sp, ecp, errp) - SCR *sp; - EXCMD *ecp; - int *errp; +ex_range(SCR *sp, EXCMD *ecp, int *errp) { enum { ADDR_FOUND, ADDR_NEED, ADDR_NONE } addr; MARK m; @@ -1803,11 +1798,7 @@ ret: if (F_ISSET(ecp, E_VISEARCH)) * it's fairly close. */ static int -ex_line(sp, ecp, mp, isaddrp, errp) - SCR *sp; - EXCMD *ecp; - MARK *mp; - int *isaddrp, *errp; +ex_line(SCR *sp, EXCMD *ecp, MARK *mp, int *isaddrp, int *errp) { enum nresult nret; long total, val; @@ -2048,8 +2039,7 @@ search: mp->lno = sp->lno; * Load up the next command, which may be an @ buffer or global command. */ static int -ex_load(sp) - SCR *sp; +ex_load(SCR *sp) { GS *gp; EXCMD *ecp; @@ -2144,8 +2134,7 @@ ex_load(sp) * Discard any pending ex commands. */ static int -ex_discard(sp) - SCR *sp; +ex_discard(SCR *sp) { GS *gp; EXCMD *ecp; @@ -2175,10 +2164,7 @@ ex_discard(sp) * Display an unknown command name. */ static void -ex_unknown(sp, cmd, len) - SCR *sp; - char *cmd; - size_t len; +ex_unknown(SCR *sp, char *cmd, size_t len) { size_t blen; char *bp; @@ -2202,9 +2188,7 @@ alloc_err: * PUBLIC: int ex_is_abbrev(char *, size_t); */ int -ex_is_abbrev(name, len) - char *name; - size_t len; +ex_is_abbrev(char *name, size_t len) { EXCMDLIST const *cp; @@ -2221,9 +2205,7 @@ ex_is_abbrev(name, len) * PUBLIC: int ex_is_unmap(char *, size_t); */ int -ex_is_unmap(name, len) - char *name; - size_t len; +ex_is_unmap(char *name, size_t len) { EXCMDLIST const *cp; @@ -2243,9 +2225,7 @@ ex_is_unmap(name, len) * Search for a command name. */ static EXCMDLIST const * -ex_comm_search(name, len) - char *name; - size_t len; +ex_comm_search(char *name, size_t len) { EXCMDLIST const *cp; @@ -2268,11 +2248,7 @@ ex_comm_search(name, len) * PUBLIC:(SCR *, EXCMDLIST const *, enum badaddr, enum nresult); */ void -ex_badaddr(sp, cp, ba, nret) - SCR *sp; - EXCMDLIST const *cp; - enum badaddr ba; - enum nresult nret; +ex_badaddr(SCR *sp, EXCMDLIST const *cp, enum badaddr ba, enum nresult nret) { recno_t lno; @@ -2334,9 +2310,7 @@ ex_badaddr(sp, cp, ba, nret) * Log ex commands. */ static void -ex_comlog(sp, ecp) - SCR *sp; - EXCMD *ecp; +ex_comlog(SCR *sp, EXCMD *ecp) { TRACE(sp, "ecmd: %s", ecp->cmd->name); if (ecp->addrcnt > 0) { diff --git a/usr.bin/vi/ex/ex_abbrev.c b/usr.bin/vi/ex/ex_abbrev.c index 706a9548a93..05ee68e09ca 100644 --- a/usr.bin/vi/ex/ex_abbrev.c +++ b/usr.bin/vi/ex/ex_abbrev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_abbrev.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_abbrev.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int ex_abbr(SCR *, EXCMD *); */ int -ex_abbr(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_abbr(SCR *sp, EXCMD *cmdp) { CHAR_T *p; size_t len; @@ -98,9 +96,7 @@ ex_abbr(sp, cmdp) * PUBLIC: int ex_unabbr(SCR *, EXCMD *); */ int -ex_unabbr(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_unabbr(SCR *sp, EXCMD *cmdp) { ARGS *ap; diff --git a/usr.bin/vi/ex/ex_append.c b/usr.bin/vi/ex/ex_append.c index b3d78061714..95ebec780b7 100644 --- a/usr.bin/vi/ex/ex_append.c +++ b/usr.bin/vi/ex/ex_append.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_append.c,v 1.9 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: ex_append.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -34,9 +34,7 @@ static int ex_aci(SCR *, EXCMD *, enum which); * PUBLIC: int ex_append(SCR *, EXCMD *); */ int -ex_append(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_append(SCR *sp, EXCMD *cmdp) { return (ex_aci(sp, cmdp, APPEND)); } @@ -48,9 +46,7 @@ ex_append(sp, cmdp) * PUBLIC: int ex_change(SCR *, EXCMD *); */ int -ex_change(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_change(SCR *sp, EXCMD *cmdp) { return (ex_aci(sp, cmdp, CHANGE)); } @@ -63,9 +59,7 @@ ex_change(sp, cmdp) * PUBLIC: int ex_insert(SCR *, EXCMD *); */ int -ex_insert(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_insert(SCR *sp, EXCMD *cmdp) { return (ex_aci(sp, cmdp, INSERT)); } @@ -75,10 +69,7 @@ ex_insert(sp, cmdp) * Append, change, insert in ex. */ static int -ex_aci(sp, cmdp, cmd) - SCR *sp; - EXCMD *cmdp; - enum which cmd; +ex_aci(SCR *sp, EXCMD *cmdp, enum which cmd) { CHAR_T *p, *t; GS *gp; diff --git a/usr.bin/vi/ex/ex_args.c b/usr.bin/vi/ex/ex_args.c index feec8bea50a..03d7d5da709 100644 --- a/usr.bin/vi/ex/ex_args.c +++ b/usr.bin/vi/ex/ex_args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_args.c,v 1.9 2009/11/15 04:32:31 deraadt Exp $ */ +/* $OpenBSD: ex_args.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -40,9 +40,7 @@ static int ex_N_next(SCR *, EXCMD *); * PUBLIC: int ex_next(SCR *, EXCMD *); */ int -ex_next(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_next(SCR *sp, EXCMD *cmdp) { ARGS **argv; FREF *frp; @@ -123,9 +121,7 @@ ex_next(sp, cmdp) * New screen version of ex_next. */ static int -ex_N_next(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_N_next(SCR *sp, EXCMD *cmdp) { SCR *new; FREF *frp; @@ -167,9 +163,7 @@ ex_N_next(sp, cmdp) * PUBLIC: int ex_prev(SCR *, EXCMD *); */ int -ex_prev(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_prev(SCR *sp, EXCMD *cmdp) { FREF *frp; @@ -214,9 +208,7 @@ ex_prev(sp, cmdp) * PUBLIC: int ex_rew(SCR *, EXCMD *); */ int -ex_rew(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_rew(SCR *sp, EXCMD *cmdp) { FREF *frp; @@ -254,9 +246,7 @@ ex_rew(sp, cmdp) * PUBLIC: int ex_args(SCR *, EXCMD *); */ int -ex_args(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_args(SCR *sp, EXCMD *cmdp) { int cnt, col, len, sep; char **ap; @@ -295,10 +285,7 @@ ex_args(sp, cmdp) * PUBLIC: char **ex_buildargv(SCR *, EXCMD *, char *); */ char ** -ex_buildargv(sp, cmdp, name) - SCR *sp; - EXCMD *cmdp; - char *name; +ex_buildargv(SCR *sp, EXCMD *cmdp, char *name) { ARGS **argv; int argc; diff --git a/usr.bin/vi/ex/ex_argv.c b/usr.bin/vi/ex/ex_argv.c index b69d27d0cd8..cbd6bdc36ca 100644 --- a/usr.bin/vi/ex/ex_argv.c +++ b/usr.bin/vi/ex/ex_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_argv.c,v 1.14 2014/10/14 22:23:12 deraadt Exp $ */ +/* $OpenBSD: ex_argv.c,v 1.15 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -40,9 +40,7 @@ static int argv_sexp(SCR *, char **, size_t *, size_t *); * PUBLIC: int argv_init(SCR *, EXCMD *); */ int -argv_init(sp, excp) - SCR *sp; - EXCMD *excp; +argv_init(SCR *sp, EXCMD *excp) { EX_PRIVATE *exp; @@ -62,11 +60,7 @@ argv_init(sp, excp) * PUBLIC: int argv_exp0(SCR *, EXCMD *, char *, size_t); */ int -argv_exp0(sp, excp, cmd, cmdlen) - SCR *sp; - EXCMD *excp; - char *cmd; - size_t cmdlen; +argv_exp0(SCR *sp, EXCMD *excp, char *cmd, size_t cmdlen) { EX_PRIVATE *exp; @@ -89,12 +83,7 @@ argv_exp0(sp, excp, cmd, cmdlen) * PUBLIC: int argv_exp1(SCR *, EXCMD *, char *, size_t, int); */ int -argv_exp1(sp, excp, cmd, cmdlen, is_bang) - SCR *sp; - EXCMD *excp; - char *cmd; - size_t cmdlen; - int is_bang; +argv_exp1(SCR *sp, EXCMD *excp, char *cmd, size_t cmdlen, int is_bang) { size_t blen, len; char *bp, *p, *t; @@ -131,11 +120,7 @@ ret: FREE_SPACE(sp, bp, blen); * PUBLIC: int argv_exp2(SCR *, EXCMD *, char *, size_t); */ int -argv_exp2(sp, excp, cmd, cmdlen) - SCR *sp; - EXCMD *excp; - char *cmd; - size_t cmdlen; +argv_exp2(SCR *sp, EXCMD *excp, char *cmd, size_t cmdlen) { size_t blen, len, n; int rval; @@ -243,11 +228,7 @@ err: FREE_SPACE(sp, bp, blen); * PUBLIC: int argv_exp3(SCR *, EXCMD *, char *, size_t); */ int -argv_exp3(sp, excp, cmd, cmdlen) - SCR *sp; - EXCMD *excp; - char *cmd; - size_t cmdlen; +argv_exp3(SCR *sp, EXCMD *excp, char *cmd, size_t cmdlen) { EX_PRIVATE *exp; size_t len; @@ -312,12 +293,8 @@ argv_exp3(sp, excp, cmd, cmdlen) * Do file name and bang command expansion. */ static int -argv_fexp(sp, excp, cmd, cmdlen, p, lenp, bpp, blenp, is_bang) - SCR *sp; - EXCMD *excp; - char *cmd, *p, **bpp; - size_t cmdlen, *lenp, *blenp; - int is_bang; +argv_fexp(SCR *sp, EXCMD *excp, char *cmd, size_t cmdlen, char *p, + size_t *lenp, char **bpp, size_t *blenp, int is_bang) { EX_PRIVATE *exp; char *bp, *t; @@ -412,9 +389,7 @@ ins_ch: ++len; * Make more space for arguments. */ static int -argv_alloc(sp, len) - SCR *sp; - size_t len; +argv_alloc(SCR *sp, size_t len) { ARGS *ap; EX_PRIVATE *exp; @@ -479,8 +454,7 @@ mem: msgq(sp, M_SYSERR, NULL); * PUBLIC: int argv_free(SCR *); */ int -argv_free(sp) - SCR *sp; +argv_free(SCR *sp) { EX_PRIVATE *exp; int off; @@ -508,10 +482,7 @@ argv_free(sp) * buffer. */ static int -argv_lexp(sp, excp, path) - SCR *sp; - EXCMD *excp; - char *path; +argv_lexp(SCR *sp, EXCMD *excp, char *path) { struct dirent *dp; DIR *dirp; @@ -595,8 +566,7 @@ argv_lexp(sp, excp, path) * Alphabetic comparison. */ static int -argv_comp(a, b) - const void *a, *b; +argv_comp(const void *a, const void *b) { return (strcmp((char *)(*(ARGS **)a)->bp, (char *)(*(ARGS **)b)->bp)); } @@ -607,10 +577,7 @@ argv_comp(a, b) * a buffer. */ static int -argv_sexp(sp, bpp, blenp, lenp) - SCR *sp; - char **bpp; - size_t *blenp, *lenp; +argv_sexp(SCR *sp, char **bpp, size_t *blenp, size_t *lenp) { enum { SEXP_ERR, SEXP_EXPANSION_ERR, SEXP_OK } rval; FILE *ifp; diff --git a/usr.bin/vi/ex/ex_at.c b/usr.bin/vi/ex/ex_at.c index d46bd82c5b1..a30c4108411 100644 --- a/usr.bin/vi/ex/ex_at.c +++ b/usr.bin/vi/ex/ex_at.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_at.c,v 1.10 2013/12/01 13:42:42 krw Exp $ */ +/* $OpenBSD: ex_at.c,v 1.11 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int ex_at(SCR *, EXCMD *); */ int -ex_at(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_at(SCR *sp, EXCMD *cmdp) { CB *cbp; CHAR_T name; diff --git a/usr.bin/vi/ex/ex_bang.c b/usr.bin/vi/ex/ex_bang.c index 267e02631b1..fa73d7cd76d 100644 --- a/usr.bin/vi/ex/ex_bang.c +++ b/usr.bin/vi/ex/ex_bang.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_bang.c,v 1.7 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_bang.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -45,9 +45,7 @@ * PUBLIC: int ex_bang(SCR *, EXCMD *); */ int -ex_bang(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_bang(SCR *sp, EXCMD *cmdp) { enum filtertype ftype; ARGS *ap; diff --git a/usr.bin/vi/ex/ex_cd.c b/usr.bin/vi/ex/ex_cd.c index 699c510309b..305fb82b4f8 100644 --- a/usr.bin/vi/ex/ex_cd.c +++ b/usr.bin/vi/ex/ex_cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cd.c,v 1.9 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_cd.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int ex_cd(SCR *, EXCMD *); */ int -ex_cd(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_cd(SCR *sp, EXCMD *cmdp) { struct passwd *pw; ARGS *ap; diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index 38200ee2359..03b38a9a4ff 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.20 2013/12/01 19:26:37 krw Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -105,9 +105,7 @@ static int terminate(SCR *, CSC *, int); * PUBLIC: int ex_cscope(SCR *, EXCMD *); */ int -ex_cscope(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_cscope(SCR *sp, EXCMD *cmdp) { CC const *ccp; EX_PRIVATE *exp; @@ -150,9 +148,7 @@ usage: msgq(sp, M_ERR, "309|Use \"cscope help\" for help"); * Initialize the cscope package. */ static int -start_cscopes(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +start_cscopes(SCR *sp, EXCMD *cmdp) { size_t blen, len; char *bp, *cscopes, *p, *t; @@ -188,10 +184,7 @@ start_cscopes(sp, cmdp) * The cscope add command. */ static int -cscope_add(sp, cmdp, dname) - SCR *sp; - EXCMD *cmdp; - char *dname; +cscope_add(SCR *sp, EXCMD *cmdp, char *dname) { struct stat sb; EX_PRIVATE *exp; @@ -286,9 +279,7 @@ err: free(csc); * cscope database. */ static int -get_paths(sp, csc) - SCR *sp; - CSC *csc; +get_paths(SCR *sp, CSC *csc) { struct stat sb; int fd, nentries; @@ -361,10 +352,7 @@ alloc_err: * Fork off the cscope process. */ static int -run_cscope(sp, csc, dbname) - SCR *sp; - CSC *csc; - char *dbname; +run_cscope(SCR *sp, CSC *csc, char *dbname) { int to_cs[2], from_cs[2]; char cmd[MAXPATHLEN * 2]; @@ -430,10 +418,7 @@ err: if (to_cs[0] != -1) * The cscope find command. */ static int -cscope_find(sp, cmdp, pattern) - SCR *sp; - EXCMD *cmdp; - char *pattern; +cscope_find(SCR *sp, EXCMD *cmdp, char *pattern) { CSC *csc, *csc_next; EX_PRIVATE *exp; @@ -578,10 +563,7 @@ alloc_err: * Build a cscope command, creating and initializing the base TAGQ. */ static TAGQ * -create_cs_cmd(sp, pattern, searchp) - SCR *sp; - char *pattern; - size_t *searchp; +create_cs_cmd(SCR *sp, char *pattern, size_t *searchp) { CB *cbp; TAGQ *tqp; @@ -651,11 +633,7 @@ usage: (void)csc_help(sp, "find"); * Parse the cscope output. */ static int -parse(sp, csc, tqp, matchesp) - SCR *sp; - CSC *csc; - TAGQ *tqp; - int *matchesp; +parse(SCR *sp, CSC *csc, TAGQ *tqp, int *matchesp) { TAG *tp; recno_t slno; @@ -771,12 +749,8 @@ io_err: if (feof(csc->from_fp)) * Search for the right path to this file. */ static void -csc_file(sp, csc, name, dirp, dlenp, isolderp) - SCR *sp; - CSC *csc; - char *name, **dirp; - size_t *dlenp; - int *isolderp; +csc_file(SCR *sp, CSC *csc, char *name, char **dirp, size_t *dlenp, + int *isolderp) { struct stat sb; char **pp, buf[MAXPATHLEN]; @@ -805,10 +779,7 @@ csc_file(sp, csc, name, dirp, dlenp, isolderp) * The cscope help command. */ static int -cscope_help(sp, cmdp, subcmd) - SCR *sp; - EXCMD *cmdp; - char *subcmd; +cscope_help(SCR *sp, EXCMD *cmdp, char *subcmd) { return (csc_help(sp, subcmd)); } @@ -818,9 +789,7 @@ cscope_help(sp, cmdp, subcmd) * Display help/usage messages. */ static int -csc_help(sp, cmd) - SCR *sp; - char *cmd; +csc_help(SCR *sp, char *cmd) { CC const *ccp; @@ -848,10 +817,7 @@ csc_help(sp, cmd) * The cscope kill command. */ static int -cscope_kill(sp, cmdp, cn) - SCR *sp; - EXCMD *cmdp; - char *cn; +cscope_kill(SCR *sp, EXCMD *cmdp, char *cn) { return (terminate(sp, NULL, atoi(cn))); } @@ -861,10 +827,7 @@ cscope_kill(sp, cmdp, cn) * Detach from a cscope process. */ static int -terminate(sp, csc, n) - SCR *sp; - CSC *csc; - int n; +terminate(SCR *sp, CSC *csc, int n) { EX_PRIVATE *exp; int i, pstat; @@ -917,10 +880,7 @@ badno: msgq(sp, M_ERR, "312|%d: no such cscope session", n); * The cscope reset command. */ static int -cscope_reset(sp, cmdp, notusedp) - SCR *sp; - EXCMD *cmdp; - char *notusedp; +cscope_reset(SCR *sp, EXCMD *cmdp, char *notusedp) { EX_PRIVATE *exp; @@ -937,8 +897,7 @@ cscope_reset(sp, cmdp, notusedp) * PUBLIC: int cscope_display(SCR *); */ int -cscope_display(sp) - SCR *sp; +cscope_display(SCR *sp) { EX_PRIVATE *exp; CSC *csc; @@ -963,10 +922,7 @@ cscope_display(sp) * PUBLIC: int cscope_search(SCR *, TAGQ *, TAG *); */ int -cscope_search(sp, tqp, tp) - SCR *sp; - TAGQ *tqp; - TAG *tp; +cscope_search(SCR *sp, TAGQ *tqp, TAG *tp) { MARK m; @@ -1015,8 +971,7 @@ cscope_search(sp, tqp, tp) * Return a pointer to the command structure. */ static CC const * -lookup_ccmd(name) - char *name; +lookup_ccmd(char *name) { CC const *ccp; size_t len; @@ -1033,9 +988,7 @@ lookup_ccmd(name) * Read a prompt from cscope. */ static int -read_prompt(sp, csc) - SCR *sp; - CSC *csc; +read_prompt(SCR *sp, CSC *csc) { int ch; diff --git a/usr.bin/vi/ex/ex_delete.c b/usr.bin/vi/ex/ex_delete.c index d8fc7868c23..3f11b9140d5 100644 --- a/usr.bin/vi/ex/ex_delete.c +++ b/usr.bin/vi/ex/ex_delete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_delete.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_delete.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -28,9 +28,7 @@ * PUBLIC: int ex_delete(SCR *, EXCMD *); */ int -ex_delete(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_delete(SCR *sp, EXCMD *cmdp) { recno_t lno; diff --git a/usr.bin/vi/ex/ex_display.c b/usr.bin/vi/ex/ex_display.c index bb717e48ced..8134c92466a 100644 --- a/usr.bin/vi/ex/ex_display.c +++ b/usr.bin/vi/ex/ex_display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_display.c,v 1.8 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: ex_display.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -34,9 +34,7 @@ static void db(SCR *, CB *, CHAR_T *); * PUBLIC: int ex_display(SCR *, EXCMD *); */ int -ex_display(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_display(SCR *sp, EXCMD *cmdp) { switch (cmdp->argv[0]->bp[0]) { case 'b': @@ -78,8 +76,7 @@ ex_display(sp, cmdp) * Display buffers. */ static int -bdisplay(sp) - SCR *sp; +bdisplay(SCR *sp) { CB *cbp; @@ -117,10 +114,7 @@ bdisplay(sp) * Display a buffer. */ static void -db(sp, cbp, name) - SCR *sp; - CB *cbp; - CHAR_T *name; +db(SCR *sp, CB *cbp, CHAR_T *name) { CHAR_T *p; TEXT *tp; diff --git a/usr.bin/vi/ex/ex_edit.c b/usr.bin/vi/ex/ex_edit.c index 384457de3fb..2c1019fb87b 100644 --- a/usr.bin/vi/ex/ex_edit.c +++ b/usr.bin/vi/ex/ex_edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_edit.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_edit.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -44,9 +44,7 @@ static int ex_N_edit(SCR *, EXCMD *, FREF *, int); * PUBLIC: int ex_edit(SCR *, EXCMD *); */ int -ex_edit(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_edit(SCR *sp, EXCMD *cmdp) { FREF *frp; int attach, setalt; @@ -106,11 +104,7 @@ ex_edit(sp, cmdp) * New screen version of ex_edit. */ static int -ex_N_edit(sp, cmdp, frp, attach) - SCR *sp; - EXCMD *cmdp; - FREF *frp; - int attach; +ex_N_edit(SCR *sp, EXCMD *cmdp, FREF *frp, int attach) { SCR *new; diff --git a/usr.bin/vi/ex/ex_equal.c b/usr.bin/vi/ex/ex_equal.c index 9878260a34e..076da1551c6 100644 --- a/usr.bin/vi/ex/ex_equal.c +++ b/usr.bin/vi/ex/ex_equal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_equal.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_equal.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -26,9 +26,7 @@ * PUBLIC: int ex_equal(SCR *, EXCMD *); */ int -ex_equal(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_equal(SCR *sp, EXCMD *cmdp) { recno_t lno; diff --git a/usr.bin/vi/ex/ex_file.c b/usr.bin/vi/ex/ex_file.c index 86199cf0b22..0cc25fa88ec 100644 --- a/usr.bin/vi/ex/ex_file.c +++ b/usr.bin/vi/ex/ex_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_file.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_file.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int ex_file(SCR *, EXCMD *); */ int -ex_file(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_file(SCR *sp, EXCMD *cmdp) { CHAR_T *p; FREF *frp; diff --git a/usr.bin/vi/ex/ex_filter.c b/usr.bin/vi/ex/ex_filter.c index cf8b0efaf90..bfdf8cfeea8 100644 --- a/usr.bin/vi/ex/ex_filter.c +++ b/usr.bin/vi/ex/ex_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_filter.c,v 1.11 2011/07/10 13:20:25 millert Exp $ */ +/* $OpenBSD: ex_filter.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -39,12 +39,8 @@ static int filter_ldisplay(SCR *, FILE *); * PUBLIC: EXCMD *, MARK *, MARK *, MARK *, char *, enum filtertype); */ int -ex_filter(sp, cmdp, fm, tm, rp, cmd, ftype) - SCR *sp; - EXCMD *cmdp; - MARK *fm, *tm, *rp; - char *cmd; - enum filtertype ftype; +ex_filter(SCR *sp, EXCMD *cmdp, MARK *fm, MARK *tm, MARK *rp, char *cmd, + enum filtertype ftype) { FILE *ifp, *ofp; pid_t parent_writer_pid, utility_pid; @@ -344,9 +340,7 @@ uwait: return (proc_wait(sp, utility_pid, cmd, * We use the ex print routines to make sure they're printable. */ static int -filter_ldisplay(sp, fp) - SCR *sp; - FILE *fp; +filter_ldisplay(SCR *sp, FILE *fp) { size_t len; diff --git a/usr.bin/vi/ex/ex_global.c b/usr.bin/vi/ex/ex_global.c index 7769fba7571..2c9b4077a6d 100644 --- a/usr.bin/vi/ex/ex_global.c +++ b/usr.bin/vi/ex/ex_global.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_global.c,v 1.12 2013/12/01 13:42:42 krw Exp $ */ +/* $OpenBSD: ex_global.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -36,9 +36,7 @@ static int ex_g_setup(SCR *, EXCMD *, enum which); * PUBLIC: int ex_global(SCR *, EXCMD *); */ int -ex_global(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_global(SCR *sp, EXCMD *cmdp) { return (ex_g_setup(sp, cmdp, FL_ISSET(cmdp->iflags, E_C_FORCE) ? V : GLOBAL)); @@ -51,9 +49,7 @@ ex_global(sp, cmdp) * PUBLIC: int ex_v(SCR *, EXCMD *); */ int -ex_v(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_v(SCR *sp, EXCMD *cmdp) { return (ex_g_setup(sp, cmdp, V)); } @@ -63,10 +59,7 @@ ex_v(sp, cmdp) * Ex global and v commands. */ static int -ex_g_setup(sp, cmdp, cmd) - SCR *sp; - EXCMD *cmdp; - enum which cmd; +ex_g_setup(SCR *sp, EXCMD *cmdp, enum which cmd) { CHAR_T *ptrn, *p, *t; EXCMD *ecp; @@ -255,10 +248,7 @@ usage: ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE); * PUBLIC: int ex_g_insdel(SCR *, lnop_t, recno_t); */ int -ex_g_insdel(sp, op, lno) - SCR *sp; - lnop_t op; - recno_t lno; +ex_g_insdel(SCR *sp, lnop_t op, recno_t lno) { EXCMD *ecp; RANGE *nrp, *rp; diff --git a/usr.bin/vi/ex/ex_init.c b/usr.bin/vi/ex/ex_init.c index 019c39ab54e..0a07e49474c 100644 --- a/usr.bin/vi/ex/ex_init.c +++ b/usr.bin/vi/ex/ex_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_init.c,v 1.11 2013/12/01 16:47:59 krw Exp $ */ +/* $OpenBSD: ex_init.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -41,8 +41,7 @@ static int ex_run_file(SCR *, int, char *); * PUBLIC: int ex_screen_copy(SCR *, SCR *); */ int -ex_screen_copy(orig, sp) - SCR *orig, *sp; +ex_screen_copy(SCR *orig, SCR *sp) { EX_PRIVATE *oexp, *nexp; @@ -77,8 +76,7 @@ ex_screen_copy(orig, sp) * PUBLIC: int ex_screen_end(SCR *); */ int -ex_screen_end(sp) - SCR *sp; +ex_screen_end(SCR *sp) { EX_PRIVATE *exp; int rval; @@ -118,11 +116,7 @@ ex_screen_end(sp) * PUBLIC: int ex_optchange(SCR *, int, char *, u_long *); */ int -ex_optchange(sp, offset, str, valp) - SCR *sp; - int offset; - char *str; - u_long *valp; +ex_optchange(SCR *sp, int offset, char *str, u_long *valp) { switch (offset) { case O_TAGS: @@ -139,8 +133,7 @@ ex_optchange(sp, offset, str, valp) * PUBLIC: int ex_exrc(SCR *); */ int -ex_exrc(sp) - SCR *sp; +ex_exrc(SCR *sp) { struct stat hsb, lsb; char *p, path[MAXPATHLEN]; @@ -257,10 +250,7 @@ ex_exrc(sp) * Set up a file of ex commands to run. */ static int -ex_run_file(sp, fd, name) - SCR *sp; - int fd; - char *name; +ex_run_file(SCR *sp, int fd, char *name) { ARGS *ap[2], a; EXCMD cmd; @@ -277,11 +267,8 @@ ex_run_file(sp, fd, name) * PUBLIC: int ex_run_str(SCR *, char *, char *, size_t, int, int); */ int -ex_run_str(sp, name, str, len, ex_flags, nocopy) - SCR *sp; - char *name, *str; - size_t len; - int ex_flags, nocopy; +ex_run_str(SCR *sp, char *name, char *str, size_t len, int ex_flags, + int nocopy) { GS *gp; EXCMD *ecp; @@ -352,12 +339,8 @@ ex_run_str(sp, name, str, len, ex_flags, nocopy) * files. */ static enum rc -exrc_isok(sp, sbp, fdp, path, rootown, rootid) - SCR *sp; - struct stat *sbp; - int *fdp; - char *path; - int rootown, rootid; +exrc_isok(SCR *sp, struct stat *sbp, int *fdp, char *path, int rootown, + int rootid) { enum { ROOTOWN, OWN, WRITER } etype; uid_t euid; diff --git a/usr.bin/vi/ex/ex_join.c b/usr.bin/vi/ex/ex_join.c index 0ab30889290..279bf5b2998 100644 --- a/usr.bin/vi/ex/ex_join.c +++ b/usr.bin/vi/ex/ex_join.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_join.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_join.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int ex_join(SCR *, EXCMD *); */ int -ex_join(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_join(SCR *sp, EXCMD *cmdp) { recno_t from, to; size_t blen, clen, len, tlen; diff --git a/usr.bin/vi/ex/ex_map.c b/usr.bin/vi/ex/ex_map.c index f9b1aba4db7..c5368235dfe 100644 --- a/usr.bin/vi/ex/ex_map.c +++ b/usr.bin/vi/ex/ex_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_map.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_map.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -40,9 +40,7 @@ * PUBLIC: int ex_map(SCR *, EXCMD *); */ int -ex_map(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_map(SCR *sp, EXCMD *cmdp) { seq_t stype; CHAR_T *input, *p; @@ -105,9 +103,7 @@ nofunc: if (stype == SEQ_COMMAND && input[1] == '\0') * PUBLIC: int ex_unmap(SCR *, EXCMD *); */ int -ex_unmap(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_unmap(SCR *sp, EXCMD *cmdp) { if (seq_delete(sp, cmdp->argv[0]->bp, cmdp->argv[0]->len, FL_ISSET(cmdp->iflags, E_C_FORCE) ? SEQ_INPUT : SEQ_COMMAND)) { diff --git a/usr.bin/vi/ex/ex_mark.c b/usr.bin/vi/ex/ex_mark.c index 1dc75085e58..dd0470329d6 100644 --- a/usr.bin/vi/ex/ex_mark.c +++ b/usr.bin/vi/ex/ex_mark.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_mark.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_mark.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int ex_mark(SCR *, EXCMD *); */ int -ex_mark(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_mark(SCR *sp, EXCMD *cmdp) { NEEDFILE(sp, cmdp); diff --git a/usr.bin/vi/ex/ex_mkexrc.c b/usr.bin/vi/ex/ex_mkexrc.c index 66db029d0a5..ce6a6d6dd7f 100644 --- a/usr.bin/vi/ex/ex_mkexrc.c +++ b/usr.bin/vi/ex/ex_mkexrc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_mkexrc.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_mkexrc.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -35,9 +35,7 @@ * PUBLIC: int ex_mkexrc(SCR *, EXCMD *); */ int -ex_mkexrc(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_mkexrc(SCR *sp, EXCMD *cmdp) { struct stat sb; FILE *fp; diff --git a/usr.bin/vi/ex/ex_move.c b/usr.bin/vi/ex/ex_move.c index 7a7651a88be..28ab7ae320d 100644 --- a/usr.bin/vi/ex/ex_move.c +++ b/usr.bin/vi/ex/ex_move.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_move.c,v 1.9 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: ex_move.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int ex_copy(SCR *, EXCMD *); */ int -ex_copy(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_copy(SCR *sp, EXCMD *cmdp) { CB cb; MARK fm1, fm2, m, tm; @@ -84,9 +82,7 @@ err: text_lfree(&cb.textq); * PUBLIC: int ex_move(SCR *, EXCMD *); */ int -ex_move(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_move(SCR *sp, EXCMD *cmdp) { LMARK *lmp; MARK fm1, fm2; diff --git a/usr.bin/vi/ex/ex_open.c b/usr.bin/vi/ex/ex_open.c index ed155cbf693..bf8734de76c 100644 --- a/usr.bin/vi/ex/ex_open.c +++ b/usr.bin/vi/ex/ex_open.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_open.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_open.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -28,9 +28,7 @@ * PUBLIC: int ex_open(SCR *, EXCMD *); */ int -ex_open(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_open(SCR *sp, EXCMD *cmdp) { /* If open option off, disallow open command. */ if (!O_ISSET(sp, O_OPEN)) { diff --git a/usr.bin/vi/ex/ex_perl.c b/usr.bin/vi/ex/ex_perl.c index 53571a6f732..b212663e8dd 100644 --- a/usr.bin/vi/ex/ex_perl.c +++ b/usr.bin/vi/ex/ex_perl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_perl.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_perl.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -39,9 +39,7 @@ * PUBLIC: int ex_perl(SCR*, EXCMD *); */ int -ex_perl(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_perl(SCR *sp, EXCMD *cmdp) { #ifdef HAVE_PERL_INTERP CHAR_T *p; diff --git a/usr.bin/vi/ex/ex_preserve.c b/usr.bin/vi/ex/ex_preserve.c index d70352b60c5..a03f88ac0da 100644 --- a/usr.bin/vi/ex/ex_preserve.c +++ b/usr.bin/vi/ex/ex_preserve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_preserve.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_preserve.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int ex_preserve(SCR *, EXCMD *); */ int -ex_preserve(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_preserve(SCR *sp, EXCMD *cmdp) { recno_t lno; @@ -65,9 +63,7 @@ ex_preserve(sp, cmdp) * PUBLIC: int ex_recover(SCR *, EXCMD *); */ int -ex_recover(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_recover(SCR *sp, EXCMD *cmdp) { ARGS *ap; FREF *frp; diff --git a/usr.bin/vi/ex/ex_print.c b/usr.bin/vi/ex/ex_print.c index 8cac5cf4115..c9841073e5b 100644 --- a/usr.bin/vi/ex/ex_print.c +++ b/usr.bin/vi/ex/ex_print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_print.c,v 1.9 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_print.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,9 +33,7 @@ static int ex_prchars(SCR *, const char *, size_t *, size_t, u_int, int); * PUBLIC: int ex_list(SCR *, EXCMD *); */ int -ex_list(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_list(SCR *sp, EXCMD *cmdp) { if (ex_print(sp, cmdp, &cmdp->addr1, &cmdp->addr2, cmdp->iflags | E_C_LIST)) @@ -53,9 +51,7 @@ ex_list(sp, cmdp) * PUBLIC: int ex_number(SCR *, EXCMD *); */ int -ex_number(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_number(SCR *sp, EXCMD *cmdp) { if (ex_print(sp, cmdp, &cmdp->addr1, &cmdp->addr2, cmdp->iflags | E_C_HASH)) @@ -73,9 +69,7 @@ ex_number(sp, cmdp) * PUBLIC: int ex_pr(SCR *, EXCMD *); */ int -ex_pr(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_pr(SCR *sp, EXCMD *cmdp) { if (ex_print(sp, cmdp, &cmdp->addr1, &cmdp->addr2, cmdp->iflags)) return (1); @@ -91,11 +85,7 @@ ex_pr(sp, cmdp) * PUBLIC: int ex_print(SCR *, EXCMD *, MARK *, MARK *, u_int32_t); */ int -ex_print(sp, cmdp, fp, tp, flags) - SCR *sp; - EXCMD *cmdp; - MARK *fp, *tp; - u_int32_t flags; +ex_print(SCR *sp, EXCMD *cmdp, MARK *fp, MARK *tp, u_int32_t flags) { recno_t from, to; size_t col, len; @@ -147,11 +137,7 @@ ex_print(sp, cmdp, fp, tp, flags) * PUBLIC: int ex_ldisplay(SCR *, const char *, size_t, size_t, u_int); */ int -ex_ldisplay(sp, p, len, col, flags) - SCR *sp; - const char *p; - size_t len, col; - u_int flags; +ex_ldisplay(SCR *sp, const char *p, size_t len, size_t col, u_int flags) { if (len > 0 && ex_prchars(sp, p, &col, len, LF_ISSET(E_C_LIST), 0)) return (1); @@ -172,9 +158,7 @@ ex_ldisplay(sp, p, len, col, flags) * PUBLIC: int ex_scprint(SCR *, MARK *, MARK *); */ int -ex_scprint(sp, fp, tp) - SCR *sp; - MARK *fp, *tp; +ex_scprint(SCR *sp, MARK *fp, MARK *tp) { const char *p; size_t col, len; @@ -209,12 +193,8 @@ ex_scprint(sp, fp, tp) * Local routine to dump characters to the screen. */ static int -ex_prchars(sp, p, colp, len, flags, repeatc) - SCR *sp; - const char *p; - size_t *colp, len; - u_int flags; - int repeatc; +ex_prchars(SCR *sp, const char *p, size_t *colp, size_t len, u_int flags, + int repeatc) { CHAR_T ch, *kp; size_t col, tlen, ts; @@ -290,9 +270,7 @@ ex_printf(SCR *sp, const char *fmt, ...) * PUBLIC: int ex_puts(SCR *, const char *); */ int -ex_puts(sp, str) - SCR *sp; - const char *str; +ex_puts(SCR *sp, const char *str) { EX_PRIVATE *exp; int doflush, n; @@ -318,8 +296,7 @@ ex_puts(sp, str) * PUBLIC: int ex_fflush(SCR *sp); */ int -ex_fflush(sp) - SCR *sp; +ex_fflush(SCR *sp) { EX_PRIVATE *exp; diff --git a/usr.bin/vi/ex/ex_put.c b/usr.bin/vi/ex/ex_put.c index 3a5707638e8..d1c463167c6 100644 --- a/usr.bin/vi/ex/ex_put.c +++ b/usr.bin/vi/ex/ex_put.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_put.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_put.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int ex_put(SCR *, EXCMD *); */ int -ex_put(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_put(SCR *sp, EXCMD *cmdp) { MARK m; diff --git a/usr.bin/vi/ex/ex_quit.c b/usr.bin/vi/ex/ex_quit.c index 3d62d5574b4..0f39a3f6cd1 100644 --- a/usr.bin/vi/ex/ex_quit.c +++ b/usr.bin/vi/ex/ex_quit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_quit.c,v 1.4 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_quit.c,v 1.5 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -27,9 +27,7 @@ * PUBLIC: int ex_quit(SCR *, EXCMD *); */ int -ex_quit(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_quit(SCR *sp, EXCMD *cmdp) { int force; diff --git a/usr.bin/vi/ex/ex_read.c b/usr.bin/vi/ex/ex_read.c index c0f2530bff0..3de3aa5e1f0 100644 --- a/usr.bin/vi/ex/ex_read.c +++ b/usr.bin/vi/ex/ex_read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_read.c,v 1.9 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_read.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -38,9 +38,7 @@ * PUBLIC: int ex_read(SCR *, EXCMD *); */ int -ex_read(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_read(SCR *sp, EXCMD *cmdp) { enum { R_ARG, R_EXPANDARG, R_FILTER } which; struct stat sb; @@ -294,13 +292,8 @@ ex_read(sp, cmdp) * PUBLIC: int ex_readfp(SCR *, char *, FILE *, MARK *, recno_t *, int); */ int -ex_readfp(sp, name, fp, fm, nlinesp, silent) - SCR *sp; - char *name; - FILE *fp; - MARK *fm; - recno_t *nlinesp; - int silent; +ex_readfp(SCR *sp, char *name, FILE *fp, MARK *fm, recno_t *nlinesp, + int silent) { EX_PRIVATE *exp; GS *gp; diff --git a/usr.bin/vi/ex/ex_screen.c b/usr.bin/vi/ex/ex_screen.c index 9407770a588..52908cea5be 100644 --- a/usr.bin/vi/ex/ex_screen.c +++ b/usr.bin/vi/ex/ex_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_screen.c,v 1.8 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: ex_screen.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -31,9 +31,7 @@ * PUBLIC: int ex_bg(SCR *, EXCMD *); */ int -ex_bg(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_bg(SCR *sp, EXCMD *cmdp) { return (vs_bg(sp)); } @@ -45,9 +43,7 @@ ex_bg(sp, cmdp) * PUBLIC: int ex_fg(SCR *, EXCMD *); */ int -ex_fg(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_fg(SCR *sp, EXCMD *cmdp) { SCR *nsp; int newscreen; @@ -71,9 +67,7 @@ ex_fg(sp, cmdp) * PUBLIC: int ex_resize(SCR *, EXCMD *); */ int -ex_resize(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_resize(SCR *sp, EXCMD *cmdp) { adj_t adj; @@ -102,8 +96,7 @@ ex_resize(sp, cmdp) * PUBLIC: int ex_sdisplay(SCR *); */ int -ex_sdisplay(sp) - SCR *sp; +ex_sdisplay(SCR *sp) { GS *gp; SCR *tsp; diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c index 23d7c7dc73c..21ff361f3f4 100644 --- a/usr.bin/vi/ex/ex_script.c +++ b/usr.bin/vi/ex/ex_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_script.c,v 1.19 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: ex_script.c,v 1.20 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -54,9 +54,7 @@ static int sscr_setprompt(SCR *, char *, size_t); * PUBLIC: int ex_script(SCR *, EXCMD *); */ int -ex_script(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_script(SCR *sp, EXCMD *cmdp) { /* Vi only command. */ if (!F_ISSET(sp, SC_VI)) { @@ -81,8 +79,7 @@ ex_script(sp, cmdp) * Create a pty setup for a shell. */ static int -sscr_init(sp) - SCR *sp; +sscr_init(SCR *sp) { SCRIPT *sc; char *sh, *sh_path; @@ -190,8 +187,7 @@ err: if (sc->sh_master != -1) * carriage return comes; set the prompt from that line. */ static int -sscr_getprompt(sp) - SCR *sp; +sscr_getprompt(SCR *sp) { CHAR_T *endp, *p, *t, buf[1024]; SCRIPT *sc; @@ -281,9 +277,7 @@ prompterr: sscr_end(sp); * PUBLIC: int sscr_exec(SCR *, recno_t); */ int -sscr_exec(sp, lno) - SCR *sp; - recno_t lno; +sscr_exec(SCR *sp, recno_t lno) { SCRIPT *sc; recno_t last_lno; @@ -424,8 +418,7 @@ done: * PUBLIC: int sscr_input(SCR *); */ int -sscr_input(sp) - SCR *sp; +sscr_input(SCR *sp) { GS *gp; struct pollfd *pfd; @@ -490,8 +483,7 @@ done: * Take a line from the shell and insert it into the file. */ static int -sscr_insert(sp) - SCR *sp; +sscr_insert(SCR *sp) { CHAR_T *endp, *p, *t; SCRIPT *sc; @@ -576,10 +568,7 @@ ret: FREE_SPACE(sp, bp, blen); * */ static int -sscr_setprompt(sp, buf, len) - SCR *sp; - char *buf; - size_t len; +sscr_setprompt(SCR *sp, char *buf, size_t len) { SCRIPT *sc; @@ -603,10 +592,7 @@ sscr_setprompt(sp, buf, len) * parts that can change, in both content and size. */ static int -sscr_matchprompt(sp, lp, line_len, lenp) - SCR *sp; - char *lp; - size_t line_len, *lenp; +sscr_matchprompt(SCR *sp, char *lp, size_t line_len, size_t *lenp) { SCRIPT *sc; size_t prompt_len; @@ -644,8 +630,7 @@ sscr_matchprompt(sp, lp, line_len, lenp) * PUBLIC: int sscr_end(SCR *); */ int -sscr_end(sp) - SCR *sp; +sscr_end(SCR *sp) { SCRIPT *sc; @@ -678,8 +663,7 @@ sscr_end(sp) * Set/clear the global scripting bit. */ static void -sscr_check(sp) - SCR *sp; +sscr_check(SCR *sp) { GS *gp; diff --git a/usr.bin/vi/ex/ex_set.c b/usr.bin/vi/ex/ex_set.c index fb60a7d698f..e416526def7 100644 --- a/usr.bin/vi/ex/ex_set.c +++ b/usr.bin/vi/ex/ex_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_set.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_set.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -27,9 +27,7 @@ * PUBLIC: int ex_set(SCR *, EXCMD *); */ int -ex_set(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_set(SCR *sp, EXCMD *cmdp) { switch(cmdp->argc) { case 0: diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c index ce7d1e0b623..43188804798 100644 --- a/usr.bin/vi/ex/ex_shell.c +++ b/usr.bin/vi/ex/ex_shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_shell.c,v 1.12 2014/11/10 21:31:42 tedu Exp $ */ +/* $OpenBSD: ex_shell.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -34,9 +34,7 @@ * PUBLIC: int ex_shell(SCR *, EXCMD *); */ int -ex_shell(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_shell(SCR *sp, EXCMD *cmdp) { int rval; char buf[MAXPATHLEN]; @@ -77,12 +75,8 @@ ex_shell(sp, cmdp) * PUBLIC: int ex_exec_proc(SCR *, EXCMD *, char *, const char *, int); */ int -ex_exec_proc(sp, cmdp, cmd, msg, need_newline) - SCR *sp; - EXCMD *cmdp; - char *cmd; - const char *msg; - int need_newline; +ex_exec_proc(SCR *sp, EXCMD *cmdp, char *cmd, const char *msg, + int need_newline) { GS *gp; const char *name; @@ -145,11 +139,7 @@ ex_exec_proc(sp, cmdp, cmd, msg, need_newline) * PUBLIC: int proc_wait(SCR *, pid_t, const char *, int, int); */ int -proc_wait(sp, pid, cmd, silent, okpipe) - SCR *sp; - pid_t pid; - const char *cmd; - int silent, okpipe; +proc_wait(SCR *sp, pid_t pid, const char *cmd, int silent, int okpipe) { size_t len; int nf, pstat; diff --git a/usr.bin/vi/ex/ex_shift.c b/usr.bin/vi/ex/ex_shift.c index 4bcf384984f..e2fb82d1b12 100644 --- a/usr.bin/vi/ex/ex_shift.c +++ b/usr.bin/vi/ex/ex_shift.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_shift.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_shift.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -31,9 +31,7 @@ static int shift(SCR *, EXCMD *, enum which); * PUBLIC: int ex_shiftl(SCR *, EXCMD *); */ int -ex_shiftl(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_shiftl(SCR *sp, EXCMD *cmdp) { return (shift(sp, cmdp, LEFT)); } @@ -44,9 +42,7 @@ ex_shiftl(sp, cmdp) * PUBLIC: int ex_shiftr(SCR *, EXCMD *); */ int -ex_shiftr(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_shiftr(SCR *sp, EXCMD *cmdp) { return (shift(sp, cmdp, RIGHT)); } @@ -56,10 +52,7 @@ ex_shiftr(sp, cmdp) * Ex shift support. */ static int -shift(sp, cmdp, rl) - SCR *sp; - EXCMD *cmdp; - enum which rl; +shift(SCR *sp, EXCMD *cmdp, enum which rl) { recno_t from, to; size_t blen, len, newcol, newidx, oldcol, oldidx, sw; diff --git a/usr.bin/vi/ex/ex_source.c b/usr.bin/vi/ex/ex_source.c index d772fe3cb45..47688f49d13 100644 --- a/usr.bin/vi/ex/ex_source.c +++ b/usr.bin/vi/ex/ex_source.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_source.c,v 1.8 2013/05/03 20:43:25 kili Exp $ */ +/* $OpenBSD: ex_source.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,10 +33,7 @@ * PUBLIC: int ex_sourcefd(SCR *, EXCMD *, int); */ int -ex_sourcefd(sp, cmdp, fd) - SCR *sp; - EXCMD *cmdp; - int fd; +ex_sourcefd(SCR *sp, EXCMD *cmdp, int fd) { struct stat sb; int len; @@ -90,9 +87,7 @@ err: msgq_str(sp, M_SYSERR, name, "%s"); * PUBLIC: int ex_source(SCR *, EXCMD *); */ int -ex_source(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_source(SCR *sp, EXCMD *cmdp) { char *name; int fd; diff --git a/usr.bin/vi/ex/ex_stop.c b/usr.bin/vi/ex/ex_stop.c index 4be5da4c4e2..8cb3403b65e 100644 --- a/usr.bin/vi/ex/ex_stop.c +++ b/usr.bin/vi/ex/ex_stop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_stop.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_stop.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -31,9 +31,7 @@ * PUBLIC: int ex_stop(SCR *, EXCMD *); */ int -ex_stop(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_stop(SCR *sp, EXCMD *cmdp) { int allowed; diff --git a/usr.bin/vi/ex/ex_subst.c b/usr.bin/vi/ex/ex_subst.c index 8ee855eec55..eff4ed755a2 100644 --- a/usr.bin/vi/ex/ex_subst.c +++ b/usr.bin/vi/ex/ex_subst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_subst.c,v 1.20 2014/10/14 22:23:12 deraadt Exp $ */ +/* $OpenBSD: ex_subst.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -45,9 +45,7 @@ static int s(SCR *, EXCMD *, char *, regex_t *, u_int); * PUBLIC: int ex_s(SCR *, EXCMD *); */ int -ex_s(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_s(SCR *sp, EXCMD *cmdp) { regex_t *re; size_t blen, len; @@ -252,9 +250,7 @@ tilde: ++p; * PUBLIC: int ex_subagain(SCR *, EXCMD *); */ int -ex_subagain(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_subagain(SCR *sp, EXCMD *cmdp) { if (sp->subre == NULL) { ex_emsg(sp, NULL, EXM_NOPREVRE); @@ -276,9 +272,7 @@ ex_subagain(sp, cmdp) * PUBLIC: int ex_subtilde(SCR *, EXCMD *); */ int -ex_subtilde(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_subtilde(SCR *sp, EXCMD *cmdp) { if (sp->re == NULL) { ex_emsg(sp, NULL, EXM_NOPREVRE); @@ -342,12 +336,7 @@ ex_subtilde(sp, cmdp) } static int -s(sp, cmdp, s, re, flags) - SCR *sp; - EXCMD *cmdp; - char *s; - regex_t *re; - u_int flags; +s(SCR *sp, EXCMD *cmdp, char *s, regex_t *re, u_int flags) { EVENT ev; MARK from, to; @@ -889,12 +878,8 @@ err: rval = 1; * PUBLIC: char *, size_t, char **, size_t *, regex_t *, u_int); */ int -re_compile(sp, ptrn, plen, ptrnp, lenp, rep, flags) - SCR *sp; - char *ptrn, **ptrnp; - size_t plen, *lenp; - regex_t *rep; - u_int flags; +re_compile(SCR *sp, char *ptrn, size_t plen, char **ptrnp, size_t *lenp, + regex_t *rep, u_int flags) { size_t len; int reflags, replaced, rval; @@ -1022,11 +1007,7 @@ re_compile(sp, ptrn, plen, ptrnp, lenp, rep, flags) * weren't historically. It's a bug. */ static int -re_conv(sp, ptrnp, plenp, replacedp) - SCR *sp; - char **ptrnp; - size_t *plenp; - int *replacedp; +re_conv(SCR *sp, char **ptrnp, size_t *plenp, int *replacedp) { size_t blen, len, needlen; int magic; @@ -1152,11 +1133,7 @@ re_conv(sp, ptrnp, plenp, replacedp) * 1003.2 RE functions can handle. */ static int -re_tag_conv(sp, ptrnp, plenp, replacedp) - SCR *sp; - char **ptrnp; - size_t *plenp; - int *replacedp; +re_tag_conv(SCR *sp, char **ptrnp, size_t *plenp, int *replacedp) { size_t blen, len; int lastdollar; @@ -1223,11 +1200,7 @@ re_tag_conv(sp, ptrnp, plenp, replacedp) * 1003.2 RE functions can handle. */ static int -re_cscope_conv(sp, ptrnp, plenp, replacedp) - SCR *sp; - char **ptrnp; - size_t *plenp; - int *replacedp; +re_cscope_conv(SCR *sp, char **ptrnp, size_t *plenp, int *replacedp) { size_t blen, len, nspaces; char *bp, *p, *t; @@ -1284,10 +1257,7 @@ re_cscope_conv(sp, ptrnp, plenp, replacedp) * PUBLIC: void re_error(SCR *, int, regex_t *); */ void -re_error(sp, errcode, preg) - SCR *sp; - int errcode; - regex_t *preg; +re_error(SCR *sp, int errcode, regex_t *preg) { size_t s; char *oe; @@ -1307,12 +1277,8 @@ re_error(sp, errcode, preg) * Do the substitution for a regular expression. */ static int -re_sub(sp, ip, lbp, lbclenp, lblenp, match) - SCR *sp; - char *ip; /* Input line. */ - char **lbp; - size_t *lbclenp, *lblenp; - regmatch_t match[10]; +re_sub(SCR *sp, char *ip, char **lbp, size_t *lbclenp, size_t *lblenp, + regmatch_t match[10]) { enum { C_NOTSET, C_LOWER, C_ONELOWER, C_ONEUPPER, C_UPPER } conv; size_t lbclen, lblen; /* Local copies. */ diff --git a/usr.bin/vi/ex/ex_tag.c b/usr.bin/vi/ex/ex_tag.c index 077152c01ef..c7938b97d30 100644 --- a/usr.bin/vi/ex/ex_tag.c +++ b/usr.bin/vi/ex/ex_tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_tag.c,v 1.18 2014/11/10 21:40:11 tedu Exp $ */ +/* $OpenBSD: ex_tag.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -56,9 +56,7 @@ static int tagq_copy(SCR *, TAGQ *, TAGQ **); * PUBLIC: int ex_tag_first(SCR *, char *); */ int -ex_tag_first(sp, tagarg) - SCR *sp; - char *tagarg; +ex_tag_first(SCR *sp, char *tagarg) { ARGS *ap[2], a; EXCMD cmd; @@ -92,9 +90,7 @@ ex_tag_first(sp, tagarg) * PUBLIC: int ex_tag_push(SCR *, EXCMD *); */ int -ex_tag_push(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tag_push(SCR *sp, EXCMD *cmdp) { EX_PRIVATE *exp; FREF *frp; @@ -229,9 +225,7 @@ alloc_err: * PUBLIC: int ex_tag_next(SCR *, EXCMD *); */ int -ex_tag_next(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tag_next(SCR *sp, EXCMD *cmdp) { EX_PRIVATE *exp; TAG *tp; @@ -264,9 +258,7 @@ ex_tag_next(sp, cmdp) * PUBLIC: int ex_tag_prev(SCR *, EXCMD *); */ int -ex_tag_prev(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tag_prev(SCR *sp, EXCMD *cmdp) { EX_PRIVATE *exp; TAG *tp; @@ -299,10 +291,7 @@ ex_tag_prev(sp, cmdp) * PUBLIC: int ex_tag_nswitch(SCR *, TAG *, int); */ int -ex_tag_nswitch(sp, tp, force) - SCR *sp; - TAG *tp; - int force; +ex_tag_nswitch(SCR *sp, TAG *tp, int force) { /* Get a file structure. */ if (tp->frp == NULL && (tp->frp = file_add(sp, tp->fname)) == NULL) @@ -336,10 +325,7 @@ ex_tag_nswitch(sp, tp, force) * PUBLIC: int ex_tag_Nswitch(SCR *, TAG *, int); */ int -ex_tag_Nswitch(sp, tp, force) - SCR *sp; - TAG *tp; - int force; +ex_tag_Nswitch(SCR *sp, TAG *tp, int force) { SCR *new; @@ -393,9 +379,7 @@ ex_tag_Nswitch(sp, tp, force) * PUBLIC: int ex_tag_pop(SCR *, EXCMD *); */ int -ex_tag_pop(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tag_pop(SCR *sp, EXCMD *cmdp) { EX_PRIVATE *exp; TAGQ *tqp, *dtqp = NULL; @@ -475,9 +459,7 @@ filearg: arglen = strlen(arg); * PUBLIC: int ex_tag_top(SCR *, EXCMD *); */ int -ex_tag_top(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tag_top(SCR *sp, EXCMD *cmdp) { EX_PRIVATE *exp; @@ -500,10 +482,7 @@ ex_tag_top(sp, cmdp) * Pop up to and including the specified TAGQ context. */ static int -tag_pop(sp, dtqp, force) - SCR *sp; - TAGQ *dtqp; - int force; +tag_pop(SCR *sp, TAGQ *dtqp, int force) { EX_PRIVATE *exp; TAG *tp; @@ -556,8 +535,7 @@ tag_pop(sp, dtqp, force) * PUBLIC: int ex_tag_display(SCR *); */ int -ex_tag_display(sp) - SCR *sp; +ex_tag_display(SCR *sp) { EX_PRIVATE *exp; TAG *tp; @@ -639,8 +617,7 @@ ex_tag_display(sp) * PUBLIC: int ex_tag_copy(SCR *, SCR *); */ int -ex_tag_copy(orig, sp) - SCR *orig, *sp; +ex_tag_copy(SCR *orig, SCR *sp) { EX_PRIVATE *oexp, *nexp; TAGQ *aqp, *tqp; @@ -686,9 +663,7 @@ ex_tag_copy(orig, sp) * Copy a TAGF structure and return it in new memory. */ static int -tagf_copy(sp, otfp, tfpp) - SCR *sp; - TAGF *otfp, **tfpp; +tagf_copy(SCR *sp, TAGF *otfp, TAGF **tfpp) { TAGF *tfp; @@ -710,9 +685,7 @@ tagf_copy(sp, otfp, tfpp) * Copy a TAGQ structure and return it in new memory. */ static int -tagq_copy(sp, otqp, tqpp) - SCR *sp; - TAGQ *otqp, **tqpp; +tagq_copy(SCR *sp, TAGQ *otqp, TAGQ **tqpp) { TAGQ *tqp; size_t len; @@ -737,9 +710,7 @@ tagq_copy(sp, otqp, tqpp) * Copy a TAG structure and return it in new memory. */ static int -tag_copy(sp, otp, tpp) - SCR *sp; - TAG *otp, **tpp; +tag_copy(SCR *sp, TAG *otp, TAG **tpp) { TAG *tp; size_t len; @@ -766,9 +737,7 @@ tag_copy(sp, otp, tpp) * Free a TAGF structure. */ static int -tagf_free(sp, tfp) - SCR *sp; - TAGF *tfp; +tagf_free(SCR *sp, TAGF *tfp) { EX_PRIVATE *exp; @@ -786,9 +755,7 @@ tagf_free(sp, tfp) * PUBLIC: int tagq_free(SCR *, TAGQ *); */ int -tagq_free(sp, tqp) - SCR *sp; - TAGQ *tqp; +tagq_free(SCR *sp, TAGQ *tqp) { EX_PRIVATE *exp; TAGQ *ttqp; @@ -821,10 +788,7 @@ tagq_free(sp, tqp) * PUBLIC: void tag_msg(SCR *, tagmsg_t, char *); */ void -tag_msg(sp, msg, tag) - SCR *sp; - tagmsg_t msg; - char *tag; +tag_msg(SCR *sp, tagmsg_t msg, char *tag) { switch (msg) { case TAG_BADLNO: @@ -849,9 +813,7 @@ tag_msg(sp, msg, tag) * PUBLIC: int ex_tagf_alloc(SCR *, char *); */ int -ex_tagf_alloc(sp, str) - SCR *sp; - char *str; +ex_tagf_alloc(SCR *sp, char *str) { EX_PRIVATE *exp; TAGF *tfp; @@ -893,8 +855,7 @@ ex_tagf_alloc(sp, str) * PUBLIC: int ex_tag_free(SCR *); */ int -ex_tag_free(sp) - SCR *sp; +ex_tag_free(SCR *sp) { EX_PRIVATE *exp; TAGF *tfp; @@ -916,10 +877,7 @@ ex_tag_free(sp) * Search a file for a tag. */ static int -ctag_search(sp, search, slen, tag) - SCR *sp; - char *search, *tag; - size_t slen; +ctag_search(SCR *sp, char *search, size_t slen, char *tag) { MARK m; char *p; @@ -979,9 +937,7 @@ notfound: tag_msg(sp, TAG_SEARCH, tag); * Search the list of tags files for a tag, and return tag queue. */ static TAGQ * -ctag_slist(sp, tag) - SCR *sp; - char *tag; +ctag_slist(SCR *sp, char *tag) { EX_PRIVATE *exp; TAGF *tfp; @@ -1037,11 +993,7 @@ alloc_err: * Search a tags file for a tag, adding any found to the tag queue. */ static int -ctag_sfile(sp, tfp, tqp, tname) - SCR *sp; - TAGF *tfp; - TAGQ *tqp; - char *tname; +ctag_sfile(SCR *sp, TAGF *tfp, TAGQ *tqp, char *tname) { struct stat sb; TAG *tp; @@ -1178,11 +1130,7 @@ done: if (munmap(map, (size_t)sb.st_size)) * Search for the right path to this file. */ static void -ctag_file(sp, tfp, name, dirp, dlenp) - SCR *sp; - TAGF *tfp; - char *name, **dirp; - size_t *dlenp; +ctag_file(SCR *sp, TAGF *tfp, char *name, char **dirp, size_t *dlenp) { struct stat sb; char *p, buf[MAXPATHLEN]; @@ -1253,8 +1201,7 @@ ctag_file(sp, tfp, name, dirp, dlenp) #define SKIP_PAST_NEWLINE(p, back) while ((p) < (back) && *(p)++ != '\n'); static char * -binary_search(string, front, back) - char *string, *front, *back; +binary_search(char *string, char *front, char *back) { char *p; @@ -1284,8 +1231,7 @@ binary_search(string, front, back) * o front is before or at the first line to be printed. */ static char * -linear_search(string, front, back) - char *string, *front, *back; +linear_search(char *string, char *front, char *back) { while (front < back) { switch (compare(string, front, back)) { @@ -1316,8 +1262,7 @@ linear_search(string, front, back) * However, historic programs did use spaces, and, I got complaints. */ static int -compare(s1, s2, back) - char *s1, *s2, *back; +compare(char *s1, char *s2, char *back) { for (; *s1 && s2 < back && (*s2 != '\t' && *s2 != ' '); ++s1, ++s2) if (*s1 != *s2) diff --git a/usr.bin/vi/ex/ex_tcl.c b/usr.bin/vi/ex/ex_tcl.c index e592cbd33f3..67c6af73e91 100644 --- a/usr.bin/vi/ex/ex_tcl.c +++ b/usr.bin/vi/ex/ex_tcl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_tcl.c,v 1.6 2014/11/10 21:40:11 tedu Exp $ */ +/* $OpenBSD: ex_tcl.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -26,9 +26,7 @@ * PUBLIC: int ex_tcl(SCR*, EXCMD *); */ int -ex_tcl(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_tcl(SCR *sp, EXCMD *cmdp) { msgq(sp, M_ERR, "302|Vi was not loaded with a Tcl interpreter"); return (1); diff --git a/usr.bin/vi/ex/ex_txt.c b/usr.bin/vi/ex/ex_txt.c index 65f6e425574..aa28e66408a 100644 --- a/usr.bin/vi/ex/ex_txt.c +++ b/usr.bin/vi/ex/ex_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_txt.c,v 1.12 2014/07/10 20:33:42 deraadt Exp $ */ +/* $OpenBSD: ex_txt.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -51,11 +51,7 @@ static void txt_prompt(SCR *, TEXT *, ARG_CHAR_T, u_int32_t); * PUBLIC: int ex_txt(SCR *, TEXTH *, ARG_CHAR_T, u_int32_t); */ int -ex_txt(sp, tiqh, prompt, flags) - SCR *sp; - TEXTH *tiqh; - ARG_CHAR_T prompt; - u_int32_t flags; +ex_txt(SCR *sp, TEXTH *tiqh, ARG_CHAR_T prompt, u_int32_t flags) { EVENT ev; GS *gp; @@ -351,11 +347,7 @@ alloc_err: * not ours. */ static void -txt_prompt(sp, tp, prompt, flags) - SCR *sp; - TEXT *tp; - ARG_CHAR_T prompt; - u_int32_t flags; +txt_prompt(SCR *sp, TEXT *tp, ARG_CHAR_T prompt, u_int32_t flags) { /* Display the prompt. */ if (LF_ISSET(TXT_PROMPT)) @@ -379,9 +371,7 @@ txt_prompt(sp, tp, prompt, flags) * ranting and raving. This is a fair bit simpler as ^T isn't special. */ static int -txt_dent(sp, tp) - SCR *sp; - TEXT *tp; +txt_dent(SCR *sp, TEXT *tp) { u_long sw, ts; size_t cno, off, scno, spaces, tabs; diff --git a/usr.bin/vi/ex/ex_undo.c b/usr.bin/vi/ex/ex_undo.c index 08579f4dc39..b55ffff3b37 100644 --- a/usr.bin/vi/ex/ex_undo.c +++ b/usr.bin/vi/ex/ex_undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_undo.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_undo.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -28,9 +28,7 @@ * PUBLIC: int ex_undo(SCR *, EXCMD *); */ int -ex_undo(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_undo(SCR *sp, EXCMD *cmdp) { EXF *ep; MARK m; diff --git a/usr.bin/vi/ex/ex_usage.c b/usr.bin/vi/ex/ex_usage.c index bd87fe14e5b..4787bcc1b03 100644 --- a/usr.bin/vi/ex/ex_usage.c +++ b/usr.bin/vi/ex/ex_usage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_usage.c,v 1.7 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_usage.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int ex_help(SCR *, EXCMD *); */ int -ex_help(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_help(SCR *sp, EXCMD *cmdp) { (void)ex_puts(sp, "To see the list of vi commands, enter \":viusage<CR>\"\n"); @@ -55,9 +53,7 @@ ex_help(sp, cmdp) * PUBLIC: int ex_usage(SCR *, EXCMD *); */ int -ex_usage(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_usage(SCR *sp, EXCMD *cmdp) { ARGS *ap; EXCMDLIST const *cp; @@ -138,9 +134,7 @@ ex_usage(sp, cmdp) * PUBLIC: int ex_viusage(SCR *, EXCMD *); */ int -ex_viusage(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_viusage(SCR *sp, EXCMD *cmdp) { VIKEYS const *kp; int key; diff --git a/usr.bin/vi/ex/ex_util.c b/usr.bin/vi/ex/ex_util.c index 0e1e055b4b0..4d0a936b838 100644 --- a/usr.bin/vi/ex/ex_util.c +++ b/usr.bin/vi/ex/ex_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_util.c,v 1.7 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_util.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -32,11 +32,8 @@ * PUBLIC: void ex_cinit(EXCMD *, int, int, recno_t, recno_t, int, ARGS **); */ void -ex_cinit(cmdp, cmd_id, naddr, lno1, lno2, force, ap) - EXCMD *cmdp; - int cmd_id, force, naddr; - recno_t lno1, lno2; - ARGS **ap; +ex_cinit(EXCMD *cmdp, int cmd_id, int naddr, recno_t lno1, recno_t lno2, + int force, ARGS **ap) { memset(cmdp, 0, sizeof(EXCMD)); cmdp->cmd = &cmds[cmd_id]; @@ -58,11 +55,7 @@ ex_cinit(cmdp, cmd_id, naddr, lno1, lno2, force, ap) * PUBLIC: void ex_cadd(EXCMD *, ARGS *, char *, size_t); */ void -ex_cadd(cmdp, ap, arg, len) - EXCMD *cmdp; - ARGS *ap; - char *arg; - size_t len; +ex_cadd(EXCMD *cmdp, ARGS *ap, char *arg, size_t len) { cmdp->argv[cmdp->argc] = ap; ap->bp = arg; @@ -77,10 +70,7 @@ ex_cadd(cmdp, ap, arg, len) * PUBLIC: int ex_getline(SCR *, FILE *, size_t *); */ int -ex_getline(sp, fp, lenp) - SCR *sp; - FILE *fp; - size_t *lenp; +ex_getline(SCR *sp, FILE *fp, size_t *lenp) { EX_PRIVATE *exp; size_t off; @@ -120,9 +110,7 @@ ex_getline(sp, fp, lenp) * PUBLIC: int ex_ncheck(SCR *, int); */ int -ex_ncheck(sp, force) - SCR *sp; - int force; +ex_ncheck(SCR *sp, int force) { char **ap; @@ -151,8 +139,7 @@ ex_ncheck(sp, force) * PUBLIC: int ex_init(SCR *); */ int -ex_init(sp) - SCR *sp; +ex_init(SCR *sp) { GS *gp; @@ -177,10 +164,7 @@ ex_init(sp) * PUBLIC: void ex_emsg(SCR *, char *, exm_t); */ void -ex_emsg(sp, p, which) - SCR *sp; - char *p; - exm_t which; +ex_emsg(SCR *sp, char *p, exm_t which) { switch (which) { case EXM_EMPTYBUF: diff --git a/usr.bin/vi/ex/ex_version.c b/usr.bin/vi/ex/ex_version.c index e1e2128623a..116aee6ad8b 100644 --- a/usr.bin/vi/ex/ex_version.c +++ b/usr.bin/vi/ex/ex_version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_version.c,v 1.9 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_version.c,v 1.10 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -28,9 +28,7 @@ * PUBLIC: int ex_version(SCR *, EXCMD *); */ int -ex_version(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_version(SCR *sp, EXCMD *cmdp) { msgq(sp, M_INFO, VI_VERSION); return (0); diff --git a/usr.bin/vi/ex/ex_visual.c b/usr.bin/vi/ex/ex_visual.c index 5a945474d54..5b5a34eb8ff 100644 --- a/usr.bin/vi/ex/ex_visual.c +++ b/usr.bin/vi/ex/ex_visual.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_visual.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_visual.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int ex_visual(SCR *, EXCMD *); */ int -ex_visual(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_visual(SCR *sp, EXCMD *cmdp) { SCR *tsp; size_t len; diff --git a/usr.bin/vi/ex/ex_write.c b/usr.bin/vi/ex/ex_write.c index 0f21d3132a9..1317849a12e 100644 --- a/usr.bin/vi/ex/ex_write.c +++ b/usr.bin/vi/ex/ex_write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_write.c,v 1.11 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_write.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -37,9 +37,7 @@ static int exwr(SCR *, EXCMD *, enum which); * PUBLIC: int ex_wn(SCR *, EXCMD *); */ int -ex_wn(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_wn(SCR *sp, EXCMD *cmdp) { if (exwr(sp, cmdp, WN)) return (1); @@ -59,9 +57,7 @@ ex_wn(sp, cmdp) * PUBLIC: int ex_wq(SCR *, EXCMD *); */ int -ex_wq(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_wq(SCR *sp, EXCMD *cmdp) { int force; @@ -87,9 +83,7 @@ ex_wq(sp, cmdp) * PUBLIC: int ex_write(SCR *, EXCMD *); */ int -ex_write(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_write(SCR *sp, EXCMD *cmdp) { return (exwr(sp, cmdp, WRITE)); } @@ -102,9 +96,7 @@ ex_write(sp, cmdp) * PUBLIC: int ex_xit(SCR *, EXCMD *); */ int -ex_xit(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_xit(SCR *sp, EXCMD *cmdp) { int force; @@ -129,10 +121,7 @@ ex_xit(sp, cmdp) * The guts of the ex write commands. */ static int -exwr(sp, cmdp, cmd) - SCR *sp; - EXCMD *cmdp; - enum which cmd; +exwr(SCR *sp, EXCMD *cmdp, enum which cmd) { MARK rm; int flags; @@ -275,13 +264,8 @@ exwr(sp, cmdp, cmd) * PUBLIC: char *, FILE *, MARK *, MARK *, u_long *, u_long *, int); */ int -ex_writefp(sp, name, fp, fm, tm, nlno, nch, silent) - SCR *sp; - char *name; - FILE *fp; - MARK *fm, *tm; - u_long *nlno, *nch; - int silent; +ex_writefp(SCR *sp, char *name, FILE *fp, MARK *fm, MARK *tm, u_long *nlno, + u_long *nch, int silent) { struct stat sb; GS *gp; diff --git a/usr.bin/vi/ex/ex_yank.c b/usr.bin/vi/ex/ex_yank.c index 1716d7e1fd2..7936567fef2 100644 --- a/usr.bin/vi/ex/ex_yank.c +++ b/usr.bin/vi/ex/ex_yank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_yank.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_yank.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -27,9 +27,7 @@ * PUBLIC: int ex_yank(SCR *, EXCMD *); */ int -ex_yank(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_yank(SCR *sp, EXCMD *cmdp) { NEEDFILE(sp, cmdp); diff --git a/usr.bin/vi/ex/ex_z.c b/usr.bin/vi/ex/ex_z.c index 1f128216c28..ec91af6a254 100644 --- a/usr.bin/vi/ex/ex_z.c +++ b/usr.bin/vi/ex/ex_z.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_z.c,v 1.6 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: ex_z.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int ex_z(SCR *, EXCMD *); */ int -ex_z(sp, cmdp) - SCR *sp; - EXCMD *cmdp; +ex_z(SCR *sp, EXCMD *cmdp) { MARK mark_abs; recno_t cnt, equals, lno; diff --git a/usr.bin/vi/perl_api/perlsfio.c b/usr.bin/vi/perl_api/perlsfio.c index 05a0ee9b4d4..f76a469c852 100644 --- a/usr.bin/vi/perl_api/perlsfio.c +++ b/usr.bin/vi/perl_api/perlsfio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: perlsfio.c,v 1.4 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: perlsfio.c,v 1.5 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1996 @@ -41,11 +41,7 @@ #define NIL(type) ((type)0) static int -sfnviwrite(f, buf, n, disc) -Sfio_t* f; /* stream involved */ -char* buf; /* buffer to read into */ -int n; /* number of bytes to read */ -Sfdisc_t* disc; /* discipline */ +sfnviwrite(Sfio_t *f, char *buf, int n, Sfdisc_t *disc) { SCR *scrp; @@ -62,8 +58,7 @@ Sfdisc_t* disc; /* discipline */ */ Sfdisc_t * -sfdcnewnvi(scrp) - SCR *scrp; +sfdcnewnvi(SCR *scrp) { Sfdisc_t* disc; diff --git a/usr.bin/vi/vi/getc.c b/usr.bin/vi/vi/getc.c index dc29213ae59..5e08c6b06c2 100644 --- a/usr.bin/vi/vi/getc.c +++ b/usr.bin/vi/vi/getc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getc.c,v 1.8 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: getc.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -41,9 +41,7 @@ * PUBLIC: int cs_init(SCR *, VCS *); */ int -cs_init(sp, csp) - SCR *sp; - VCS *csp; +cs_init(SCR *sp, VCS *csp) { int isempty; @@ -70,9 +68,7 @@ cs_init(sp, csp) * PUBLIC: int cs_next(SCR *, VCS *); */ int -cs_next(sp, csp) - SCR *sp; - VCS *csp; +cs_next(SCR *sp, VCS *csp) { char *p; @@ -122,9 +118,7 @@ cs_next(sp, csp) * PUBLIC: int cs_fspace(SCR *, VCS *); */ int -cs_fspace(sp, csp) - SCR *sp; - VCS *csp; +cs_fspace(SCR *sp, VCS *csp) { if (csp->cs_flags != 0 || !isblank(csp->cs_ch)) return (0); @@ -144,9 +138,7 @@ cs_fspace(sp, csp) * PUBLIC: int cs_fblank(SCR *, VCS *); */ int -cs_fblank(sp, csp) - SCR *sp; - VCS *csp; +cs_fblank(SCR *sp, VCS *csp) { for (;;) { if (cs_next(sp, csp)) @@ -166,9 +158,7 @@ cs_fblank(sp, csp) * PUBLIC: int cs_prev(SCR *, VCS *); */ int -cs_prev(sp, csp) - SCR *sp; - VCS *csp; +cs_prev(SCR *sp, VCS *csp) { switch (csp->cs_flags) { case CS_EMP: /* EMP; get previous line. */ @@ -218,9 +208,7 @@ cs_prev(sp, csp) * PUBLIC: int cs_bblank(SCR *, VCS *); */ int -cs_bblank(sp, csp) - SCR *sp; - VCS *csp; +cs_bblank(SCR *sp, VCS *csp) { for (;;) { if (cs_prev(sp, csp)) diff --git a/usr.bin/vi/vi/v_at.c b/usr.bin/vi/vi/v_at.c index fb777e6895d..004f6cd545c 100644 --- a/usr.bin/vi/vi/v_at.c +++ b/usr.bin/vi/vi/v_at.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_at.c,v 1.8 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: v_at.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_at(SCR *, VICMD *); */ int -v_at(sp, vp) - SCR *sp; - VICMD *vp; +v_at(SCR *sp, VICMD *vp) { CB *cbp; CHAR_T name; diff --git a/usr.bin/vi/vi/v_ch.c b/usr.bin/vi/vi/v_ch.c index f9ca98a6fb6..b823530ea78 100644 --- a/usr.bin/vi/vi/v_ch.c +++ b/usr.bin/vi/vi/v_ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_ch.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: v_ch.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,9 +33,7 @@ static void noprev(SCR *); * PUBLIC: int v_chrepeat(SCR *, VICMD *); */ int -v_chrepeat(sp, vp) - SCR *sp; - VICMD *vp; +v_chrepeat(SCR *sp, VICMD *vp) { vp->character = VIP(sp)->lastckey; @@ -64,9 +62,7 @@ v_chrepeat(sp, vp) * PUBLIC: int v_chrrepeat(SCR *, VICMD *); */ int -v_chrrepeat(sp, vp) - SCR *sp; - VICMD *vp; +v_chrrepeat(SCR *sp, VICMD *vp) { cdir_t savedir; int rval; @@ -105,9 +101,7 @@ v_chrrepeat(sp, vp) * PUBLIC: int v_cht(SCR *, VICMD *); */ int -v_cht(sp, vp) - SCR *sp; - VICMD *vp; +v_cht(SCR *sp, VICMD *vp) { if (v_chf(sp, vp)) return (1); @@ -138,9 +132,7 @@ v_cht(sp, vp) * PUBLIC: int v_chf(SCR *, VICMD *); */ int -v_chf(sp, vp) - SCR *sp; - VICMD *vp; +v_chf(SCR *sp, VICMD *vp) { size_t len; u_long cnt; @@ -196,9 +188,7 @@ empty: notfound(sp, key); * PUBLIC: int v_chT(SCR *, VICMD *); */ int -v_chT(sp, vp) - SCR *sp; - VICMD *vp; +v_chT(SCR *sp, VICMD *vp) { if (v_chF(sp, vp)) return (1); @@ -223,9 +213,7 @@ v_chT(sp, vp) * PUBLIC: int v_chF(SCR *, VICMD *); */ int -v_chF(sp, vp) - SCR *sp; - VICMD *vp; +v_chF(SCR *sp, VICMD *vp) { size_t len; u_long cnt; @@ -278,16 +266,13 @@ empty: notfound(sp, key); } static void -noprev(sp) - SCR *sp; +noprev(SCR *sp) { msgq(sp, M_BERR, "178|No previous F, f, T or t search"); } static void -notfound(sp, ch) - SCR *sp; - ARG_CHAR_T ch; +notfound(SCR *sp, ARG_CHAR_T ch) { msgq(sp, M_BERR, "179|%s not found", KEY_NAME(sp, ch)); } diff --git a/usr.bin/vi/vi/v_delete.c b/usr.bin/vi/vi/v_delete.c index c07eeb9e384..3c9c8c80918 100644 --- a/usr.bin/vi/vi/v_delete.c +++ b/usr.bin/vi/vi/v_delete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_delete.c,v 1.7 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: v_delete.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_delete(SCR *, VICMD *); */ int -v_delete(sp, vp) - SCR *sp; - VICMD *vp; +v_delete(SCR *sp, VICMD *vp) { recno_t nlines; size_t len; diff --git a/usr.bin/vi/vi/v_ex.c b/usr.bin/vi/vi/v_ex.c index 2d1dce24364..d572fea83a0 100644 --- a/usr.bin/vi/vi/v_ex.c +++ b/usr.bin/vi/vi/v_ex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_ex.c,v 1.11 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: v_ex.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -38,9 +38,7 @@ static int v_exec_ex(SCR *, VICMD *, EXCMD *); * PUBLIC: int v_again(SCR *, VICMD *); */ int -v_again(sp, vp) - SCR *sp; - VICMD *vp; +v_again(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -58,9 +56,7 @@ v_again(sp, vp) * PUBLIC: int v_exmode(SCR *, VICMD *); */ int -v_exmode(sp, vp) - SCR *sp; - VICMD *vp; +v_exmode(SCR *sp, VICMD *vp) { GS *gp; @@ -96,9 +92,7 @@ v_exmode(sp, vp) * PUBLIC: int v_join(SCR *, VICMD *); */ int -v_join(sp, vp) - SCR *sp; - VICMD *vp; +v_join(SCR *sp, VICMD *vp) { EXCMD cmd; int lno; @@ -127,9 +121,7 @@ v_join(sp, vp) * PUBLIC: int v_shiftl(SCR *, VICMD *); */ int -v_shiftl(sp, vp) - SCR *sp; - VICMD *vp; +v_shiftl(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -146,9 +138,7 @@ v_shiftl(sp, vp) * PUBLIC: int v_shiftr(SCR *, VICMD *); */ int -v_shiftr(sp, vp) - SCR *sp; - VICMD *vp; +v_shiftr(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -165,9 +155,7 @@ v_shiftr(sp, vp) * PUBLIC: int v_suspend(SCR *, VICMD *); */ int -v_suspend(sp, vp) - SCR *sp; - VICMD *vp; +v_suspend(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -184,9 +172,7 @@ v_suspend(sp, vp) * PUBLIC: int v_switch(SCR *, VICMD *); */ int -v_switch(sp, vp) - SCR *sp; - VICMD *vp; +v_switch(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -223,9 +209,7 @@ v_switch(sp, vp) * PUBLIC: int v_tagpush(SCR *, VICMD *); */ int -v_tagpush(sp, vp) - SCR *sp; - VICMD *vp; +v_tagpush(SCR *sp, VICMD *vp) { ARGS *ap[2], a; EXCMD cmd; @@ -242,9 +226,7 @@ v_tagpush(sp, vp) * PUBLIC: int v_tagpop(SCR *, VICMD *); */ int -v_tagpop(sp, vp) - SCR *sp; - VICMD *vp; +v_tagpop(SCR *sp, VICMD *vp) { EXCMD cmd; @@ -259,9 +241,7 @@ v_tagpop(sp, vp) * PUBLIC: int v_filter(SCR *, VICMD *); */ int -v_filter(sp, vp) - SCR *sp; - VICMD *vp; +v_filter(SCR *sp, VICMD *vp) { EXCMD cmd; TEXT *tp; @@ -337,9 +317,7 @@ v_filter(sp, vp) * PUBLIC: int v_event_exec(SCR *, VICMD *); */ int -v_event_exec(sp, vp) - SCR *sp; - VICMD *vp; +v_event_exec(SCR *sp, VICMD *vp) { EXCMD cmd; @@ -361,10 +339,7 @@ v_event_exec(sp, vp) * Execute an ex command. */ static int -v_exec_ex(sp, vp, exp) - SCR *sp; - VICMD *vp; - EXCMD *exp; +v_exec_ex(SCR *sp, VICMD *vp, EXCMD *exp) { int rval; @@ -379,9 +354,7 @@ v_exec_ex(sp, vp, exp) * PUBLIC: int v_ex(SCR *, VICMD *); */ int -v_ex(sp, vp) - SCR *sp; - VICMD *vp; +v_ex(SCR *sp, VICMD *vp) { GS *gp; TEXT *tp; @@ -505,9 +478,7 @@ v_ex(sp, vp) * Cleanup from an ex command. */ static int -v_ex_done(sp, vp) - SCR *sp; - VICMD *vp; +v_ex_done(SCR *sp, VICMD *vp) { size_t len; @@ -549,8 +520,7 @@ v_ex_done(sp, vp) * Start an edit window on the colon command-line commands. */ static int -v_ecl(sp) - SCR *sp; +v_ecl(SCR *sp) { GS *gp; SCR *new; @@ -599,8 +569,7 @@ v_ecl(sp) * PUBLIC: int v_ecl_exec(SCR *); */ int -v_ecl_exec(sp) - SCR *sp; +v_ecl_exec(SCR *sp) { size_t len; char *p; @@ -629,9 +598,7 @@ v_ecl_exec(sp) * Log a command into the colon command-line log file. */ static int -v_ecl_log(sp, tp) - SCR *sp; - TEXT *tp; +v_ecl_log(SCR *sp, TEXT *tp) { EXF *save_ep; recno_t lno; @@ -670,8 +637,7 @@ v_ecl_log(sp, tp) * Initialize the colon command-line log file. */ static int -v_ecl_init(sp) - SCR *sp; +v_ecl_init(SCR *sp) { FREF *frp; GS *gp; diff --git a/usr.bin/vi/vi/v_increment.c b/usr.bin/vi/vi/v_increment.c index 95f5ed5a7b4..f4e946164bd 100644 --- a/usr.bin/vi/vi/v_increment.c +++ b/usr.bin/vi/vi/v_increment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_increment.c,v 1.7 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: v_increment.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -48,9 +48,7 @@ static void inc_err(SCR *, enum nresult); * PUBLIC: int v_increment(SCR *, VICMD *); */ int -v_increment(sp, vp) - SCR *sp; - VICMD *vp; +v_increment(SCR *sp, VICMD *vp) { enum nresult nret; u_long ulval; @@ -249,9 +247,7 @@ err: rval = 1; } static void -inc_err(sp, nret) - SCR *sp; - enum nresult nret; +inc_err(SCR *sp, enum nresult nret) { switch (nret) { case NUM_ERR: diff --git a/usr.bin/vi/vi/v_init.c b/usr.bin/vi/vi/v_init.c index 6f201483ec2..6b30dbd5a46 100644 --- a/usr.bin/vi/vi/v_init.c +++ b/usr.bin/vi/vi/v_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_init.c,v 1.5 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: v_init.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,8 +32,7 @@ * PUBLIC: int v_screen_copy(SCR *, SCR *); */ int -v_screen_copy(orig, sp) - SCR *orig, *sp; +v_screen_copy(SCR *orig, SCR *sp) { VI_PRIVATE *ovip, *nvip; @@ -76,8 +75,7 @@ v_screen_copy(orig, sp) * PUBLIC: int v_screen_end(SCR *); */ int -v_screen_end(sp) - SCR *sp; +v_screen_end(SCR *sp) { VI_PRIVATE *vip; @@ -106,11 +104,7 @@ v_screen_end(sp) * PUBLIC: int v_optchange(SCR *, int, char *, u_long *); */ int -v_optchange(sp, offset, str, valp) - SCR *sp; - int offset; - char *str; - u_long *valp; +v_optchange(SCR *sp, int offset, char *str, u_long *valp) { switch (offset) { case O_PARAGRAPHS: diff --git a/usr.bin/vi/vi/v_itxt.c b/usr.bin/vi/vi/v_itxt.c index 748f42da389..fa6f6fb93ef 100644 --- a/usr.bin/vi/vi/v_itxt.c +++ b/usr.bin/vi/vi/v_itxt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_itxt.c,v 1.7 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_itxt.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -64,9 +64,7 @@ static u_int32_t set_txt_std(SCR *, VICMD *, u_int32_t); * PUBLIC: int v_iA(SCR *, VICMD *); */ int -v_iA(sp, vp) - SCR *sp; - VICMD *vp; +v_iA(SCR *sp, VICMD *vp) { size_t len; @@ -86,9 +84,7 @@ v_iA(sp, vp) * PUBLIC: int v_ia(SCR *, VICMD *); */ int -v_ia(sp, vp) - SCR *sp; - VICMD *vp; +v_ia(SCR *sp, VICMD *vp) { size_t len; u_int32_t flags; @@ -125,9 +121,7 @@ v_ia(sp, vp) * PUBLIC: int v_iI(SCR *, VICMD *); */ int -v_iI(sp, vp) - SCR *sp; - VICMD *vp; +v_iI(SCR *sp, VICMD *vp) { sp->cno = 0; if (nonblank(sp, vp->m_start.lno, &sp->cno)) @@ -146,9 +140,7 @@ v_iI(sp, vp) * PUBLIC: int v_ii(SCR *, VICMD *); */ int -v_ii(sp, vp) - SCR *sp; - VICMD *vp; +v_ii(SCR *sp, VICMD *vp) { size_t len; u_int32_t flags; @@ -181,9 +173,7 @@ static int io(SCR *, VICMD *, enum which); * PUBLIC: int v_iO(SCR *, VICMD *); */ int -v_iO(sp, vp) - SCR *sp; - VICMD *vp; +v_iO(SCR *sp, VICMD *vp) { return (io(sp, vp, O_cmd)); } @@ -195,18 +185,13 @@ v_iO(sp, vp) * PUBLIC: int v_io(SCR *, VICMD *); */ int -v_io(sp, vp) - SCR *sp; - VICMD *vp; +v_io(SCR *sp, VICMD *vp) { return (io(sp, vp, o_cmd)); } static int -io(sp, vp, cmd) - SCR *sp; - VICMD *vp; - enum which cmd; +io(SCR *sp, VICMD *vp, enum which cmd) { recno_t ai_line, lno; size_t len; @@ -256,9 +241,7 @@ insert: p = ""; * PUBLIC: int v_change(SCR *, VICMD *); */ int -v_change(sp, vp) - SCR *sp; - VICMD *vp; +v_change(SCR *sp, VICMD *vp) { size_t blen, len; u_int32_t flags; @@ -397,9 +380,7 @@ v_change(sp, vp) * PUBLIC: int v_Replace(SCR *, VICMD *); */ int -v_Replace(sp, vp) - SCR *sp; - VICMD *vp; +v_Replace(SCR *sp, VICMD *vp) { size_t len; u_int32_t flags; @@ -433,9 +414,7 @@ v_Replace(sp, vp) * PUBLIC: int v_subst(SCR *, VICMD *); */ int -v_subst(sp, vp) - SCR *sp; - VICMD *vp; +v_subst(SCR *sp, VICMD *vp) { size_t len; u_int32_t flags; @@ -475,10 +454,7 @@ v_subst(sp, vp) * Initialize text processing flags. */ static u_int32_t -set_txt_std(sp, vp, flags) - SCR *sp; - VICMD *vp; - u_int32_t flags; +set_txt_std(SCR *sp, VICMD *vp, u_int32_t flags) { LF_SET(TXT_CNTRLT | TXT_ESCAPE | TXT_MAPINPUT | TXT_RECORD | TXT_RESOLVE); diff --git a/usr.bin/vi/vi/v_left.c b/usr.bin/vi/vi/v_left.c index 196d7d47388..10e4f086a15 100644 --- a/usr.bin/vi/vi/v_left.c +++ b/usr.bin/vi/vi/v_left.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_left.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_left.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_left(SCR *, VICMD *); */ int -v_left(sp, vp) - SCR *sp; - VICMD *vp; +v_left(SCR *sp, VICMD *vp) { recno_t cnt; @@ -69,9 +67,7 @@ v_left(sp, vp) * PUBLIC: int v_cfirst(SCR *, VICMD *); */ int -v_cfirst(sp, vp) - SCR *sp; - VICMD *vp; +v_cfirst(SCR *sp, VICMD *vp) { recno_t cnt, lno; @@ -138,9 +134,7 @@ v_cfirst(sp, vp) * PUBLIC: int v_first(SCR *, VICMD *); */ int -v_first(sp, vp) - SCR *sp; - VICMD *vp; +v_first(SCR *sp, VICMD *vp) { /* * !!! @@ -202,9 +196,7 @@ v_first(sp, vp) * PUBLIC: int v_ncol(SCR *, VICMD *); */ int -v_ncol(sp, vp) - SCR *sp; - VICMD *vp; +v_ncol(SCR *sp, VICMD *vp) { if (F_ISSET(vp, VC_C1SET) && vp->count > 1) { --vp->count; @@ -264,9 +256,7 @@ v_ncol(sp, vp) * PUBLIC: int v_zero(SCR *, VICMD *); */ int -v_zero(sp, vp) - SCR *sp; - VICMD *vp; +v_zero(SCR *sp, VICMD *vp) { /* * !!! diff --git a/usr.bin/vi/vi/v_mark.c b/usr.bin/vi/vi/v_mark.c index 8fa292ca8e0..a2d7decf1c1 100644 --- a/usr.bin/vi/vi/v_mark.c +++ b/usr.bin/vi/vi/v_mark.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_mark.c,v 1.8 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_mark.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_mark(SCR *, VICMD *); */ int -v_mark(sp, vp) - SCR *sp; - VICMD *vp; +v_mark(SCR *sp, VICMD *vp) { return (mark_set(sp, vp->character, &vp->m_start, 1)); } @@ -57,9 +55,7 @@ static int mark(SCR *, VICMD *, enum which); * PUBLIC: int v_bmark(SCR *, VICMD *); */ int -v_bmark(sp, vp) - SCR *sp; - VICMD *vp; +v_bmark(SCR *sp, VICMD *vp) { return (mark(sp, vp, BQMARK)); } @@ -73,9 +69,7 @@ v_bmark(sp, vp) * PUBLIC: int v_fmark(SCR *, VICMD *); */ int -v_fmark(sp, vp) - SCR *sp; - VICMD *vp; +v_fmark(SCR *sp, VICMD *vp) { return (mark(sp, vp, FQMARK)); } @@ -85,10 +79,7 @@ v_fmark(sp, vp) * Mark commands. */ static int -mark(sp, vp, cmd) - SCR *sp; - VICMD *vp; - enum which cmd; +mark(SCR *sp, VICMD *vp, enum which cmd) { MARK m; size_t len; diff --git a/usr.bin/vi/vi/v_match.c b/usr.bin/vi/vi/v_match.c index b9eccd5f2a8..2b7062ce9ae 100644 --- a/usr.bin/vi/vi/v_match.c +++ b/usr.bin/vi/vi/v_match.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_match.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_match.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_match(SCR *, VICMD *); */ int -v_match(sp, vp) - SCR *sp; - VICMD *vp; +v_match(SCR *sp, VICMD *vp) { VCS cs; MARK *mp; diff --git a/usr.bin/vi/vi/v_paragraph.c b/usr.bin/vi/vi/v_paragraph.c index 56449327f59..9ffe281220d 100644 --- a/usr.bin/vi/vi/v_paragraph.c +++ b/usr.bin/vi/vi/v_paragraph.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_paragraph.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_paragraph.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -62,9 +62,7 @@ * PUBLIC: int v_paragraphf(SCR *, VICMD *); */ int -v_paragraphf(sp, vp) - SCR *sp; - VICMD *vp; +v_paragraphf(SCR *sp, VICMD *vp) { enum { P_INTEXT, P_INBLANK } pstate; size_t lastlen, len; @@ -202,9 +200,7 @@ eof: if (vp->m_start.lno == lno || vp->m_start.lno == lno - 1) { * PUBLIC: int v_paragraphb(SCR *, VICMD *); */ int -v_paragraphb(sp, vp) - SCR *sp; - VICMD *vp; +v_paragraphb(SCR *sp, VICMD *vp) { enum { P_INTEXT, P_INBLANK } pstate; size_t len; @@ -311,9 +307,7 @@ found: vp->m_stop.lno = lno; * PUBLIC: int v_buildps(SCR *, char *, char *); */ int -v_buildps(sp, p_p, s_p) - SCR *sp; - char *p_p, *s_p; +v_buildps(SCR *sp, char *p_p, char *s_p) { VI_PRIVATE *vip; size_t p_len, s_len; diff --git a/usr.bin/vi/vi/v_put.c b/usr.bin/vi/vi/v_put.c index e7a78c21ed2..05afda22f56 100644 --- a/usr.bin/vi/vi/v_put.c +++ b/usr.bin/vi/vi/v_put.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_put.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_put.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -31,9 +31,7 @@ static void inc_buf(SCR *, VICMD *); * PUBLIC: int v_Put(SCR *, VICMD *); */ int -v_Put(sp, vp) - SCR *sp; - VICMD *vp; +v_Put(SCR *sp, VICMD *vp) { u_long cnt; @@ -64,9 +62,7 @@ v_Put(sp, vp) * PUBLIC: int v_put(SCR *, VICMD *); */ int -v_put(sp, vp) - SCR *sp; - VICMD *vp; +v_put(SCR *sp, VICMD *vp) { u_long cnt; @@ -106,9 +102,7 @@ v_put(sp, vp) * the buffer increment gets done regardless of the success of the put. */ static void -inc_buf(sp, vp) - SCR *sp; - VICMD *vp; +inc_buf(SCR *sp, VICMD *vp) { CHAR_T v; diff --git a/usr.bin/vi/vi/v_redraw.c b/usr.bin/vi/vi/v_redraw.c index eeea87d8c65..dad58453d2f 100644 --- a/usr.bin/vi/vi/v_redraw.c +++ b/usr.bin/vi/vi/v_redraw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_redraw.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_redraw.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_redraw(SCR *, VICMD *); */ int -v_redraw(sp, vp) - SCR *sp; - VICMD *vp; +v_redraw(SCR *sp, VICMD *vp) { return (sp->gp->scr_refresh(sp, 1)); } diff --git a/usr.bin/vi/vi/v_replace.c b/usr.bin/vi/vi/v_replace.c index 47dcb292282..6b78d369efa 100644 --- a/usr.bin/vi/vi/v_replace.c +++ b/usr.bin/vi/vi/v_replace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_replace.c,v 1.7 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_replace.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -41,9 +41,7 @@ * PUBLIC: int v_replace(SCR *, VICMD *); */ int -v_replace(sp, vp) - SCR *sp; - VICMD *vp; +v_replace(SCR *sp, VICMD *vp) { EVENT ev; VI_PRIVATE *vip; diff --git a/usr.bin/vi/vi/v_right.c b/usr.bin/vi/vi/v_right.c index 9633a099d56..779df3ac3a8 100644 --- a/usr.bin/vi/vi/v_right.c +++ b/usr.bin/vi/vi/v_right.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_right.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_right.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_right(SCR *, VICMD *); */ int -v_right(sp, vp) - SCR *sp; - VICMD *vp; +v_right(SCR *sp, VICMD *vp) { size_t len; int isempty; @@ -81,9 +79,7 @@ eol: v_eol(sp, NULL); * PUBLIC: int v_dollar(SCR *, VICMD *); */ int -v_dollar(sp, vp) - SCR *sp; - VICMD *vp; +v_dollar(SCR *sp, VICMD *vp) { size_t len; int isempty; diff --git a/usr.bin/vi/vi/v_screen.c b/usr.bin/vi/vi/v_screen.c index 8b048c74702..d4fce68d1b5 100644 --- a/usr.bin/vi/vi/v_screen.c +++ b/usr.bin/vi/vi/v_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_screen.c,v 1.7 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: v_screen.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_screen(SCR *, VICMD *); */ int -v_screen(sp, vp) - SCR *sp; - VICMD *vp; +v_screen(SCR *sp, VICMD *vp) { /* * You can't leave a colon command-line edit window -- it's not that diff --git a/usr.bin/vi/vi/v_scroll.c b/usr.bin/vi/vi/v_scroll.c index baa49f286ff..5ecdb944834 100644 --- a/usr.bin/vi/vi/v_scroll.c +++ b/usr.bin/vi/vi/v_scroll.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_scroll.c,v 1.8 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_scroll.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -65,9 +65,7 @@ static void goto_adjust(VICMD *); * PUBLIC: int v_lgoto(SCR *, VICMD *); */ int -v_lgoto(sp, vp) - SCR *sp; - VICMD *vp; +v_lgoto(SCR *sp, VICMD *vp) { recno_t nlines; @@ -104,9 +102,7 @@ v_lgoto(sp, vp) * PUBLIC: int v_home(SCR *, VICMD *); */ int -v_home(sp, vp) - SCR *sp; - VICMD *vp; +v_home(SCR *sp, VICMD *vp) { if (vs_sm_position(sp, &vp->m_stop, F_ISSET(vp, VC_C1SET) ? vp->count - 1 : 0, P_TOP)) @@ -123,9 +119,7 @@ v_home(sp, vp) * PUBLIC: int v_middle(SCR *, VICMD *); */ int -v_middle(sp, vp) - SCR *sp; - VICMD *vp; +v_middle(SCR *sp, VICMD *vp) { /* * Yielding to none in our quest for compatibility with every @@ -146,9 +140,7 @@ v_middle(sp, vp) * PUBLIC: int v_bottom(SCR *, VICMD *); */ int -v_bottom(sp, vp) - SCR *sp; - VICMD *vp; +v_bottom(SCR *sp, VICMD *vp) { if (vs_sm_position(sp, &vp->m_stop, F_ISSET(vp, VC_C1SET) ? vp->count - 1 : 0, P_BOTTOM)) @@ -158,8 +150,7 @@ v_bottom(sp, vp) } static void -goto_adjust(vp) - VICMD *vp; +goto_adjust(VICMD *vp) { /* Guess that it's the end of the range. */ vp->m_final = vp->m_stop; @@ -212,9 +203,7 @@ goto_adjust(vp) * PUBLIC: int v_up(SCR *, VICMD *); */ int -v_up(sp, vp) - SCR *sp; - VICMD *vp; +v_up(SCR *sp, VICMD *vp) { recno_t lno; @@ -236,9 +225,7 @@ v_up(sp, vp) * PUBLIC: int v_cr(SCR *, VICMD *); */ int -v_cr(sp, vp) - SCR *sp; - VICMD *vp; +v_cr(SCR *sp, VICMD *vp) { /* If it's a colon command-line edit window, it's an ex command. */ if (F_ISSET(sp, SC_COMEDIT)) @@ -259,9 +246,7 @@ v_cr(sp, vp) * PUBLIC: int v_down(SCR *, VICMD *); */ int -v_down(sp, vp) - SCR *sp; - VICMD *vp; +v_down(SCR *sp, VICMD *vp) { recno_t lno; @@ -282,9 +267,7 @@ v_down(sp, vp) * PUBLIC: int v_hpageup(SCR *, VICMD *); */ int -v_hpageup(sp, vp) - SCR *sp; - VICMD *vp; +v_hpageup(SCR *sp, VICMD *vp) { /* * Half screens always succeed unless already at SOF. @@ -308,9 +291,7 @@ v_hpageup(sp, vp) * PUBLIC: int v_hpagedown(SCR *, VICMD *); */ int -v_hpagedown(sp, vp) - SCR *sp; - VICMD *vp; +v_hpagedown(SCR *sp, VICMD *vp) { /* * Half screens always succeed unless already at EOF. @@ -338,9 +319,7 @@ v_hpagedown(sp, vp) * PUBLIC: int v_pagedown(SCR *, VICMD *); */ int -v_pagedown(sp, vp) - SCR *sp; - VICMD *vp; +v_pagedown(SCR *sp, VICMD *vp) { recno_t offset; @@ -386,9 +365,7 @@ v_pagedown(sp, vp) * PUBLIC: int v_pageup(SCR *, VICMD *); */ int -v_pageup(sp, vp) - SCR *sp; - VICMD *vp; +v_pageup(SCR *sp, VICMD *vp) { recno_t offset; @@ -434,9 +411,7 @@ v_pageup(sp, vp) * PUBLIC: int v_lineup(SCR *, VICMD *); */ int -v_lineup(sp, vp) - SCR *sp; - VICMD *vp; +v_lineup(SCR *sp, VICMD *vp) { /* * The cursor moves down, staying with its original line, unless it @@ -456,9 +431,7 @@ v_lineup(sp, vp) * PUBLIC: int v_linedown(SCR *, VICMD *); */ int -v_linedown(sp, vp) - SCR *sp; - VICMD *vp; +v_linedown(SCR *sp, VICMD *vp) { /* * The cursor moves up, staying with its original line, unless it diff --git a/usr.bin/vi/vi/v_search.c b/usr.bin/vi/vi/v_search.c index 388a5b234a0..727e556deec 100644 --- a/usr.bin/vi/vi/v_search.c +++ b/usr.bin/vi/vi/v_search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_search.c,v 1.12 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: v_search.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -36,9 +36,7 @@ static int v_search(SCR *, VICMD *, char *, size_t, u_int, dir_t); * PUBLIC: int v_searchb(SCR *, VICMD *); */ int -v_searchb(sp, vp) - SCR *sp; - VICMD *vp; +v_searchb(SCR *sp, VICMD *vp) { return (v_exaddr(sp, vp, BACKWARD)); } @@ -50,9 +48,7 @@ v_searchb(sp, vp) * PUBLIC: int v_searchf(SCR *, VICMD *); */ int -v_searchf(sp, vp) - SCR *sp; - VICMD *vp; +v_searchf(SCR *sp, VICMD *vp) { return (v_exaddr(sp, vp, FORWARD)); } @@ -62,10 +58,7 @@ v_searchf(sp, vp) * Do a vi search (which is really an ex address). */ static int -v_exaddr(sp, vp, dir) - SCR *sp; - VICMD *vp; - dir_t dir; +v_exaddr(SCR *sp, VICMD *vp, dir_t dir) { static EXCMDLIST fake = { "search" }; EXCMD *cmdp; @@ -284,9 +277,7 @@ err2: vp->m_final.lno = s_lno; * PUBLIC: int v_searchN(SCR *, VICMD *); */ int -v_searchN(sp, vp) - SCR *sp; - VICMD *vp; +v_searchN(SCR *sp, VICMD *vp) { dir_t dir; @@ -311,9 +302,7 @@ v_searchN(sp, vp) * PUBLIC: int v_searchn(SCR *, VICMD *); */ int -v_searchn(sp, vp) - SCR *sp; - VICMD *vp; +v_searchn(SCR *sp, VICMD *vp) { return (v_search(sp, vp, NULL, 0, SEARCH_PARSE, sp->searchdir)); } @@ -325,9 +314,7 @@ v_searchn(sp, vp) * PUBLIC: int v_searchw(SCR *, VICMD *); */ int -v_searchw(sp, vp) - SCR *sp; - VICMD *vp; +v_searchw(SCR *sp, VICMD *vp) { size_t blen, len; int rval; @@ -350,13 +337,7 @@ v_searchw(sp, vp) * The search commands. */ static int -v_search(sp, vp, ptrn, plen, flags, dir) - SCR *sp; - VICMD *vp; - u_int flags; - char *ptrn; - size_t plen; - dir_t dir; +v_search(SCR *sp, VICMD *vp, char *ptrn, size_t plen, u_int flags, dir_t dir) { /* Display messages. */ LF_SET(SEARCH_MSG); @@ -419,10 +400,7 @@ v_search(sp, vp, ptrn, plen, flags, dir) * PUBLIC: int v_correct(SCR *, VICMD *, int); */ int -v_correct(sp, vp, isdelta) - SCR *sp; - VICMD *vp; - int isdelta; +v_correct(SCR *sp, VICMD *vp, int isdelta) { MARK m; size_t len; diff --git a/usr.bin/vi/vi/v_section.c b/usr.bin/vi/vi/v_section.c index 503eff98c98..9f82754944a 100644 --- a/usr.bin/vi/vi/v_section.c +++ b/usr.bin/vi/vi/v_section.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_section.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_section.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -60,9 +60,7 @@ * PUBLIC: int v_sectionf(SCR *, VICMD *); */ int -v_sectionf(sp, vp) - SCR *sp; - VICMD *vp; +v_sectionf(SCR *sp, VICMD *vp) { recno_t cnt, lno; size_t len; @@ -169,9 +167,7 @@ ret2: if (ISMOTION(vp)) { * PUBLIC: int v_sectionb(SCR *, VICMD *); */ int -v_sectionb(sp, vp) - SCR *sp; - VICMD *vp; +v_sectionb(SCR *sp, VICMD *vp) { size_t len; recno_t cnt, lno; diff --git a/usr.bin/vi/vi/v_sentence.c b/usr.bin/vi/vi/v_sentence.c index caf02196331..64b62de62a0 100644 --- a/usr.bin/vi/vi/v_sentence.c +++ b/usr.bin/vi/vi/v_sentence.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_sentence.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_sentence.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -50,9 +50,7 @@ * PUBLIC: int v_sentencef(SCR *, VICMD *); */ int -v_sentencef(sp, vp) - SCR *sp; - VICMD *vp; +v_sentencef(SCR *sp, VICMD *vp) { enum { BLANK, NONE, PERIOD } state; VCS cs; @@ -191,9 +189,7 @@ okret: vp->m_stop.lno = cs.cs_lno; * PUBLIC: int v_sentenceb(SCR *, VICMD *); */ int -v_sentenceb(sp, vp) - SCR *sp; - VICMD *vp; +v_sentenceb(SCR *sp, VICMD *vp) { VCS cs; recno_t slno; diff --git a/usr.bin/vi/vi/v_status.c b/usr.bin/vi/vi/v_status.c index cba61738844..30f4c28bf75 100644 --- a/usr.bin/vi/vi/v_status.c +++ b/usr.bin/vi/vi/v_status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_status.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_status.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_status(SCR *, VICMD *); */ int -v_status(sp, vp) - SCR *sp; - VICMD *vp; +v_status(SCR *sp, VICMD *vp) { (void)msgq_status(sp, vp->m_start.lno, MSTAT_SHOWLAST); return (0); diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c index fa3d6517e37..c74b20a8c80 100644 --- a/usr.bin/vi/vi/v_txt.c +++ b/usr.bin/vi/vi/v_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_txt.c,v 1.26 2013/11/26 16:38:57 krw Exp $ */ +/* $OpenBSD: v_txt.c,v 1.27 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -61,11 +61,7 @@ static void txt_unmap(SCR *, TEXT *, u_int32_t *); * PUBLIC: int v_tcmd(SCR *, VICMD *, ARG_CHAR_T, u_int); */ int -v_tcmd(sp, vp, prompt, flags) - SCR *sp; - VICMD *vp; - ARG_CHAR_T prompt; - u_int flags; +v_tcmd(SCR *sp, VICMD *vp, ARG_CHAR_T prompt, u_int flags) { /* Normally, we end up where we started. */ vp->m_final.lno = sp->lno; @@ -116,8 +112,7 @@ v_tcmd(sp, vp, prompt, flags) * Initialize the screen map for colon command-line input. */ static int -txt_map_init(sp) - SCR *sp; +txt_map_init(SCR *sp) { SMAP *esmp; VI_PRIVATE *vip; @@ -169,8 +164,7 @@ txt_map_init(sp) * Reset the screen map for colon command-line input. */ static int -txt_map_end(sp) - SCR *sp; +txt_map_end(SCR *sp) { VI_PRIVATE *vip; size_t cnt; @@ -243,16 +237,8 @@ txt_map_end(sp) * PUBLIC: const char *, size_t, ARG_CHAR_T, recno_t, u_long, u_int32_t); */ int -v_txt(sp, vp, tm, lp, len, prompt, ai_line, rcount, flags) - SCR *sp; - VICMD *vp; - MARK *tm; /* To MARK. */ - const char *lp; /* Input line. */ - size_t len; /* Input line length. */ - ARG_CHAR_T prompt; /* Prompt to display. */ - recno_t ai_line; /* Line number to use for autoindent count. */ - u_long rcount; /* Replay count. */ - u_int32_t flags; /* TXT_* flags. */ +v_txt(SCR *sp, VICMD *vp, MARK *tm, const char *lp, size_t len, + ARG_CHAR_T prompt, recno_t ai_line, u_long rcount, u_int32_t flags) { EVENT ev, *evp = NULL; /* Current event. */ EVENT fc; /* File name completion event. */ @@ -1480,11 +1466,8 @@ alloc_err: * Handle abbreviations. */ static int -txt_abbrev(sp, tp, pushcp, isinfoline, didsubp, turnoffp) - SCR *sp; - TEXT *tp; - CHAR_T *pushcp; - int isinfoline, *didsubp, *turnoffp; +txt_abbrev(SCR *sp, TEXT *tp, CHAR_T *pushcp, int isinfoline, int *didsubp, + int *turnoffp) { CHAR_T ch, *p; SEQ *qp; @@ -1648,10 +1631,7 @@ search: if (isinfoline) { * Handle the unmap command. */ static void -txt_unmap(sp, tp, ec_flagsp) - SCR *sp; - TEXT *tp; - u_int32_t *ec_flagsp; +txt_unmap(SCR *sp, TEXT *tp, u_int32_t *ec_flagsp) { size_t len, off; char *p; @@ -1691,10 +1671,7 @@ txt_unmap(sp, tp, ec_flagsp) * When a line is resolved by <esc>, review autoindent characters. */ static void -txt_ai_resolve(sp, tp, changedp) - SCR *sp; - TEXT *tp; - int *changedp; +txt_ai_resolve(SCR *sp, TEXT *tp, int *changedp) { u_long ts; int del; @@ -1781,11 +1758,7 @@ txt_ai_resolve(sp, tp, changedp) * PUBLIC: int v_txt_auto(SCR *, recno_t, TEXT *, size_t, TEXT *); */ int -v_txt_auto(sp, lno, aitp, len, tp) - SCR *sp; - recno_t lno; - TEXT *aitp, *tp; - size_t len; +v_txt_auto(SCR *sp, recno_t lno, TEXT *aitp, size_t len, TEXT *tp) { size_t nlen; char *p, *t; @@ -1835,11 +1808,7 @@ v_txt_auto(sp, lno, aitp, len, tp) * Back up to the previously edited line. */ static TEXT * -txt_backup(sp, tiqh, tp, flagsp) - SCR *sp; - TEXTH *tiqh; - TEXT *tp; - u_int32_t *flagsp; +txt_backup(SCR *sp, TEXTH *tiqh, TEXT *tp, u_int32_t *flagsp) { TEXT *ntp; @@ -1912,10 +1881,7 @@ txt_backup(sp, tiqh, tp, flagsp) * changes. */ static int -txt_dent(sp, tp, isindent) - SCR *sp; - TEXT *tp; - int isindent; +txt_dent(SCR *sp, TEXT *tp, int isindent) { CHAR_T ch; u_long sw, ts; @@ -2016,10 +1982,7 @@ txt_dent(sp, tp, isindent) * File name completion. */ static int -txt_fc(sp, tp, redrawp) - SCR *sp; - TEXT *tp; - int *redrawp; +txt_fc(SCR *sp, TEXT *tp, int *redrawp) { struct stat sb; ARGS **argv; @@ -2172,10 +2135,7 @@ isdir: if (tp->owrite == 0) { * Display file names for file name completion. */ static int -txt_fc_col(sp, argc, argv) - SCR *sp; - int argc; - ARGS **argv; +txt_fc_col(SCR *sp, int argc, ARGS **argv) { ARGS **av; CHAR_T *p; @@ -2284,10 +2244,7 @@ intr: F_CLR(gp, G_INTERRUPTED); * Set the end mark on the line. */ static int -txt_emark(sp, tp, cno) - SCR *sp; - TEXT *tp; - size_t cno; +txt_emark(SCR *sp, TEXT *tp, size_t cno) { CHAR_T ch, *kp; size_t chlen, nlen, olen; @@ -2337,9 +2294,7 @@ txt_emark(sp, tp, cno) * Handle an error during input processing. */ static void -txt_err(sp, tiqh) - SCR *sp; - TEXTH *tiqh; +txt_err(SCR *sp, TEXTH *tiqh) { recno_t lno; @@ -2372,9 +2327,7 @@ txt_err(sp, tiqh) * may not be able to enter. */ static int -txt_hex(sp, tp) - SCR *sp; - TEXT *tp; +txt_hex(SCR *sp, TEXT *tp) { CHAR_T savec; size_t len, off; @@ -2452,11 +2405,7 @@ nothex: tp->lb[tp->cno] = savec; * of the screen space they require, but that it not overwrite other characters. */ static int -txt_insch(sp, tp, chp, flags) - SCR *sp; - TEXT *tp; - CHAR_T *chp; - u_int flags; +txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp, u_int flags) { CHAR_T *kp, savech; size_t chlen, cno, copydown, olen, nlen; @@ -2568,11 +2517,7 @@ txt_insch(sp, tp, chp, flags) * Do an incremental search. */ static int -txt_isrch(sp, vp, tp, is_flagsp) - SCR *sp; - VICMD *vp; - TEXT *tp; - u_int8_t *is_flagsp; +txt_isrch(SCR *sp, VICMD *vp, TEXT *tp, u_int8_t *is_flagsp) { MARK start; recno_t lno; @@ -2692,10 +2637,7 @@ txt_isrch(sp, vp, tp, is_flagsp) * Resolve the input text chain into the file. */ static int -txt_resolve(sp, tiqh, flags) - SCR *sp; - TEXTH *tiqh; - u_int32_t flags; +txt_resolve(SCR *sp, TEXTH *tiqh, u_int32_t flags) { TEXT *tp; recno_t lno; @@ -2747,9 +2689,7 @@ txt_resolve(sp, tiqh, flags) * I think not. */ static int -txt_showmatch(sp, tp) - SCR *sp; - TEXT *tp; +txt_showmatch(SCR *sp, TEXT *tp) { VCS cs; MARK m; @@ -2813,11 +2753,7 @@ txt_showmatch(sp, tp) * Handle margin wrap. */ static int -txt_margin(sp, tp, wmtp, didbreak, flags) - SCR *sp; - TEXT *tp, *wmtp; - int *didbreak; - u_int32_t flags; +txt_margin(SCR *sp, TEXT *tp, TEXT *wmtp, int *didbreak, u_int32_t flags) { size_t len, off; char *p; @@ -2889,11 +2825,7 @@ txt_margin(sp, tp, wmtp, didbreak, flags) * Resolve the input line for the 'R' command. */ static void -txt_Rresolve(sp, tiqh, tp, orig_len) - SCR *sp; - TEXTH *tiqh; - TEXT *tp; - const size_t orig_len; +txt_Rresolve(SCR *sp, TEXTH *tiqh, TEXT *tp, const size_t orig_len) { TEXT *ttp; size_t input_len, retain; @@ -2946,8 +2878,7 @@ txt_Rresolve(sp, tiqh, tp, orig_len) * No more characters message. */ static void -txt_nomorech(sp) - SCR *sp; +txt_nomorech(SCR *sp) { msgq(sp, M_BERR, "194|No more characters to erase"); } diff --git a/usr.bin/vi/vi/v_ulcase.c b/usr.bin/vi/vi/v_ulcase.c index 653710d71f8..4f1ccbd2187 100644 --- a/usr.bin/vi/vi/v_ulcase.c +++ b/usr.bin/vi/vi/v_ulcase.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_ulcase.c,v 1.7 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_ulcase.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -45,9 +45,7 @@ static int ulcase(SCR *, recno_t, CHAR_T *, size_t, size_t, size_t); * PUBLIC: int v_ulcase(SCR *, VICMD *); */ int -v_ulcase(sp, vp) - SCR *sp; - VICMD *vp; +v_ulcase(SCR *sp, VICMD *vp) { recno_t lno; size_t cno, lcnt, len; @@ -105,9 +103,7 @@ v_ulcase(sp, vp) * PUBLIC: int v_mulcase(SCR *, VICMD *); */ int -v_mulcase(sp, vp) - SCR *sp; - VICMD *vp; +v_mulcase(SCR *sp, VICMD *vp) { CHAR_T *p; size_t len; @@ -143,11 +139,7 @@ v_mulcase(sp, vp) * Change part of a line's case. */ static int -ulcase(sp, lno, lp, len, scno, ecno) - SCR *sp; - recno_t lno; - CHAR_T *lp; - size_t len, scno, ecno; +ulcase(SCR *sp, recno_t lno, CHAR_T *lp, size_t len, size_t scno, size_t ecno) { size_t blen; int change, rval; diff --git a/usr.bin/vi/vi/v_undo.c b/usr.bin/vi/vi/v_undo.c index dd90df19919..1acac97be40 100644 --- a/usr.bin/vi/vi/v_undo.c +++ b/usr.bin/vi/vi/v_undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_undo.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_undo.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -32,9 +32,7 @@ * PUBLIC: int v_Undo(SCR *, VICMD *); */ int -v_Undo(sp, vp) - SCR *sp; - VICMD *vp; +v_Undo(SCR *sp, VICMD *vp) { /* * Historically, U reset the cursor to the first column in the line @@ -68,9 +66,7 @@ v_Undo(sp, vp) * PUBLIC: int v_undo(SCR *, VICMD *); */ int -v_undo(sp, vp) - SCR *sp; - VICMD *vp; +v_undo(SCR *sp, VICMD *vp) { EXF *ep; diff --git a/usr.bin/vi/vi/v_util.c b/usr.bin/vi/vi/v_util.c index e31fbea8ae8..dd168ef9f97 100644 --- a/usr.bin/vi/vi/v_util.c +++ b/usr.bin/vi/vi/v_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_util.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_util.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -33,9 +33,7 @@ * PUBLIC: void v_eof(SCR *, MARK *); */ void -v_eof(sp, mp) - SCR *sp; - MARK *mp; +v_eof(SCR *sp, MARK *mp) { recno_t lno; @@ -58,9 +56,7 @@ v_eof(sp, mp) * PUBLIC: void v_eol(SCR *, MARK *); */ void -v_eol(sp, mp) - SCR *sp; - MARK *mp; +v_eol(SCR *sp, MARK *mp) { size_t len; @@ -83,8 +79,7 @@ v_eol(sp, mp) * PUBLIC: void v_nomove(SCR *); */ void -v_nomove(sp) - SCR *sp; +v_nomove(SCR *sp) { msgq(sp, M_BERR, "197|No cursor movement made"); } @@ -96,9 +91,7 @@ v_nomove(sp) * PUBLIC: void v_sof(SCR *, MARK *); */ void -v_sof(sp, mp) - SCR *sp; - MARK *mp; +v_sof(SCR *sp, MARK *mp) { if (mp == NULL || mp->lno == 1) msgq(sp, M_BERR, "198|Already at the beginning of the file"); @@ -113,8 +106,7 @@ v_sof(sp, mp) * PUBLIC: void v_sol(SCR *); */ void -v_sol(sp) - SCR *sp; +v_sol(SCR *sp) { msgq(sp, M_BERR, "200|Already in the first column"); } @@ -126,9 +118,7 @@ v_sol(sp) * PUBLIC: int v_isempty(char *, size_t); */ int -v_isempty(p, len) - char *p; - size_t len; +v_isempty(char *p, size_t len) { for (; len--; ++p) if (!isblank(*p)) @@ -143,10 +133,7 @@ v_isempty(p, len) * PUBLIC: void v_emsg(SCR *, char *, vim_t); */ void -v_emsg(sp, p, which) - SCR *sp; - char *p; - vim_t which; +v_emsg(SCR *sp, char *p, vim_t which) { switch (which) { case VIM_COMBUF: diff --git a/usr.bin/vi/vi/v_word.c b/usr.bin/vi/vi/v_word.c index 61ac531ea23..70db59c6561 100644 --- a/usr.bin/vi/vi/v_word.c +++ b/usr.bin/vi/vi/v_word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_word.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_word.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -75,9 +75,7 @@ static int fword(SCR *, VICMD *, enum which); * PUBLIC: int v_wordW(SCR *, VICMD *); */ int -v_wordW(sp, vp) - SCR *sp; - VICMD *vp; +v_wordW(SCR *sp, VICMD *vp) { return (fword(sp, vp, BIGWORD)); } @@ -89,9 +87,7 @@ v_wordW(sp, vp) * PUBLIC: int v_wordw(SCR *, VICMD *); */ int -v_wordw(sp, vp) - SCR *sp; - VICMD *vp; +v_wordw(SCR *sp, VICMD *vp) { return (fword(sp, vp, LITTLEWORD)); } @@ -101,10 +97,7 @@ v_wordw(sp, vp) * Move forward by words. */ static int -fword(sp, vp, type) - SCR *sp; - VICMD *vp; - enum which type; +fword(SCR *sp, VICMD *vp, enum which type) { enum { INWORD, NOTWORD } state; VCS cs; @@ -242,9 +235,7 @@ ret: if (!ISMOTION(vp) && * PUBLIC: int v_wordE(SCR *, VICMD *); */ int -v_wordE(sp, vp) - SCR *sp; - VICMD *vp; +v_wordE(SCR *sp, VICMD *vp) { return (eword(sp, vp, BIGWORD)); } @@ -256,9 +247,7 @@ v_wordE(sp, vp) * PUBLIC: int v_worde(SCR *, VICMD *); */ int -v_worde(sp, vp) - SCR *sp; - VICMD *vp; +v_worde(SCR *sp, VICMD *vp) { return (eword(sp, vp, LITTLEWORD)); } @@ -268,10 +257,7 @@ v_worde(sp, vp) * Move forward to the end of the word. */ static int -eword(sp, vp, type) - SCR *sp; - VICMD *vp; - enum which type; +eword(SCR *sp, VICMD *vp, enum which type) { enum { INWORD, NOTWORD } state; VCS cs; @@ -395,9 +381,7 @@ ret: if (!ISMOTION(vp) && * PUBLIC: int v_wordB(SCR *, VICMD *); */ int -v_wordB(sp, vp) - SCR *sp; - VICMD *vp; +v_wordB(SCR *sp, VICMD *vp) { return (bword(sp, vp, BIGWORD)); } @@ -409,9 +393,7 @@ v_wordB(sp, vp) * PUBLIC: int v_wordb(SCR *, VICMD *); */ int -v_wordb(sp, vp) - SCR *sp; - VICMD *vp; +v_wordb(SCR *sp, VICMD *vp) { return (bword(sp, vp, LITTLEWORD)); } @@ -421,10 +403,7 @@ v_wordb(sp, vp) * Move backward by words. */ static int -bword(sp, vp, type) - SCR *sp; - VICMD *vp; - enum which type; +bword(SCR *sp, VICMD *vp, enum which type) { enum { INWORD, NOTWORD } state; VCS cs; diff --git a/usr.bin/vi/vi/v_xchar.c b/usr.bin/vi/vi/v_xchar.c index 48d501bd409..f209802da0c 100644 --- a/usr.bin/vi/vi/v_xchar.c +++ b/usr.bin/vi/vi/v_xchar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_xchar.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_xchar.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_xchar(SCR *, VICMD *); */ int -v_xchar(sp, vp) - SCR *sp; - VICMD *vp; +v_xchar(SCR *sp, VICMD *vp) { size_t len; int isempty; @@ -78,9 +76,7 @@ nodel: msgq(sp, M_BERR, "206|No characters to delete"); * PUBLIC: int v_Xchar(SCR *, VICMD *); */ int -v_Xchar(sp, vp) - SCR *sp; - VICMD *vp; +v_Xchar(SCR *sp, VICMD *vp) { u_long cnt; diff --git a/usr.bin/vi/vi/v_yank.c b/usr.bin/vi/vi/v_yank.c index 9346981ebdf..1cb80880c16 100644 --- a/usr.bin/vi/vi/v_yank.c +++ b/usr.bin/vi/vi/v_yank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_yank.c,v 1.6 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_yank.c,v 1.7 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -40,9 +40,7 @@ * PUBLIC: int v_yank(SCR *, VICMD *); */ int -v_yank(sp, vp) - SCR *sp; - VICMD *vp; +v_yank(SCR *sp, VICMD *vp) { size_t len; diff --git a/usr.bin/vi/vi/v_z.c b/usr.bin/vi/vi/v_z.c index 406224e0827..5d6fe9b7b2c 100644 --- a/usr.bin/vi/vi/v_z.c +++ b/usr.bin/vi/vi/v_z.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_z.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_z.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -29,9 +29,7 @@ * PUBLIC: int v_z(SCR *, VICMD *); */ int -v_z(sp, vp) - SCR *sp; - VICMD *vp; +v_z(SCR *sp, VICMD *vp) { recno_t lno; u_int value; @@ -134,9 +132,7 @@ v_z(sp, vp) * PUBLIC: int vs_crel(SCR *, long); */ int -vs_crel(sp, count) - SCR *sp; - long count; +vs_crel(SCR *sp, long count) { sp->t_minrows = sp->t_rows = count; if (sp->t_rows > sp->rows - 1) diff --git a/usr.bin/vi/vi/v_zexit.c b/usr.bin/vi/vi/v_zexit.c index f33501f464b..46e5cb46265 100644 --- a/usr.bin/vi/vi/v_zexit.c +++ b/usr.bin/vi/vi/v_zexit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_zexit.c,v 1.5 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: v_zexit.c,v 1.6 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int v_zexit(SCR *, VICMD *); */ int -v_zexit(sp, vp) - SCR *sp; - VICMD *vp; +v_zexit(SCR *sp, VICMD *vp) { /* Write back any modifications. */ if (F_ISSET(sp->ep, F_MODIFIED) && diff --git a/usr.bin/vi/vi/vi.c b/usr.bin/vi/vi/vi.c index a94597717fa..5cc10e57d3d 100644 --- a/usr.bin/vi/vi/vi.c +++ b/usr.bin/vi/vi/vi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vi.c,v 1.14 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: vi.c,v 1.15 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -60,8 +60,7 @@ static void v_comlog(SCR *, VICMD *); * PUBLIC: int vi(SCR **); */ int -vi(spp) - SCR **spp; +vi(SCR **spp) { GS *gp; MARK abs; @@ -450,11 +449,8 @@ VIKEYS const tmotion = { * [count] key [character] */ static gcret_t -v_cmd(sp, dp, vp, ismotion, comcountp, mappedp) - SCR *sp; - VICMD *dp, *vp; - VICMD *ismotion; /* Previous key if getting motion component. */ - int *comcountp, *mappedp; +v_cmd(SCR *sp, VICMD *dp, VICMD *vp, VICMD *ismotion, int *comcountp, + int *mappedp) { enum { COMMANDMODE, ISPARTIAL, NOTPARTIAL } cpart; EVENT ev; @@ -714,10 +710,7 @@ esc: switch (cpart) { * Get resulting motion mark. */ static int -v_motion(sp, dm, vp, mappedp) - SCR *sp; - VICMD *dm, *vp; - int *mappedp; +v_motion(SCR *sp, VICMD *dm, VICMD *vp, int *mappedp) { VICMD motion; size_t len; @@ -927,8 +920,7 @@ v_motion(sp, dm, vp, mappedp) * Initialize the vi screen. */ static int -v_init(sp) - SCR *sp; +v_init(SCR *sp) { GS *gp; VI_PRIVATE *vip; @@ -999,8 +991,7 @@ v_init(sp) * Move all but the current screen to the hidden queue. */ static void -v_dtoh(sp) - SCR *sp; +v_dtoh(SCR *sp) { GS *gp; SCR *tsp; @@ -1039,8 +1030,7 @@ v_dtoh(sp) * Get the word (or non-word) the cursor is on. */ static int -v_keyword(sp) - SCR *sp; +v_keyword(SCR *sp) { VI_PRIVATE *vip; size_t beg, end, len; @@ -1093,10 +1083,7 @@ v_keyword(sp) * Check for a command alias. */ static VIKEYS const * -v_alias(sp, vp, kp) - SCR *sp; - VICMD *vp; - VIKEYS const *kp; +v_alias(SCR *sp, VICMD *vp, VIKEYS const *kp) { CHAR_T push; @@ -1129,10 +1116,7 @@ v_alias(sp, vp, kp) * Return the next count. */ static int -v_count(sp, fkey, countp) - SCR *sp; - ARG_CHAR_T fkey; - u_long *countp; +v_count(SCR *sp, ARG_CHAR_T fkey, u_long *countp) { EVENT ev; u_long count, tc; @@ -1169,11 +1153,7 @@ v_count(sp, fkey, countp) * Return the next event. */ static gcret_t -v_key(sp, command_events, evp, ec_flags) - SCR *sp; - int command_events; - EVENT *evp; - u_int32_t ec_flags; +v_key(SCR *sp, int command_events, EVENT *evp, u_int32_t ec_flags) { u_int32_t quote; @@ -1236,9 +1216,7 @@ v_key(sp, command_events, evp, ec_flags) * Log the contents of the command structure. */ static void -v_comlog(sp, vp) - SCR *sp; - VICMD *vp; +v_comlog(SCR *sp, VICMD *vp) { TRACE(sp, "vcmd: %c", vp->key); if (F_ISSET(vp, VC_BUFFER)) diff --git a/usr.bin/vi/vi/vs_line.c b/usr.bin/vi/vi/vs_line.c index 8dda32926f9..639c1c7bc70 100644 --- a/usr.bin/vi/vi/vs_line.c +++ b/usr.bin/vi/vi/vs_line.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_line.c,v 1.13 2009/10/27 23:59:48 deraadt Exp $ */ +/* $OpenBSD: vs_line.c,v 1.14 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -36,10 +36,7 @@ * PUBLIC: int vs_line(SCR *, SMAP *, size_t *, size_t *); */ int -vs_line(sp, smp, yp, xp) - SCR *sp; - SMAP *smp; - size_t *xp, *yp; +vs_line(SCR *sp, SMAP *smp, size_t *yp, size_t *xp) { CHAR_T *kp; GS *gp; @@ -466,8 +463,7 @@ ret1: (void)gp->scr_move(sp, oldy, oldx); * PUBLIC: int vs_number(SCR *); */ int -vs_number(sp) - SCR *sp; +vs_number(SCR *sp) { GS *gp; SMAP *smp; diff --git a/usr.bin/vi/vi/vs_msg.c b/usr.bin/vi/vi/vs_msg.c index 83598704493..f5d2db3d3d4 100644 --- a/usr.bin/vi/vi/vs_msg.c +++ b/usr.bin/vi/vi/vs_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_msg.c,v 1.12 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: vs_msg.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -54,10 +54,7 @@ static void vs_wait(SCR *, int *, sw_t); * PUBLIC: void vs_busy(SCR *, const char *, busy_t); */ void -vs_busy(sp, msg, btype) - SCR *sp; - const char *msg; - busy_t btype; +vs_busy(SCR *sp, const char *msg, busy_t btype) { GS *gp; VI_PRIVATE *vip; @@ -144,8 +141,7 @@ vs_busy(sp, msg, btype) * PUBLIC: void vs_home(SCR *); */ void -vs_home(sp) - SCR *sp; +vs_home(SCR *sp) { (void)sp->gp->scr_move(sp, LASTLINE(sp), 0); (void)sp->gp->scr_refresh(sp, 0); @@ -158,9 +154,7 @@ vs_home(sp) * PUBLIC: void vs_update(SCR *, const char *, const char *); */ void -vs_update(sp, m1, m2) - SCR *sp; - const char *m1, *m2; +vs_update(SCR *sp, const char *m1, const char *m2) { GS *gp; size_t len, mlen, oldx, oldy; @@ -226,11 +220,7 @@ vs_update(sp, m1, m2) * PUBLIC: void vs_msg(SCR *, mtype_t, char *, size_t); */ void -vs_msg(sp, mtype, line, len) - SCR *sp; - mtype_t mtype; - char *line; - size_t len; +vs_msg(SCR *sp, mtype_t mtype, char *line, size_t len) { GS *gp; VI_PRIVATE *vip; @@ -395,11 +385,7 @@ ret: (void)gp->scr_move(sp, oldy, oldx); * Output the text to the screen. */ static void -vs_output(sp, mtype, line, llen) - SCR *sp; - mtype_t mtype; - const char *line; - int llen; +vs_output(SCR *sp, mtype_t mtype, const char *line, int llen) { CHAR_T *kp; GS *gp; @@ -524,9 +510,7 @@ vs_output(sp, mtype, line, llen) * PUBLIC: int vs_ex_resolve(SCR *, int *); */ int -vs_ex_resolve(sp, continuep) - SCR *sp; - int *continuep; +vs_ex_resolve(SCR *sp, int *continuep) { EVENT ev; GS *gp; @@ -650,9 +634,7 @@ vs_ex_resolve(sp, continuep) * PUBLIC: int vs_resolve(SCR *, SCR *, int); */ int -vs_resolve(sp, csp, forcewait) - SCR *sp, *csp; - int forcewait; +vs_resolve(SCR *sp, SCR *csp, int forcewait) { EVENT ev; GS *gp; @@ -759,10 +741,7 @@ vs_resolve(sp, csp, forcewait) * Scroll the screen for output. */ static void -vs_scroll(sp, continuep, wtype) - SCR *sp; - int *continuep; - sw_t wtype; +vs_scroll(SCR *sp, int *continuep, sw_t wtype) { GS *gp; VI_PRIVATE *vip; @@ -795,10 +774,7 @@ vs_scroll(sp, continuep, wtype) * Prompt the user to continue. */ static void -vs_wait(sp, continuep, wtype) - SCR *sp; - int *continuep; - sw_t wtype; +vs_wait(SCR *sp, int *continuep, sw_t wtype) { EVENT ev; VI_PRIVATE *vip; @@ -869,8 +845,7 @@ vs_wait(sp, continuep, wtype) * Draw a dividing line between the screen and the output. */ static void -vs_divider(sp) - SCR *sp; +vs_divider(SCR *sp) { GS *gp; size_t len; @@ -889,11 +864,7 @@ vs_divider(sp) * Save a message for later display. */ static void -vs_msgsave(sp, mt, p, len) - SCR *sp; - mtype_t mt; - char *p; - size_t len; +vs_msgsave(SCR *sp, mtype_t mt, char *p, size_t len) { GS *gp; MSGS *mp_c, *mp_n; diff --git a/usr.bin/vi/vi/vs_refresh.c b/usr.bin/vi/vi/vs_refresh.c index 263f68c701e..4855f1e7b07 100644 --- a/usr.bin/vi/vi/vs_refresh.c +++ b/usr.bin/vi/vi/vs_refresh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_refresh.c,v 1.18 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: vs_refresh.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -38,9 +38,7 @@ static int vs_paint(SCR *, u_int); * PUBLIC: int vs_repaint(SCR *, EVENT *); */ int -vs_repaint(sp, evp) - SCR *sp; - EVENT *evp; +vs_repaint(SCR *sp, EVENT *evp) { SMAP *smp; @@ -60,9 +58,7 @@ vs_repaint(sp, evp) * PUBLIC: int vs_refresh(SCR *, int); */ int -vs_refresh(sp, forcepaint) - SCR *sp; - int forcepaint; +vs_refresh(SCR *sp, int forcepaint) { GS *gp; SCR *tsp; @@ -158,9 +154,7 @@ vs_refresh(sp, forcepaint) * what you're doing. It's subtle and quick to anger. */ static int -vs_paint(sp, flags) - SCR *sp; - u_int flags; +vs_paint(SCR *sp, u_int flags) { GS *gp; SMAP *smp, tmp; @@ -773,8 +767,7 @@ number: if (O_ISSET(sp, O_NUMBER) && * Update the mode line. */ static void -vs_modeline(sp) - SCR *sp; +vs_modeline(SCR *sp) { static char * const modes[] = { "215|Append", /* SM_APPEND */ diff --git a/usr.bin/vi/vi/vs_relative.c b/usr.bin/vi/vi/vs_relative.c index 32a3568f506..fc68f077e84 100644 --- a/usr.bin/vi/vi/vs_relative.c +++ b/usr.bin/vi/vi/vs_relative.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_relative.c,v 1.8 2009/10/27 23:59:49 deraadt Exp $ */ +/* $OpenBSD: vs_relative.c,v 1.9 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -30,9 +30,7 @@ * PUBLIC: int vs_column(SCR *, size_t *); */ int -vs_column(sp, colp) - SCR *sp; - size_t *colp; +vs_column(SCR *sp, size_t *colp) { VI_PRIVATE *vip; @@ -53,10 +51,7 @@ vs_column(sp, colp) * PUBLIC: size_t vs_screens(SCR *, recno_t, size_t *); */ size_t -vs_screens(sp, lno, cnop) - SCR *sp; - recno_t lno; - size_t *cnop; +vs_screens(SCR *sp, recno_t lno, size_t *cnop) { size_t cols, screens; @@ -99,11 +94,7 @@ vs_screens(sp, lno, cnop) * PUBLIC: size_t vs_columns(SCR *, char *, recno_t, size_t *, size_t *); */ size_t -vs_columns(sp, lp, lno, cnop, diffp) - SCR *sp; - char *lp; - recno_t lno; - size_t *cnop, *diffp; +vs_columns(SCR *sp, char *lp, recno_t lno, size_t *cnop, size_t *diffp) { size_t chlen, cno, curoff, last, len, scno; int ch, leftright, listset; @@ -205,10 +196,7 @@ done: if (diffp != NULL) /* XXX */ * PUBLIC: size_t vs_rcm(SCR *, recno_t, int); */ size_t -vs_rcm(sp, lno, islast) - SCR *sp; - recno_t lno; - int islast; +vs_rcm(SCR *sp, recno_t lno, int islast) { size_t len; @@ -234,10 +222,7 @@ vs_rcm(sp, lno, islast) * PUBLIC: size_t vs_colpos(SCR *, recno_t, size_t); */ size_t -vs_colpos(sp, lno, cno) - SCR *sp; - recno_t lno; - size_t cno; +vs_colpos(SCR *sp, recno_t lno, size_t cno) { size_t chlen, curoff, len, llen, off, scno; int ch, leftright, listset; diff --git a/usr.bin/vi/vi/vs_smap.c b/usr.bin/vi/vi/vs_smap.c index 7135c702ec6..4abf7e69b69 100644 --- a/usr.bin/vi/vi/vs_smap.c +++ b/usr.bin/vi/vi/vs_smap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_smap.c,v 1.7 2009/10/27 23:59:49 deraadt Exp $ */ +/* $OpenBSD: vs_smap.c,v 1.8 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -40,10 +40,7 @@ static int vs_sm_up(SCR *, MARK *, recno_t, scroll_t, SMAP *); * PUBLIC: int vs_change(SCR *, recno_t, lnop_t); */ int -vs_change(sp, lno, op) - SCR *sp; - recno_t lno; - lnop_t op; +vs_change(SCR *sp, recno_t lno, lnop_t op) { VI_PRIVATE *vip; SMAP *p; @@ -170,10 +167,7 @@ vs_change(sp, lno, op) * PUBLIC: int vs_sm_fill(SCR *, recno_t, pos_t); */ int -vs_sm_fill(sp, lno, pos) - SCR *sp; - recno_t lno; - pos_t pos; +vs_sm_fill(SCR *sp, recno_t lno, pos_t pos) { SMAP *p, tmp; size_t cnt; @@ -297,9 +291,7 @@ err: HMAP->lno = 1; * Delete a line out of the SMAP. */ static int -vs_sm_delete(sp, lno) - SCR *sp; - recno_t lno; +vs_sm_delete(SCR *sp, recno_t lno) { SMAP *p, *t; size_t cnt_orig; @@ -347,9 +339,7 @@ vs_sm_delete(sp, lno) * Insert a line into the SMAP. */ static int -vs_sm_insert(sp, lno) - SCR *sp; - recno_t lno; +vs_sm_insert(SCR *sp, recno_t lno) { SMAP *p, *t; size_t cnt_orig, cnt, coff; @@ -403,9 +393,7 @@ vs_sm_insert(sp, lno) * Reset a line in the SMAP. */ static int -vs_sm_reset(sp, lno) - SCR *sp; - recno_t lno; +vs_sm_reset(SCR *sp, recno_t lno) { SMAP *p, *t; size_t cnt_orig, cnt_new, cnt, diff; @@ -510,11 +498,7 @@ vs_sm_reset(sp, lno) * PUBLIC: int vs_sm_scroll(SCR *, MARK *, recno_t, scroll_t); */ int -vs_sm_scroll(sp, rp, count, scmd) - SCR *sp; - MARK *rp; - recno_t count; - scroll_t scmd; +vs_sm_scroll(SCR *sp, MARK *rp, recno_t count, scroll_t scmd) { SMAP *smp; @@ -571,12 +555,7 @@ vs_sm_scroll(sp, rp, count, scmd) * Scroll the SMAP up count logical lines. */ static int -vs_sm_up(sp, rp, count, scmd, smp) - SCR *sp; - MARK *rp; - scroll_t scmd; - recno_t count; - SMAP *smp; +vs_sm_up(SCR *sp, MARK *rp, recno_t count, scroll_t scmd, SMAP *smp) { int cursor_set, echanged, zset; SMAP *ssmp, s1, s2; @@ -752,8 +731,7 @@ vs_sm_up(sp, rp, count, scmd, smp) * PUBLIC: int vs_sm_1up(SCR *); */ int -vs_sm_1up(sp) - SCR *sp; +vs_sm_1up(SCR *sp) { /* * Delete the top line of the screen. Shift the screen map @@ -782,9 +760,7 @@ vs_sm_1up(sp) * line and other screens back. */ static int -vs_deleteln(sp, cnt) - SCR *sp; - int cnt; +vs_deleteln(SCR *sp, int cnt) { GS *gp; size_t oldy, oldx; @@ -809,12 +785,7 @@ vs_deleteln(sp, cnt) * Scroll the SMAP down count logical lines. */ static int -vs_sm_down(sp, rp, count, scmd, smp) - SCR *sp; - MARK *rp; - recno_t count; - SMAP *smp; - scroll_t scmd; +vs_sm_down(SCR *sp, MARK *rp, recno_t count, scroll_t scmd, SMAP *smp) { SMAP *ssmp, s1, s2; int cursor_set, ychanged, zset; @@ -965,8 +936,7 @@ vs_sm_down(sp, rp, count, scmd, smp) * Erase the small screen area for the scrolling functions. */ static int -vs_sm_erase(sp) - SCR *sp; +vs_sm_erase(SCR *sp) { GS *gp; @@ -987,8 +957,7 @@ vs_sm_erase(sp) * PUBLIC: int vs_sm_1down(SCR *); */ int -vs_sm_1down(sp) - SCR *sp; +vs_sm_1down(SCR *sp) { /* * Insert a line at the top of the screen. Shift the screen map @@ -1017,9 +986,7 @@ vs_sm_1down(sp) * line and other screens back. */ static int -vs_insertln(sp, cnt) - SCR *sp; - int cnt; +vs_insertln(SCR *sp, int cnt) { GS *gp; size_t oldy, oldx; @@ -1047,9 +1014,7 @@ vs_insertln(sp, cnt) * PUBLIC: int vs_sm_next(SCR *, SMAP *, SMAP *); */ int -vs_sm_next(sp, p, t) - SCR *sp; - SMAP *p, *t; +vs_sm_next(SCR *sp, SMAP *p, SMAP *t) { size_t lcnt; @@ -1077,9 +1042,7 @@ vs_sm_next(sp, p, t) * PUBLIC: int vs_sm_prev(SCR *, SMAP *, SMAP *); */ int -vs_sm_prev(sp, p, t) - SCR *sp; - SMAP *p, *t; +vs_sm_prev(SCR *sp, SMAP *p, SMAP *t) { SMAP_FLUSH(t); if (O_ISSET(sp, O_LEFTRIGHT)) { @@ -1104,9 +1067,7 @@ vs_sm_prev(sp, p, t) * PUBLIC: int vs_sm_cursor(SCR *, SMAP **); */ int -vs_sm_cursor(sp, smpp) - SCR *sp; - SMAP **smpp; +vs_sm_cursor(SCR *sp, SMAP **smpp) { SMAP *p; @@ -1145,11 +1106,7 @@ vs_sm_cursor(sp, smpp) * PUBLIC: int vs_sm_position(SCR *, MARK *, u_long, pos_t); */ int -vs_sm_position(sp, rp, cnt, pos) - SCR *sp; - MARK *rp; - u_long cnt; - pos_t pos; +vs_sm_position(SCR *sp, MARK *rp, u_long cnt, pos_t pos) { SMAP *smp; recno_t last; @@ -1229,11 +1186,7 @@ eof: msgq(sp, M_BERR, * PUBLIC: recno_t vs_sm_nlines(SCR *, SMAP *, recno_t, size_t); */ recno_t -vs_sm_nlines(sp, from_sp, to_lno, max) - SCR *sp; - SMAP *from_sp; - recno_t to_lno; - size_t max; +vs_sm_nlines(SCR *sp, SMAP *from_sp, recno_t to_lno, size_t max) { recno_t lno, lcnt; diff --git a/usr.bin/vi/vi/vs_split.c b/usr.bin/vi/vi/vs_split.c index 4b6b2683504..12b85061904 100644 --- a/usr.bin/vi/vi/vs_split.c +++ b/usr.bin/vi/vi/vs_split.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_split.c,v 1.11 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: vs_split.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -34,9 +34,7 @@ static SCR *vs_getbg(SCR *, char *); * PUBLIC: int vs_split(SCR *, SCR *, int); */ int -vs_split(sp, new, ccl) - SCR *sp, *new; - int ccl; /* Colon-command line split. */ +vs_split(SCR *sp, SCR *new, int ccl) { GS *gp; SMAP *smp; @@ -195,8 +193,7 @@ vs_split(sp, new, ccl) * PUBLIC: int vs_discard(SCR *, SCR **); */ int -vs_discard(sp, spp) - SCR *sp, **spp; +vs_discard(SCR *sp, SCR **spp) { SCR *nsp; dir_t dir; @@ -284,10 +281,7 @@ vs_discard(sp, spp) * PUBLIC: int vs_fg(SCR *, SCR **, CHAR_T *, int); */ int -vs_fg(sp, nspp, name, newscreen) - SCR *sp, **nspp; - CHAR_T *name; - int newscreen; +vs_fg(SCR *sp, SCR **nspp, CHAR_T *name, int newscreen) { GS *gp; SCR *nsp; @@ -334,8 +328,7 @@ vs_fg(sp, nspp, name, newscreen) * PUBLIC: int vs_bg(SCR *); */ int -vs_bg(sp) - SCR *sp; +vs_bg(SCR *sp) { GS *gp; SCR *nsp; @@ -373,9 +366,7 @@ vs_bg(sp) * PUBLIC: int vs_swap(SCR *, SCR **, char *); */ int -vs_swap(sp, nspp, name) - SCR *sp, **nspp; - char *name; +vs_swap(SCR *sp, SCR **nspp, char *name) { GS *gp; SCR *nsp; @@ -465,10 +456,7 @@ vs_swap(sp, nspp, name) * PUBLIC: int vs_resize(SCR *, long, adj_t); */ int -vs_resize(sp, count, adj) - SCR *sp; - long count; - adj_t adj; +vs_resize(SCR *sp, long count, adj_t adj) { GS *gp; SCR *g, *s; @@ -566,9 +554,7 @@ toosmall: msgq(sp, M_BERR, * background screen. */ static SCR * -vs_getbg(sp, name) - SCR *sp; - char *name; +vs_getbg(SCR *sp, char *name) { GS *gp; SCR *nsp; |