1
0
Fork 0
forked from len0rd/rockbox

codecs: abs() --> llabs() in speex and libgme

We were calling abs() on 64-bit (ie long long) variables.

Change-Id: I8326910a4ce733e9e2251aa5f9047e336c8be6df
This commit is contained in:
Solomon Peachy 2024-10-12 11:57:25 -04:00
parent 8dc42711b4
commit d4d74fda00
2 changed files with 6 additions and 6 deletions

View file

@ -466,17 +466,17 @@ static void impl_set_rate( struct Ym2612_Impl* impl, int sample_rate, int clock_
{
assert( sample_rate );
assert( !clock_rate || clock_rate > sample_rate );
int i;
// 144 = 12 * (prescale * 2) = 12 * 6 * 2
// prescale set to 6 by default
int Frequency = (clock_rate ? (int)((FP_ONE_CLOCK * clock_rate) / sample_rate / 144) : (int)FP_ONE_CLOCK);
if ( abs( Frequency - FP_ONE_CLOCK ) < 1 )
if ( llabs( Frequency - FP_ONE_CLOCK ) < 1 )
Frequency = FP_ONE_CLOCK;
impl->YM2612.TimerBase = Frequency;
/* double Frequence = (double)Frequency / FP_ONE_CLOCK; */
// Tableau TL :