summaryrefslogtreecommitdiffstats
path: root/trek/main.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1997-10-12 21:24:24 +0000
committerchristos <christos@NetBSD.org>1997-10-12 21:24:24 +0000
commit634cb6ceab3191623a3daed5e953821e3f37a4cb (patch)
tree2bb707d4d2f4e28a241cac2e70f7392be0acb329 /trek/main.c
parenta77b3f8edc13dc6efdbcf80e336689cfa1de08ab (diff)
downloadbsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.tar.gz
bsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.tar.zst
bsdgames-darwin-634cb6ceab3191623a3daed5e953821e3f37a4cb.zip
Warnsify and remove local implementations of libc functions.
Diffstat (limited to 'trek/main.c')
-rw-r--r--trek/main.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/trek/main.c b/trek/main.c
index 9d8491e6..3d90d0f8 100644
--- a/trek/main.c
+++ b/trek/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.4 1995/04/22 10:59:10 cgd Exp $ */
+/* $NetBSD: main.c,v 1.5 1997/10/12 21:25:01 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -33,24 +33,28 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1980, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.4 1995/04/22 10:59:10 cgd Exp $";
+__RCSID("$NetBSD: main.c,v 1.5 1997/10/12 21:25:01 christos Exp $");
#endif
#endif /* not lint */
-# include "trek.h"
-# include <stdio.h>
-# include <setjmp.h>
-# include <termios.h>
+#include <stdio.h>
+#include <setjmp.h>
+#include <termios.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <err.h>
+#include "trek.h"
+#include "getpar.h"
# define PRIO 00 /* default priority */
@@ -155,16 +159,18 @@ int Mother = 51 + (51 << 8);
jmp_buf env;
+int main __P((int, char **));
+
+int
main(argc, argv)
int argc;
char **argv;
{
long vect;
- /* extern FILE *f_log; */
- register char opencode;
+ char opencode;
int prio;
- register int ac;
- register char **av;
+ int ac;
+ char **av;
struct termios argp;
av = argv;
@@ -220,7 +226,7 @@ char **argv;
av++;
}
if (ac > 2)
- syserr(0, "arg count");
+ errx(1, "arg count");
/*
if (ac > 1)
f_log = fopen(av[0], opencode);
@@ -240,4 +246,5 @@ char **argv;
} while (getynpar("Another game"));
fflush(stdout);
+ return 0;
}