rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake)

This commit is contained in:
withmorten
2021-06-28 13:57:05 +02:00
parent f8297df9c5
commit d17d437de3
41 changed files with 189 additions and 189 deletions

View File

@ -162,7 +162,7 @@ public:
else
StepIndex--;
StepIndex = clamp(StepIndex, 0, 88);
StepIndex = Clamp(StepIndex, 0, 88);
int delta = step >> 3;
if (adpcm & 1) delta += step >> 2;
@ -171,7 +171,7 @@ public:
if (adpcm & 8) delta = -delta;
int newSample = Sample + delta;
Sample = clamp(newSample, -32768, 32767);
Sample = Clamp(newSample, -32768, 32767);
return Sample;
}
};
@ -716,7 +716,7 @@ public:
static short quantize(double sample)
{
int a = int(sample + 0.5);
return short(clamp(a, -32768, 32767));
return short(Clamp(a, -32768, 32767));
}
void Decode(void* _inbuf, int16* _outbuf, size_t size)
@ -1448,10 +1448,10 @@ void CStream::SetVolume(uint32 nVol)
void CStream::SetPan(uint8 nPan)
{
m_nPan = clamp((int8)nPan - 63, 0, 63);
m_nPan = Clamp((int8)nPan - 63, 0, 63);
SetPosition(0, (m_nPan - 63) / 64.0f, 0.0f, Sqrt(1.0f - SQR((m_nPan - 63) / 64.0f)));
m_nPan = clamp((int8)nPan + 64, 64, 127);
m_nPan = Clamp((int8)nPan + 64, 64, 127);
SetPosition(1, (m_nPan - 63) / 64.0f, 0.0f, Sqrt(1.0f - SQR((m_nPan - 63) / 64.0f)));
m_nPan = nPan;