From 2cb51ad326d0c7ee20496a76d57ff7feadfb7376 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 16 Jan 2023 09:56:50 -0800 Subject: [PATCH] Silence warnings for incompatible pointer type assignments in stack pointer save/restore defines CSTKPTR is "LispPTR *" while CurrentStackPTR is "DLword *", cast to "void *" to silence the warning, add comment pointing out size difference to explain the "- 1" vs "+ 2" adjustments when saving/restoring. --- inc/tos1defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/tos1defs.h b/inc/tos1defs.h index f8745af..a9e4a06 100644 --- a/inc/tos1defs.h +++ b/inc/tos1defs.h @@ -69,9 +69,9 @@ /* OPCODE interface routines */ #define StackPtrSave \ - do { CurrentStackPTR = (DLword *)(CSTKPTR - 1); } while (0) + do { CurrentStackPTR = (void *)(CSTKPTR - 1); /* CSTKPTR in cells */ } while (0) #define StackPtrRestore \ - do { CSTKPTRL = ((LispPTR *)CurrentStackPTR) + 1; } while (0) + do { CSTKPTRL = (void *)(CurrentStackPTR + 2); /* CurrentStackPTR in DLwords */ } while (0) #define EXT \ do { \