mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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:
parent
8dc42711b4
commit
d4d74fda00
2 changed files with 6 additions and 6 deletions
|
@ -473,7 +473,7 @@ static void impl_set_rate( struct Ym2612_Impl* impl, int sample_rate, int clock_
|
||||||
// prescale set to 6 by default
|
// prescale set to 6 by default
|
||||||
|
|
||||||
int Frequency = (clock_rate ? (int)((FP_ONE_CLOCK * clock_rate) / sample_rate / 144) : (int)FP_ONE_CLOCK);
|
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;
|
Frequency = FP_ONE_CLOCK;
|
||||||
impl->YM2612.TimerBase = Frequency;
|
impl->YM2612.TimerBase = Frequency;
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ static int speex_seek_page_granule(spx_int64_t pos, spx_int64_t curpos,
|
||||||
spx_int64_t avgpagelen = -1;
|
spx_int64_t avgpagelen = -1;
|
||||||
spx_int64_t lastgranule = -1;
|
spx_int64_t lastgranule = -1;
|
||||||
|
|
||||||
if(abs(pos-curpos)>10000 && headerssize>0 && curoffset-headerssize>10000) {
|
if(llabs(pos-curpos)>10000 && headerssize>0 && curoffset-headerssize>10000) {
|
||||||
/* if seeking for more that 10sec,
|
/* if seeking for more that 10sec,
|
||||||
headersize is known & more than 10kb is played,
|
headersize is known & more than 10kb is played,
|
||||||
try to guess a place to seek from the number of
|
try to guess a place to seek from the number of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue