diff --git a/Source/Core/Core/Src/HW/AudioInterface.cpp b/Source/Core/Core/Src/HW/AudioInterface.cpp index 4ceba760c8..84476d71b5 100644 --- a/Source/Core/Core/Src/HW/AudioInterface.cpp +++ b/Source/Core/Core/Src/HW/AudioInterface.cpp @@ -284,7 +284,7 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples if (g_AISampleRate == 48000 && _sampleRate == 32000) { - _dbg_assert_msg_(AUDIO_INTERFACE, !(_numSamples % 2), "Number of Samples: %i must be even!", _numSamples); + _dbg_assert_msg_(AUDIO_INTERFACE, !(_numSamples & 1), "Number of Samples: %i must be even!", _numSamples); _numSamples = _numSamples * 3 / 2; } else if (g_AISampleRate == 32000 && _sampleRate == 48000) diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index b627fed499..96f58ceff4 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -173,7 +173,7 @@ void Read8(u8& _uReturnValue, const u32 _iAddress) // but the hardware accepts it. Action Replay uses this. u16 val = 0; - if (_iAddress % 2 == 0) + if ((_iAddress & 1) == 0) { Read16(val, _iAddress); _uReturnValue = (u8)(val >> 8); diff --git a/Source/Core/VideoCommon/Src/IndexGenerator.cpp b/Source/Core/VideoCommon/Src/IndexGenerator.cpp index 1517e48008..8e2a1986ed 100644 --- a/Source/Core/VideoCommon/Src/IndexGenerator.cpp +++ b/Source/Core/VideoCommon/Src/IndexGenerator.cpp @@ -293,7 +293,7 @@ void IndexGenerator::AddLineList(int numVerts) *Lptr++ = index+i*2; *Lptr++ = index+i*2+1; } - if(numVerts%2 != 0) + if((numVerts & 1) != 0) { //use line strip for remaining vert *Lptr++ = index + numLines * 2 - 1; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp index 0c3e466a3a..9ec5c852ac 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp @@ -229,7 +229,7 @@ void PrintObject(const T &Obj) std::stringstream ss; u8 *o = (u8 *)&Obj; for(int i = 0; i < sizeof(T); i++) { - if(i > 0 && i % 2 == 0) + if((i > 0) && ((i & 1) == 0)) ss << " "; sprintf(byte, "%02X", Common::swap16(o[i])); @@ -718,7 +718,7 @@ ContinueWithBlock: case 0: _LeftBuffer[i] += (u64)value * ramp >> 29; break; case 1: _RightBuffer[i] += (u64)value * ramp >> 29; break; } - if ((i & 1) == 0 && i < 64) { + if (((i & 1) == 0) && i < 64) { ramp += delta; } } diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp index 401d00fa12..315d772658 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp @@ -222,16 +222,9 @@ THREAD_RETURN dsp_thread(void* lpParameter) { int cycles = (int)cycle_count; if (cycles > 0) { - if (jit) - { - cycles -= DSPCore_RunCycles(cycles); - } - else { - cycles -= DSPInterpreter::RunCycles(cycles); - } + cycles -= jit ? DSPCore_RunCycles(cycles) : DSPInterpreter::RunCycles(cycles); Common::AtomicAdd(cycle_count, -cycles); } - // yield? } return 0;