Merge pull request #474 from OPNA2608/fix/fallthrough_gcc

Nicer fix for implicit fallthrough warnings on GCC
This commit is contained in:
tildearrow 2022-05-20 04:16:31 -05:00 committed by GitHub
commit 983ec75eb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,22 +388,8 @@ void namco_device::polepos_sound_w(int offset, uint8_t data)
case 0x23:
voice->waveform_select = data & 7;
// FALLTHROUGH
voice->volume[0] = voice->volume[1] = 0;
// front speakers ?
voice->volume[0] += m_soundregs[ch * 4 + 0x03] >> 4;
voice->volume[1] += m_soundregs[ch * 4 + 0x03] & 0x0f;
// rear speakers ?
voice->volume[0] += m_soundregs[ch * 4 + 0x23] >> 4;
voice->volume[1] += m_soundregs[ch * 4 + 0x02] >> 4;
voice->volume[0] /= 2;
voice->volume[1] /= 2;
/* if 54XX or 52XX selected, silence this voice */
if (m_soundregs[ch * 4 + 0x23] & 8)
voice->volume[0] = voice->volume[1] = 0;
break;
// https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
// fall through
case 0x02:
case 0x03:
voice->volume[0] = voice->volume[1] = 0;
@ -485,12 +471,8 @@ void namco_15xx_device::namco_15xx_w(int offset, uint8_t data)
case 0x06:
voice->waveform_select = (data >> 4) & 7;
// FALLTHROUGH
/* the frequency has 20 bits */
voice->frequency = m_soundregs[ch * 8 + 0x04];
voice->frequency += m_soundregs[ch * 8 + 0x05] << 8;
voice->frequency += (m_soundregs[ch * 8 + 0x06] & 15) << 16; /* high bits are from here */
break;
// https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
// fall through
case 0x04:
case 0x05:
/* the frequency has 20 bits */
@ -564,12 +546,8 @@ void namco_cus30_device::namcos1_sound_w(int offset, uint8_t data)
case 0x01:
voice->waveform_select = (data >> 4) & 15;
// FALLTHROUGH
/* the frequency has 20 bits */
voice->frequency = (soundregs[ch * 8 + 0x01] & 15) << 16; /* high bits are from here */
voice->frequency += soundregs[ch * 8 + 0x02] << 8;
voice->frequency += soundregs[ch * 8 + 0x03];
break;
// https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
// fall through
case 0x02:
case 0x03:
/* the frequency has 20 bits */