summaryrefslogtreecommitdiff
path: root/games/atc
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2004-11-29 08:52:30 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2004-11-29 08:52:30 +0000
commit9f35ef98a75e416220366f7f6ac0f8864d6239fb (patch)
treea3cc1c29744d5270e4662e30a4a7b7d0158c77ed /games/atc
parent0e91e5b94fb68ab00eed960bad30f73eba33c15b (diff)
ansi. ok deraadt@
Diffstat (limited to 'games/atc')
-rw-r--r--games/atc/graphics.c47
-rw-r--r--games/atc/input.c83
-rw-r--r--games/atc/list.c14
-rw-r--r--games/atc/log.c18
-rw-r--r--games/atc/main.c18
-rw-r--r--games/atc/update.c30
6 files changed, 77 insertions, 133 deletions
diff --git a/games/atc/graphics.c b/games/atc/graphics.c
index 20139adf806..9d6efb66e1d 100644
--- a/games/atc/graphics.c
+++ b/games/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: graphics.c,v 1.6 2003/06/03 03:01:38 millert Exp $ */
+/* $OpenBSD: graphics.c,v 1.7 2004/11/29 08:52:28 jsg Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: graphics.c,v 1.6 2003/06/03 03:01:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: graphics.c,v 1.7 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
@@ -64,7 +64,7 @@ static char rcsid[] = "$OpenBSD: graphics.c,v 1.6 2003/06/03 03:01:38 millert Ex
WINDOW *radar, *cleanradar, *credit, *input, *planes;
int
-getAChar()
+getAChar(void)
{
int c;
#ifdef BSD
@@ -79,7 +79,7 @@ getAChar()
}
void
-erase_all()
+erase_all(void)
{
PLANE *pp;
@@ -94,7 +94,7 @@ erase_all()
}
void
-draw_all()
+draw_all(void)
{
PLANE *pp;
@@ -114,8 +114,7 @@ draw_all()
}
void
-setup_screen(scp)
- const C_SCREEN *scp;
+setup_screen(const C_SCREEN *scp)
{
static char buffer[BUFSIZ];
int i, j;
@@ -223,10 +222,7 @@ setup_screen(scp)
}
void
-draw_line(w, x, y, lx, ly, s)
- WINDOW *w;
- int x, y, lx, ly;
- const char *s;
+draw_line(WINDOW *w, int x, int y, int lx, int ly, const char *s)
{
int dx, dy;
@@ -243,8 +239,7 @@ draw_line(w, x, y, lx, ly, s)
}
void
-ioclrtoeol(pos)
- int pos;
+ioclrtoeol(int pos)
{
wmove(input, 0, pos);
wclrtoeol(input);
@@ -253,8 +248,7 @@ ioclrtoeol(pos)
}
void
-iomove(pos)
- int pos;
+iomove(int pos)
{
wmove(input, 0, pos);
wrefresh(input);
@@ -262,9 +256,7 @@ iomove(pos)
}
void
-ioaddstr(pos, str)
- int pos;
- const char *str;
+ioaddstr(int pos, const char *str)
{
wmove(input, 0, pos);
waddstr(input, str);
@@ -273,7 +265,7 @@ ioaddstr(pos, str)
}
void
-ioclrtobot()
+ioclrtobot(void)
{
wclrtobot(input);
wrefresh(input);
@@ -281,9 +273,7 @@ ioclrtobot()
}
void
-ioerror(pos, len, str)
- int pos, len;
- const char *str;
+ioerror(int pos, int len, const char *str)
{
int i;
@@ -297,8 +287,7 @@ ioerror(pos, len, str)
}
void
-quit(dummy)
- int dummy;
+quit(int dummy)
{
int c, y, x;
#ifdef BSD
@@ -338,7 +327,7 @@ quit(dummy)
}
void
-planewin()
+planewin(void)
{
PLANE *pp;
int warning = 0;
@@ -381,9 +370,7 @@ planewin()
}
void
-loser(p, s)
- const PLANE *p;
- const char *s;
+loser(const PLANE *p, const char *s)
{
int c;
#ifdef BSD
@@ -419,7 +406,7 @@ loser(p, s)
}
void
-redraw()
+redraw(void)
{
clear();
refresh();
@@ -438,7 +425,7 @@ redraw()
}
void
-done_screen()
+done_screen(void)
{
clear();
refresh();
diff --git a/games/atc/input.c b/games/atc/input.c
index b38929dca5f..b4a57e2219d 100644
--- a/games/atc/input.c
+++ b/games/atc/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.9 2003/06/03 03:01:38 millert Exp $ */
+/* $OpenBSD: input.c,v 1.10 2004/11/29 08:52:28 jsg Exp $ */
/* $NetBSD: input.c,v 1.4 1995/04/27 21:22:24 mycroft Exp $ */
/*-
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: input.c,v 1.9 2003/06/03 03:01:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: input.c,v 1.10 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
@@ -173,7 +173,7 @@ int tval;
int dest_type, dest_no, dir;
int
-pop()
+pop(void)
{
if (level == 0)
return (-1);
@@ -188,7 +188,7 @@ pop()
}
void
-rezero()
+rezero(void)
{
iomove(0);
@@ -201,8 +201,7 @@ rezero()
}
void
-push(ruleno, ch)
- int ruleno, ch;
+push(int ruleno, int ch)
{
int newstate, newpos;
@@ -224,7 +223,7 @@ push(ruleno, ch)
}
int
-getcommand()
+getcommand(void)
{
int c, i, done;
const char *s, *(*func)(char);
@@ -283,7 +282,7 @@ getcommand()
}
void
-noise()
+noise(void)
{
if (makenoise)
putchar('\07');
@@ -291,7 +290,7 @@ noise()
}
int
-gettoken()
+gettoken(void)
{
while ((tval = getAChar()) == REDRAWTOKEN)
{
@@ -307,8 +306,7 @@ gettoken()
}
const char *
-setplane(c)
- char c;
+setplane(char c)
{
PLANE *pp;
@@ -321,8 +319,7 @@ setplane(c)
}
const char *
-turn(c)
- char c;
+turn(char c)
{
if (p.altitude == 0)
return ("Planes at airports may not change direction");
@@ -330,8 +327,7 @@ turn(c)
}
const char *
-circle(c)
- char c;
+circle(char c)
{
if (p.altitude == 0)
return ("Planes cannot circle on the ground");
@@ -340,8 +336,7 @@ circle(c)
}
const char *
-left(c)
- char c;
+left(char c)
{
dir = D_LEFT;
p.new_dir = p.dir - 1;
@@ -351,8 +346,7 @@ left(c)
}
const char *
-right(c)
- char c;
+right(char c)
{
dir = D_RIGHT;
p.new_dir = p.dir + 1;
@@ -362,8 +356,7 @@ right(c)
}
const char *
-Left(c)
- char c;
+Left(char c)
{
p.new_dir = p.dir - 2;
if (p.new_dir < 0)
@@ -372,8 +365,7 @@ Left(c)
}
const char *
-Right(c)
- char c;
+Right(char c)
{
p.new_dir = p.dir + 2;
if (p.new_dir >= MAXDIR)
@@ -382,8 +374,7 @@ Right(c)
}
const char *
-delayb(c)
- char c;
+delayb(char c)
{
int xdiff, ydiff;
@@ -432,48 +423,42 @@ delayb(c)
}
const char *
-beacon(c)
- char c;
+beacon(char c)
{
dest_type = T_BEACON;
return (NULL);
}
const char *
-ex_it(c)
- char c;
+ex_it(char c)
{
dest_type = T_EXIT;
return (NULL);
}
const char *
-airport(c)
- char c;
+airport(char c)
{
dest_type = T_AIRPORT;
return (NULL);
}
const char *
-climb(c)
- char c;
+climb(char c)
{
dir = D_UP;
return (NULL);
}
const char *
-descend(c)
- char c;
+descend(char c)
{
dir = D_DOWN;
return (NULL);
}
const char *
-setalt(c)
- char c;
+setalt(char c)
{
if ((p.altitude == c - '0') && (p.new_altitude == p.altitude))
return ("Already at that altitude");
@@ -482,8 +467,7 @@ setalt(c)
}
const char *
-setrelalt(c)
- char c;
+setrelalt(char c)
{
if (c == 0)
return ("altitude not changed");
@@ -507,8 +491,7 @@ setrelalt(c)
}
const char *
-benum(c)
- char c;
+benum(char c)
{
dest_no = c -= '0';
@@ -539,16 +522,14 @@ benum(c)
}
const char *
-to_dir(c)
- char c;
+to_dir(char c)
{
p.new_dir = dir_no(c);
return (NULL);
}
const char *
-rel_dir(c)
- char c;
+rel_dir(char c)
{
int angle;
@@ -572,8 +553,7 @@ rel_dir(c)
}
const char *
-mark(c)
- char c;
+mark(char c)
{
if (p.altitude == 0)
return ("Cannot mark planes on the ground");
@@ -584,8 +564,7 @@ mark(c)
}
const char *
-unmark(c)
- char c;
+unmark(char c)
{
if (p.altitude == 0)
return ("Cannot unmark planes on the ground");
@@ -596,8 +575,7 @@ unmark(c)
}
const char *
-ignore(c)
- char c;
+ignore(char c)
{
if (p.altitude == 0)
return ("Cannot ignore planes on the ground");
@@ -608,8 +586,7 @@ ignore(c)
}
int
-dir_no(ch)
- char ch;
+dir_no(char ch)
{
int dir;
diff --git a/games/atc/list.c b/games/atc/list.c
index a18e8f6daca..c51c69a8a7c 100644
--- a/games/atc/list.c
+++ b/games/atc/list.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: list.c,v 1.5 2003/11/08 19:17:27 jmc Exp $ */
+/* $OpenBSD: list.c,v 1.6 2004/11/29 08:52:28 jsg Exp $ */
/* $NetBSD: list.c,v 1.3 1995/03/21 15:04:18 cgd Exp $ */
/*-
@@ -46,14 +46,14 @@
#if 0
static char sccsid[] = "@(#)list.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: list.c,v 1.5 2003/11/08 19:17:27 jmc Exp $";
+static char rcsid[] = "$OpenBSD: list.c,v 1.6 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
#include "include.h"
PLANE *
-newplane()
+newplane(void)
{
PLANE *p;
@@ -63,9 +63,7 @@ newplane()
}
void
-append(l, p)
- LIST *l;
- PLANE *p;
+append(LIST *l, PLANE *p)
{
PLANE *q = NULL, *r = NULL;
@@ -102,9 +100,7 @@ append(l, p)
}
void
-delete(l, p)
- LIST *l;
- PLANE *p;
+delete(LIST *l, PLANE *p)
{
if (l->head == NULL)
loser(p, "deleted a non-existent plane! Get help!");
diff --git a/games/atc/log.c b/games/atc/log.c
index f9143519635..a91543179e5 100644
--- a/games/atc/log.c
+++ b/games/atc/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.14 2003/09/26 15:52:16 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.15 2004/11/29 08:52:28 jsg Exp $ */
/* $NetBSD: log.c,v 1.3 1995/03/21 15:04:21 cgd Exp $ */
/*-
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: log.c,v 1.14 2003/09/26 15:52:16 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: log.c,v 1.15 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
@@ -56,8 +56,7 @@ static char rcsid[] = "$OpenBSD: log.c,v 1.14 2003/09/26 15:52:16 deraadt Exp $"
static FILE *score_fp;
int
-compar(va, vb)
- const void *va, *vb;
+compar(const void *va, const void *vb)
{
const SCORE *a, *b;
@@ -80,8 +79,7 @@ compar(va, vb)
#define SEC(t) ((t) % SECAMIN)
const char *
-timestr(t)
- int t;
+timestr(int t)
{
static char s[80];
@@ -101,7 +99,7 @@ timestr(t)
}
int
-open_score_file()
+open_score_file(void)
{
mode_t old_mode;
int score_fd;
@@ -126,8 +124,7 @@ open_score_file()
}
int
-log_score(list_em)
- int list_em;
+log_score(int list_em)
{
int i, num_scores = 0, good, changed = 0, found = 0;
struct passwd *pw;
@@ -263,8 +260,7 @@ log_score(list_em)
}
void
-log_score_quit(dummy)
- int dummy;
+log_score_quit(int dummy)
{
(void)log_score(0);
exit(0);
diff --git a/games/atc/main.c b/games/atc/main.c
index 857ec2edc17..172417f47f8 100644
--- a/games/atc/main.c
+++ b/games/atc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.11 2003/06/03 03:01:38 millert Exp $ */
+/* $OpenBSD: main.c,v 1.12 2004/11/29 08:52:28 jsg Exp $ */
/* $NetBSD: main.c,v 1.4 1995/04/27 21:22:25 mycroft Exp $ */
/*-
@@ -52,7 +52,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.11 2003/06/03 03:01:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.12 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
@@ -60,9 +60,7 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.11 2003/06/03 03:01:38 millert Exp $
#include "pathnames.h"
int
-main(ac, av)
- int ac;
- char *av[];
+main(int ac, char *av[])
{
int f_usage = 0, f_list = 0, f_showscore = 0;
int f_printpath = 0;
@@ -230,8 +228,7 @@ main(ac, av)
}
int
-read_file(s)
- const char *s;
+read_file(const char *s)
{
extern FILE *yyin;
int retval;
@@ -252,7 +249,7 @@ read_file(s)
}
const char *
-default_game()
+default_game(void)
{
FILE *fp;
static char file[256];
@@ -281,8 +278,7 @@ default_game()
}
const char *
-okay_game(s)
- const char *s;
+okay_game(const char *s)
{
FILE *fp;
static char file[256];
@@ -321,7 +317,7 @@ okay_game(s)
}
int
-list_games()
+list_games(void)
{
FILE *fp;
char line[256], games[256];
diff --git a/games/atc/update.c b/games/atc/update.c
index 30eb20f2d10..ad1e4472704 100644
--- a/games/atc/update.c
+++ b/games/atc/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.8 2003/06/03 03:01:38 millert Exp $ */
+/* $OpenBSD: update.c,v 1.9 2004/11/29 08:52:28 jsg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -45,15 +45,14 @@
#if 0
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: update.c,v 1.8 2003/06/03 03:01:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: update.c,v 1.9 2004/11/29 08:52:28 jsg Exp $";
#endif
#endif /* not lint */
#include "include.h"
void
-update(dummy)
- int dummy;
+update(int dummy)
{
int i, dir_diff, unclean;
PLANE *pp, *p1, *p2;
@@ -219,8 +218,7 @@ update(dummy)
}
const char *
-command(pp)
- PLANE *pp;
+command(PLANE *pp)
{
static char buf[50], *bp, *comm_start;
@@ -254,8 +252,7 @@ command(pp)
}
char
-name(p)
- const PLANE *p;
+name(const PLANE *p)
{
if (p->plane_type == 0)
return ('A' + p->plane_no);
@@ -264,8 +261,7 @@ name(p)
}
int
-number(l)
- char l;
+number(char l)
{
if (l < 'a' && l > 'z' && l < 'A' && l > 'Z')
return (-1);
@@ -276,7 +272,7 @@ number(l)
}
int
-next_plane()
+next_plane(void)
{
static int last_plane = -1;
PLANE *pp;
@@ -305,7 +301,7 @@ next_plane()
}
int
-addplane()
+addplane(void)
{
PLANE p, *pp, *p1;
int i, num_starts, close, rnd, rnd2, pnum;
@@ -376,8 +372,7 @@ addplane()
}
PLANE *
-findplane(n)
- int n;
+findplane(int n)
{
PLANE *pp;
@@ -391,9 +386,7 @@ findplane(n)
}
int
-too_close(p1, p2, dist)
- const PLANE *p1, *p2;
- int dist;
+too_close(const PLANE *p1, const PLANE *p2, int dist)
{
if (ABS(p1->altitude - p2->altitude) <= dist &&
ABS(p1->xpos - p2->xpos) <= dist && ABS(p1->ypos - p2->ypos) <= dist)
@@ -403,8 +396,7 @@ too_close(p1, p2, dist)
}
int
-dir_deg(d)
- int d;
+dir_deg(int d)
{
switch (d) {
case 0: return (0);