1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-26 03:51:32 +00:00

Remove extra semicolons, convert #define x() {...} to do {...} while (0) style (#444)

* Remove extra semicolons, convert #define x() {...} to do {...} while (0) style

* Fix missing brace in INIT-specific definition of init_kbd_startup
This commit is contained in:
Nick Briggs
2022-10-05 09:07:17 -07:00
committed by GitHub
parent f5b17b0e63
commit cdffa541ef
57 changed files with 413 additions and 400 deletions

View File

@@ -738,7 +738,7 @@ int srcRshift;
/************************************************************************/
#define new_bitblt_code \
{ \
do { \
variables \
some_init \
while (num_lines_remaining-- > 0) \
@@ -778,7 +778,7 @@ next_line: \
continue; \
} \
} /* end line loop */ \
}
} while (0)
@@ -791,7 +791,7 @@ next_line: \
/************************************************************************/
#define new_gray_bitblt_code \
{ \
do { \
variables \
some_init \
while (num_lines_remaining-- > 0) \
@@ -803,7 +803,7 @@ do_fpt: \
next_line: \
do_gray_advance \
} /* end line loop */ \
}
} while (0)
@@ -816,7 +816,7 @@ next_line: \
/************************************************************************/
#define new_char_bitblt_code \
{ \
do { \
variables \
some_init \
while (num_lines_remaining-- > 0) \
@@ -828,7 +828,7 @@ do_fpt: \
next_line: \
F_do_advance \
} /* end line loop */ \
}
} while (0)

View File

@@ -76,13 +76,13 @@ extern DLword *EmCursorX68K,*EmCursorY68K;
/* Macro for locking and unlocking screen to prevent multiple updates */
#ifdef DOS
#define LOCKSCREEN currentdsp->device.locked++;
#define UNLOCKSCREEN currentdsp->device.locked--;
#define LOCKSCREEN currentdsp->device.locked++
#define UNLOCKSCREEN currentdsp->device.locked--
#else
#define LOCKSCREEN ScreenLocked = T;
#define UNLOCKSCREEN ScreenLocked = NIL;
#define LOCKSCREEN ScreenLocked = T
#define UNLOCKSCREEN ScreenLocked = NIL
#endif /* DOS */
#endif /* BITBLT_H */

View File

@@ -416,11 +416,11 @@ struct cadr_cell {
/* When cadr() function is called, type check should be done. */
#define S_N_CHECKANDCADR(sour, dest, tos) \
{ \
do { \
LispPTR parm = sour; \
if (GetTypeNumber(parm) != TYPE_LISTP) { \
ERROR_EXIT(tos); \
} else \
(dest) = cadr(parm); \
}
} while (0)
#endif

View File

@@ -48,23 +48,23 @@
/* IncAllocCnt is called only when *Reclaim_cnt_word != NIL */
#define IncAllocCnt(n) {\
#define IncAllocCnt(n) do { \
if ((*Reclaim_cnt_word -= (n)) <= S_POSITIVE) { \
/* time for GC */\
Irq_Stk_Check = Irq_Stk_End = 0;\
*Reclaim_cnt_word = S_POSITIVE;\
};\
}
/* time for GC */ \
Irq_Stk_Check = Irq_Stk_End = 0; \
*Reclaim_cnt_word = S_POSITIVE; \
} \
} while (0)
/* DecAllocCnt only called when *Reclaim_cnt_word != NIL */
#define DecAllocCnt(n) { *Reclaim_cnt_word += (n); }
#define DecAllocCnt(n) do { *Reclaim_cnt_word += (n); } while (0)
#define FreeLink(link) { \
#define FreeLink(link) do { \
GETGC(link) = 0; \
GETGC((link)+1) = GETGC(HTcoll); \
GETGC(HTcoll) = ((link) - HTcoll); \
}
} while (0)
/* Given the contents of an HTMAIN or HTCOLL entry,
@@ -72,7 +72,7 @@
#define GetLinkptr(entry) ((entry) & 0x0fffffffe)
#define DelLink(link, prev, entry) { \
#define DelLink(link, prev, entry) do { \
if ((prev) != (GCENTRY *)0) \
{ \
GETGC((GCENTRY *)(prev) + 1) = GETGC((GCENTRY *)(link) + 1); \
@@ -88,41 +88,41 @@
GETGC((GCENTRY *)(entry)) = GETGC((GCENTRY *)(link)); \
FreeLink((GCENTRY *)(link)); \
} \
}
} while (0)
#define RefCntP(ptr) (!(GetTypeEntry((ptr)) & TT_NOREF) && \
(*GcDisabled_word != ATOM_T))
#define GCLOOKUP(ptr, case) { \
#define GCLOOKUP(ptr, case) do { \
if (RefCntP(ptr)) { \
if (*Reclaim_cnt_word != NIL) \
htfind(ptr, case); \
else \
rec_htfind(ptr, case); \
} \
}
} while (0)
#define GCLOOKUPV(ptr, case, val) { \
#define GCLOOKUPV(ptr, case, val) do { \
if (RefCntP(ptr)) { \
if (*Reclaim_cnt_word != NIL) \
(val) = htfind((ptr), (case)); \
else \
(val) = rec_htfind((ptr), (case)); \
} else (val) = NIL; \
}
} while (0)
#define REC_GCLOOKUP(ptr, case) { if (RefCntP(ptr)) rec_htfind(ptr, case); }
#define REC_GCLOOKUPV(ptr, case, val) { \
#define REC_GCLOOKUP(ptr, case) do { if (RefCntP(ptr)) rec_htfind(ptr, case); } while (0)
#define REC_GCLOOKUPV(ptr, case, val) do { \
if (RefCntP(ptr)) \
(val) = rec_htfind((ptr), (case)); \
else \
(val) = NIL; \
}
} while (0)
#define FRPLPTR(old , new) { \
#define FRPLPTR(old , new) do { \
GCLOOKUP(new, ADDREF); \
GCLOOKUP(old, DELREF); \
(old) = (new) ; }
(old) = (new) ; } while (0)
#ifndef BYTESWAP

View File

@@ -4,7 +4,7 @@
/* DOS version of LispVersionToUnixVersion */
#define LispVersionToUnixVersion(pathname, ver) \
{ \
do { \
\
char *cp; \
char *vp; \
@@ -43,5 +43,5 @@
else ver = -1; \
} \
else ver = -1; \
}
} while (0)
#endif /* LISPVER1_H */

