summaryrefslogtreecommitdiff
path: root/usr/src/cmd/vgrind/vgrindefs.c
diff options
context:
space:
mode:
authorcraigm <none@none>2005-08-03 13:46:46 -0700
committercraigm <none@none>2005-08-03 13:46:46 -0700
commite5af7cce311c40ac0c6cf3c9d3e81b3f0a9c7c3a (patch)
treedc47700b593a2f6461a86dae8b730b7e4338db3c /usr/src/cmd/vgrind/vgrindefs.c
parent662492f525abc18107d5365e4c9a09c240f0c9d8 (diff)
downloadillumos-joyent-e5af7cce311c40ac0c6cf3c9d3e81b3f0a9c7c3a.tar.gz
6273961 gcc and cmd/vgrind don't get along
Diffstat (limited to 'usr/src/cmd/vgrind/vgrindefs.c')
-rw-r--r--usr/src/cmd/vgrind/vgrindefs.c59
1 files changed, 29 insertions, 30 deletions
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;