diff options
Diffstat (limited to 'src/synth_math.h')
-rw-r--r-- | src/synth_math.h | 22 |
1 files changed, 13 insertions, 9 deletions
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 <stddef.h> -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++) { |