View File

@@ -4,7 +4,7 @@
/* non-DOS version of LispVersionToUnixVersion */
#define LispVersionToUnixVersion(pathname){ \
#define LispVersionToUnixVersion(pathname) do { \
\
char *lv_cp; \
char *lv_vp; \
@@ -70,5 +70,5 @@
lv_vp--; /* Just for label */ \
} \
} \
}
} while (0)
#endif /* LISPVER2_H */

View File

@@ -45,24 +45,24 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/* For getfileinfo. For WDATE&RDATE */
/* 29969152 == (timer.c)LISP_UNIX_TIME_DIFF */
#define StrNCpyFromCToLisp(lispbuf, cbuf ,len) { \
#define StrNCpyFromCToLisp(lispbuf, cbuf ,len) do { \
char *lf_sptr = (cbuf); \
char *lf_dptr = (lispbuf); \
for(size_t lf_i=0;lf_i<(len);lf_i++)\
GETBYTE(lf_dptr++) = *lf_sptr++; \
}
} while (0)
#define StrNCpyFromLispToC(cbuf , lispbuf, len) { \
#define StrNCpyFromLispToC(cbuf , lispbuf, len) do { \
char *lf_sptr = (lispbuf); \
char *lf_dptr = (cbuf); \
for(size_t lf_i=0;lf_i<(len);lf_i++)\
*lf_dptr++ = GETBYTE(lf_sptr++); \
}
} while (0)
#define FGetNum(ptr, place) { \
#define FGetNum(ptr, place) do { \
if(((ptr) & SEGMASK)== S_POSITIVE) {(place) = ((ptr) & 0xffff);}\
else if(((ptr) & SEGMASK)== S_NEGATIVE) {(place) = (int)((ptr)| 0xffff0000);}\
else {return(NIL);}}
else {return(NIL);}} while (0)
/************************************************************************/
@@ -81,7 +81,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/************************************************************************/
#ifndef BYTESWAP
#define LispStringToCString(Lisp, C, MaxLen) \
{ \
do { \
OneDArray *lf_arrayp; \
char *lf_base, *lf_dp; \
short *lf_sbase; \
@@ -108,10 +108,10 @@ extern DLword *Lisp_world; /* To access LispSysout area */
default: \
error("LispStringToCString: Not a character array.\n"); \
} \
}
} while (0)
#else /* BYTESWAP == T CHANGED-BY-TAKE */
#define LispStringToCString(Lisp, C, MaxLen) \
{ \
do { \
OneDArray *lf_arrayp; \
char *lf_base, *lf_dp; \
short *lf_sbase; \
@@ -138,7 +138,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
default: \
error("LispStringToCString: Not a character array.\n"); \
} \
}
} while (0)
#endif /* BYTESWAP */
@@ -154,7 +154,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/* */
/************************************************************************/
#define LispStringLength(LispString, Length, FatP) \
{ \
do { \
OneDArray *lf_arrayp; \
lf_arrayp = (OneDArray *)(NativeAligned4FromLAddr(LispString)); \
switch(lf_arrayp->typenumber) \
@@ -171,7 +171,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
default: \
error("LispStringLength: Not a character array.\n"); \
} \
}
} while (0)
@@ -184,11 +184,11 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/* */
/************************************************************************/
#define STRING_BASE(lstringp, cstringp) \
{ \
do { \
LispPTR *lf_naddress; \
lf_naddress = (LispPTR *)(NativeAligned4FromLAddr(lstringp)); \
(cstringp) = (char *)(NativeAligned2FromLAddr(((OneDArray *)lf_naddress)->base)); \
}
} while (0)
#ifndef min
#define min(a, b) (((a) <= (b))?(a):(b))
@@ -200,23 +200,23 @@ extern DLword *Lisp_world; /* To access LispSysout area */
#define UPLOWDIFF 0x20
#define DOWNCASE(name){ \
#define DOWNCASE(name) do { \
\
char *lf_cp; \
\
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
if((*lf_cp >= 'A') && (*lf_cp <= 'Z')) *lf_cp += UPLOWDIFF; \
}
} while (0)
#define UPCASE(name){ \
#define UPCASE(name) do { \
\
char *lf_cp; \
\
for(lf_cp = (name); *lf_cp!='\0'; ++lf_cp) \
if((*lf_cp >= 'a') && (*lf_cp <= 'z')) *lf_cp -= UPLOWDIFF; \
}
} while (0)
#define DIR_OR_FILE_P(name, type){ \
#define DIR_OR_FILE_P(name, type) do { \
int lf_result; \
struct stat lf_statbuf; \
\
@@ -244,9 +244,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */
break; \
} \
} \
}
} while (0)
#define DIRP(path, dir, buf){ \
#define DIRP(path, dir, buf) do { \
int lf_rval; \
struct stat lf_statbuf; \
strcpy(buf, path); \
@@ -262,9 +262,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */
*Lisp_errno = 60; \
return(0); \
} \
}
} while (0)
#define FILEP(path, file, buf){ \
#define FILEP(path, file, buf) do { \
int lf_rval; \
strcpy(buf, path); \
strcat(buf, file); \
@@ -273,7 +273,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
strcat(path, file); \
return(1); \
} \
}
} while (0)
#define STREQ(name1, name2)( \
(*(name1) == *(name2)) && (strcmp(name1, name2) == 0) \
@@ -281,7 +281,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
#define SPECIALFILEMARK (-1)
#define NumericStringP(str, truetag, falsetag) { \
#define NumericStringP(str, truetag, falsetag) do { \
char *lfn_cp; \
\
/* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
@@ -291,7 +291,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
if(*lfn_cp < '0' || '9' < *lfn_cp) \
goto falsetag; /* NOLINT(bugprone-macro-parentheses) */ \
goto truetag; /* NOLINT(bugprone-macro-parentheses) */ \
}
} while (0)
/*
* Name: LispVersionToUnixVersion
@@ -353,7 +353,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
* dealt with as version 1.
*/
#define UnixVersionToLispVersion(pathname, vlessp){ \
#define UnixVersionToLispVersion(pathname, vlessp) do { \
\
char *start; \
char *end; \
@@ -408,7 +408,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/* Dealt with as version 1 unless vlessp. */ \
if (!(vlessp)) strcat(pathname, ";1"); \
} \
}
} while (0)
/*
* Name: ConcDirAndName
@@ -428,7 +428,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
*
*/
#define ConcDirAndName(dir, name, fname){ \
#define ConcDirAndName(dir, name, fname) do { \
\
char *lf_cp1, *lf_cp2; \
\
@@ -464,7 +464,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
strcat(fname, "/"); \
strcat(fname, name); \
} \
}
} while (0)
/*
* Name: ConcNameAndVersion
@@ -483,7 +483,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
*
*/
#define ConcNameAndVersion(name, ver, rname){ \
#define ConcNameAndVersion(name, ver, rname) do { \
if (*(ver) != '\0') { \
strcpy(rname, name); \
strcat(rname, ".~"); \
@@ -492,7 +492,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
} else { \
strcpy(rname, name); \
} \
}
} while (0)
#define VERSIONLEN 16
@@ -517,7 +517,7 @@ extern DLword *Lisp_world; /* To access LispSysout area */
/* Like "foo/fee.fee;3" or "/foo/foo;3" */
/* AddDotNoExtension must be put after UnixVersionToLispVersion */
#define AddDotNoExtension(file){ \
#define AddDotNoExtension(file) do { \
char *lf_cp; \
char *lf_cp1; \
if( (strrchr(file,'.')== 0) && ((lf_cp=strrchr(file,';'))!=0) ){ \
@@ -527,41 +527,41 @@ extern DLword *Lisp_world; /* To access LispSysout area */
*lf_cp1 = *(lf_cp1-1); \
*lf_cp = '.'; \
} \
}
} while (0)
/* An argument of RemoveDotNoExtension must be LispVersion convention */
/* Like "foo/fee.fee;3" or "/foo/foo.;3" */
/* RemoveDotNoExtension must be put before LispVersionToUnixVersion */
#define RemoveDotNoExtension(file){ \
#define RemoveDotNoExtension(file) do { \
char *lf_cp; \
if( ((lf_cp=strrchr(file, ';'))!=0) && (*(lf_cp-1)=='.') ){ \
for(;*lf_cp!='\0';++lf_cp) \
*(lf_cp-1) = *lf_cp; \
*(lf_cp-1) = '\0'; \
} \
}
} while (0)
extern int errno;
#define ChangeToVersionless(pathname){ \
#define ChangeToVersionless(pathname) do { \
char *lf_cp; \
if( (lf_cp=strrchr(pathname, ';')) != 0) \
*lf_cp = '\0'; \
}
} while (0)
#define UNLINK(x){ \
#define UNLINK(x) do { \
TIMEOUT(lf_rval=unlink(x)); \
if(lf_rval == -1){ \
err_mess("unlink", errno); \
*Lisp_errno = errno; \
return(0); \
} \
}
} while (0)
#define LINK(x,y){ \
#define LINK(x,y) do { \
TIMEOUT(lf_rval=link(x, y)); \
if(lf_rval == -1){ \
if(errno == 2) \
@@ -572,9 +572,9 @@ extern int errno;
return(0); \
} \
} \
}
} while (0)
#define RENAME(x,y){ \
#define RENAME(x,y) do { \
TIMEOUT(lf_rval=rename(x, y)); \
if(lf_rval == -1){ \
switch(errno){ \
@@ -589,26 +589,26 @@ extern int errno;
return(0); \
} \
} \
}
} while (0)
#define STAT(x,y){ \
#define STAT(x,y) do { \
TIMEOUT(lf_rval=stat(x, y)); \
if(lf_rval != 0){ \
err_mess("stat", errno); \
*Lisp_errno = errno; \
return(-1); \
} \
}
} while (0)
/*
* For file name length check
*/
#define FNAMETOOLONG 200
#define FileNameTooLong(val) { \
#define FileNameTooLong(val) do { \
*Lisp_errno = FNAMETOOLONG; \
return((val)); \
}
} while (0)

