mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-04 10:24:43 +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:
76
inc/arith.h
76
inc/arith.h
@@ -30,19 +30,19 @@
|
||||
#define FLOATP_VALUE(dest) *((float *)Addr68k_from_LADDR(dest))
|
||||
|
||||
#define N_GETNUMBER(sour, dest, label) \
|
||||
{ \
|
||||
do { \
|
||||
dest = sour; /* access memory once */ \
|
||||
switch (SEGMASK & dest) { \
|
||||
case S_POSITIVE: dest = 0xFFFF & (dest); break; \
|
||||
case S_NEGATIVE: dest = 0xFFFF0000 | (dest); break; \
|
||||
default: \
|
||||
if (GetTypeNumber(dest) != TYPE_FIXP) { goto label; } \
|
||||
if (GetTypeNumber(dest) != TYPE_FIXP) goto label; \
|
||||
dest = FIXP_VALUE(dest); \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define N_IGETNUMBER(sour, dest, label) \
|
||||
{ \
|
||||
do { \
|
||||
dest = sour; /* access memory once */ \
|
||||
switch (SEGMASK & dest) { \
|
||||
case S_POSITIVE: dest = 0xFFFF & dest; break; \
|
||||
@@ -60,21 +60,23 @@
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define ARITH_SWITCH(arg, result) \
|
||||
switch ((int)arg & 0xFFFF0000) { \
|
||||
case 0: result = (S_POSITIVE | (int)arg); break; \
|
||||
case 0xFFFF0000: result = (S_NEGATIVE | (0xFFFF & (int)arg)); break; \
|
||||
default: { \
|
||||
register LispPTR *wordp; \
|
||||
/* arg is FIXP, call createcell */ \
|
||||
wordp = (LispPTR *)createcell68k(TYPE_FIXP); \
|
||||
*((int *)wordp) = (int)arg; \
|
||||
result = (LADDR_from_68k(wordp)); \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
#define ARITH_SWITCH(arg, result) \
|
||||
do { \
|
||||
switch ((int)arg & 0xFFFF0000) { \
|
||||
case 0: result = (S_POSITIVE | (int)arg); break; \
|
||||
case 0xFFFF0000: result = (S_NEGATIVE | (0xFFFF & (int)arg)); break; \
|
||||
default: { \
|
||||
register LispPTR *wordp; \
|
||||
/* arg is FIXP, call createcell */ \
|
||||
wordp = (LispPTR *)createcell68k(TYPE_FIXP); \
|
||||
*((int *)wordp) = (int)arg; \
|
||||
result = (LADDR_from_68k(wordp)); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* *******
|
||||
NEED to See if this is faster than the N_ARITH_SWITCH macro
|
||||
@@ -100,21 +102,23 @@
|
||||
}
|
||||
****** */
|
||||
|
||||
#define N_ARITH_SWITCH(arg) \
|
||||
switch (arg & 0xFFFF0000) { \
|
||||
case 0: return (S_POSITIVE | arg); \
|
||||
case 0xFFFF0000: return (S_NEGATIVE | (0xFFFF & arg)); \
|
||||
default: { \
|
||||
register LispPTR *fixpp; \
|
||||
/* arg is FIXP, call createcell */ \
|
||||
fixpp = (LispPTR *)createcell68k(TYPE_FIXP); \
|
||||
*((int *)fixpp) = arg; \
|
||||
return (LADDR_from_68k(fixpp)); \
|
||||
} \
|
||||
}
|
||||
#define N_ARITH_SWITCH(arg) \
|
||||
do { \
|
||||
switch (arg & 0xFFFF0000) { \
|
||||
case 0: return (S_POSITIVE | arg); \
|
||||
case 0xFFFF0000: return (S_NEGATIVE | (0xFFFF & arg)); \
|
||||
default: { \
|
||||
register LispPTR *fixpp; \
|
||||
/* arg is FIXP, call createcell */ \
|
||||
fixpp = (LispPTR *)createcell68k(TYPE_FIXP); \
|
||||
*((int *)fixpp) = arg; \
|
||||
return (LADDR_from_68k(fixpp)); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define N_IARITH_BODY_2(a, tos, op) \
|
||||
{ \
|
||||
do { \
|
||||
register int arg1, arg2; \
|
||||
\
|
||||
N_IGETNUMBER(a, arg1, do_ufn); \
|
||||
@@ -126,10 +130,10 @@
|
||||
\
|
||||
do_ufn: \
|
||||
ERROR_EXIT(tos); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define N_ARITH_BODY_1(a, n, op) \
|
||||
{ \
|
||||
do { \
|
||||
register int arg1; \
|
||||
\
|
||||
N_GETNUMBER(a, arg1, do_ufn); \
|
||||
@@ -140,10 +144,10 @@
|
||||
\
|
||||
do_ufn: \
|
||||
ERROR_EXIT(a); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define N_ARITH_BODY_1_UNSIGNED(a, n, op) \
|
||||
{ \
|
||||
do { \
|
||||
register unsigned int arg1; \
|
||||
\
|
||||
N_GETNUMBER(a, arg1, do_ufn); \
|
||||
@@ -154,6 +158,6 @@
|
||||
\
|
||||
do_ufn: \
|
||||
ERROR_EXIT(a); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#endif /* ARITH_H */
|
||||
|
||||
938
inc/inlineC.h
938
inc/inlineC.h
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,7 @@ typedef struct closure_type {
|
||||
unsigned env_ptr : 28; /* LispPTR to environment */
|
||||
} Closure;
|
||||
|
||||
#else /* not BIGVM */
|
||||
#else /* not BIGVM */
|
||||
typedef struct consstr {
|
||||
unsigned cdr_code : 8;
|
||||
unsigned car_field : 24;
|
||||
@@ -146,14 +146,14 @@ typedef struct lbits {
|
||||
} LBITS;
|
||||
|
||||
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
||||
{ \
|
||||
do { \
|
||||
if (bitvalue) \
|
||||
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) |= \
|
||||
1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD); \
|
||||
else \
|
||||
*((DLword *)(base68k) + (((u_short)(offset)) >> 4)) &= \
|
||||
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
/*** Byte-swapped structure declarations, for 80386 ***/
|
||||
@@ -185,7 +185,7 @@ typedef struct closure_type {
|
||||
unsigned env_ptr : 28; /* LispPTR to environment */
|
||||
unsigned nil2 : 4;
|
||||
} Closure;
|
||||
#else /* BIGVM */
|
||||
#else /* BIGVM */
|
||||
typedef struct consstr {
|
||||
unsigned car_field : 24;
|
||||
unsigned cdr_code : 8;
|
||||
@@ -295,7 +295,7 @@ typedef struct lbits {
|
||||
} LBITS;
|
||||
|
||||
#define PUTBASEBIT68K(base68k, offset, bitvalue) \
|
||||
{ \
|
||||
do { \
|
||||
UNSIGNED real68kbase; \
|
||||
real68kbase = 2 ^ ((UNSIGNED)(base68k)); \
|
||||
if (bitvalue) \
|
||||
@@ -304,7 +304,7 @@ typedef struct lbits {
|
||||
else \
|
||||
(*(DLword *)(2 ^ (UNSIGNED)((DLword *)(real68kbase) + (((u_short)(offset)) >> 4)))) &= \
|
||||
~(1 << (15 - ((u_short)(offset)) % BITSPER_DLWORD)); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#endif /* BYTESWAP */
|
||||
|
||||
@@ -368,40 +368,40 @@ PopCStack:
|
||||
#define PopCStack {TopOfStack = *((LispPTR *)(--CurrentStackPTR)); --CurrentStackPTR;}
|
||||
*****************************************************/
|
||||
#define PopCStack \
|
||||
{ \
|
||||
do { \
|
||||
TopOfStack = *((LispPTR *)(CurrentStackPTR)); \
|
||||
CurrentStackPTR -= 2; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/****************************************************
|
||||
PopStackTo: CSTK -> Place
|
||||
#define PopStackTo(Place) {Place= *((LispPTR *)(--CurrentStackPTR)); CurrentStackPTR--; }
|
||||
*****************************************************/
|
||||
#define PopStackTo(Place) \
|
||||
{ \
|
||||
do { \
|
||||
Place = *((LispPTR *)(CurrentStackPTR)); \
|
||||
CurrentStackPTR -= 2; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/****************************************************
|
||||
PushCStack:
|
||||
#define PushCStack {*((int *)(++CurrentStackPTR)) = TopOfStack; ++CurrentStackPTR;}
|
||||
*****************************************************/
|
||||
#define PushCStack \
|
||||
{ \
|
||||
do { \
|
||||
CurrentStackPTR += 2; \
|
||||
*((LispPTR *)(CurrentStackPTR)) = TopOfStack; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/****************************************************
|
||||
PushStack:
|
||||
#define PushStack(x) {*((LispPTR *)(++CurrentStackPTR))=x;CurrentStackPTR++;}
|
||||
*****************************************************/
|
||||
#define PushStack(x) \
|
||||
{ \
|
||||
do { \
|
||||
CurrentStackPTR += 2; \
|
||||
*((LispPTR *)(CurrentStackPTR)) = x; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/****************************************************
|
||||
SmashStack:
|
||||
@@ -422,13 +422,13 @@ DOSTACKOVERFLOW(argnum,bytenum) if it needs hardreturn-cleanup
|
||||
then upnt to contextsw and immediately return
|
||||
**********************************************************/
|
||||
#define DOSTACKOVERFLOW(argnum, bytenum) \
|
||||
{ \
|
||||
do { \
|
||||
if (do_stackoverflow(T)) { \
|
||||
PushStack(S_POSITIVE | argnum); \
|
||||
contextsw(SubovFXP, bytenum, 1); \
|
||||
return; \
|
||||
} \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
@@ -488,7 +488,7 @@ DOSTACKOVERFLOW(argnum,bytenum) if it needs hardreturn-cleanup
|
||||
#define STKLIM 0x1FFFF
|
||||
#define FRAMESIZE 10 /* size of frameex1: 10 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_CELL 32
|
||||
|
||||
@@ -431,6 +431,6 @@ typedef struct stackp {
|
||||
|
||||
#define STK_END_COMPUTE(stk_end, fnobj) ((UNSIGNED)(stk_end)-STK_MIN(fnobj))
|
||||
|
||||
#define CLR_IRQ \
|
||||
{ Irq_Stk_Check = STK_END_COMPUTE((Irq_Stk_End = (UNSIGNED)EndSTKP), FuncObj); }
|
||||
#define CLR_IRQ \
|
||||
Irq_Stk_Check = STK_END_COMPUTE((Irq_Stk_End = (UNSIGNED) EndSTKP), FuncObj)
|
||||
#endif
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
|
||||
#define HARD_PUSH(x) *(CSTKPTRL++) = x
|
||||
#define PUSH(x) \
|
||||
{ \
|
||||
do { \
|
||||
HARD_PUSH(TOPOFSTACK); \
|
||||
TOPOFSTACK = x; \
|
||||
}
|
||||
} while (0)
|
||||
#define POP TOPOFSTACK = *(--CSTKPTRL)
|
||||
#define GET_TOS_1 *(CSTKPTR - 1)
|
||||
#define GET_TOS_2 *(CSTKPTR - 2)
|
||||
@@ -51,10 +51,10 @@
|
||||
|
||||
#define HARD_PUSH(x) *(CSTKPTRL++) = x
|
||||
#define PUSH(x) \
|
||||
{ \
|
||||
do { \
|
||||
HARD_PUSH(TOPOFSTACK); \
|
||||
TOPOFSTACK = x; \
|
||||
}
|
||||
} while (0)
|
||||
#define POP TOPOFSTACK = *(--CSTKPTRL)
|
||||
#define GET_TOS_1 *(CSTKPTR - 1)
|
||||
#define GET_TOS_2 *(CSTKPTR - 2)
|
||||
@@ -69,28 +69,28 @@
|
||||
/* OPCODE interface routines */
|
||||
|
||||
#define StackPtrSave \
|
||||
{ CurrentStackPTR = (DLword *)(CSTKPTR - 1); }
|
||||
do { CurrentStackPTR = (DLword *)(CSTKPTR - 1); } while (0)
|
||||
#define StackPtrRestore \
|
||||
{ CSTKPTRL = ((LispPTR *)CurrentStackPTR) + 1; }
|
||||
do { CSTKPTRL = ((LispPTR *)CurrentStackPTR) + 1; } while (0)
|
||||
|
||||
#define EXT \
|
||||
{ \
|
||||
do { \
|
||||
PC = pccache - 1; \
|
||||
TopOfStack = TOPOFSTACK; \
|
||||
StackPtrSave; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define RET \
|
||||
{ \
|
||||
do { \
|
||||
pccache = PC + 1; \
|
||||
StackPtrRestore; \
|
||||
TOPOFSTACK = TopOfStack; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define NRET \
|
||||
{ \
|
||||
do { \
|
||||
RET; \
|
||||
nextop0; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#endif /* TOS1DEFS_H */
|
||||
|
||||
219
inc/tosfns.h
219
inc/tosfns.h
@@ -17,7 +17,7 @@
|
||||
#if 0
|
||||
#define FN_STACK_CHECK \
|
||||
if ((UNSIGNED)CSTKPTR >= (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL)))) \
|
||||
goto check_interrupt;
|
||||
goto check_interrupt
|
||||
#else
|
||||
/* 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 */
|
||||
@@ -26,7 +26,7 @@
|
||||
#define FN_STACK_CHECK \
|
||||
if ((Irq_Stk_End == 0) || \
|
||||
((UNSIGNED)CSTKPTR > (Irq_Stk_Check = (Irq_Stk_End - STK_MIN(LOCFNCELL))))) \
|
||||
goto check_interrupt;
|
||||
goto check_interrupt
|
||||
#endif /* 0 */
|
||||
|
||||
/****************************************************************/
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
#ifdef BIGATOMS
|
||||
#define APPLY_POP_PUSH_TEST \
|
||||
{ \
|
||||
do { \
|
||||
switch (fn_apply) { \
|
||||
case 0: break; /* do nothing */ \
|
||||
case 1: \
|
||||
@@ -80,17 +80,17 @@
|
||||
case 5: { \
|
||||
unsigned int atm = Get_AtomNo_PCMAC1; \
|
||||
if (atm & SEGMASK) \
|
||||
PUSH(atm) /* new atom */ \
|
||||
PUSH(atm); /* new atom */ \
|
||||
else \
|
||||
PUSH(S_POSITIVE | atm); /* old atom as SMALLP*/ \
|
||||
} break; \
|
||||
default: error("Storage error: invalid UFN entry"); \
|
||||
} \
|
||||
if (needpush) PUSH(fn_atom_index); \
|
||||
}
|
||||
} while (0)
|
||||
#else /* not big atoms */
|
||||
#define APPLY_POP_PUSH_TEST \
|
||||
{ \
|
||||
do { \
|
||||
switch (fn_apply) { \
|
||||
case 0: break; /* do nothing */ \
|
||||
case 1: \
|
||||
@@ -104,28 +104,28 @@
|
||||
default: error("Storage error: invalid UFN entry"); \
|
||||
} \
|
||||
if (needpush) PUSH(fn_atom_index); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#endif /* BIGATOMS */
|
||||
|
||||
#define N_APPLY_POP_PUSH_TEST \
|
||||
{ \
|
||||
do { \
|
||||
APPLY_POP_PUSH_TEST; \
|
||||
native_closure_env = closure_env; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define N_ENVCALL_POP_TEST \
|
||||
{ \
|
||||
do { \
|
||||
CSTKPTRL -= 2; \
|
||||
native_closure_env = closure_env; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/****************************************************************/
|
||||
/****** OPAPPLY ********/
|
||||
/****************************************************************/
|
||||
#ifndef BIGATOMS
|
||||
#define OPAPPLY \
|
||||
{ \
|
||||
do { \
|
||||
if (GET_TOS_1_HI == SPOS_HI) { \
|
||||
fn_num_args = GET_TOS_1_LO; \
|
||||
fn_opcode_size = 1; \
|
||||
@@ -146,10 +146,10 @@
|
||||
} \
|
||||
} \
|
||||
goto op_ufn; \
|
||||
} /* OPAPPLY */
|
||||
} while (0) /* OPAPPLY */
|
||||
#else
|
||||
#define OPAPPLY \
|
||||
{ \
|
||||
do { \
|
||||
if (GET_TOS_1_HI == SPOS_HI) { \
|
||||
fn_num_args = GET_TOS_1_LO; \
|
||||
fn_opcode_size = 1; \
|
||||
@@ -171,7 +171,7 @@
|
||||
} /* end of switch */ \
|
||||
} \
|
||||
goto op_ufn; \
|
||||
} /* OPAPPLY */
|
||||
} while (0) /* OPAPPLY */
|
||||
#endif /* BIGATOMS */
|
||||
|
||||
/****************************************************************/
|
||||
@@ -179,7 +179,7 @@
|
||||
/****************************************************************/
|
||||
|
||||
#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 int defcell_word; \
|
||||
register int NEXTBLOCK; \
|
||||
@@ -242,11 +242,11 @@
|
||||
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
|
||||
FuncObj = LOCFNCELL; \
|
||||
nextop0; \
|
||||
} /* end OPFN */
|
||||
} while (0) /* end OPFN */
|
||||
|
||||
/*************** OPFNX *************/
|
||||
#define OPFNX \
|
||||
{ \
|
||||
do { \
|
||||
register struct fnhead *LOCFNCELL; \
|
||||
register DefCell *defcell; /* this reg is not allocated */ \
|
||||
register int NEXTBLOCK; \
|
||||
@@ -309,30 +309,30 @@
|
||||
CSTKPTRL += 1; \
|
||||
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
|
||||
FuncObj = LOCFNCELL; \
|
||||
} /* end OPFN */
|
||||
} while (0) /* end OPFNX */
|
||||
|
||||
/****************************************************************/
|
||||
/****** OPCHECKAPPLY ********/
|
||||
/****************************************************************/
|
||||
#ifdef BIGATOMS
|
||||
#define OPCHECKAPPLY \
|
||||
{ \
|
||||
do { \
|
||||
register DefCell *defcell; \
|
||||
defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \
|
||||
if (!(defcell->ccodep && \
|
||||
(((TOPOFSTACK & SEGMASK) == 0) || (GetTypeNumber(TOPOFSTACK) == TYPE_NEWATOM)) && \
|
||||
((defcell->argtype == 0) || (defcell->argtype == 2)))) \
|
||||
goto op_ufn; \
|
||||
}
|
||||
} while (0)
|
||||
#else
|
||||
#define OPCHECKAPPLY \
|
||||
{ \
|
||||
do { \
|
||||
register DefCell *defcell; \
|
||||
defcell = (DefCell *)GetDEFCELL68k(TOPOFSTACK & POINTERMASK); \
|
||||
if (!(defcell->ccodep && ((TOPOFSTACK & SEGMASK) == 0)) && \
|
||||
((defcell->argtype == 0) || (defcell->argtype == 2))) \
|
||||
goto op_ufn; \
|
||||
}
|
||||
} while (0)
|
||||
#endif /* BIGATOMS */
|
||||
|
||||
/****************************************************************/
|
||||
@@ -448,7 +448,7 @@
|
||||
/************************************************************************/
|
||||
|
||||
#define OP_ENVCALL \
|
||||
{ \
|
||||
do { \
|
||||
register struct fnhead *LOCFNCELL; \
|
||||
register int NEXTBLOCK; \
|
||||
register LispPTR closure_env = TOPOFSTACK; \
|
||||
@@ -507,7 +507,7 @@
|
||||
PCMACL = (ByteCode *)LOCFNCELL + LOCFNCELL->startpc + 1; \
|
||||
FuncObj = LOCFNCELL; \
|
||||
SWAPPED_FN_CHECK; \
|
||||
} /* end OP_ENVCALL */
|
||||
} while (0) /* end OP_ENVCALL */
|
||||
|
||||
/***************************/
|
||||
/* */
|
||||
@@ -517,11 +517,13 @@
|
||||
/* (Only in on ISC, now. */
|
||||
/********************************************************/
|
||||
#ifdef RESWAPPEDCODESTREAM
|
||||
#define SWAPPED_FN_CHECK \
|
||||
if (!FuncObj->byteswapped) { \
|
||||
byte_swap_code_block(FuncObj); \
|
||||
FuncObj->byteswapped = 1; \
|
||||
}
|
||||
#define SWAPPED_FN_CHECK \
|
||||
do \
|
||||
if (!FuncObj->byteswapped) { \
|
||||
byte_swap_code_block(FuncObj); \
|
||||
FuncObj->byteswapped = 1; \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define SWAPPED_FN_CHECK
|
||||
#endif /* RESWAPPEDCODESTREAM */
|
||||
@@ -530,78 +532,89 @@
|
||||
/****** EVAL ********/
|
||||
/****************************************************************/
|
||||
#ifndef BIGATOMS
|
||||
#define EVAL \
|
||||
{ \
|
||||
LispPTR scratch, work, lookuped; \
|
||||
switch (TOPOFSTACK & SEGMASK) { \
|
||||
case S_POSITIVE: \
|
||||
case S_NEGATIVE: nextop1; \
|
||||
case ATOM_OFFSET: \
|
||||
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) goto Hack_Label; \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
Hack_Label: \
|
||||
nextop1; \
|
||||
default: \
|
||||
switch (GetTypeNumber(TOPOFSTACK)) { \
|
||||
case TYPE_FIXP: \
|
||||
case TYPE_FLOATP: \
|
||||
case TYPE_STRINGP: \
|
||||
case TYPE_ONED_ARRAY: \
|
||||
case TYPE_GENERAL_ARRAY: nextop1; \
|
||||
case TYPE_LISTP: \
|
||||
fn_atom_index = ATOM_EVALFORM; \
|
||||
fn_num_args = 1; \
|
||||
fn_opcode_size = 1; \
|
||||
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
|
||||
fn_apply = 0; \
|
||||
goto op_fn_common; \
|
||||
default: goto op_ufn; \
|
||||
} \
|
||||
} /* end switch */ \
|
||||
} /* EVAL end */
|
||||
#define EVAL \
|
||||
do { \
|
||||
LispPTR scratch, work, lookuped; \
|
||||
switch (TOPOFSTACK & SEGMASK) { \
|
||||
case S_POSITIVE: \
|
||||
case S_NEGATIVE: \
|
||||
nextop1; \
|
||||
case ATOM_OFFSET: \
|
||||
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) \
|
||||
goto Hack_Label; \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) \
|
||||
goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
Hack_Label: \
|
||||
nextop1; \
|
||||
default: \
|
||||
switch (GetTypeNumber(TOPOFSTACK)) { \
|
||||
case TYPE_FIXP: \
|
||||
case TYPE_FLOATP: \
|
||||
case TYPE_STRINGP: \
|
||||
case TYPE_ONED_ARRAY: \
|
||||
case TYPE_GENERAL_ARRAY: \
|
||||
nextop1; \
|
||||
case TYPE_LISTP: \
|
||||
fn_atom_index = ATOM_EVALFORM; \
|
||||
fn_num_args = 1; \
|
||||
fn_opcode_size = 1; \
|
||||
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
|
||||
fn_apply = 0; \
|
||||
goto op_fn_common; \
|
||||
default: \
|
||||
goto op_ufn; \
|
||||
} \
|
||||
} /* end switch */ \
|
||||
} while (0) /* EVAL end */
|
||||
#else
|
||||
#define EVAL \
|
||||
{ \
|
||||
LispPTR scratch, work, lookuped; \
|
||||
switch (TOPOFSTACK & SEGMASK) { \
|
||||
case S_POSITIVE: \
|
||||
case S_NEGATIVE: nextop1; \
|
||||
case ATOM_OFFSET: \
|
||||
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) goto Hack_Label; \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
Hack_Label: \
|
||||
nextop1; \
|
||||
default: \
|
||||
switch (GetTypeNumber(TOPOFSTACK)) { \
|
||||
case TYPE_FIXP: \
|
||||
case TYPE_FLOATP: \
|
||||
case TYPE_STRINGP: \
|
||||
case TYPE_ONED_ARRAY: \
|
||||
case TYPE_GENERAL_ARRAY: nextop1; \
|
||||
case TYPE_LISTP: \
|
||||
fn_atom_index = ATOM_EVALFORM; \
|
||||
fn_num_args = 1; \
|
||||
fn_opcode_size = 1; \
|
||||
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
|
||||
fn_apply = 0; \
|
||||
goto op_fn_common; \
|
||||
case TYPE_NEWATOM: \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
nextop1; \
|
||||
default: goto op_ufn; \
|
||||
} \
|
||||
} /* end switch */ \
|
||||
} /* EVAL end */
|
||||
#define EVAL \
|
||||
do { \
|
||||
LispPTR scratch, work, lookuped; \
|
||||
switch (TOPOFSTACK & SEGMASK) { \
|
||||
case S_POSITIVE: \
|
||||
case S_NEGATIVE: \
|
||||
nextop1; \
|
||||
case ATOM_OFFSET: \
|
||||
if ((TOPOFSTACK == NIL_PTR) || (TOPOFSTACK == ATOM_T)) \
|
||||
goto Hack_Label; \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK & 0xffff); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) \
|
||||
goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
Hack_Label: \
|
||||
nextop1; \
|
||||
default: \
|
||||
switch (GetTypeNumber(TOPOFSTACK)) { \
|
||||
case TYPE_FIXP: \
|
||||
case TYPE_FLOATP: \
|
||||
case TYPE_STRINGP: \
|
||||
case TYPE_ONED_ARRAY: \
|
||||
case TYPE_GENERAL_ARRAY: \
|
||||
nextop1; \
|
||||
case TYPE_LISTP: \
|
||||
fn_atom_index = ATOM_EVALFORM; \
|
||||
fn_num_args = 1; \
|
||||
fn_opcode_size = 1; \
|
||||
fn_defcell = (DefCell *)GetDEFCELL68k(ATOM_EVALFORM); \
|
||||
fn_apply = 0; \
|
||||
goto op_fn_common; \
|
||||
case TYPE_NEWATOM: \
|
||||
nnewframe(CURRENTFX, &scratch, TOPOFSTACK); \
|
||||
work = POINTERMASK & swapx(scratch); \
|
||||
lookuped = *((LispPTR *)(Addr68k_from_LADDR(work))); \
|
||||
if (lookuped == NOBIND_PTR) \
|
||||
goto op_ufn; \
|
||||
TOPOFSTACK = lookuped; \
|
||||
nextop1; \
|
||||
default: \
|
||||
goto op_ufn; \
|
||||
} \
|
||||
} /* end switch */ \
|
||||
} while (0) /* EVAL end */
|
||||
#endif
|
||||
|
||||
8
src/xc.c
8
src/xc.c
@@ -230,7 +230,7 @@ void dispatch(void) {
|
||||
goto nextopcode;
|
||||
|
||||
/* OPCODE FAIL ENTRY POINTS, CALL UFNS HERE */
|
||||
UFN_CALLS;
|
||||
UFN_CALLS
|
||||
|
||||
op_ufn : {
|
||||
UFN *entry68k;
|
||||
@@ -241,11 +241,11 @@ op_ufn : {
|
||||
fn_defcell = (DefCell *)GetDEFCELL68k(fn_atom_index);
|
||||
fn_apply = 2 + entry68k->byte_num; /* code for UFN entry */
|
||||
goto op_fn_common;
|
||||
};
|
||||
}
|
||||
|
||||
/* FUNCTION CALL TAIL ROUTINE */
|
||||
|
||||
OP_FN_COMMON;
|
||||
OP_FN_COMMON
|
||||
|
||||
/* DISPATCH "LOOP" */
|
||||
|
||||
@@ -930,7 +930,7 @@ nextopcode:
|
||||
TIMES2; /* TIMES2 */
|
||||
case 0327:
|
||||
case327:
|
||||
QUOTIENT /* QUOTIENT */
|
||||
QUOTIENT; /* QUOTIENT */
|
||||
case 0330:
|
||||
case330:
|
||||
IPLUS2; /* IPLUS2 only while PLUS has no float */
|
||||
|
||||
Reference in New Issue
Block a user