mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
More unsigned ints because of undefined integer overflow behaviour
This commit is contained in:
parent
b525de33b5
commit
623223354a
|
@ -260,8 +260,8 @@ static void Mix(short *pFinalOut, unsigned Frames)
|
||||||
for(unsigned i = 0; i < Frames; i++)
|
for(unsigned i = 0; i < Frames; i++)
|
||||||
{
|
{
|
||||||
int j = i<<1;
|
int j = i<<1;
|
||||||
int vl = ((m_pMixBuffer[j]*MasterVol)/101)>>8;
|
unsigned int vl = (((unsigned int) m_pMixBuffer[j]*MasterVol)/101)>>8;
|
||||||
int vr = ((m_pMixBuffer[j+1]*MasterVol)/101)>>8;
|
unsigned int vr = (((unsigned int) m_pMixBuffer[j+1]*MasterVol)/101)>>8;
|
||||||
|
|
||||||
pFinalOut[j] = Int2Short(vl);
|
pFinalOut[j] = Int2Short(vl);
|
||||||
pFinalOut[j+1] = Int2Short(vr);
|
pFinalOut[j+1] = Int2Short(vr);
|
||||||
|
|
|
@ -30,7 +30,7 @@ int CSnapshot::GetItemIndex(int Key)
|
||||||
|
|
||||||
int CSnapshot::Crc()
|
int CSnapshot::Crc()
|
||||||
{
|
{
|
||||||
int Crc = 0;
|
unsigned int Crc = 0;
|
||||||
|
|
||||||
for(int i = 0; i < m_NumItems; i++)
|
for(int i = 0; i < m_NumItems; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue