From 881f21e9ce1fae397adf461eaa806daf65c2ae86 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 10 Aug 2020 17:50:54 -0700 Subject: [PATCH] 16-bit constants with high bit set that are going to be shifted << 16 should be unsigned to avoid overflow warning. Remove some unnecessary 32-bit convenience constants that can be calculated at compile time. modified: inc/stack.h --- inc/stack.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/inc/stack.h b/inc/stack.h index cc2b79d..fbcab15 100755 --- a/inc/stack.h +++ b/inc/stack.h @@ -24,16 +24,12 @@ #define GCFXP 5 #define FAULTFXP 6 -#define STK_FSB_WORD 0xA000 -#define STK_FSB_32 0xA0000000 - -#define STK_GUARD_WORD 0xE000 -#define STK_GUARD_32 0xE0000000 -#define BF_MARK0 0x8000 -#define BF_MARK 0x8000 +#define STK_FSB_WORD 0xA000u +#define STK_GUARD_WORD 0xE000u +#define BF_MARK 0x8000u #define BF_MARK32 0x80000000 -#define FX_MARK 0xc000 -#define FX_MARK_NATIVE 0xc800 +#define FX_MARK 0xc000u +#define FX_MARK_NATIVE 0xc800u #define STK_GUARD 7 #define STK_FX 6 @@ -372,13 +368,13 @@ typedef struct stackp #define MAKEFREEBLOCK(ptr68k,size) \ { \ if ((size) <= 0) error("creating 0 long FSP"); \ - *((LispPTR*)(ptr68k))=STK_FSB_32| ((DLword)(size)); \ + *((LispPTR*)(ptr68k))=(STK_FSB_WORD << 16) | ((DLword)(size)); \ } #define SETUPGUARDBLOCK(ptr68k,size) \ { \ if ((size) <= 0) error("creating 0 long Guard block"); \ - ( *((LispPTR*)(ptr68k))=STK_GUARD_32| ((DLword)(size)) ); \ + ( *((LispPTR*)(ptr68k))=(STK_GUARD_WORD << 16) | ((DLword)(size)) ); \ }