View File

@@ -34,7 +34,7 @@
/* from SMALLP or FIXP, if necessary. */
/* */
/************************************************************************/
#define N_MakeFloat(arg, dest, tos){ \
#define N_MakeFloat(arg, dest, tos) do { \
switch (SEGMASK & (LispPTR)(arg)) { \
case S_POSITIVE: \
(dest) = (float)(0xFFFF & (LispPTR)(arg)); \
@@ -53,11 +53,11 @@
default: ERROR_EXIT(tos); \
} \
} \
}
} while (0)
#define N_GetPos(arg, dest, tos){ \
#define N_GetPos(arg, dest, tos) do { \
if (((arg) & SEGMASK) == S_POSITIVE) \
(dest) = (arg) & 0xFFFF; \
else { \
@@ -65,7 +65,7 @@
if (((dest) = *((int *)NativeAligned4FromLAddr(arg))) & 0x80000000) \
ERROR_EXIT(tos); \
} \
}
} while (0)
static inline LispPTR
aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
@@ -117,7 +117,7 @@ aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
}
#define aset_switch(type, tos) \
{ \
do { \
switch (type) { \
case 38: /* pointer : 32 bits */ \
GCLOOKUP(*(((int *)NativeAligned4FromLAddr(base)) + index), DELREF); \
@@ -178,5 +178,5 @@ aref_switch(unsigned type, LispPTR tos, LispPTR baseL, int index)
default: /* Illegal or Unimplemented */ \
ERROR_EXIT(tos); \
}/* end switch typenumber */ \
}
} while (0)
#endif /* MY_H */

