SCI: Simplified gcd (and fixed crash when a = 0, not that it would be relevant ;)

svn-id: r38715
This commit is contained in:
Max Horn 2009-02-21 18:13:03 +00:00
parent 3cd9706c63
commit 11b2ddfc54

View File

@ -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) {