X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=526eda171513899093f5a381e7a218d621d4fc86;hb=d844c2a3913e1c7d331b080a4a09631e515d9364;hp=706b2987db1e9eec58ffaf4996ec8762a214f0df;hpb=32fdd08d9bd3f9e17421771bcc428530f20daef0;p=open-adventure.git diff --git a/main.c b/main.c index 706b298..526eda1 100644 --- a/main.c +++ b/main.c @@ -48,10 +48,7 @@ bool oldstyle = false; bool editline = true; bool prompt = true; -extern void initialise(); -extern int action(FILE *, long, long, long); - -void sig_handler(int signo) +static void sig_handler(int signo) { if (signo == SIGINT){ if (logfp != NULL) @@ -95,13 +92,13 @@ int main(int argc, char *argv[]) editline = prompt = false; break; case 'r': - rfp = fopen(optarg, "r"); - if (rfp == NULL) - fprintf(stderr, - "advent: can't open save file %s for read\n", - optarg); - signal(SIGINT, sig_handler); - break; + rfp = fopen(optarg, "r"); + if (rfp == NULL) + fprintf(stderr, + "advent: can't open save file %s for read\n", + optarg); + signal(SIGINT, sig_handler); + break; case 's': editline = false; break; @@ -268,7 +265,7 @@ static void checkhints(FILE *cmdin) } } -bool spotted_by_pirate(int i) +static bool spotted_by_pirate(int i) { if (i != PIRATE) return false; @@ -916,7 +913,7 @@ static void listobjects(void) static bool do_command(FILE *cmdin) /* Get and execute a command */ { - long verb, V1, V2; + long verb=0, V1, V2; long kmod, defn; static long igo = 0; static long obj = 0; @@ -953,7 +950,7 @@ static bool do_command(FILE *cmdin) for (;;) { if (game.loc == 0) croak(cmdin); - char* msg = locations[game.loc].description.small; + const char* msg = locations[game.loc].description.small; if (MOD(game.abbrev[game.loc],game.abbnum) == 0 || msg == 0) msg=locations[game.loc].description.big; if (!FORCED(game.loc) && DARK(game.loc)) {