Really mean it about strict C99 compliance.
This commit is contained in:
parent
4beb21e08f
commit
519d8f07e6
5 changed files with 15 additions and 6 deletions
7
Makefile
7
Makefile
|
@ -1,5 +1,6 @@
|
|||
# Makefile for the open-source release of adventure 2.5
|
||||
|
||||
CCFLAGS=-std=c99
|
||||
LIBS=-lrt
|
||||
UNAME_S := $(shell uname -s)
|
||||
GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
|
||||
|
@ -13,10 +14,10 @@ OBJS=main.o init.o actions1.o actions2.o score.o misc.o
|
|||
SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h
|
||||
|
||||
.c.o:
|
||||
$(CC) -O $(DBX) -c $<
|
||||
$(CC) $(CCFLAGS) -O $(DBX) -c $<
|
||||
|
||||
advent: $(OBJS) database.o
|
||||
$(CC) -Wall -std=c99 -O $(DBX) -o advent $(OBJS) database.o $(LIBS)
|
||||
$(CC) $(CCFLAGS) -O $(DBX) -o advent $(OBJS) database.o $(LIBS)
|
||||
|
||||
main.o: main.h misc.h funcs.h database.h
|
||||
|
||||
|
@ -32,7 +33,7 @@ misc.o: misc.h main.h database.h
|
|||
|
||||
database.c database.h: compile
|
||||
./compile
|
||||
$(CC) $(OPTIONS) -O $(DBX) -c database.c
|
||||
$(CC) $(CCFLAGS) -O $(DBX) -c database.c
|
||||
|
||||
clean:
|
||||
rm -f *.o advent advent.html advent.6 database.[ch] compile
|
||||
|
|
|
@ -523,7 +523,7 @@ L8300: SPK=201;
|
|||
/* This next part is shared with the "resume" code. The two cases are
|
||||
* distinguished by the value of kk (-1 for suspend, +1 for resume). */
|
||||
|
||||
L8305: DATIME(I,K);
|
||||
L8305: DATIME(&I,&K);
|
||||
K=I+650*K;
|
||||
SAVWRD(KK,K);
|
||||
K=VRSION;
|
||||
|
|
2
main.c
2
main.c
|
@ -8,6 +8,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include "main.h"
|
||||
#include "database.h"
|
||||
#include "misc.h"
|
||||
|
@ -920,4 +921,5 @@ L12400: LIMIT= -1;
|
|||
L18999: RSPEAK(SPK);
|
||||
L19000: RSPEAK(136);
|
||||
score(0);
|
||||
return true;
|
||||
}
|
||||
|
|
7
misc.c
7
misc.c
|
@ -2,6 +2,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include "main.h"
|
||||
#include "share.h" /* for SETUP */
|
||||
#include "misc.h"
|
||||
|
@ -1002,5 +1003,11 @@ L30: if(IN)IGNORE(fread(ARR,sizeof(long),250,F));
|
|||
|
||||
|
||||
|
||||
void DATIME(long* D, long* T) {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
*D = (long) tv.tv_sec;
|
||||
*T = (long) tv.tv_usec;
|
||||
}
|
||||
long fIABS(N)long N; {return(N<0? -N : N);}
|
||||
long fMOD(N,M)long N, M; {return(N%M);}
|
||||
|
|
3
misc.h
3
misc.h
|
@ -1,4 +1,3 @@
|
|||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -68,7 +67,7 @@ extern void fMPINIT();
|
|||
#define MPINIT() fMPINIT()
|
||||
extern void fSAVEIO(long,long,long*);
|
||||
#define SAVEIO(OP,IN,ARR) fSAVEIO(OP,IN,ARR)
|
||||
#define DATIME(D,T) do {struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); D=ts.tv_sec, T=ts.tv_nsec;} while (0)
|
||||
extern void DATIME(long*, long*);
|
||||
extern long fIABS(long);
|
||||
#define IABS(N) fIABS(N)
|
||||
extern long fMOD(long,long);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue