mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
SCI: Simplified gcd (and fixed crash when a = 0, not that it would be relevant ;)
svn-id: r38715
This commit is contained in:
parent
3cd9706c63
commit
11b2ddfc54
@ -92,19 +92,13 @@ static int mix_init(sfx_pcm_mixer_t *self, sfx_pcm_device_t *device) {
|
||||
return SFX_OK;
|
||||
}
|
||||
|
||||
static inline unsigned int gcd(unsigned int a, unsigned int b) {
|
||||
if (a == b)
|
||||
return a;
|
||||
|
||||
if (a < b) {
|
||||
unsigned int c = b % a;
|
||||
|
||||
if (!c)
|
||||
return a;
|
||||
|
||||
return gcd(c, a);
|
||||
} else
|
||||
return gcd(b, a);
|
||||
static inline uint gcd(uint a, uint b) {
|
||||
while (a) {
|
||||
uint c = b % a;
|
||||
b = a;
|
||||
a = c;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
static sfx_pcm_urat_t urat(unsigned int nom, unsigned int denom) {
|
||||
|
Loading…
Reference in New Issue
Block a user