diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2002-04-26 16:15:17 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2002-04-26 16:15:17 +0000 |
commit | 751f1207fc4315779434d03c633db0f5a685a704 (patch) | |
tree | 6a606fc3547a1303a7c7a83a07c10fc0a685293e /usr.bin/m4/gnum4.c | |
parent | f9893f673eaa78484fd40b361e55bb60053d9266 (diff) |
use ansi function declarations. ok millert@
Diffstat (limited to 'usr.bin/m4/gnum4.c')
-rw-r--r-- | usr.bin/m4/gnum4.c | 78 |
1 files changed, 19 insertions, 59 deletions
diff --git a/usr.bin/m4/gnum4.c b/usr.bin/m4/gnum4.c index c938e8e28be..0383ef4c745 100644 --- a/usr.bin/m4/gnum4.c +++ b/usr.bin/m4/gnum4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gnum4.c,v 1.17 2002/04/26 13:13:41 espie Exp $ */ +/* $OpenBSD: gnum4.c,v 1.18 2002/04/26 16:15:16 espie Exp $ */ /* * Copyright (c) 1999 Marc Espie @@ -67,8 +67,7 @@ static void ensure_m4path(void); static struct input_file *dopath(struct input_file *, const char *); static struct path_entry * -new_path_entry(dirname) - const char *dirname; +new_path_entry(const char *dirname) { struct path_entry *n; @@ -83,8 +82,7 @@ new_path_entry(dirname) } void -addtoincludepath(dirname) - const char *dirname; +addtoincludepath(const char *dirname) { struct path_entry *n; @@ -124,9 +122,7 @@ ensure_m4path() static struct input_file * -dopath(i, filename) - struct input_file *i; - const char *filename; +dopath(struct input_file *i, const char *filename) { char path[MAXPATHLEN]; struct path_entry *pe; @@ -143,9 +139,7 @@ dopath(i, filename) } struct input_file * -fopen_trypath(i, filename) - struct input_file *i; - const char *filename; +fopen_trypath(struct input_file *i, const char *filename) { FILE *f; @@ -163,9 +157,7 @@ fopen_trypath(i, filename) } void -doindir(argv, argc) - const char *argv[]; - int argc; +doindir(const char *argv[], int argc) { ndptr p; @@ -177,9 +169,7 @@ doindir(argv, argc) } void -dobuiltin(argv, argc) - const char *argv[]; - int argc; +dobuiltin(const char *argv[], int argc) { int n; argv[1] = NULL; @@ -210,9 +200,7 @@ static void add_replace(const char *, regex_t *, const char *, regmatch_t *); #define addconstantstring(s) addchars((s), sizeof(s)-1) static void -addchars(c, n) - const char *c; - size_t n; +addchars(const char *c, size_t n) { if (n == 0) return; @@ -230,8 +218,7 @@ addchars(c, n) } static void -addchar(c) - int c; +addchar(int c) { if (current +1 > bufsize) { if (bufsize == 0) @@ -255,9 +242,7 @@ getstring() static void -exit_regerror(er, re) - int er; - regex_t *re; +exit_regerror(int er, regex_t *re) { size_t errlen; char *errbuf; @@ -269,11 +254,7 @@ exit_regerror(er, re) } static void -add_sub(n, string, re, pm) - int n; - const char *string; - regex_t *re; - regmatch_t *pm; +add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) { if (n > re->re_nsub) warnx("No subexpression %d", n); @@ -290,11 +271,7 @@ add_sub(n, string, re, pm) * constructs and replacing them with substrings of the original string. */ static void -add_replace(string, re, replace, pm) - const char *string; - regex_t *re; - const char *replace; - regmatch_t *pm; +add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm) { const char *p; @@ -327,11 +304,7 @@ add_replace(string, re, replace, pm) } static void -do_subst(string, re, replace, pm) - const char *string; - regex_t *re; - const char *replace; - regmatch_t *pm; +do_subst(const char *string, regex_t *re, const char *replace, regmatch_t *pm) { int error; int flags = 0; @@ -371,11 +344,7 @@ do_subst(string, re, replace, pm) } static void -do_regexp(string, re, replace, pm) - const char *string; - regex_t *re; - const char *replace; - regmatch_t *pm; +do_regexp(const char *string, regex_t *re, const char *replace, regmatch_t *pm) { int error; @@ -392,10 +361,7 @@ do_regexp(string, re, replace, pm) } static void -do_regexpindex(string, re, pm) - const char *string; - regex_t *re; - regmatch_t *pm; +do_regexpindex(const char *string, regex_t *re, regmatch_t *pm) { int error; @@ -415,8 +381,7 @@ do_regexpindex(string, re, pm) * says. So we twiddle with the regexp before passing it to regcomp. */ static char * -twiddle(p) - const char *p; +twiddle(const char *p) { /* This could use strcspn for speed... */ while (*p != '\0') { @@ -461,9 +426,7 @@ twiddle(p) * argv[4]: opt rep */ void -dopatsubst(argv, argc) - const char *argv[]; - int argc; +dopatsubst(const char *argv[], int argc) { int error; regex_t re; @@ -487,9 +450,7 @@ dopatsubst(argv, argc) } void -doregexp(argv, argc) - const char *argv[]; - int argc; +doregexp(const char *argv[], int argc) { int error; regex_t re; @@ -514,8 +475,7 @@ doregexp(argv, argc) } void -doesyscmd(cmd) - const char *cmd; +doesyscmd(const char *cmd) { int p[2]; pid_t pid, cpid; |