View File

@@ -18,9 +18,9 @@
#include "osmsgdefs.h" // for flush_pty
#define OSMESSAGE_PRINT(print_exp) \
{ \
do { \
flush_pty(); \
print_exp; \
}
} while (0)
#endif /* OSMSG_H */

View File

@@ -65,21 +65,22 @@
/** in CONTEXTSW , for exchanging context **/
#define Midpunt(fxnum) \
{ DLword midpunt; \
do { DLword midpunt; \
midpunt = LOLOC(LAddrFromNative(CURRENTFX)); \
PVar=(DLword *) \
NativeAligned2FromStackOffset( \
(GETWORD(((DLword *)InterfacePage) + (fxnum)))) \
+ FRAMESIZE; \
GETWORD(((DLword *)InterfacePage) + (fxnum)) = midpunt ; \
}
} while (0)
#define CHECKFX \
if (((UNSIGNED)PVar -(UNSIGNED)CURRENTFX) != 20) \
do { if (((UNSIGNED)PVar -(UNSIGNED)CURRENTFX) != 20) \
{ printf("Invalid FX(0x%x) and PV(0x%x) \n", \
LAddrFromNative(CURRENTFX),LAddrFromNative(PVar)); \
}
} \
} while (0)
@@ -87,16 +88,16 @@
that it is called by CONTEXTSW in original LISP code **/
#define BEFORE_CONTEXTSW \
{ CurrentStackPTR += 2; \
do { CurrentStackPTR += 2; \
CURRENTFX->nextblock=StackOffsetFromNative(CurrentStackPTR); \
GETWORD(CurrentStackPTR)=STK_FSB_WORD; \
GETWORD(CurrentStackPTR+1)= (((UNSIGNED)EndSTKP-(UNSIGNED)(CurrentStackPTR))>>1); \
if (GETWORD(CurrentStackPTR+1) == 0) error("0-long free block."); \
}
} while (0)
#define AFTER_CONTEXTSW \
{ DLword *ac_ptr68k,*ac_freeptr; \
do { DLword *ac_ptr68k,*ac_freeptr; \
ac_ptr68k = (DLword*)NativeAligned2FromStackOffset(CURRENTFX->nextblock); \
if(GETWORD(ac_ptr68k) != STK_FSB_WORD) error("pre_moveframe: MP9316"); \
CHECK_FX(CURRENTFX); \
@@ -109,5 +110,5 @@
CHECK_FX(CURRENTFX); \
S_CHECK( EndSTKP > CurrentStackPTR, \
"End of stack isn't beyond current stk pointer."); \
}
} while (0)
#endif /* RETURN_H */

