X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/f12b51f99bbe8bb6ad7eca12b047ba9b46836ee6..e7cd658820ba2c7119b98f1c8959b6fbe8e379b7:/battlestar/extern.h diff --git a/battlestar/extern.h b/battlestar/extern.h index fd6d9629..ce9a3127 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.29 2003/08/07 09:37:02 agc Exp $ */ +/* $NetBSD: extern.h,v 1.36 2014/03/22 23:33:33 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,17 +38,18 @@ #include #include #include +#include #include #include -#define BITS (8 * sizeof (int)) +#define BITS (CHAR_BIT * sizeof (unsigned int)) #define OUTSIDE (position > 68 && position < 246 && position != 218) -#define rnd(x) (rand() % (x)) +#define rnd(x) (random() % (x)) #define max(a,b) ((a) < (b) ? (b) : (a)) -#define testbit(array, index) (array[index/BITS] & (1 << (index % BITS))) -#define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) -#define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) +#define testbit(array, index) (array[index/BITS] & (1U << (index % BITS))) +#define setbit(array, index) (array[index/BITS] |= (1U << (index % BITS))) +#define clearbit(array, index) (array[index/BITS] &= ~(1U << (index % BITS))) /* well known rooms */ #define FINAL 275 @@ -328,60 +329,58 @@ extern const struct objs nightobjs[]; #define DEFAULT_SAVE_FILE ".Bstar" -void bury __P((void)); -int card __P((const char *, int)); -void chime __P((void)); -void convert __P((int)); -void crash __P((void)); -int cypher __P((void)); -void die __P((void)) __attribute__((__noreturn__)); -void diesig __P((int)) __attribute__((__noreturn__)); -void dig __P((void)); -void dooropen __P((void)); -int draw __P((void)); -void drink __P((void)); -int drive __P((void)); -int drop __P((const char *)); -int eat __P((void)); -int fight __P((int, int)); -int follow __P((void)); -char *getcom __P((char *, int, const char *, const char *)); -char *getword __P((char *, char *, int)); -int give __P((void)); -void initialize __P((const char *)); -int jump __P((void)); -void kiss __P((void)); -int land __P((void)); -int launch __P((void)); -void light __P((void)); -void live __P((void)) __attribute__((__noreturn__)); -void love __P((void)); -int moveplayer __P((int, int)); -void murder __P((void)); -void news __P((void)); -void newway __P((int)); -void open_score_file __P((void)); -void parse __P((void)); -void post __P((char)); -void printobjs __P((void)); -int put __P((void)); -int puton __P((void)); -const char *rate __P((void)); -void ravage __P((void)); -void restore __P((const char *)); -int ride __P((void)); -void save __P((const char *)); -char *save_file_name __P((const char *, size_t)); -int shoot __P((void)); -int take __P((unsigned int[])); -int takeoff __P((void)); -int throw __P((const char *)); -const char *truedirec __P((int, char)); -int ucard __P((const unsigned int *)); -int use __P((void)); -int visual __P((void)); -int wearit __P((void)); -void whichway __P((struct room)); -void wordinit __P((void)); -void writedes __P((void)); -int zzz __P((void)); +void bury(void); +int card(const char *, int); +void chime(void); +void crash(void); +int cypher(void); +void die(void) __dead; +void diesig(int) __dead; +void dig(void); +void dooropen(void); +int draw(void); +void drink(void); +int drive(void); +int drop(const char *); +int eat(void); +int fight(int, int); +int follow(void); +char *getcom(char *, int, const char *, const char *); +char *getword(char *, char *, int); +int give(void); +void initialize(const char *); +int jump(void); +void kiss(void); +int land(void); +int launch(void); +void light(void); +void live(void) __dead; +void love(void); +int moveplayer(int, int); +void murder(void); +void news(void); +void newway(int); +void open_score_file(void); +void parse(void); +void printobjs(void); +int put(void); +int puton(void); +const char *rate(void); +void ravage(void); +void restore(const char *); +int ride(void); +void save(const char *); +char *save_file_name(const char *, size_t); +int shoot(void); +int take(unsigned int[]); +int takeoff(void); +int throw(const char *); +const char *truedirec(int, int); +int ucard(const unsigned int *); +int use(void); +int visual(void); +int wearit(void); +void whichway(struct room); +void wordinit(void); +void writedes(void); +int zzz(void);