1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-04-28 05:05:41 +00:00

Fix extra semicolon warnings (#345)

"warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning" [-Wextra-semi-stmt]
occurred 254 times in xc.c when warnings were turned up.

Review this commit with "git diff -w ..." to make it easier to see changes other than indentation caused by
the addition of do { ... } while (0) around many macro definition bodies.
This commit is contained in:
Nick Briggs
2021-02-10 20:33:54 -08:00
committed by GitHub
parent 7274e16b24
commit 1fc0d28167
7 changed files with 650 additions and 653 deletions

View File

@@ -30,19 +30,19 @@
#define FLOATP_VALUE(dest) *((float *)Addr68k_from_LADDR(dest)) #define FLOATP_VALUE(dest) *((float *)Addr68k_from_LADDR(dest))
#define N_GETNUMBER(sour, dest, label) \ #define N_GETNUMBER(sour, dest, label) \
{ \ do { \
dest = sour; /* access memory once */ \ dest = sour; /* access memory once */ \
switch (SEGMASK & dest) { \ switch (SEGMASK & dest) { \
case S_POSITIVE: dest = 0xFFFF & (dest); break; \ case S_POSITIVE: dest = 0xFFFF & (dest); break; \
case S_NEGATIVE: dest = 0xFFFF0000 | (dest); break; \ case S_NEGATIVE: dest = 0xFFFF0000 | (dest); break; \
default: \ default: \
if (GetTypeNumber(dest) != TYPE_FIXP) { goto label; } \ if (GetTypeNumber(dest) != TYPE_FIXP) goto label; \
dest = FIXP_VALUE(dest); \ dest = FIXP_VALUE(dest); \
} \ } \
} } while (0)
#define N_IGETNUMBER(sour, dest, label) \ #define N_IGETNUMBER(sour, dest, label) \
{ \ do { \
dest = sour; /* access memory once */ \ dest = sour; /* access memory once */ \
switch (SEGMASK & dest) { \ switch (SEGMASK & dest) { \
case S_POSITIVE: dest = 0xFFFF & dest; break; \ case S_POSITIVE: dest = 0xFFFF & dest; break; \
@@ -60,21 +60,23 @@
} \ } \
break; \ break; \
} \ } \
} } while (0)
#define ARITH_SWITCH(arg, result) \ #define ARITH_SWITCH(arg, result) \
switch ((int)arg & 0xFFFF0000) { \ do { \
case 0: result = (S_POSITIVE | (int)arg); break; \ switch ((int)arg & 0xFFFF0000) { \
case 0xFFFF0000: result = (S_NEGATIVE | (0xFFFF & (int)arg)); break; \ case 0: result = (S_POSITIVE | (int)arg); break; \
default: { \ case 0xFFFF0000: result = (S_NEGATIVE | (0xFFFF & (int)arg)); break; \
register LispPTR *wordp; \ default: { \
/* arg is FIXP, call createcell */ \ register LispPTR *wordp; \
wordp = (LispPTR *)createcell68k(TYPE_FIXP); \ /* arg is FIXP, call createcell */ \
*((int *)wordp) = (int)arg; \ wordp = (LispPTR *)createcell68k(TYPE_FIXP); \
result = (LADDR_from_68k(wordp)); \ *((int *)wordp) = (int)arg; \
break; \ result = (LADDR_from_68k(wordp)); \
} \ break; \
} } \
} \
} while (0)
/* ******* /* *******
NEED to See if this is faster than the N_ARITH_SWITCH macro NEED to See if this is faster than the N_ARITH_SWITCH macro
@@ -100,21 +102,23 @@
} }
****** */ ****** */
#define N_ARITH_SWITCH(arg) \ #define N_ARITH_SWITCH(arg) \
switch (arg & 0xFFFF0000) { \ do { \
case 0: return (S_POSITIVE | arg); \ switch (arg & 0xFFFF0000) { \
case 0xFFFF0000: return (S_NEGATIVE | (0xFFFF & arg)); \ case 0: return (S_POSITIVE | arg); \
default: { \ case 0xFFFF0000: return (S_NEGATIVE | (0xFFFF & arg)); \
register LispPTR *fixpp; \ default: { \
/* arg is FIXP, call createcell */ \ register LispPTR *fixpp; \
fixpp = (LispPTR *)createcell68k(TYPE_FIXP); \ /* arg is FIXP, call createcell */ \
*((int *)fixpp) = arg; \ fixpp = (LispPTR *)createcell68k(TYPE_FIXP); \
return (LADDR_from_68k(fixpp)); \ *((int *)fixpp) = arg; \
} \ return (LADDR_from_68k(fixpp)); \
} } \
} \
} while (0)
#define N_IARITH_BODY_2(a, tos, op) \ #define N_IARITH_BODY_2(a, tos, op) \
{ \ do { \
register int arg1, arg2; \ register int arg1, arg2; \
\ \
N_IGETNUMBER(a, arg1, do_ufn); \ N_IGETNUMBER(a, arg1, do_ufn); \
@@ -126,10 +130,10 @@
\ \
do_ufn: \ do_ufn: \
ERROR_EXIT(tos); \ ERROR_EXIT(tos); \
} } while (0)
#define N_ARITH_BODY_1(a, n, op) \ #define N_ARITH_BODY_1(a, n, op) \
{ \ do { \
register int arg1; \ register int arg1; \
\ \
N_GETNUMBER(a, arg1, do_ufn); \ N_GETNUMBER(a, arg1, do_ufn); \
@@ -140,10 +144,10 @@
\ \
do_ufn: \ do_ufn: \
ERROR_EXIT(a); \ ERROR_EXIT(a); \
} } while (0)
#define N_ARITH_BODY_1_UNSIGNED(a, n, op) \ #define N_ARITH_BODY_1_UNSIGNED(a, n, op) \
{ \ do { \
register unsigned int arg1; \ register unsigned int arg1; \
\ \
N_GETNUMBER(a, arg1, do_ufn); \ N_GETNUMBER(a, arg1, do_ufn); \
@@ -154,6 +158,6 @@
\ \
do_ufn: \ do_ufn: \
ERROR_EXIT(a); \ ERROR_EXIT(a); \
} } while (0)
#endif /* ARITH_H */ #endif /* ARITH_H */

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,7 @@ typedef struct closure_type {
unsigned env_ptr : 28; /* LispPTR to environment */ unsigned env_ptr : 28; /* LispPTR to environment */
} Closure; } Closure;
#else /* not BIGVM */ #else /* not BIGVM */
typedef struct consstr { typedef struct consstr {
unsigned cdr_code : 8; unsigned cdr_code : 8;
unsigned car_field : 24; unsigned car_field : 24;
@@ -146,14 +146,14 @@ typedef struct lbits {
} LBITS; } LBITS;
#define PUTBASEBIT68K(base68k, offset, bitvalue) \ #define PUTBASEBIT68K(base68k, offset, bitvalue) \
{ \ do { \
if (bitvalue) \ if (bitvalue) \
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) |= \ *((DLword *)(base68k) + (((u_short)(offset)) >> 4)) |= \
1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD); \ 1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD); \
else \ else \
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) &= \ *((DLword *)(base68k) + (((u_short)(offset)) >> 4)) &= \
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \ ~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
} } while (0)
#else #else
/*** Byte-swapped structure declarations, for 80386 ***/ /*** Byte-swapped structure declarations, for 80386 ***/
@@ -185,7 +185,7 @@ typedef struct closure_type {
unsigned env_ptr : 28; /* LispPTR to environment */ unsigned env_ptr : 28; /* LispPTR to environment */
unsigned nil2 : 4; unsigned nil2 : 4;
} Closure; } Closure;
#else /* BIGVM */ #else /* BIGVM */
typedef struct consstr { typedef struct consstr {
unsigned car_field : 24; unsigned car_field : 24;
unsigned cdr_code : 8; unsigned cdr_code : 8;
@@ -295,7 +295,7 @@ typedef struct lbits {
} LBITS; } LBITS;
#define PUTBASEBIT68K(base68k, offset, bitvalue) \ #define PUTBASEBIT68K(base68k, offset, bitvalue) \
{ \ do { \
UNSIGNED real68kbase; \ UNSIGNED real68kbase; \
real68kbase = 2 ^ ((UNSIGNED)(base68k)); \ real68kbase = 2 ^ ((UNSIGNED)(base68k)); \
if (bitvalue) \ if (bitvalue) \
@@ -304,7 +304,7 @@ typedef struct lbits {
else \ else \
(*(DLword *)(2 ^ (UNSIGNED)((DLword *)(real68kbase) + (((u_short)(offset)) >> 4)))) &= \ (*(DLword *)(2 ^ (UNSIGNED)((DLword *)(real68kbase) + (((u_short)(offset)) >> 4)))) &= \
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \ ~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
} } while (0)
#endif /* BYTESWAP */ #endif /* BYTESWAP */
@@ -368,40 +368,40 @@ PopCStack:
#define PopCStack {TopOfStack = *((LispPTR *)(--CurrentStackPTR)); --CurrentStackPTR;} #define PopCStack {TopOfStack = *((LispPTR *)(--CurrentStackPTR)); --CurrentStackPTR;}
*****************************************************/ *****************************************************/
#define PopCStack \ #define PopCStack \
{ \ do { \
TopOfStack = *((LispPTR *)(CurrentStackPTR)); \ TopOfStack = *((LispPTR *)(CurrentStackPTR)); \
CurrentStackPTR -= 2; \ CurrentStackPTR -= 2; \
} } while (0)
/**************************************************** /****************************************************
PopStackTo: CSTK -> Place PopStackTo: CSTK -> Place
#define PopStackTo(Place) {Place= *((LispPTR *)(--CurrentStackPTR)); CurrentStackPTR--; } #define PopStackTo(Place) {Place= *((LispPTR *)(--CurrentStackPTR)); CurrentStackPTR--; }
*****************************************************/ *****************************************************/
#define PopStackTo(Place) \ #define PopStackTo(Place) \
{ \ do { \
Place = *((LispPTR *)(CurrentStackPTR)); \ Place = *((LispPTR *)(CurrentStackPTR)); \
CurrentStackPTR -= 2; \ CurrentStackPTR -= 2; \
} } while (0)
/**************************************************** /****************************************************
PushCStack: PushCStack:
#define PushCStack {*((int *)(++CurrentStackPTR)) = TopOfStack; ++CurrentStackPTR;} #define PushCStack {*((int *)(++CurrentStackPTR)) = TopOfStack; ++CurrentStackPTR;}
*****************************************************/ *****************************************************/
#define PushCStack \ #define PushCStack \
{ \ do { \
CurrentStackPTR += 2; \ CurrentStackPTR += 2; \
*((LispPTR *)(CurrentStackPTR)) = TopOfStack; \ *((LispPTR *)(CurrentStackPTR)) = TopOfStack; \
} } while (0)
/**************************************************** /****************************************************
PushStack: PushStack:
#define PushStack(x) {*((LispPTR *)(++CurrentStackPTR))=x;CurrentStackPTR++;} #define PushStack(x) {*((LispPTR *)(++CurrentStackPTR))=x;CurrentStackPTR++;}
*****************************************************/ *****************************************************/
#define PushStack(x) \ #define PushStack(x) \
{ \ do { \
CurrentStackPTR += 2; \ CurrentStackPTR += 2; \
*((LispPTR *)(CurrentStackPTR)) = x; \ *((LispPTR *)(CurrentStackPTR)) = x; \
} } while (0)
/**************************************************** /****************************************************
SmashStack: SmashStack:
@@ -422,13 +422,13 @@ DOSTACKOVERFLOW(argnum,bytenum) if it needs hardreturn-cleanup
then upnt to contextsw and immediately return then upnt to contextsw and immediately return
**********************************************************/ **********************************************************/
#define DOSTACKOVERFLOW(argnum, bytenum) \ #define DOSTACKOVERFLOW(argnum, bytenum) \
{ \ do { \
if (do_stackoverflow(T)) { \ if (do_stackoverflow(T)) { \
PushStack(S_POSITIVE | argnum); \ PushStack(S_POSITIVE | argnum); \
contextsw(SubovFXP, bytenum, 1); \ contextsw(SubovFXP, bytenum, 1); \
return; \ return; \
} \ } \
} } while (0)
/************************************************************************/ /************************************************************************/
/* */ /* */
@@ -488,7 +488,7 @@ DOSTACKOVERFLOW(argnum,bytenum) if it needs hardreturn-cleanup
#define STKLIM 0x1FFFF #define STKLIM 0x1FFFF
#define FRAMESIZE 10 /* size of frameex1: 10 words */ #define FRAMESIZE 10 /* size of frameex1: 10 words */
#define FNHEADSIZE 8 /* size of fnhead: 8 words */ #define FNHEADSIZE 8 /* size of fnhead: 8 words */
#define BFSIZE 2 /* size of basic frame pointer: 2 words */ #define BFSIZE 2 /* size of basic frame pointer: 2 words */
#define BITSPER_DLWORD 16 #define BITSPER_DLWORD 16
#define BITSPER_CELL 32 #define BITSPER_CELL 32

View File

@@ -431,6 +431,6 @@ typedef struct stackp {
#define STK_END_COMPUTE(stk_end, fnobj) ((UNSIGNED)(stk_end)-STK_MIN(fnobj)) #define STK_END_COMPUTE(stk_end, fnobj) ((UNSIGNED)(stk_end)-STK_MIN(fnobj))
#define CLR_IRQ \ #define CLR_IRQ \
{ Irq_Stk_Check = STK_END_COMPUTE((Irq_Stk_End = (UNSIGNED)EndSTKP), FuncObj); } Irq_Stk_Check = STK_END_COMPUTE((Irq_Stk_End = (UNSIGNED) EndSTKP), FuncObj)
#endif #endif

View File

@@ -28,10 +28,10 @@
#define HARD_PUSH(x) *(CSTKPTRL++) = x #define HARD_PUSH(x) *(CSTKPTRL++) = x
#define PUSH(x) \ #define PUSH(x) \
{ \ do { \
HARD_PUSH(TOPOFSTACK); \ HARD_PUSH(TOPOFSTACK); \
TOPOFSTACK = x; \ TOPOFSTACK = x; \
} } while (0)
#define POP TOPOFSTACK = *(--CSTKPTRL) #define POP TOPOFSTACK = *(--CSTKPTRL)
#define GET_TOS_1 *(CSTKPTR - 1) #define GET_TOS_1 *(CSTKPTR - 1)
#define GET_TOS_2 *(CSTKPTR - 2) #define GET_TOS_2 *(CSTKPTR - 2)
@@ -51,10 +51,10 @@
#define HARD_PUSH(x) *(CSTKPTRL++) = x #define HARD_PUSH(x) *(CSTKPTRL++) = x
#define PUSH(x) \ #define PUSH(x) \
{ \ do { \
HARD_PUSH(TOPOFSTACK); \ HARD_PUSH(TOPOFSTACK); \
TOPOFSTACK = x; \ TOPOFSTACK = x; \
} } while (0)
#define POP TOPOFSTACK = *(--CSTKPTRL) #define POP TOPOFSTACK = *(--CSTKPTRL)
#define GET_TOS_1 *(CSTKPTR - 1) #define GET_TOS_1 *(CSTKPTR - 1)
#define GET_TOS_2 *(CSTKPTR - 2) #define GET_TOS_2 *(CSTKPTR - 2)
@@ -69,28 +69,28 @@
/* OPCODE interface routines */ /* OPCODE interface routines */
#define StackPtrSave \ #define StackPtrSave \
{ CurrentStackPTR = (DLword *)(CSTKPTR - 1); } do { CurrentStackPTR = (DLword *)(CSTKPTR - 1); } while (0)
#define StackPtrRestore \ #define StackPtrRestore \
{ CSTKPTRL = ((LispPTR *)CurrentStackPTR) + 1; } do { CSTKPTRL = ((LispPTR *)CurrentStackPTR) + 1; } while (0)
#define EXT \ #define EXT \
{ \ do { \
PC = pccache - 1; \ PC = pccache - 1; \
TopOfStack = TOPOFSTACK; \ TopOfStack = TOPOFSTACK; \
StackPtrSave; \ StackPtrSave; \
} } while (0)
#define RET \ #define RET \
{ \ do { \
pccache = PC + 1; \ pccache = PC + 1; \
StackPtrRestore; \ StackPtrRestore; \
TOPOFSTACK = TopOfStack; \ TOPOFSTACK = TopOfStack; \
} } while (0)
#define NRET \ #define NRET \
{ \ do { \
RET; \ RET; \
nextop0; \ nextop0; \
} } while (0)
#endif /* TOS1DEFS_H */ #endif /* TOS1DEFS_H */

View File

@@ -17,7 +17,7 @@
#if 0 #if 0
#define FN_STACK_CHECK \ #define FN_STACK_CHECK \
if ((UNSIGNED)CSTKPTR >= (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL)))) \ if ((UNSIGNED)CSTKPTR >= (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL)))) \
goto check_interrupt; goto check_interrupt
#else #else
/* JDS 13 Feb 98 -- with Irq_Stk_Chk being unsigned, need to revise */ /* JDS 13 Feb 98 -- with Irq_Stk_Chk being unsigned, need to revise */
/* the test; if Irq_Stk_Chk == 0, can't just do the subtraction now */ /* the test; if Irq_Stk_Chk == 0, can't just do the subtraction now */
@@ -26,7 +26,7 @@
#define FN_STACK_CHECK \ #define FN_STACK_CHECK \
if ((Irq_Stk_End == 0) || \ if ((Irq_Stk_End == 0) || \
((UNSIGNED)CSTKPTR > (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL))))) \ ((UNSIGNED)CSTKPTR > (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL))))) \
goto check_interrupt; goto check_interrupt
#endif /* 0 */ #endif /* 0 */
/****************************************************************/ /****************************************************************/
@@ -66,7 +66,7 @@
#ifdef BIGATOMS #ifdef BIGATOMS
#define APPLY_POP_PUSH_TEST \ #define APPLY_POP_PUSH_TEST \
{ \ do { \
switch (fn_apply) { \ switch (fn_apply) { \
case 0: break; /* do nothing */ \ case 0: break; /* do nothing */ \
case 1: \ case 1: \
@@ -80,17 +80,17 @@
case 5: { \ case 5: { \
unsigned int atm = Get_AtomNo_PCMAC1; \ unsigned int atm = Get_AtomNo_PCMAC1; \
if (atm & SEGMASK) \ if (atm & SEGMASK) \
PUSH(atm) /* new atom */ \ PUSH(atm); /* new atom */ \
else \ else \
PUSH(S_POSITIVE | atm); /* old atom as SMALLP*/ \ PUSH(S_POSITIVE | atm); /* old atom as SMALLP*/ \
} break; \ } break; \
default: error("Storage error: invalid UFN entry"); \ default: error("Storage error: invalid UFN entry"); \
} \ } \
if (needpush) PUSH(fn_atom_index); \ if (needpush) PUSH(fn_atom_index); \
} } while (0)
#else /* not big atoms */ #else /* not big atoms */
#define APPLY_POP_PUSH_TEST \ #define APPLY_POP_PUSH_TEST \
{ \ do { \
switch (fn_apply) { \ switch (fn_apply) { \
case 0: break; /* do nothing */ \ case 0: break; /* do nothing */ \
case 1: \ case 1: \
@@ -104,28 +104,28 @@
default: error("Storage error: invalid UFN entry"); \ default: error("Storage error: invalid UFN entry"); \
} \ } \
if (needpush) PUSH(fn_atom_index); \ if (needpush) PUSH(fn_atom_index); \
} } while (0)
#endif /* BIGATOMS */ #endif /* BIGATOMS */
#define N_APPLY_POP_PUSH_TEST \ #define N_APPLY_POP_PUSH_TEST \
{ \ do { \
APPLY_POP_PUSH_TEST; \ APPLY_POP_PUSH_TEST; \
native_closure_env = closure_env; \ native_closure_env = closure_env; \
} } while (0)
#define N_ENVCALL_POP_TEST \ #define N_ENVCALL_POP_TEST \
{ \ do { \
CSTKPTRL -= 2; \ CSTKPTRL -= 2; \
native_closure_env = closure_env; \ native_closure_env = closure_env; \
} } while (0)
/****************************************************************/ /****************************************************************/
/****** OPAPPLY ********/ /****** OPAPPLY ********/
/****************************************************************/ /****************************************************************/
#ifndef BIGATOMS #ifndef BIGATOMS
#define OPAPPLY \ #define OPAPPLY \
{ \ do { \
if (GET_TOS_1_HI == SPOS_HI) { \ if (GET_TOS_1_HI == SPOS_HI) { \
fn_num_args = GET_TOS_1_LO; \ fn_num_args = GET_TOS_1_LO; \
fn_opcode_size = 1; \ fn_opcode_size = 1; \
@@ -146,10 +146,10 @@
} \ } \
} \ } \
goto op_ufn; \ goto op_ufn; \
} /* OPAPPLY */ } while (0) /* OPAPPLY */
#else #else
#define OPAPPLY \ #define OPAPPLY \
{ \ do { \
if (GET_TOS_1_HI == SPOS_HI) { \ if (GET_TOS_1_HI == SPOS_HI) { \
fn_num_args = GET_TOS_1_LO; \ fn_num_args = GET_TOS_1_LO; \
fn_opcode_size = 1; \ fn_opcode_size = 1; \
@@ -171,7 +171,7 @@
} /* end of switch */ \ } /* end of switch */ \
} \ } \
goto op_ufn; \ goto op_ufn; \
} /* OPAPPLY */ } while (0) /* OPAPPLY */
#endif /* BIGATOMS */ #endif /* BIGATOMS */
/****************************************************************/ /****************************************************************/
@@ -179,7 +179,7 @@
/****************************************************************/ /****************************************************************/
#define OPFN(argcount, num_args_fn, fn_xna_args, fn_native) \ #define OPFN(argcount, num_args_fn, fn_xna_args, fn_native) \
{ /* argcount is a number of the arguments on stack */ \ do { /* argcount is a number of the arguments on stack */ \
register struct fnhead *LOCFNCELL; \ register struct fnhead *LOCFNCELL; \
register int defcell_word; \ register int defcell_word; \
register int NEXTBLOCK; \ register int NEXTBLOCK; \
@@ -242,11 +242,11 @@
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \ PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
FuncObj = LOCFNCELL; \ FuncObj = LOCFNCELL; \
nextop0; \ nextop0; \
} /* end OPFN */ } while (0) /* end OPFN */
/*************** OPFNX *************/ /*************** OPFNX *************/
#define OPFNX \ #define OPFNX \
{ \ do { \
register struct fnhead *LOCFNCELL; \ register struct fnhead *LOCFNCELL; \
register DefCell *defcell; /* this reg is not allocated */ \ register DefCell *defcell; /* this reg is not allocated */ \
register int NEXTBLOCK; \ register int NEXTBLOCK; \
@@ -309,30 +309,30 @@
CSTKPTRL += 1; \ CSTKPTRL += 1; \
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \ PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
FuncObj = LOCFNCELL; \ FuncObj = LOCFNCELL; \
} /* end OPFN */ } while (0) /* end OPFNX */
/****************************************************************/ /****************************************************************/
/****** OPCHECKAPPLY ********/ /****** OPCHECKAPPLY ********/
/****************************************************************/ /****************************************************************/
#ifdef BIGATOMS #ifdef BIGATOMS
#define OPCHECKAPPLY \ #define OPCHECKAPPLY \
{ \ do { \
register DefCell *defcell; \ register DefCell *defcell; \
defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \ defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \
if (!(defcell->ccodep && \ if (!(defcell->ccodep && \
(((TOPOFSTACK & SEGMASK) == 0) || (GetTypeNumber(TOPOFSTACK) == TYPE_NEWATOM)) && \ (((TOPOFSTACK & SEGMASK) == 0) || (GetTypeNumber(TOPOFSTACK) == TYPE_NEWATOM)) && \
((defcell->argtype == 0) || (defcell->argtype == 2)))) \ ((defcell->argtype == 0) || (defcell->argtype == 2)))) \
goto op_ufn; \ goto op_ufn; \
} } while (0)
#else #else
#define OPCHECKAPPLY \ #define OPCHECKAPPLY \
{ \ do { \
register DefCell *defcell; \ register DefCell *defcell; \
defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \ defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \
if (!(defcell->ccodep && ((TOPOFSTACK & SEGMASK) == 0)) && \ if (!(defcell->ccodep && ((TOPOFSTACK & SEGMASK) == 0)) && \
((defcell->argtype == 0) || (defcell->argtype == 2))) \ ((defcell->argtype == 0) || (defcell->argtype == 2))) \
goto op_ufn; \ goto op_ufn; \
} } while (0)
#endif /* BIGATOMS */ #endif /* BIGATOMS */
/****************************************************************/ /****************************************************************/
@@ -448,7 +448,7 @@
/************************************************************************/ /************************************************************************/
#define OP_ENVCALL \ #define OP_ENVCALL \
{ \ do { \
register struct fnhead *LOCFNCELL; \ register struct fnhead *LOCFNCELL; \
register int NEXTBLOCK; \ register int NEXTBLOCK; \
register LispPTR closure_env = TOPOFSTACK; \ register LispPTR closure_env = TOPOFSTACK; \
@@ -507,7 +507,7 @@
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \ PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
FuncObj = LOCFNCELL; \ FuncObj = LOCFNCELL; \
SWAPPED_FN_CHECK; \ SWAPPED_FN_CHECK; \
} /* end OP_ENVCALL */ } while (0) /* end OP_ENVCALL */
/***************************/ /***************************/
/* */ /* */
@@ -517,11 +517,13 @@
/* (Only in on ISC, now. */ /* (Only in on ISC, now. */
/********************************************************/ /********************************************************/
#ifdef RESWAPPEDCODESTREAM #ifdef RESWAPPEDCODESTREAM
#define SWAPPED_FN_CHECK \ #define SWAPPED_FN_CHECK \
if (!FuncObj->byteswapped) { \ do \
byte_swap_code_block(FuncObj); \ if (!FuncObj->byteswapped) { \
FuncObj->byteswapped = 1; \ byte_swap_code_block(FuncObj); \
} FuncObj->byteswapped = 1; \
} \
while (0)
#else #else
#define SWAPPED_FN_CHECK #define SWAPPED_FN_CHECK
#endif /* RESWAPPEDCODESTREAM */ #endif /* RESWAPPEDCODESTREAM */
@@ -530,78 +532,89 @@
/****** EVAL ********/ /****** EVAL ********/
/****************************************************************/ /****************************************************************/
#ifndef BIGATOMS #ifndef BIGATOMS
#define EVAL \ #define EVAL \
{ \ do { \
LispPTR scratch, work, lookuped; \ LispPTR scratch, work, lookuped; \
switch (TOPOFSTACK & SEGMASK) { \ switch (TOPOFSTACK & SEGMASK) { \
case S_POSITIVE: \ case S_POSITIVE: \
case S_NEGATIVE: nextop1; \ case S_NEGATIVE: \
case ATOM_OFFSET: \ nextop1; \
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) goto Hack_Label; \ case ATOM_OFFSET: \
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \ if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) \
work = POINTERMASK & swapx(scratch); \ goto Hack_Label; \
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \ nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
if (lookuped == NOBIND_PTR) goto op_ufn; \ work = POINTERMASK & swapx(scratch); \
TOPOFSTACK = lookuped; \ lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
Hack_Label: \ if (lookuped == NOBIND_PTR) \
nextop1; \ goto op_ufn; \
default: \ TOPOFSTACK = lookuped; \
switch (GetTypeNumber(TOPOFSTACK)) { \ Hack_Label: \
case TYPE_FIXP: \ nextop1; \
case TYPE_FLOATP: \ default: \
case TYPE_STRINGP: \ switch (GetTypeNumber(TOPOFSTACK)) { \
case TYPE_ONED_ARRAY: \ case TYPE_FIXP: \
case TYPE_GENERAL_ARRAY: nextop1; \ case TYPE_FLOATP: \
case TYPE_LISTP: \ case TYPE_STRINGP: \
fn_atom_index = ATOM_EVALFORM; \ case TYPE_ONED_ARRAY: \
fn_num_args = 1; \ case TYPE_GENERAL_ARRAY: \
fn_opcode_size = 1; \ nextop1; \
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \ case TYPE_LISTP: \
fn_apply = 0; \ fn_atom_index = ATOM_EVALFORM; \
goto op_fn_common; \ fn_num_args = 1; \
default: goto op_ufn; \ fn_opcode_size = 1; \
} \ fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
} /* end switch */ \ fn_apply = 0; \
} /* EVAL end */ goto op_fn_common; \
default: \
goto op_ufn; \
} \
} /* end switch */ \
} while (0) /* EVAL end */
#else #else
#define EVAL \ #define EVAL \
{ \ do { \
LispPTR scratch, work, lookuped; \ LispPTR scratch, work, lookuped; \
switch (TOPOFSTACK & SEGMASK) { \ switch (TOPOFSTACK & SEGMASK) { \
case S_POSITIVE: \ case S_POSITIVE: \
case S_NEGATIVE: nextop1; \ case S_NEGATIVE: \
case ATOM_OFFSET: \ nextop1; \
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) goto Hack_Label; \ case ATOM_OFFSET: \
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \ if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) \
work = POINTERMASK & swapx(scratch); \ goto Hack_Label; \
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \ nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
if (lookuped == NOBIND_PTR) goto op_ufn; \ work = POINTERMASK & swapx(scratch); \
TOPOFSTACK = lookuped; \ lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
Hack_Label: \ if (lookuped == NOBIND_PTR) \
nextop1; \ goto op_ufn; \
default: \ TOPOFSTACK = lookuped; \
switch (GetTypeNumber(TOPOFSTACK)) { \ Hack_Label: \
case TYPE_FIXP: \ nextop1; \
case TYPE_FLOATP: \ default: \
case TYPE_STRINGP: \ switch (GetTypeNumber(TOPOFSTACK)) { \
case TYPE_ONED_ARRAY: \ case TYPE_FIXP: \
case TYPE_GENERAL_ARRAY: nextop1; \ case TYPE_FLOATP: \
case TYPE_LISTP: \ case TYPE_STRINGP: \
fn_atom_index = ATOM_EVALFORM; \ case TYPE_ONED_ARRAY: \
fn_num_args = 1; \ case TYPE_GENERAL_ARRAY: \
fn_opcode_size = 1; \ nextop1; \
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \ case TYPE_LISTP: \
fn_apply = 0; \ fn_atom_index = ATOM_EVALFORM; \
goto op_fn_common; \ fn_num_args = 1; \
case TYPE_NEWATOM: \ fn_opcode_size = 1; \
nnewframe(CURRENTFX, &scratch, TOPOFSTACK); \ fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
work = POINTERMASK & swapx(scratch); \ fn_apply = 0; \
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \ goto op_fn_common; \
if (lookuped == NOBIND_PTR) goto op_ufn; \ case TYPE_NEWATOM: \
TOPOFSTACK = lookuped; \ nnewframe(CURRENTFX, &scratch, TOPOFSTACK); \
nextop1; \ work = POINTERMASK & swapx(scratch); \
default: goto op_ufn; \ lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
} \ if (lookuped == NOBIND_PTR) \
} /* end switch */ \ goto op_ufn; \
} /* EVAL end */ TOPOFSTACK = lookuped; \
nextop1; \
default: \
goto op_ufn; \
} \
} /* end switch */ \
} while (0) /* EVAL end */
#endif #endif

