From 80d773a0883b54c135ee71c767d456c2b8c74258 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 21 May 2018 07:48:38 +0200 Subject: [PATCH] Silence compiler warning in get_long_cache_040 GCC with -O1 and Clang complain that 'v' may be used uninitialized in the function get_long_cache_040(). The warning is wrong since all cases are handled, so that v can never be used uninitialized here. But the last check "if (offset == 14)" is redundant here anyway, so let's simply turn this into an unconditional else-statement instead - which then also makes the compilers happy. --- newcpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newcpu.cpp b/newcpu.cpp index 610b356d..6a1c2fb3 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -10590,7 +10590,7 @@ uae_u32 get_long_cache_040(uaecptr addr) v = read_dcache040(addr + 0, 0, dcache_bget) << 24; v |= read_dcache040(addr + 1, 1, dcache_wget) << 8; v |= read_dcache040(addr + 3, 0, dcache_bget) << 0; - } else if (offset == 14) { + } else /* if (offset == 14) */ { v = read_dcache040(addr + 0, 1, dcache_wget) << 16; v |= read_dcache040(addr + 2, 1, dcache_wget) << 0; } -- 2.47.3