From 43894be666e21e1764b01f348801a03f09141645 Mon Sep 17 00:00:00 2001 From: jwise Date: Thu, 4 Jan 2001 02:43:32 +0000 Subject: [PATCH] Second half of static-ization of local funcs. --- games/sail/extern.h | 10 +--------- games/sail/misc.c | 14 +++++++++++--- games/sail/parties.c | 8 ++++++-- games/sail/pl_1.c | 8 ++++++-- games/sail/pl_2.c | 6 ++++-- games/sail/pl_3.c | 8 ++++++-- games/sail/pl_4.c | 10 ++++++++-- games/sail/pl_5.c | 10 +++++++--- games/sail/pl_6.c | 10 +++++++--- games/sail/pl_7.c | 36 ++++++++++++++++++++++++++++-------- games/sail/pl_main.c | 9 ++++++--- games/sail/sync.c | 17 ++++++++++++++--- 12 files changed, 104 insertions(+), 42 deletions(-) diff --git a/games/sail/extern.h b/games/sail/extern.h index 149d500791e2..987e2a1fe915 100644 --- a/games/sail/extern.h +++ b/games/sail/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.20 2001/01/04 01:56:27 jwise Exp $ */ +/* $NetBSD: extern.h,v 1.21 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -345,7 +345,6 @@ int lo_main (void); /* misc.c */ int range (struct ship *, struct ship *); struct ship *closestenemy (struct ship *, int, int); -int angle (int, int); int gunsbear (struct ship *, struct ship *); int portside (struct ship *, struct ship *, int); int colours (struct ship *); @@ -379,11 +378,9 @@ void eyeball (struct ship *); /* pl_5.c */ void acceptmove (void); void acceptboard (void); -void parties (int[3], struct ship *, int, int); /* pl_6.c */ void repair (void); -int turned (void); void loadplayer (void); /* pl_7.c */ @@ -394,9 +391,7 @@ void Signal (const char *, struct ship *, ...) __attribute__((__format__(__printf__,1,3))); void Msg (const char *, ...) __attribute__((__format__(__printf__,1,2))); -void Scroll (void); void prompt (const char *, struct ship *); -void endprompt (int); int sgetch (const char *, struct ship *, int); void sgetstr (const char *, char *, int); void draw_screen (void); @@ -410,11 +405,9 @@ void upview (void); void downview (void); void leftview (void); void rightview (void); -void adjustview (void); /* pl_main.c */ int pl_main (void); -void initialize (void); /* sync.c */ void fmtship (char *, size_t, const char *, struct ship *); @@ -428,4 +421,3 @@ void sync_close (int); void Write (int, struct ship *, long, long, long, long); void Writestr (int, struct ship *, const char *); int Sync (void); -int sync_update (int, struct ship *, const char *, long, long, long, long); diff --git a/games/sail/misc.c b/games/sail/misc.c index a1e91ce3529a..8e3858c59a76 100644 --- a/games/sail/misc.c +++ b/games/sail/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: misc.c,v 1.8 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: misc.c,v 1.7 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: misc.c,v 1.8 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ @@ -50,6 +50,14 @@ __RCSID("$NetBSD: misc.c,v 1.7 2001/01/01 21:57:38 jwise Exp $"); #define distance(x,y) (abs(x) >= abs(y) ? abs(x) + abs(y)/2 : abs(y) + abs(x)/2) +int range(struct ship *, struct ship *); +struct ship *closestenemy(struct ship *, int, int); +static int angle(int, int); +int gunsbear(struct ship *, struct ship *); +int portside(struct ship *, struct ship *, int); +int colours(struct ship *); +void logger(struct ship *); + /* XXX */ int range(struct ship *from, struct ship *to) @@ -105,7 +113,7 @@ closestenemy(struct ship *from, int side, int anyship) return closest; } -int +static int angle(int dr, int dc) { int i; diff --git a/games/sail/parties.c b/games/sail/parties.c index f4df352a7b17..28b266c90e72 100644 --- a/games/sail/parties.c +++ b/games/sail/parties.c @@ -1,4 +1,4 @@ -/* $NetBSD: parties.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: parties.c,v 1.8 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,12 +38,16 @@ #if 0 static char sccsid[] = "@(#)parties.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: parties.c,v 1.7 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: parties.c,v 1.8 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ #include "extern.h" +int meleeing(struct ship *, struct ship *); +int boarding(struct ship *, int); +void unboard(struct ship *, struct ship *, int); + int meleeing(struct ship *from, struct ship *to) { diff --git a/games/sail/pl_1.c b/games/sail/pl_1.c index 56d7ad3b804c..c73657b1e5b1 100644 --- a/games/sail/pl_1.c +++ b/games/sail/pl_1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_1.c,v 1.9 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_1.c,v 1.10 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pl_1.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_1.c,v 1.9 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_1.c,v 1.10 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ @@ -48,6 +48,10 @@ __RCSID("$NetBSD: pl_1.c,v 1.9 2001/01/01 21:57:38 jwise Exp $"); #include #include +void leave(int); +void choke(int); +void child(int); + /* * If we get here before a ship is chosen, then ms == 0 and * we don't want to update the score file, or do any Write's either. diff --git a/games/sail/pl_2.c b/games/sail/pl_2.c index f69f7ebed466..efd66ddd1379 100644 --- a/games/sail/pl_2.c +++ b/games/sail/pl_2.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_2.c,v 1.5 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_2.c,v 1.6 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,12 +38,14 @@ #if 0 static char sccsid[] = "@(#)pl_2.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_2.c,v 1.5 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_2.c,v 1.6 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ #include "player.h" +void play(void); + void play(void) { diff --git a/games/sail/pl_3.c b/games/sail/pl_3.c index 0fc3588b3a16..8e71f22000fd 100644 --- a/games/sail/pl_3.c +++ b/games/sail/pl_3.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_3.c,v 1.10 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_3.c,v 1.11 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,13 +38,17 @@ #if 0 static char sccsid[] = "@(#)pl_3.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_3.c,v 1.10 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_3.c,v 1.11 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ #include "player.h" #include +void acceptcombat(void); +void grapungrap(void); +void unfoulplayer(void); + void acceptcombat(void) { diff --git a/games/sail/pl_4.c b/games/sail/pl_4.c index bff20cbcb48a..56c6dba80fd4 100644 --- a/games/sail/pl_4.c +++ b/games/sail/pl_4.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_4.c,v 1.9 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_4.c,v 1.10 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,12 +38,18 @@ #if 0 static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_4.c,v 1.9 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_4.c,v 1.10 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ #include "player.h" +void changesail(void); +void acceptsignal(void); +void lookout(void); +const char *saywhat(struct ship *, int); +void eyeball(struct ship *); + void changesail(void) { diff --git a/games/sail/pl_5.c b/games/sail/pl_5.c index fa873d50745e..3d763f3fb497 100644 --- a/games/sail/pl_5.c +++ b/games/sail/pl_5.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_5.c,v 1.8 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_5.c,v 1.9 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_5.c,v 1.8 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_5.c,v 1.9 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ @@ -46,6 +46,10 @@ __RCSID("$NetBSD: pl_5.c,v 1.8 2001/01/01 21:57:38 jwise Exp $"); #define turnfirst(x) (*x == 'r' || *x == 'l') +void acceptmove(void); +void acceptboard(void); +static void parties(int *, struct ship *, int, int); + void acceptmove(void) { @@ -200,7 +204,7 @@ acceptboard(void) unblockalarm(); } -void +static void parties(int *crew, struct ship *to, int isdefense, int buf) { int k, j, men; diff --git a/games/sail/pl_6.c b/games/sail/pl_6.c index 6e58bd7b8551..0f071f681bec 100644 --- a/games/sail/pl_6.c +++ b/games/sail/pl_6.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_6.c,v 1.6 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_6.c,v 1.7 2001/01/04 02:43:32 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,12 +38,16 @@ #if 0 static char sccsid[] = "@(#)pl_6.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_6.c,v 1.6 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_6.c,v 1.7 2001/01/04 02:43:32 jwise Exp $"); #endif #endif /* not lint */ #include "player.h" +void repair(void); +static int turned(void); +void loadplayer(void); + void repair(void) { @@ -138,7 +142,7 @@ repair(void) repaired = 1; } -int +static int turned(void) { char *p; diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index b876edcade54..36cd5347ac4e 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_7.c,v 1.16 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_7.c,v 1.17 2001/01/04 02:43:33 jwise 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.16 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_7.c,v 1.17 2001/01/04 02:43:33 jwise Exp $"); #endif #endif /* not lint */ @@ -52,6 +52,28 @@ __RCSID("$NetBSD: pl_7.c,v 1.16 2001/01/01 21:57:38 jwise Exp $"); #include #include +void initscreen(void); +void cleanupscreen(void); +void newturn(int); +void Signal(const char *, struct ship *, ...); +void Msg(const char *, ...); +static void Scroll(void); +void prompt(const char *, struct ship *); +static void endprompt(int); +int sgetch(const char *, struct ship *, int); +void sgetstr(const char *, char *, int); +void draw_screen(void); +void draw_view(void); +void draw_turn(void); +void draw_stat(void); +void draw_slot(void); +void draw_board(void); +void centerview(void); +void upview(void); +void downview(void); +void leftview(void); +void rightview(void); +static void adjustview(void); /* * Display interface @@ -201,7 +223,7 @@ Msg(const char *fmt, ...) Scroll(); } -void +static void Scroll(void) { if (++sc_line >= SCROLL_Y) @@ -211,9 +233,7 @@ Scroll(void) } void -prompt(p, ship) - const char *p; - struct ship *ship; +prompt(const char *p, struct ship *ship) { static char buf[BUFSIZ]; @@ -224,7 +244,7 @@ prompt(p, ship) waddstr(scroll_w, buf); } -void +static void endprompt(int flag) { sc_hasprompt = 0; @@ -510,7 +530,7 @@ rightview(void) viewcol += VIEW_X / 5; } -void +static void adjustview(void) { if (dont_adjust) diff --git a/games/sail/pl_main.c b/games/sail/pl_main.c index 6c974ea8d22f..a818cc33b486 100644 --- a/games/sail/pl_main.c +++ b/games/sail/pl_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_main.c,v 1.10 2001/01/04 01:13:34 jwise Exp $ */ +/* $NetBSD: pl_main.c,v 1.11 2001/01/04 02:43:33 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_main.c,v 1.10 2001/01/04 01:13:34 jwise Exp $"); +__RCSID("$NetBSD: pl_main.c,v 1.11 2001/01/04 02:43:33 jwise Exp $"); #endif #endif /* not lint */ @@ -48,6 +48,9 @@ __RCSID("$NetBSD: pl_main.c,v 1.10 2001/01/04 01:13:34 jwise Exp $"); #include #include +int pl_main(void); +static void initialize(void); + /*ARGSUSED*/ int pl_main(void) @@ -59,7 +62,7 @@ pl_main(void) return 0; /* for lint, play() never returns */ } -void +static void initialize(void) { struct File *fp; diff --git a/games/sail/sync.c b/games/sail/sync.c index 16714ff19083..71043d9a2e8e 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -1,4 +1,4 @@ -/* $NetBSD: sync.c,v 1.15 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: sync.c,v 1.16 2001/01/04 02:43:33 jwise Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sync.c,v 1.15 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: sync.c,v 1.16 2001/01/04 02:43:33 jwise Exp $"); #endif #endif /* not lint */ @@ -59,6 +59,17 @@ __RCSID("$NetBSD: sync.c,v 1.15 2001/01/01 21:57:38 jwise Exp $"); #define BUFSIZE 4096 +void fmtship(char *, size_t, const char *, struct ship *); +void makesignal(struct ship *, const char *, struct ship *, ...); +void makemsg(struct ship *, const char *, ...); +int sync_exists(int); +int sync_open(void); +void sync_close(int); +void Write(int, struct ship *, long, long, long, long); +void Writestr(int, struct ship *, const char *); +int Sync(void); +static int sync_update(int, struct ship *, const char *, long, long, long, long); + static const char SF[] = _PATH_SYNC; static const char LF[] = _PATH_LOCK; static char sync_buf[BUFSIZE]; @@ -304,7 +315,7 @@ out: return erred ? -1 : 0; } -int +static int sync_update(int type, struct ship *ship, const char *astr, long a, long b, long c, long d) { switch (type) {