From: Eric S. Raymond Date: Thu, 4 Nov 2004 21:12:18 +0000 (+0000) Subject: First step towards getting rid of the non-ANSI stuff. X-Git-Tag: 2.0~433 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5ac8c94a3ddf49203587787f3cb0d85052e51d55;p=super-star-trek.git First step towards getting rid of the non-ANSI stuff. --- diff --git a/linux.c b/linux.c index 708f933..d99c738 100644 --- a/linux.c +++ b/linux.c @@ -6,13 +6,3 @@ void randomize(void) { } -int max(int a, int b) { - if (a > b) return a; - return b; -} - -int min(int a, int b) { - if (a < b) return a; - return b; -} - diff --git a/makefile b/makefile index 0a0f9ff..592f4ef 100644 --- a/makefile +++ b/makefile @@ -7,7 +7,7 @@ CFLAGS= -O -g -DSSTDOC='"/usr/share/doc/sst/sst.doc"' .c.o: $(CC) $(CFLAGS) -c $< -CFILES= sst.c finish.c reports.c setup.c linux.c moving.c battle.c events.c ai.c planets.c +CFILES= sst.c finish.c reports.c setup.c moving.c battle.c events.c ai.c planets.c OFILES= $(CFILES:.c=.o) HFILES=sst.h DOCS = README sst-doc.xml sst.xml TODO diff --git a/os2.c b/os2.c index e419e29..1670895 100644 --- a/os2.c +++ b/os2.c @@ -4,14 +4,3 @@ void randomize(void) { srand((int)time(NULL)); } - - -int max(int a, int b) { - if (a > b) return a; - return b; -} - -int min(int a, int b) { - if (a < b) return a; - return b; -} diff --git a/setup.c b/setup.c index 5b8c20d..6497744 100644 --- a/setup.c +++ b/setup.c @@ -378,6 +378,10 @@ void setup(int needprompt) { if (neutz) attack(0); // bad luck to start in a Romulan Neutral Zone } +void randomize(void) { + srand((int)time(NULL)); +} + int choose(int needprompt) { tourn = 0; thawed = 0; diff --git a/sst.c b/sst.c index 5fc0997..ee5bd3e 100644 --- a/sst.c +++ b/sst.c @@ -428,7 +428,7 @@ char *cramlc(enum loctype key, int x, int y) { void crmena(int i, int enemy, int key, int x, int y) { if (i == 1) proutn("***"); cramen(enemy); - proutn(" at"); + proutn(" at "); proutn(cramlc(key, x, y)); } diff --git a/sst.h b/sst.h index 40ba849..0966319 100644 --- a/sst.h +++ b/sst.h @@ -8,6 +8,9 @@ #define EXTERN #endif +#define min(x, y) ((x)<(y)?(x):(y)) +#define max(x, y) ((x)>(y)?(x):(y)) + // #define DEBUG #define NDEVICES (15) // Number of devices