From a20bb982cce0c5b69f7597c197a0866893e25ff8 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 11 Nov 2021 17:33:40 +0300 Subject: [PATCH] cvg, sst1: tweak another getenv() usage. --- glide2x/cvg/init/sst1init.c | 8 ++++++-- glide2x/sst1/init/initvg/sst1init.c | 9 +++++++-- glide3x/cvg/init/sst1init.c | 8 ++++++-- glide3x/sst1/init/initvg/sst1init.c | 9 +++++++-- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/glide2x/cvg/init/sst1init.c b/glide2x/cvg/init/sst1init.c index f9b81a2..5301bce 100644 --- a/glide2x/cvg/init/sst1init.c +++ b/glide2x/cvg/init/sst1init.c @@ -898,11 +898,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) return(FXFALSE); } - if(GETENV(("SSTV2_NOSHUTDOWN"))) + if(GETENV(("SSTV2_NOSHUTDOWN"))) { INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SSTV2_NOSHUTDOWN\n")); + goto noshutdown; + } n = 0; - while(!GETENV(("SSTV2_NOSHUTDOWN"))) { + for ( ;; ) { if(!n) sstPtr = sstMaster; else @@ -948,6 +950,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) break; } + noshutdown: ; + /* sst1InitIdle(sstbase); */ #if !DIRECTX diff --git a/glide2x/sst1/init/initvg/sst1init.c b/glide2x/sst1/init/initvg/sst1init.c index 315f2b3..ae3d51f 100644 --- a/glide2x/sst1/init/initvg/sst1init.c +++ b/glide2x/sst1/init/initvg/sst1init.c @@ -703,11 +703,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) pciClose(); #endif - if(GETENV(("SST_NOSHUTDOWN"))) + if(GETENV(("SST_NOSHUTDOWN"))) { INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SST_NOSHUTDOWN\n")); + goto noshutdown; + } n = 0; - while(!GETENV(("SST_NOSHUTDOWN"))) { + for ( ;; ) { if(!n) sstPtr = sstMaster; else @@ -749,6 +751,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if((++n > 1) || !SliEnable) break; } + + noshutdown: ; + sst1InitIdle(sstbase); INIT_PRINTF(("sst1InitShutdown(): Returning with status %d...\n", FXTRUE)); #ifdef INIT_OUTPUT diff --git a/glide3x/cvg/init/sst1init.c b/glide3x/cvg/init/sst1init.c index 8e7cda3..855bfd9 100644 --- a/glide3x/cvg/init/sst1init.c +++ b/glide3x/cvg/init/sst1init.c @@ -898,11 +898,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) return(FXFALSE); } - if(GETENV(("SSTV2_NOSHUTDOWN"))) + if(GETENV(("SSTV2_NOSHUTDOWN"))) { INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SSTV2_NOSHUTDOWN\n")); + goto noshutdown; + } n = 0; - while(!GETENV(("SSTV2_NOSHUTDOWN"))) { + for ( ;; ) { if(!n) sstPtr = sstMaster; else @@ -948,6 +950,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) break; } + noshutdown: ; + /* sst1InitIdle(sstbase); */ #if !DIRECTX diff --git a/glide3x/sst1/init/initvg/sst1init.c b/glide3x/sst1/init/initvg/sst1init.c index 6d185d3..957c23b 100644 --- a/glide3x/sst1/init/initvg/sst1init.c +++ b/glide3x/sst1/init/initvg/sst1init.c @@ -703,11 +703,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) /*pciClose(); [dBorca] not just yet! We still need PCI to shutdown */ #endif - if(GETENV(("SST_NOSHUTDOWN"))) + if(GETENV(("SST_NOSHUTDOWN"))) { INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SST_NOSHUTDOWN\n")); + goto noshutdown; + } n = 0; - while(!GETENV(("SST_NOSHUTDOWN"))) { + for ( ;; ) { if(!n) sstPtr = sstMaster; else @@ -749,6 +751,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if((++n > 1) || !SliEnable) break; } + + noshutdown: ; + sst1InitIdle(sstbase); INIT_PRINTF(("sst1InitShutdown(): Returning with status %d...\n", FXTRUE)); #ifdef INIT_OUTPUT