summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
14c83ed)
Moved prototypes for initialise() and action() from main.c to advent.h
Made the following functions static, so they wouldn't require prototypes:
sig_handler (main.c)
spotted_by_pirate (main.c)
light (actions.c)
CC?=gcc
CCFLAGS+=-std=c99 -D _DEFAULT_SOURCE -Wall -Wpedantic -Wextra -g
CC?=gcc
CCFLAGS+=-std=c99 -D _DEFAULT_SOURCE -Wall -Wpedantic -Wextra -g
+CCFLAGS+=-Wstrict-prototypes
+CCFLAGS+=-Wmissing-prototypes
LIBS=
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LIBS=
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
rm -f newdb.c newdb.h
rm -f README advent.6 MANIFEST *.tar.gz
rm -f *~
rm -f newdb.c newdb.h
rm -f README advent.6 MANIFEST *.tar.gz
rm -f *~
cd tests; $(MAKE) --quiet clean
check: advent
cd tests; $(MAKE) --quiet clean
check: advent
-int light(token_t verb, token_t obj)
+static int light(token_t verb, token_t obj)
/* Light. Applicable only to lamp and urn. */
{
int spk = ACTSPK[verb];
/* Light. Applicable only to lamp and urn. */
{
int spk = ACTSPK[verb];
enum speechpart {unknown, intransitive, transitive};
enum speechpart {unknown, intransitive, transitive};
+void initialise(void);
+int action(FILE *input, enum speechpart part, long verb, token_t obj);
+
/* Phase codes for action returns.
* These were at one time FORTRAN line numbers.
* The values don't matter, but perturb their order at your peril.
/* Phase codes for action returns.
* These were at one time FORTRAN line numbers.
* The values don't matter, but perturb their order at your peril.
bool editline = true;
bool prompt = true;
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)
{
if (signo == SIGINT){
if (logfp != NULL)
-bool spotted_by_pirate(int i)
+static bool spotted_by_pirate(int i)
{
if (i != PIRATE)
return false;
{
if (i != PIRATE)
return false;