]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Silence compiler warning in get_long_cache_040
authorThomas Huth <huth@tuxfamily.org>
Mon, 21 May 2018 05:48:38 +0000 (07:48 +0200)
committerThomas Huth <huth@tuxfamily.org>
Mon, 21 May 2018 06:04:38 +0000 (08:04 +0200)
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

index 610b356df647818f0cfe40df7b4de33ef51385be..6a1c2fb3e34c56832a8d46980327ebf03e494e5e 100644 (file)
@@ -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;
        }