Remove unneeded declarations and definitions

This commit is contained in:
Chris Robinson 2018-11-17 01:29:35 -08:00
parent 3bbfd0c099
commit f1731af282
4 changed files with 33 additions and 70 deletions

View File

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

View File

@ -13,39 +13,6 @@ typedef struct ALcomplex {
ALdouble Imag;
} ALcomplex;
/** Addition of two complex numbers. */
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. */
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. */
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;
}
/**
* Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
* FFT and 1 is iFFT (inverse). Fills FFTBuffer[0...FFTSize-1] with the

View File

@ -31,13 +31,8 @@
extern inline althrd_t althrd_current(void);
extern inline int althrd_equal(althrd_t thr0, althrd_t thr1);
extern inline void althrd_exit(int res);
extern inline void althrd_yield(void);
extern inline int almtx_lock(almtx_t *mtx);
extern inline int almtx_unlock(almtx_t *mtx);
extern inline int almtx_trylock(almtx_t *mtx);
#ifndef UNUSED
#if defined(__cplusplus)

View File

@ -59,11 +59,6 @@ inline int althrd_equal(althrd_t thr0, althrd_t thr1)
return thr0 == thr1;
}
inline void althrd_exit(int res)
{
ExitThread(res);
}
inline void althrd_yield(void)
{
SwitchToThread();
@ -84,14 +79,6 @@ inline int almtx_unlock(almtx_t *mtx)
return althrd_success;
}
inline int almtx_trylock(almtx_t *mtx)
{
if(!mtx) return althrd_error;
if(!TryEnterCriticalSection(mtx))
return althrd_busy;
return althrd_success;
}
#else
#include <stdint.h>
@ -126,11 +113,6 @@ inline int althrd_equal(althrd_t thr0, althrd_t thr1)
return pthread_equal(thr0, thr1);
}
inline void althrd_exit(int res)
{
pthread_exit((void*)(intptr_t)res);
}
inline void althrd_yield(void)
{
sched_yield();
@ -151,17 +133,6 @@ inline int almtx_unlock(almtx_t *mtx)
return althrd_success;
}
inline int almtx_trylock(almtx_t *mtx)
{
int ret = pthread_mutex_trylock(mtx);
switch(ret)
{
case 0: return althrd_success;
case EBUSY: return althrd_busy;
}
return althrd_error;
}
inline void alcall_once(alonce_flag *once, void (*callback)(void))
{