diff options
author | mycroft <mycroft@NetBSD.org> | 1993-12-08 07:50:47 +0000 |
---|---|---|
committer | mycroft <mycroft@NetBSD.org> | 1993-12-08 07:50:47 +0000 |
commit | 77db8b9323c1e0b90e3f21299eda85c75245d46b (patch) | |
tree | afe04e9e3ff130f6ca97d3c70d0ad87e0be0d0ae /cribbage/io.c | |
parent | 5b2c4c58d461c565135b4c88fcfe9c96dd39c83a (diff) | |
download | bsdgames-darwin-77db8b9323c1e0b90e3f21299eda85c75245d46b.tar.gz bsdgames-darwin-77db8b9323c1e0b90e3f21299eda85c75245d46b.tar.zst bsdgames-darwin-77db8b9323c1e0b90e3f21299eda85c75245d46b.zip |
Eliminate two compiler warnings.
Diffstat (limited to 'cribbage/io.c')
-rw-r--r-- | cribbage/io.c | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/cribbage/io.c b/cribbage/io.c index 2cef04b0..ab1c538d 100644 --- a/cribbage/io.c +++ b/cribbage/io.c @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)io.c 5.8 (Berkeley) 2/28/91";*/ -static char rcsid[] = "$Id: io.c,v 1.5 1993/08/10 03:41:48 mycroft Exp $"; +static char rcsid[] = "$Id: io.c,v 1.6 1993/12/08 07:50:47 mycroft Exp $"; #endif /* not lint */ # include <curses.h> @@ -75,6 +75,90 @@ char *suitchar[ SUITS ] = { "S", "H", "D", "C" }; /* + * msg: + * Display a message at the top of the screen. + */ +char Msgbuf[BUFSIZ] = { '\0' }; + +int Mpos = 0; + +static int Newpos = 0; + +msg(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void)vsprintf(&Msgbuf[Newpos], fmt, ap); + endmsg(); +} + +/* + * addmsg: + * Add things to the current message + */ +addmsg(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void)vsprintf(&Msgbuf[Newpos], fmt, ap); +} + +/* + * endmsg: + * Display a new msg. + */ + +int Lineno = 0; + +endmsg() +{ + register int len; + register char *mp, *omp; + static int lastline = 0; + + /* + * All messages should start with uppercase + */ + mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); + if (islower(Msgbuf[0]) && Msgbuf[1] != ')') + Msgbuf[0] = toupper(Msgbuf[0]); + mp = Msgbuf; + len = strlen(mp); + if (len / MSG_X + Lineno >= MSG_Y) { + while (Lineno < MSG_Y) { + wmove(Msgwin, Lineno++, 0); + wclrtoeol(Msgwin); + } + Lineno = 0; + } + mvaddch(Lineno + Y_MSG_START, SCORE_X, '*'); + lastline = Lineno; + do { + mvwaddstr(Msgwin, Lineno, 0, mp); + if ((len = strlen(mp)) > MSG_X) { + omp = mp; + for (mp = &mp[MSG_X-1]; *mp != ' '; mp--) + continue; + while (*mp == ' ') + mp--; + mp++; + wmove(Msgwin, Lineno, mp - omp); + wclrtoeol(Msgwin); + } + if (++Lineno >= MSG_Y) + Lineno = 0; + } while (len > MSG_X); + wclrtoeol(Msgwin); + Mpos = len; + Newpos = 0; + wrefresh(Msgwin); + refresh(); + wrefresh(Msgwin); +} + +/* * msgcard: * Call msgcrd in one of two forms */ @@ -365,90 +449,6 @@ char *prompt; } } -/* - * msg: - * Display a message at the top of the screen. - */ -char Msgbuf[BUFSIZ] = { '\0' }; - -int Mpos = 0; - -static int Newpos = 0; - -/* VARARGS1 */ -msg(fmt,ap) - char *fmt; - va_list ap; -{ - (void)vsprintf(&Msgbuf[Newpos], fmt, &ap); - endmsg(); -} - -/* - * addmsg: - * Add things to the current message - */ -/* VARARGS1 */ -addmsg(fmt,ap) - char *fmt; - va_list ap; -{ - (void)vsprintf(&Msgbuf[Newpos], fmt, &ap); -} - -/* - * endmsg: - * Display a new msg. - */ - -int Lineno = 0; - -endmsg() -{ - register int len; - register char *mp, *omp; - static int lastline = 0; - - /* - * All messages should start with uppercase - */ - mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); - if (islower(Msgbuf[0]) && Msgbuf[1] != ')') - Msgbuf[0] = toupper(Msgbuf[0]); - mp = Msgbuf; - len = strlen(mp); - if (len / MSG_X + Lineno >= MSG_Y) { - while (Lineno < MSG_Y) { - wmove(Msgwin, Lineno++, 0); - wclrtoeol(Msgwin); - } - Lineno = 0; - } - mvaddch(Lineno + Y_MSG_START, SCORE_X, '*'); - lastline = Lineno; - do { - mvwaddstr(Msgwin, Lineno, 0, mp); - if ((len = strlen(mp)) > MSG_X) { - omp = mp; - for (mp = &mp[MSG_X-1]; *mp != ' '; mp--) - continue; - while (*mp == ' ') - mp--; - mp++; - wmove(Msgwin, Lineno, mp - omp); - wclrtoeol(Msgwin); - } - if (++Lineno >= MSG_Y) - Lineno = 0; - } while (len > MSG_X); - wclrtoeol(Msgwin); - Mpos = len; - Newpos = 0; - wrefresh(Msgwin); - refresh(); - wrefresh(Msgwin); -} - #ifdef notdef /* * doadd: |