diff options
author | Anthony J. Bentley <bentley@cvs.openbsd.org> | 2014-11-12 04:28:42 +0000 |
---|---|---|
committer | Anthony J. Bentley <bentley@cvs.openbsd.org> | 2014-11-12 04:28:42 +0000 |
commit | f379c5a4fc207e3e2af7d8bd0e4e1790c78cec5a (patch) | |
tree | 030999aa13d1334a6758863068cb926a69f27ab1 /usr.bin/vi/ex | |
parent | af29160dd230e5790a6a9687a3821272df0412c5 (diff) |
Ansify vi.
ok bcallah@ millert@
Diffstat (limited to 'usr.bin/vi/ex')
48 files changed, 245 insertions, 688 deletions
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; |