diff options
author | Chris Robinson <[email protected]> | 2013-05-28 22:27:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-28 22:27:07 -0700 |
commit | e96cc656e9c9176ba60cd191896fd6386a7fd74d (patch) | |
tree | b6deb2a859ca08a519f9ff2c1c3d9022eb698462 /OpenAL32/Include | |
parent | 48aa1e10d64d7c62cab856a0c5d7f9e140efbd6b (diff) |
Use C99's inline instead of __inline
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alBuffer.h | 6 | ||||
-rw-r--r-- | OpenAL32/Include/alEffect.h | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alFilter.h | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 72 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 34 |
5 files changed, 59 insertions, 59 deletions
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h index 8ecc4dd8..f1d64666 100644 --- a/OpenAL32/Include/alBuffer.h +++ b/OpenAL32/Include/alBuffer.h @@ -35,8 +35,8 @@ enum UserFmtChannels { ALuint BytesFromUserFmt(enum UserFmtType type); ALuint ChannelsFromUserFmt(enum UserFmtChannels chans); -static __inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, - enum UserFmtType type) +static inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, + enum UserFmtType type) { return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type); } @@ -60,7 +60,7 @@ enum FmtChannels { ALuint BytesFromFmt(enum FmtType type); ALuint ChannelsFromFmt(enum FmtChannels chans); -static __inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type) +static inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type) { return ChannelsFromFmt(chans) * BytesFromFmt(type); } diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h index a685681e..a1b430e9 100644 --- a/OpenAL32/Include/alEffect.h +++ b/OpenAL32/Include/alEffect.h @@ -162,7 +162,7 @@ typedef struct ALeffect { ALuint id; } ALeffect; -static __inline ALboolean IsReverbEffect(ALenum type) +static inline ALboolean IsReverbEffect(ALenum type) { return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; } ALenum InitEffect(ALeffect *effect); diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index f42747f2..605c96c7 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -31,7 +31,7 @@ typedef struct ALfilterState { void ALfilterState_clear(ALfilterState *filter); void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat gain, ALfloat freq_scale, ALfloat bandwidth); -static __inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample) +static inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample) { ALfloat outsmp; @@ -48,7 +48,7 @@ static __inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALflo return outsmp; } -static __inline ALfloat ALfilterState_processSingleC(const ALfilterState *filter, ALfloat sample) +static inline ALfloat ALfilterState_processSingleC(const ALfilterState *filter, ALfloat sample) { return filter->b[0] * sample + filter->b[1] * filter->x[0] + diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index c0c7baac..9bf10903 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -109,7 +109,7 @@ typedef LONG pthread_once_t; #define PTHREAD_ONCE_INIT 0 void pthread_once(pthread_once_t *once, void (*callback)(void)); -static __inline int sched_yield(void) +static inline int sched_yield(void) { SwitchToThread(); return 0; } #else @@ -143,31 +143,31 @@ typedef void *volatile XchgPtr; #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && !defined(__QNXNTO__) typedef ALuint RefCount; -static __inline RefCount IncrementRef(volatile RefCount *ptr) +static inline RefCount IncrementRef(volatile RefCount *ptr) { return __sync_add_and_fetch(ptr, 1); } -static __inline RefCount DecrementRef(volatile RefCount *ptr) +static inline RefCount DecrementRef(volatile RefCount *ptr) { return __sync_sub_and_fetch(ptr, 1); } -static __inline int ExchangeInt(volatile int *ptr, int newval) +static inline int ExchangeInt(volatile int *ptr, int newval) { return __sync_lock_test_and_set(ptr, newval); } -static __inline void *ExchangePtr(XchgPtr *ptr, void *newval) +static inline void *ExchangePtr(XchgPtr *ptr, void *newval) { return __sync_lock_test_and_set(ptr, newval); } -static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) +static inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) { return __sync_bool_compare_and_swap(ptr, oldval, newval); } -static __inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) +static inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) { return __sync_bool_compare_and_swap(ptr, oldval, newval); } #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -static __inline int xaddl(volatile int *dest, int incr) +static inline int xaddl(volatile int *dest, int incr) { int ret; __asm__ __volatile__("lock; xaddl %0,(%1)" @@ -178,12 +178,12 @@ static __inline int xaddl(volatile int *dest, int incr) } typedef int RefCount; -static __inline RefCount IncrementRef(volatile RefCount *ptr) +static inline RefCount IncrementRef(volatile RefCount *ptr) { return xaddl(ptr, 1)+1; } -static __inline RefCount DecrementRef(volatile RefCount *ptr) +static inline RefCount DecrementRef(volatile RefCount *ptr) { return xaddl(ptr, -1)-1; } -static __inline int ExchangeInt(volatile int *dest, int newval) +static inline int ExchangeInt(volatile int *dest, int newval) { int ret; __asm__ __volatile__("lock; xchgl %0,(%1)" @@ -193,7 +193,7 @@ static __inline int ExchangeInt(volatile int *dest, int newval) return ret; } -static __inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int newval) +static inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int newval) { int ret; __asm__ __volatile__("lock; cmpxchgl %2,(%1)" @@ -203,7 +203,7 @@ static __inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int ne return ret == oldval; } -static __inline void *ExchangePtr(XchgPtr *dest, void *newval) +static inline void *ExchangePtr(XchgPtr *dest, void *newval) { void *ret; __asm__ __volatile__( @@ -219,7 +219,7 @@ static __inline void *ExchangePtr(XchgPtr *dest, void *newval) return ret; } -static __inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *newval) +static inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *newval) { void *ret; __asm__ __volatile__( @@ -238,14 +238,14 @@ static __inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *new #elif defined(_WIN32) typedef LONG RefCount; -static __inline RefCount IncrementRef(volatile RefCount *ptr) +static inline RefCount IncrementRef(volatile RefCount *ptr) { return InterlockedIncrement(ptr); } -static __inline RefCount DecrementRef(volatile RefCount *ptr) +static inline RefCount DecrementRef(volatile RefCount *ptr) { return InterlockedDecrement(ptr); } extern ALbyte LONG_size_does_not_match_int[(sizeof(LONG)==sizeof(int))?1:-1]; -static __inline int ExchangeInt(volatile int *ptr, int newval) +static inline int ExchangeInt(volatile int *ptr, int newval) { union { volatile int *i; @@ -253,11 +253,11 @@ static __inline int ExchangeInt(volatile int *ptr, int newval) } u = { ptr }; return InterlockedExchange(u.l, newval); } -static __inline void *ExchangePtr(XchgPtr *ptr, void *newval) +static inline void *ExchangePtr(XchgPtr *ptr, void *newval) { return InterlockedExchangePointer(ptr, newval); } -static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) +static inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) { union { volatile int *i; @@ -265,7 +265,7 @@ static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int new } u = { ptr }; return InterlockedCompareExchange(u.l, newval, oldval) == oldval; } -static __inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) +static inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) { return InterlockedCompareExchangePointer(ptr, newval, oldval) == oldval; } @@ -275,12 +275,12 @@ static __inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newv #include <libkern/OSAtomic.h> typedef int32_t RefCount; -static __inline RefCount IncrementRef(volatile RefCount *ptr) +static inline RefCount IncrementRef(volatile RefCount *ptr) { return OSAtomicIncrement32Barrier(ptr); } -static __inline RefCount DecrementRef(volatile RefCount *ptr) +static inline RefCount DecrementRef(volatile RefCount *ptr) { return OSAtomicDecrement32Barrier(ptr); } -static __inline int ExchangeInt(volatile int *ptr, int newval) +static inline int ExchangeInt(volatile int *ptr, int newval) { /* Really? No regular old atomic swap? */ int oldval; @@ -289,7 +289,7 @@ static __inline int ExchangeInt(volatile int *ptr, int newval) } while(!OSAtomicCompareAndSwap32Barrier(oldval, newval, ptr)); return oldval; } -static __inline void *ExchangePtr(XchgPtr *ptr, void *newval) +static inline void *ExchangePtr(XchgPtr *ptr, void *newval) { void *oldval; do { @@ -297,11 +297,11 @@ static __inline void *ExchangePtr(XchgPtr *ptr, void *newval) } while(!OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr)); return oldval; } -static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) +static inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) { return OSAtomicCompareAndSwap32Barrier(oldval, newval, ptr); } -static __inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) +static inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) { return OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr); } @@ -345,13 +345,13 @@ ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value); ALvoid *RemoveUIntMapKey(UIntMap *map, ALuint key); ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key); -static __inline void LockUIntMapRead(UIntMap *map) +static inline void LockUIntMapRead(UIntMap *map) { ReadLock(&map->lock); } -static __inline void UnlockUIntMapRead(UIntMap *map) +static inline void UnlockUIntMapRead(UIntMap *map) { ReadUnlock(&map->lock); } -static __inline void LockUIntMapWrite(UIntMap *map) +static inline void LockUIntMapWrite(UIntMap *map) { WriteLock(&map->lock); } -static __inline void UnlockUIntMapWrite(UIntMap *map) +static inline void UnlockUIntMapWrite(UIntMap *map) { WriteUnlock(&map->lock); } @@ -367,7 +367,7 @@ struct Hrtf; // Find the next power-of-2 for non-power-of-2 numbers. -static __inline ALuint NextPowerOf2(ALuint value) +static inline ALuint NextPowerOf2(ALuint value) { if(value > 0) { @@ -383,7 +383,7 @@ static __inline ALuint NextPowerOf2(ALuint value) /* Fast float-to-int conversion. Assumes the FPU is already in round-to-zero * mode. */ -static __inline ALint fastf2i(ALfloat f) +static inline ALint fastf2i(ALfloat f) { #ifdef HAVE_LRINTF return lrintf(f); @@ -399,7 +399,7 @@ static __inline ALint fastf2i(ALfloat f) /* Fast float-to-uint conversion. Assumes the FPU is already in round-to-zero * mode. */ -static __inline ALuint fastf2u(ALfloat f) +static inline ALuint fastf2u(ALfloat f) { return fastf2i(f); } @@ -546,7 +546,7 @@ enum DevFmtChannels { ALuint BytesFromDevFmt(enum DevFmtType type); ALuint ChannelsFromDevFmt(enum DevFmtChannels chans); -static __inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, +static inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type) { return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type); @@ -751,9 +751,9 @@ void ALCdevice_LockDefault(ALCdevice *device); void ALCdevice_UnlockDefault(ALCdevice *device); ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device); -static __inline void LockContext(ALCcontext *context) +static inline void LockContext(ALCcontext *context) { ALCdevice_Lock(context->Device); } -static __inline void UnlockContext(ALCcontext *context) +static inline void UnlockContext(ALCcontext *context) { ALCdevice_Unlock(context->Device); } diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index f323b0d0..b389ec1e 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -51,47 +51,47 @@ typedef ALvoid (*WetMixerFunc)(const struct SendParams *params, #define FRACTIONMASK (FRACTIONONE-1) -static __inline ALfloat minf(ALfloat a, ALfloat b) +static inline ALfloat minf(ALfloat a, ALfloat b) { return ((a > b) ? b : a); } -static __inline ALfloat maxf(ALfloat a, ALfloat b) +static inline ALfloat maxf(ALfloat a, ALfloat b) { return ((a > b) ? a : b); } -static __inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max) +static inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max) { return minf(max, maxf(min, val)); } -static __inline ALuint minu(ALuint a, ALuint b) +static inline ALuint minu(ALuint a, ALuint b) { return ((a > b) ? b : a); } -static __inline ALuint maxu(ALuint a, ALuint b) +static inline ALuint maxu(ALuint a, ALuint b) { return ((a > b) ? a : b); } -static __inline ALuint clampu(ALuint val, ALuint min, ALuint max) +static inline ALuint clampu(ALuint val, ALuint min, ALuint max) { return minu(max, maxu(min, val)); } -static __inline ALint mini(ALint a, ALint b) +static inline ALint mini(ALint a, ALint b) { return ((a > b) ? b : a); } -static __inline ALint maxi(ALint a, ALint b) +static inline ALint maxi(ALint a, ALint b) { return ((a > b) ? a : b); } -static __inline ALint clampi(ALint val, ALint min, ALint max) +static inline ALint clampi(ALint val, ALint min, ALint max) { return mini(max, maxi(min, val)); } -static __inline ALint64 mini64(ALint64 a, ALint64 b) +static inline ALint64 mini64(ALint64 a, ALint64 b) { return ((a > b) ? b : a); } -static __inline ALint64 maxi64(ALint64 a, ALint64 b) +static inline ALint64 maxi64(ALint64 a, ALint64 b) { return ((a > b) ? a : b); } -static __inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max) +static inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max) { return mini64(max, maxi64(min, val)); } -static __inline ALuint64 minu64(ALuint64 a, ALuint64 b) +static inline ALuint64 minu64(ALuint64 a, ALuint64 b) { return ((a > b) ? b : a); } -static __inline ALuint64 maxu64(ALuint64 a, ALuint64 b) +static inline ALuint64 maxu64(ALuint64 a, ALuint64 b) { return ((a > b) ? a : b); } -static __inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) +static inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) { return minu64(max, maxu64(min, val)); } -static __inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) +static inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) { return val1 + (val2-val1)*mu; } -static __inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat mu) +static inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat mu) { ALfloat mu2 = mu*mu; ALfloat a0 = -0.5f*val0 + 1.5f*val1 + -1.5f*val2 + 0.5f*val3; |