From 500b9a07b93d6cd3e771edc5698e06d163da60f1 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 22 Feb 2025 02:36:27 +0200 Subject: a year of changes (web, better soundcard handling, biquad) --- src/synth_math.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/synth_math.h') diff --git a/src/synth_math.h b/src/synth_math.h index 2dd9f83..029ed74 100644 --- a/src/synth_math.h +++ b/src/synth_math.h @@ -3,19 +3,23 @@ #include -static long long +// do I really want inline? used to be static +inline long long gcd(long long a, long long b) { - long long rem; - rem=a-(a/b*b); - if(rem==0) - return b; - else - gcd(b,rem); + long long rem; + rem=a-(a/b*b); + if(rem==0) + return b; + else + gcd(b, rem); + + // unreachable + return 0; } // Function to return LCM of two numbers -static long long +inline long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; @@ -30,7 +34,7 @@ clamp(float f, int min, int max) } /* 1d convolution */ -static void +inline void convole(float *signal, float *filter, size_t signal_size, size_t filter_size, float *out) { for (size_t i = 0; i < filter_size + signal_size; i++) { -- cgit v1.2.3