From ba0a42f6631814391e5a7a033a74fcbabb7d22d8 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Tue, 8 Dec 2020 12:34:59 -0800 Subject: [PATCH] Remove replicated (debug) storage for stack block checks causing shadowed variable warnings. Initialize free stack block debug storage using sizeof() appropriately. modified: src/llstk.c --- src/llstk.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/llstk.c b/src/llstk.c index c0eab07..85f058e 100644 --- a/src/llstk.c +++ b/src/llstk.c @@ -540,7 +540,7 @@ void blt(register DLword *dest68k, register DLword *source68k, int nw) { DLword offset; DLword size; } bigFSB[100]; - int bigFSBindex = 0; + int bigFSBindex; #endif void stack_check(StackWord *start68k) { @@ -553,7 +553,8 @@ void stack_check(StackWord *start68k) { DLword freesize; #ifdef FSBCHECK - memset((char *)bigFSB, 0, 100 * 2 * 2); + bigFSBindex = 0; + memset((char *)bigFSB, 0, sizeof(bigFSB)); #endif if ((CURRENTFX->nextblock != StkOffset_from_68K(CurrentStackPTR)) || (!FSBP(CurrentStackPTR))) { @@ -848,13 +849,8 @@ void quick_stack_check(void) { DLword freesize; #ifdef FSBCHECK - struct big_fsbs { - DLword offset; - DLword size; - } bigFSB[100]; - int bigFSBindex = 0; - - memset((char *)bigFSB, 0, 100 * 2 * 2); + bigFSBindex = 0; + memset((char *)bigFSB, 0, sizeof(bigFSB)); #endif if ((CURRENTFX->nextblock != StkOffset_from_68K(CurrentStackPTR)) || (!FSBP(CurrentStackPTR))) {