View File

@@ -305,51 +305,51 @@ typedef struct stackp {
#define SLOWP(fx) (((FXBLOCK *)(fx))->slowp)
#define FASTP(fx) (!SLOWP(fx))
#define SET_FASTP_NIL(fx68k) \
{ \
do { \
if (FASTP(fx68k)) { \
((FX *)(fx68k))->blink = StackOffsetFromNative(DUMMYBF(fx68k)); \
((FX *)(fx68k))->clink = ((FX *)(fx68k))->alink; \
SLOWP(fx68k) = T; \
} \
}
} while (0)
#define GETALINK(fx) ((((fx)->alink) & 0xfffe) - FRAMESIZE)
#define SETALINK(fx, val) \
{ \
do { \
if (FASTP(fx)) { \
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
} \
((FX *)(fx))->alink = (val) + FRAMESIZE + 1; \
}
} while (0)
#define GETBLINK(fx) (SLOWP(fx) ? ((FX *)(fx))->blink : LOLOC(LAddrFromNative(DUMMYBF(fx))))
#define SETBLINK(fx, val) \
{ \
do { \
((FX *)(fx))->blink = (val); \
if (FASTP(fx)) { \
((FX *)(fx))->clink = ((FX *)(fx))->alink; \
SLOWP(fx) = 1; \
} \
}
} while (0)
#define GETCLINK(fx) \
(SLOWP(fx) ? (((FX *)(fx))->clink - FRAMESIZE) : (((FX *)(fx))->alink - FRAMESIZE))
#define SETCLINK(fx, val) \
{ \
do { \
((FX *)(fx))->clink = (val) + FRAMESIZE; \
if (FASTP((fx))) { \
((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); \
SLOWP(fx) = 1; \
} \
}
} while (0)
#define SETACLINK(fx, val) \
{ \
do { \
if (FASTP(fx)) { ((FX *)(fx))->blink = LAddrFromNative(DUMMYBF(fx)); } \
((FX *)(fx))->clink = (val) + FRAMESIZE; \
((FX *)(fx))->alink = ((FX *)(fx))->clink + 1; \
}
} while (0)
#ifdef BIGVM
#define SWAP_FNHEAD
@@ -364,16 +364,16 @@ typedef struct stackp {
POINTERMASK))
#define MAKEFREEBLOCK(ptr68k, size) \
{ \
do { \
if ((size) <= 0) error("creating 0 long FSP"); \
*((LispPTR *)(ptr68k)) = (STK_FSB_WORD << 16) | ((DLword)(size)); \
}
} while (0)
#define SETUPGUARDBLOCK(ptr68k, size) \
{ \
do { \
if ((size) <= 0) error("creating 0 long Guard block"); \
(*((LispPTR *)(ptr68k)) = (STK_GUARD_WORD << 16) | ((DLword)(size))); \
}
} while (0)
/************************************************************************/
/* */
@@ -389,24 +389,24 @@ typedef struct stackp {
#include "testtooldefs.h"
#define S_CHECK(condition, msg) \
{ \
do { \
if (!(condition)) { \
printf("\n\nStack check failed: %s.\n\n", (msg)); \
error("S_Check.."); \
} \
}
} while (0)
#define S_WARN(condition, msg, scanptr) \
{ \
do { \
if (!(condition)) { printf("\n\nStack check failed at %p: %s.\n\n", (scanptr), (msg)); } \
}
} while (0)
#define CHECK_BF(bf68k) check_BF(bf68k)
#define CHECK_FX(fx68k) check_FX(fx68k)
#define PreMoveFrameCheck(fx68k) \
{ \
do { \
LispPTR *tos_on_stack; \
if (check_stack_rooms(fx68k) > 1000) { \
warn("moveframe:there is more than 100 words SPACE for FX"); \
@@ -416,20 +416,20 @@ typedef struct stackp {
printf("\n"); \
stack_check(0); \
} \
}
} while (0)
#else /* STACKCHECK */
#define S_CHECK(condition, msg) \
{}
do {} while (0)
#define S_WARN(condition, msg, scanptr) \
{}
do {} while (0)
#define PreMoveFrameCheck(fx68k) \
{}
do {} while (0)
#define CHECK_BF(bf68k) \
{}
do {} while (0)
#define CHECK_FX(fx68k) \
{}
do {} while (0)
#endif /* STACKCHECK */

View File

@@ -19,37 +19,37 @@ extern jmp_buf jmpbuf;
extern unsigned int TIMEOUT_TIME;
#define SETJMP(x) \
{ \
do { \
if(setjmp(jmpbuf) != 0) return(x); \
}
} while (0)
#define TIMEOUT(exp) \
{ \
do { \
alarm(TIMEOUT_TIME); \
INTRSAFE(exp); \
alarm(0); \
}
} while (0)
#define TIMEOUT0(exp) \
{ \
do { \
alarm(TIMEOUT_TIME); \
INTRSAFE0(exp); \
alarm(0); \
}
} while (0)
#define S_TOUT(exp) \
alarm(TIMEOUT_TIME),\
(exp), \
alarm(0)
alarm(TIMEOUT_TIME), \
(exp), \
alarm(0)
#define ERRSETJMP(rval) \
{ \
do { \
if(setjmp(jmpbuf) != 0) \
{ \
*Lisp_errno = 100; \
return(rval); \
} \
}
} while (0)
/************************************************************************/