Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/sail Use separate definitions and extern declarations ...
details: https://anonhg.NetBSD.org/src/rev/98f43f78e94d
branches: trunk
changeset: 479951:98f43f78e94d
user: jsm <jsm%NetBSD.org@localhost>
date: Tue Dec 28 18:05:24 1999 +0000
description:
Use separate definitions and extern declarations of variables rather
than linker commons.
diffstat:
games/sail/extern.h | 52 ++++++++++++++++++++++++++--------------------------
games/sail/globals.c | 25 +++++++++++++++++++++++--
games/sail/pl_7.c | 20 ++++++++++++++++++--
games/sail/player.h | 30 +++++++++++++++---------------
4 files changed, 82 insertions(+), 45 deletions(-)
diffs (236 lines):
diff -r 511899d30001 -r 98f43f78e94d games/sail/extern.h
--- a/games/sail/extern.h Tue Dec 28 15:47:41 1999 +0000
+++ b/games/sail/extern.h Tue Dec 28 18:05:24 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.12 1999/09/30 18:01:33 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.13 1999/12/28 18:05:24 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,20 +43,20 @@
#include "machdep.h"
/* program mode */
-int mode;
-jmp_buf restart;
+extern int mode;
+extern jmp_buf restart;
#define MODE_PLAYER 1
#define MODE_DRIVER 2
#define MODE_LOGGER 3
/* command line flags */
-char debug; /* -D */
-char randomize; /* -x, give first available ship */
-char longfmt; /* -l, print score in long format */
-char nobells; /* -b, don't ring bell before Signal */
+extern char debug; /* -D */
+extern char randomize; /* -x, give first available ship */
+extern char longfmt; /* -l, print score in long format */
+extern char nobells; /* -b, don't ring bell before Signal */
/* other initial modes */
-char issetuid; /* running setuid */
+extern char issetuid; /* running setuid */
#define die() ((rand() >> 3) % 6 + 1)
#define sqr(a) ((a) * (a))
@@ -232,7 +232,7 @@
struct ship ship[NSHIP]; /* 16 */
};
extern struct scenario scene[];
-int nscene;
+extern int nscene;
struct shipspecs {
char bs;
@@ -257,8 +257,8 @@
};
extern struct shipspecs specs[];
-struct scenario *cc; /* the current scenario */
-struct ship *ls; /* &cc->ship[cc->vessels] */
+extern struct scenario *cc; /* the current scenario */
+extern struct ship *ls; /* &cc->ship[cc->vessels] */
#define SHIP(s) (&cc->ship[s])
#define foreachship(sp) for ((sp) = cc->ship; (sp) < ls; (sp)++)
@@ -266,19 +266,19 @@
struct windeffects {
char A, B, C, D;
};
-const struct windeffects WET[7][6];
+extern const struct windeffects WET[7][6];
struct Tables {
char H, G, C, R;
};
-const struct Tables RigTable[11][6];
-const struct Tables HullTable[11][6];
+extern const struct Tables RigTable[11][6];
+extern const struct Tables HullTable[11][6];
-const char AMMO[9][4];
-const char HDT[9][10];
-const char HDTrake[9][10];
-const char QUAL[9][5];
-const char MT[9][3];
+extern const char AMMO[9][4];
+extern const char HDT[9][10];
+extern const char HDTrake[9][10];
+extern const char QUAL[9][5];
+extern const char MT[9][3];
extern const char *const countryname[];
extern const char *const classname[];
@@ -290,13 +290,13 @@
extern const char dr[], dc[];
-int winddir;
-int windspeed;
-int turn;
-int game;
-int alive;
-int people;
-char hasdriver;
+extern int winddir;
+extern int windspeed;
+extern int turn;
+extern int game;
+extern int alive;
+extern int people;
+extern char hasdriver;
/* assorted.c */
void table __P((int, int, int, struct ship *, struct ship *, int));
diff -r 511899d30001 -r 98f43f78e94d games/sail/globals.c
--- a/games/sail/globals.c Tue Dec 28 15:47:41 1999 +0000
+++ b/games/sail/globals.c Tue Dec 28 18:05:24 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.c,v 1.7 1999/09/08 21:17:58 jsm Exp $ */
+/* $NetBSD: globals.c,v 1.8 1999/12/28 18:05:24 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: globals.c,v 1.7 1999/09/08 21:17:58 jsm Exp $");
+__RCSID("$NetBSD: globals.c,v 1.8 1999/12/28 18:05:24 jsm Exp $");
#endif
#endif /* not lint */
@@ -544,3 +544,24 @@
const char dr[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
const char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 };
+
+int mode;
+jmp_buf restart;
+
+char debug; /* -D */
+char randomize; /* -x, give first available ship */
+char longfmt; /* -l, print score in long format */
+char nobells; /* -b, don't ring bell before Signal */
+
+char issetuid;
+
+struct scenario *cc; /* the current scenario */
+struct ship *ls; /* &cc->ship[cc->vessels] */
+
+int winddir;
+int windspeed;
+int turn;
+int game;
+int alive;
+int people;
+char hasdriver;
diff -r 511899d30001 -r 98f43f78e94d games/sail/pl_7.c
--- a/games/sail/pl_7.c Tue Dec 28 15:47:41 1999 +0000
+++ b/games/sail/pl_7.c Tue Dec 28 18:05:24 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_7.c,v 1.12 1999/09/08 21:45:30 jsm Exp $ */
+/* $NetBSD: pl_7.c,v 1.13 1999/12/28 18:05:25 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_7.c,v 1.12 1999/09/08 21:45:30 jsm Exp $");
+__RCSID("$NetBSD: pl_7.c,v 1.13 1999/12/28 18:05:25 jsm Exp $");
#endif
#endif /* not lint */
@@ -61,6 +61,22 @@
static const char *sc_buf;
static int sc_line;
+WINDOW *view_w;
+WINDOW *slot_w;
+WINDOW *scroll_w;
+WINDOW *stat_w;
+WINDOW *turn_w;
+
+char done_curses;
+char loaded, fired, changed, repaired;
+char dont_adjust;
+int viewrow, viewcol;
+char movebuf[sizeof SHIP(0)->file->movebuf];
+int player;
+struct ship *ms; /* memorial structure, &cc->ship[player] */
+struct File *mf; /* ms->file */
+struct shipspecs *mc; /* ms->specs */
+
void
initscreen()
{
diff -r 511899d30001 -r 98f43f78e94d games/sail/player.h
--- a/games/sail/player.h Tue Dec 28 15:47:41 1999 +0000
+++ b/games/sail/player.h Tue Dec 28 18:05:24 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: player.h,v 1.7 1999/04/18 03:30:12 simonb Exp $ */
+/* $NetBSD: player.h,v 1.8 1999/12/28 18:05:25 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -98,22 +98,22 @@
#define SCREENTEST() (initscr() != NULL && STAT_R < COLS && SCROLL_Y > 0)
#endif
-WINDOW *view_w;
-WINDOW *slot_w;
-WINDOW *scroll_w;
-WINDOW *stat_w;
-WINDOW *turn_w;
+extern WINDOW *view_w;
+extern WINDOW *slot_w;
+extern WINDOW *scroll_w;
+extern WINDOW *stat_w;
+extern WINDOW *turn_w;
-char done_curses;
-char loaded, fired, changed, repaired;
-char dont_adjust;
-int viewrow, viewcol;
-char movebuf[sizeof SHIP(0)->file->movebuf];
+extern char done_curses;
+extern char loaded, fired, changed, repaired;
+extern char dont_adjust;
+extern int viewrow, viewcol;
+extern char movebuf[sizeof SHIP(0)->file->movebuf];
extern char version[];
-int player;
-struct ship *ms; /* memorial structure, &cc->ship[player] */
-struct File *mf; /* ms->file */
-struct shipspecs *mc; /* ms->specs */
+extern int player;
+extern struct ship *ms; /* memorial structure, &cc->ship[player] */
+extern struct File *mf; /* ms->file */
+extern struct shipspecs *mc; /* ms->specs */
/* condition codes for leave() */
#define LEAVE_QUIT 0
Home |
Main Index |
Thread Index |
Old Index