diff options
author | Chris Robinson <[email protected]> | 2018-11-17 01:29:35 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-17 01:29:35 -0800 |
commit | f1731af282b3c54d2b19dedd72beb584cbda5220 (patch) | |
tree | 3f18e993ec0f51d7863ca16c3de0f788a3838021 /common/alcomplex.c | |
parent | 3bbfd0c0996e1db310cc2b72cffaf310a2adf6fb (diff) |
Remove unneeded declarations and definitions
Diffstat (limited to 'common/alcomplex.c')
-rw-r--r-- | common/alcomplex.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/common/alcomplex.c b/common/alcomplex.c index d4045aeb..851f4105 100644 --- a/common/alcomplex.c +++ b/common/alcomplex.c @@ -5,9 +5,39 @@ #include "math_defs.h" -extern inline ALcomplex complex_add(ALcomplex a, ALcomplex b); -extern inline ALcomplex complex_sub(ALcomplex a, ALcomplex b); -extern inline ALcomplex complex_mult(ALcomplex a, ALcomplex b); +/** Addition of two complex numbers. */ +static inline ALcomplex complex_add(ALcomplex a, ALcomplex b) +{ + ALcomplex result; + + result.Real = a.Real + b.Real; + result.Imag = a.Imag + b.Imag; + + return result; +} + +/** Subtraction of two complex numbers. */ +static inline ALcomplex complex_sub(ALcomplex a, ALcomplex b) +{ + ALcomplex result; + + result.Real = a.Real - b.Real; + result.Imag = a.Imag - b.Imag; + + return result; +} + +/** Multiplication of two complex numbers. */ +static inline ALcomplex complex_mult(ALcomplex a, ALcomplex b) +{ + ALcomplex result; + + result.Real = a.Real*b.Real - a.Imag*b.Imag; + result.Imag = a.Imag*b.Real + a.Real*b.Imag; + + return result; +} + void complex_fft(ALcomplex *FFTBuffer, ALsizei FFTSize, ALdouble Sign) { |