From 1c47bf5df06e602a6b3f8252505943354d4474d9 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Thu, 17 Jun 2021 13:21:00 -0700 Subject: [PATCH] Fix the FastRetCALL macro to use do {} while (0) style (#384) --- inc/return.h | 8 ++++---- src/return.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/return.h b/inc/return.h index 879b89d..775d9d3 100644 --- a/inc/return.h +++ b/inc/return.h @@ -35,7 +35,7 @@ /* FAST case return use */ #ifndef RESWAPPEDCODESTREAM #define FastRetCALL \ - { \ + do { \ /* Get IVar from Returnee's IVAR offset slot(BF) */ \ IVar = Addr68k_from_LADDR(STK_OFFSET | GETWORD((DLword *)CURRENTFX -1)); \ /* Get FuncObj from Returnee's FNHEAD slot in FX */ \ @@ -43,10 +43,10 @@ Addr68k_from_LADDR(FX_FNHEADER); \ /* Get PC from Returnee's pc slot in FX */ \ PC = (ByteCode *)FuncObj + CURRENTFX->pc ; \ - } + } while (0) #else #define FastRetCALL \ - { \ + do { \ /* Get IVar from Returnee's IVAR offset slot(BF) */ \ IVar = Addr68k_from_LADDR(STK_OFFSET | GETWORD((DLword *)CURRENTFX -1)); \ /* Get FuncObj from Returnee's FNHEAD slot in FX */ \ @@ -59,7 +59,7 @@ byte_swap_code_block(FuncObj); \ FuncObj->byteswapped = 1; \ } \ - } + } while (0) #endif /* RESWAPPEDCODESTREAM */ diff --git a/src/return.c b/src/return.c index c0ea0e8..e978a03 100644 --- a/src/return.c +++ b/src/return.c @@ -168,7 +168,8 @@ void contextsw(register DLword fxnum, register DLword bytenum, register DLword f CHECKFX; if (EndSTKP < CurrentStackPTR) error("contextsw:Illegal ESP"); #endif - FastRetCALL return; + FastRetCALL; + return; } } /* end contextsw */