From e9497bffef384a29700ce98122c9a0f3798de783 Mon Sep 17 00:00:00 2001 From: tseng0201 <99745983+tseng0201@users.noreply.github.com> Date: Sat, 14 Jan 2023 01:43:47 +0900 Subject: [PATCH] ADD STATIC MODIFIER FOR HELP COMPILER OPTIMIZATION Add static modifier on CombinedScreens and DOOMHeap in i_system.c for help compiler optimization. No other file use both array directly and they use them by pointer. --- src/riscv/i_system.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/riscv/i_system.c b/src/riscv/i_system.c index e9084e6..b08cfcc 100644 --- a/src/riscv/i_system.c +++ b/src/riscv/i_system.c @@ -40,9 +40,9 @@ #include "console.h" #ifdef COMBINE_SCREENS -unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT]; +static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT]; #else -unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4]; +static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4]; #endif /* Original 6M - wipe function (130560 bytes) */ @@ -52,7 +52,7 @@ unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4]; #define DOOM_HEAP_SIZE 6*1024*1024 #endif -unsigned char DOOMHeap[DOOM_HEAP_SIZE]; +static unsigned char DOOMHeap[DOOM_HEAP_SIZE]; enum { KEY_EVENT = 0,