From: Thomas Huth Date: Mon, 21 May 2018 05:48:38 +0000 (+0200) Subject: Silence compiler warning in get_long_cache_040 X-Git-Tag: 4000~39^2^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=80d773a0883b54c135ee71c767d456c2b8c74258;p=francis%2Fwinuae.git 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. --- 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; }