diff options
author | 2003-06-10 22:20:44 +0000 | |
---|---|---|
committer | 2003-06-10 22:20:44 +0000 | |
commit | 1837a5ca509d93cac77d2e89322c0c4869f9215d (patch) | |
tree | 52dbe14a25e44bdf8161f4c51f39a50c072fe221 /usr.bin/sed/compile.c | |
parent | It would kind of help if the flags member was initialized, otherwise random (diff) | |
download | wireguard-openbsd-1837a5ca509d93cac77d2e89322c0c4869f9215d.tar.xz wireguard-openbsd-1837a5ca509d93cac77d2e89322c0c4869f9215d.zip |
mostly ansi cleanup; pval ok
Diffstat (limited to 'usr.bin/sed/compile.c')
-rw-r--r-- | usr.bin/sed/compile.c | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index c32191fb097..e8672d27e81 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.14 2003/06/03 02:56:16 millert Exp $ */ +/* $OpenBSD: compile.c,v 1.15 2003/06/10 22:20:50 deraadt Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */ -static char *rcsid = "$OpenBSD: compile.c,v 1.14 2003/06/03 02:56:16 millert Exp $"; +static char *rcsid = "$OpenBSD: compile.c,v 1.15 2003/06/10 22:20:50 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -128,7 +128,7 @@ struct s_command *prog; * Initialise appends. */ void -compile() +compile(void) { *compile_stream(&prog) = NULL; fixuplabel(prog, NULL); @@ -144,8 +144,7 @@ compile() } while (0) static struct s_command ** -compile_stream(link) - struct s_command **link; +compile_stream(struct s_command **link) { char *p; static char lbuf[_POSIX2_LINE_MAX + 1]; /* To save stack */ @@ -335,8 +334,7 @@ nonsel: /* Now parse the command */ * with the processed string. */ static char * -compile_delimited(p, d) - char *p, *d; +compile_delimited(char *p, char *d) { char c; @@ -374,9 +372,7 @@ compile_delimited(p, d) /* compile_ccl: expand a POSIX character class */ static char * -compile_ccl(sp, t) - char **sp; - char *t; +compile_ccl(char **sp, char *t) { int c, d; char *s = *sp; @@ -407,9 +403,7 @@ compile_ccl(sp, t) * Cflags are passed to regcomp. */ static char * -compile_re(p, repp) - char *p; - regex_t **repp; +compile_re(char *p, regex_t **repp) { int eval; char re[_POSIX2_LINE_MAX + 1]; @@ -433,9 +427,7 @@ compile_re(p, repp) * expressions. */ static char * -compile_subst(p, s) - char *p; - struct s_subst *s; +compile_subst(char *p, struct s_subst *s) { static char lbuf[_POSIX2_LINE_MAX + 1]; int asize, ref, size; @@ -493,9 +485,7 @@ compile_subst(p, s) * Compile the flags of the s command */ static char * -compile_flags(p, s) - char *p; - struct s_subst *s; +compile_flags(char *p, struct s_subst *s) { int gn; /* True if we have seen g or n */ char wfile[_POSIX2_LINE_MAX + 1], *q; @@ -568,9 +558,7 @@ compile_flags(p, s) * Compile a translation set of strings into a lookup table. */ static char * -compile_tr(p, transtab) - char *p; - char **transtab; +compile_tr(char *p, char **transtab) { int i; char *lt, *op, *np; @@ -609,7 +597,7 @@ compile_tr(p, transtab) * Compile the text following an a, c, or i command. */ static char * -compile_text() +compile_text(void) { int asize, esc_nl, size; char *text, *p, *op, *s; @@ -646,9 +634,7 @@ compile_text() * it. Fill the structure pointed to according to the address. */ static char * -compile_addr(p, a) - char *p; - struct s_addr *a; +compile_addr(char *p, struct s_addr *a) { char *end; @@ -683,9 +669,7 @@ compile_addr(p, a) * Return a copy of all the characters up to \n or \0. */ static char * -duptoeol(s, ctype) - char *s; - char *ctype; +duptoeol(char *s, char *ctype) { size_t len; int ws; @@ -709,8 +693,7 @@ duptoeol(s, ctype) * TODO: Remove } nodes */ static void -fixuplabel(cp, end) - struct s_command *cp, *end; +fixuplabel(struct s_command *cp, struct s_command *end) { for (; cp != end; cp = cp->next) @@ -741,8 +724,7 @@ fixuplabel(cp, end) * Associate the given command label for later lookup. */ static void -enterlabel(cp) - struct s_command *cp; +enterlabel(struct s_command *cp) { struct labhash **lhp, *lh; u_char *p; @@ -767,8 +749,7 @@ enterlabel(cp) * list cp. L is excluded from the search. Return NULL if not found. */ static struct s_command * -findlabel(name) - char *name; +findlabel(char *name) { struct labhash *lh; u_char *p; @@ -790,7 +771,7 @@ findlabel(name) * table space. */ static void -uselabel() +uselabel(void) { struct labhash *lh, *next; int i; |