More unsigned ints because of undefined integer overflow behaviour

This commit is contained in:
def 2014-12-02 12:10:21 +01:00
parent b525de33b5
commit 623223354a
2 changed files with 3 additions and 3 deletions

View file

@ -260,8 +260,8 @@ static void Mix(short *pFinalOut, unsigned Frames)
for(unsigned i = 0; i < Frames; i++)
{
int j = i<<1;
int vl = ((m_pMixBuffer[j]*MasterVol)/101)>>8;
int vr = ((m_pMixBuffer[j+1]*MasterVol)/101)>>8;
unsigned int vl = (((unsigned int) m_pMixBuffer[j]*MasterVol)/101)>>8;
unsigned int vr = (((unsigned int) m_pMixBuffer[j+1]*MasterVol)/101)>>8;
pFinalOut[j] = Int2Short(vl);
pFinalOut[j+1] = Int2Short(vr);

View file

@ -30,7 +30,7 @@ int CSnapshot::GetItemIndex(int Key)
int CSnapshot::Crc()
{
int Crc = 0;
unsigned int Crc = 0;
for(int i = 0; i < m_NumItems; i++)
{