diff options
author | craigm <none@none> | 2005-08-03 13:46:46 -0700 |
---|---|---|
committer | craigm <none@none> | 2005-08-03 13:46:46 -0700 |
commit | e5af7cce311c40ac0c6cf3c9d3e81b3f0a9c7c3a (patch) | |
tree | dc47700b593a2f6461a86dae8b730b7e4338db3c /usr/src | |
parent | 662492f525abc18107d5365e4c9a09c240f0c9d8 (diff) | |
download | illumos-joyent-e5af7cce311c40ac0c6cf3c9d3e81b3f0a9c7c3a.tar.gz |
6273961 gcc and cmd/vgrind don't get along
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/vgrind/regexp.c | 39 | ||||
-rw-r--r-- | usr/src/cmd/vgrind/vfontedpr.c | 54 | ||||
-rw-r--r-- | usr/src/cmd/vgrind/vgrindefs.c | 59 |
3 files changed, 78 insertions, 74 deletions
diff --git a/usr/src/cmd/vgrind/regexp.c b/usr/src/cmd/vgrind/regexp.c index 2715e21fc6..027cdc058c 100644 --- a/usr/src/cmd/vgrind/regexp.c +++ b/usr/src/cmd/vgrind/regexp.c @@ -5,7 +5,6 @@ */ #pragma ident "%Z%%M% %I% %E% SMI" - /* from UCB 5.1 (Berkeley) 6/5/85 */ #include <ctype.h> @@ -19,6 +18,7 @@ extern char *l_idchars; /* set of characters legal in identifiers in addition to letters and digits */ extern char *strchr(); +static void expconv(void); #define isidchr(c) \ (isalnum(c) || ((c) != NIL && strchr(l_idchars, (c)) != NIL)) @@ -29,9 +29,8 @@ extern char *strchr(); * if l_onecase is set. */ -STRNCMP(s1, s2, len) - register char *s1,*s2; - register int len; +int +STRNCMP(char *s1, char *s2, int len) { if (l_onecase) { do @@ -112,10 +111,10 @@ char *ccre; /* pointer to current position in converted exp*/ char *malloc(); char * -convexp(re) - char *re; /* unconverted irregular expression */ +convexp(char *re) + /* re - unconverted irregular expression */ { - register char *cre; /* pointer to converted regular expression */ + char *cre; /* pointer to converted regular expression */ /* allocate room for the converted expression */ if (re == NIL) @@ -137,12 +136,13 @@ convexp(re) return (cre); } -expconv() +static void +expconv(void) { - register char *cs; /* pointer to current symbol in converted exp */ - register char c; /* character being processed */ - register char *acs; /* pinter to last alternate */ - register int temp; + char *cs; /* pointer to current symbol in converted exp */ + char c; /* character being processed */ + char *acs; /* pinter to last alternate */ + int temp; /* let the conversion begin */ acs = NIL; @@ -280,7 +280,6 @@ expconv() } while (temp != 0); acs = NIL; } - return; } /* end of convertre */ @@ -311,14 +310,14 @@ boolean _escaped; /* true if we are currently _escaped */ char *Start; /* start of string */ char * -expmatch (s, re, mstring) - register char *s; /* string to check for a match in */ - register char *re; /* a converted irregular expression */ - register char *mstring; /* where to put whatever matches a \p */ +expmatch(char *s, char *re, char *mstring) + /* s - string to check for a match in */ + /* re - a converted irregular expression */ + /* mstring - where to put whatever matches a \p */ { - register char *cs; /* the current symbol */ - register char *ptr,*s1; /* temporary pointer */ - boolean matched; /* a temporary boolean */ + char *cs; /* the current symbol */ + char *ptr, *s1; /* temporary pointer */ + boolean matched; /* a temporary boolean */ /* initial conditions */ if (re == NIL) diff --git a/usr/src/cmd/vgrind/vfontedpr.c b/usr/src/cmd/vgrind/vfontedpr.c index ae5ba89168..3a69a61deb 100644 --- a/usr/src/cmd/vgrind/vfontedpr.c +++ b/usr/src/cmd/vgrind/vfontedpr.c @@ -117,15 +117,21 @@ boolean l_onecase; /* upper and lower case are equivalent */ char *l_idchars; /* characters legal in identifiers in addition to letters and digits (default "_") */ +static void putcp(int c); +static int width(char *s, char *os); +static int tabs(char *s, char *os); +static void putKcp(char *start, char *end, boolean force); +static void putScp(char *os); +static int iskw(char *s); + /* * The code below emits troff macros and directives that consume part of the * troff macro and register space. See tmac.vgrind for an enumeration of * these macros and registers. */ -main(argc, argv) - int argc; - char *argv[]; +int +main(int argc, char *argv[]) { FILE *in; char *fname; @@ -415,16 +421,15 @@ flagsdone: if (!filter) printf("'vE\n"); - exit(0); - /* NOTREACHED */ + return (0); } #define isidchr(c) (isalnum(c) || ((c) != NIL && strchr(l_idchars, (c)) != NIL)) -putScp(os) - char *os; +static void +putScp(char *os) { - register char *s = os; /* pointer to unmatched string */ + char *s = os; /* pointer to unmatched string */ char dummy[BUFSIZ]; /* dummy to be used by expmatch */ char *comptr; /* end of a comment delimiter */ char *acmptr; /* end of a comment delimiter */ @@ -610,10 +615,11 @@ skip: } while (*s); } -putKcp (start, end, force) - char *start; /* start of string to write */ - char *end; /* end of string to write */ - boolean force; /* true if we should force nokeyw */ +static void +putKcp(char *start, char *end, boolean force) + /* start - start of string to write */ + /* end - end of string to write */ + /* force - true if we should force nokeyw */ { int i; int xfld = 0; @@ -661,17 +667,17 @@ putKcp (start, end, force) } -tabs(s, os) - char *s, *os; +static int +tabs(char *s, char *os) { return (width(s, os) / tabsize); } -width(s, os) - register char *s, *os; +static int +width(char *s, char *os) { - register int i = 0; + int i = 0; unsigned char c; int n; @@ -696,8 +702,8 @@ width(s, os) return (i); } -putcp(c) - register int c; +static void +putcp(int c) { switch(c) { @@ -813,12 +819,12 @@ isproc(s) * Return its length if it is or 0 if it isn't. */ -iskw(s) - register char *s; +static int +iskw(char *s) { - register char **ss = l_keywds; - register int i = 1; - register char *cp = s; + char **ss = l_keywds; + int i = 1; + char *cp = s; /* Get token length. */ while (++cp, isidchr(*cp)) diff --git a/usr/src/cmd/vgrind/vgrindefs.c b/usr/src/cmd/vgrind/vgrindefs.c index b4fc3919de..d6cc33703a 100644 --- a/usr/src/cmd/vgrind/vgrindefs.c +++ b/usr/src/cmd/vgrind/vgrindefs.c @@ -5,7 +5,6 @@ */ #pragma ident "%Z%%M% %I% %E% SMI" - /* from UCB 5.1 (Berkeley) 6/5/85 */ #define BUFSIZ 1024 #define MAXHOP 32 /* max number of tc= indirections */ @@ -31,11 +30,14 @@ static char *tbuf; static char *filename; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); char *tgetstr(); -char *tdecode(); char *getenv(); +static char *tdecode(char *str, char **area); +static char *tskip(char *bp); +static int tnchktc(void); +static int tnamatch(char *np); + static char *vgrind_msg; /* @@ -43,12 +45,12 @@ static char *vgrind_msg; * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -tgetent(bp, name, file) - char *bp, *name, *file; +int +tgetent(char *bp, char *name, char *file) { - register char *cp; - register int c; - register int i = 0, cnt = 0; + char *cp; + int c; + int i = 0, cnt = 0; char ibuf[BUFSIZ]; char *cp2; int tf; @@ -104,9 +106,10 @@ tgetent(bp, name, file) * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ -tnchktc() +static int +tnchktc(void) { - register char *p, *q; + char *p, *q; char tcname[16]; /* name of similar terminal */ char tcbuf[BUFSIZ]; char *holdtbuf = tbuf; @@ -154,10 +157,10 @@ tnchktc() * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -tnamatch(np) - char *np; +static int +tnamatch(char *np) { - register char *Np, *Bp; + char *Np, *Bp; Bp = tbuf; if (*Bp == '#') @@ -181,8 +184,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - register char *bp; +tskip(char *bp) { while (*bp && *bp != ':') @@ -200,11 +202,11 @@ tskip(bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -tgetnum(id) - char *id; +static int +tgetnum(char *id) { - register int i, base; - register char *bp = tbuf; + int i, base; + char *bp = tbuf; for (;;) { bp = tskip(bp); @@ -233,10 +235,10 @@ tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -tgetflag(id) - char *id; +int +tgetflag(char *id) { - register char *bp = tbuf; + char *bp = tbuf; for (;;) { bp = tskip(bp); @@ -260,10 +262,9 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { - register char *bp = tbuf; + char *bp = tbuf; for (;;) { bp = tskip(bp); @@ -285,12 +286,10 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(char *str, char **area) { - register char *cp; - register int c; + char *cp; + int c; int i; cp = *area; |