-/* $NetBSD: graphics.c,v 1.4 1997/10/10 02:07:11 lukem Exp $ */
+/* $NetBSD: graphics.c,v 1.9 1999/09/10 00:16:43 jsm Exp $ */
/*-
* Copyright (c) 1990, 1993
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: graphics.c,v 1.4 1997/10/10 02:07:11 lukem Exp $");
+__RCSID("$NetBSD: graphics.c,v 1.9 1999/09/10 00:16:43 jsm Exp $");
#endif
#endif /* not lint */
int
getAChar()
{
-#ifdef BSD
- return (getchar());
-#endif
-#ifdef SYSV
int c;
- while ((c = getchar()) == -1 && errno == EINTR) ;
+ errno = 0;
+ while ((c = getchar()) == EOF && errno == EINTR) {
+ errno = 0;
+ clearerr(stdin);
+ }
return(c);
-#endif
}
void
void
setup_screen(scp)
- C_SCREEN *scp;
+ const C_SCREEN *scp;
{
int i, j;
- char str[3], *airstr;
+ char str[3];
+ const char *airstr;
str[2] = '\0';
draw_line(w, x, y, lx, ly, s)
WINDOW *w;
int x, y, lx, ly;
- char *s;
+ const char *s;
{
int dx, dy;
void
ioaddstr(pos, str)
int pos;
- char *str;
+ const char *str;
{
wmove(input, 0, pos);
waddstr(input, str);
void
ioerror(pos, len, str)
int pos, len;
- char *str;
+ const char *str;
{
int i;
void
quit(dummy)
- int dummy;
+ int dummy __attribute__((__unused__));
{
int c, y, x;
#ifdef BSD
void
loser(p, s)
- PLANE *p;
- char *s;
+ const PLANE *p;
+ const char *s;
{
int c;
#ifdef BSD
wmove(input, 0, 0);
wclrtobot(input);
- wprintw(input, "Plane '%c' %s\n\nHit space for top players list...",
- name(p), s);
+ /* p may be NULL if we ran out of memory */
+ if (p == NULL)
+ wprintw(input, "%s\n\nHit space for top players list...", s);
+ else
+ wprintw(input, "Plane '%c' %s\n\nHit space for top players list...",
+ name(p), s);
wrefresh(input);
fflush(stdout);
while ((c = getchar()) != EOF && c != ' ')