aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sfx/mixer/soft.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/engines/sci/sfx/mixer/soft.cpp b/engines/sci/sfx/mixer/soft.cpp
index bf76268356..6e70be6eea 100644
--- a/engines/sci/sfx/mixer/soft.cpp
+++ b/engines/sci/sfx/mixer/soft.cpp
@@ -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) {