View File

@@ -230,7 +230,7 @@ void dispatch(void) {
goto nextopcode; goto nextopcode;
/* OPCODE FAIL ENTRY POINTS, CALL UFNS HERE */ /* OPCODE FAIL ENTRY POINTS, CALL UFNS HERE */
UFN_CALLS; UFN_CALLS
op_ufn : { op_ufn : {
UFN *entry68k; UFN *entry68k;
@@ -241,11 +241,11 @@ op_ufn : {
fn_defcell = (DefCell *)GetDEFCELL68k(fn_atom_index); fn_defcell = (DefCell *)GetDEFCELL68k(fn_atom_index);
fn_apply = 2 + entry68k->byte_num; /* code for UFN entry */ fn_apply = 2 + entry68k->byte_num; /* code for UFN entry */
goto op_fn_common; goto op_fn_common;
}; }
/* FUNCTION CALL TAIL ROUTINE */ /* FUNCTION CALL TAIL ROUTINE */
OP_FN_COMMON; OP_FN_COMMON
/* DISPATCH "LOOP" */ /* DISPATCH "LOOP" */
@@ -930,7 +930,7 @@ nextopcode:
TIMES2; /* TIMES2 */ TIMES2; /* TIMES2 */
case 0327: case 0327:
case327: case327:
QUOTIENT /* QUOTIENT */ QUOTIENT; /* QUOTIENT */
case 0330: case 0330:
case330: case330:
IPLUS2; /* IPLUS2 only while PLUS has no float */ IPLUS2; /* IPLUS2 only while PLUS has no float */