Removed WORDLENGTH generation program; no longer assume that the machine
on which we compile is the machine on which we run
This commit is contained in:
parent
27d53b0d33
commit
ac83fe3815
4 changed files with 15 additions and 27 deletions
|
@ -25,7 +25,6 @@ lset.c
|
||||||
lset.h
|
lset.h
|
||||||
makecldef.c
|
makecldef.c
|
||||||
makedepend
|
makedepend
|
||||||
makewlen.c
|
|
||||||
map.c
|
map.c
|
||||||
map.h
|
map.h
|
||||||
parser.c
|
parser.c
|
||||||
|
|
|
@ -22,7 +22,7 @@ PRFILES=$(SRC)
|
||||||
$(CC) -c.m $(CFLAGS) $<
|
$(CC) -c.m $(CFLAGS) $<
|
||||||
|
|
||||||
all:\
|
all:\
|
||||||
classdefs.h pop_push.h wordlen.h alloc.o cset.o debug.o files.o go.o\
|
classdefs.h pop_push.h alloc.o cset.o debug.o files.o go.o\
|
||||||
global.o lset.o map.o parser.o get.o put.o aux.o stack_chg.o locals.o\
|
global.o lset.o map.o parser.o get.o put.o aux.o stack_chg.o locals.o\
|
||||||
init_glob.o
|
init_glob.o
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ cmp: all
|
||||||
distr: pop_push.h
|
distr: pop_push.h
|
||||||
|
|
||||||
em_files:\
|
em_files:\
|
||||||
classdefs.h pop_push.h wordlen.h alloc.m cset.m debug.m\
|
classdefs.h pop_push.h alloc.m cset.m debug.m\
|
||||||
files.m go.m global.m lset.m map.m parser.m get.m put.m aux.m stack_chg.m\
|
files.m go.m global.m lset.m map.m parser.m get.m put.m aux.m stack_chg.m\
|
||||||
locals.m init_glob.m
|
locals.m init_glob.m
|
||||||
|
|
||||||
|
@ -50,13 +50,6 @@ pop_push.h: \
|
||||||
$(EMHOME)/etc/em_table pop_push.awk
|
$(EMHOME)/etc/em_table pop_push.awk
|
||||||
awk -f pop_push.awk < $(EMHOME)/etc/em_table > pop_push.h
|
awk -f pop_push.awk < $(EMHOME)/etc/em_table > pop_push.h
|
||||||
|
|
||||||
wordlen.h: makewordlen
|
|
||||||
makewordlen > wordlen.h
|
|
||||||
rm makewordlen
|
|
||||||
|
|
||||||
makewordlen: makewlen.c
|
|
||||||
$(CC) -o makewordlen makewlen.c
|
|
||||||
|
|
||||||
show: \
|
show: \
|
||||||
show.c
|
show.c
|
||||||
$(CC) -o show show.c $(EMLIB)/em_data.a
|
$(CC) -o show show.c $(EMLIB)/em_data.a
|
||||||
|
@ -73,7 +66,7 @@ clean:
|
||||||
@echo "cleaned. Type 'make oclean' instead."
|
@echo "cleaned. Type 'make oclean' instead."
|
||||||
|
|
||||||
oclean:
|
oclean:
|
||||||
rm -f makeclassdef classdefs.h makewordlen wordlen.h *.o Out out nohup.out *.m
|
rm -f makeclassdef classdefs.h *.o Out out nohup.out *.m
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES)
|
lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES)
|
||||||
|
|
|
@ -17,9 +17,6 @@ extern int ws; /* word size */
|
||||||
/* number of bits in a byte */
|
/* number of bits in a byte */
|
||||||
#define BYTELENGTH 8
|
#define BYTELENGTH 8
|
||||||
|
|
||||||
/* number of bits in a word, defined in automatically generated file */
|
|
||||||
#include "../share/wordlen.h"
|
|
||||||
|
|
||||||
#if BYTELENGTH==8
|
#if BYTELENGTH==8
|
||||||
#define DIVBL(a) ((a) >> 3)
|
#define DIVBL(a) ((a) >> 3)
|
||||||
#define MODBL(a) ((a) & 07)
|
#define MODBL(a) ((a) & 07)
|
||||||
|
@ -28,19 +25,18 @@ extern int ws; /* word size */
|
||||||
#define MODBL(a) (a%BYTELENGTH)
|
#define MODBL(a) (a%BYTELENGTH)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WORDLENGTH==16
|
#define WORDLENGTH (sizeof(int)*BYTELENGTH)
|
||||||
#define DIVWL(a) ((a) >> 4)
|
|
||||||
#define MODWL(a) ((a) & 017)
|
|
||||||
#else
|
|
||||||
#if WORDLENGTH==32
|
|
||||||
#define DIVWL(a) ((a) >> 5)
|
|
||||||
#define MODWL(a) ((a) & 037)
|
|
||||||
#else
|
|
||||||
#define DIVWL(a) (a/WORDLENGTH)
|
|
||||||
#define MODWL(a) (a%WORDLENGTH)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#define DIVWL(a) (WORDLENGTH==16 ? \
|
||||||
|
((a)>>4) : \
|
||||||
|
(WORDLENGTH==32 ? \
|
||||||
|
((a)>>5) : \
|
||||||
|
((a)/(8*sizeof(int)))))
|
||||||
|
#define MODWL(a) (WORDLENGTH==16 ? \
|
||||||
|
((a)&017) : \
|
||||||
|
(WORDLENGTH==32 ? \
|
||||||
|
((a)&037) : \
|
||||||
|
((a)%(8*sizeof(int)))))
|
||||||
|
|
||||||
#define UNKNOWN_SIZE (-1)
|
#define UNKNOWN_SIZE (-1)
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ showcset()
|
||||||
for (;;) {
|
for (;;) {
|
||||||
w = getint();
|
w = getint();
|
||||||
mask = 1 ;
|
mask = 1 ;
|
||||||
for (j = 1; j <= WORDLENGTH; j++) {
|
for (j = 1; j <= sizeof(int)*8; j++) {
|
||||||
if (w & mask) {
|
if (w & mask) {
|
||||||
printf("%d ",i);
|
printf("%d ",i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue