aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/atomic.h50
-rw-r--r--Alc/helpers.c16
-rw-r--r--Alc/uintmap.h8
-rw-r--r--OpenAL32/Include/alBuffer.h5
-rw-r--r--OpenAL32/Include/alEffect.h2
-rw-r--r--OpenAL32/Include/alFilter.h4
-rw-r--r--OpenAL32/alBuffer.c3
-rw-r--r--OpenAL32/alEffect.c1
-rw-r--r--OpenAL32/alFilter.c3
9 files changed, 57 insertions, 35 deletions
diff --git a/Alc/atomic.h b/Alc/atomic.h
index 9c249808..1dd8f9dc 100644
--- a/Alc/atomic.h
+++ b/Alc/atomic.h
@@ -6,31 +6,31 @@ typedef void *volatile XchgPtr;
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && !defined(__QNXNTO__)
typedef unsigned int RefCount;
-static inline RefCount IncrementRef(volatile RefCount *ptr)
+inline RefCount IncrementRef(volatile RefCount *ptr)
{ return __sync_add_and_fetch(ptr, 1); }
-static inline RefCount DecrementRef(volatile RefCount *ptr)
+inline RefCount DecrementRef(volatile RefCount *ptr)
{ return __sync_sub_and_fetch(ptr, 1); }
-static inline int ExchangeInt(volatile int *ptr, int newval)
+inline int ExchangeInt(volatile int *ptr, int newval)
{
return __sync_lock_test_and_set(ptr, newval);
}
-static inline void *ExchangePtr(XchgPtr *ptr, void *newval)
+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)
+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)
+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 unsigned int xaddl(volatile unsigned int *dest, int incr)
+inline unsigned int xaddl(volatile unsigned int *dest, int incr)
{
unsigned int ret;
__asm__ __volatile__("lock; xaddl %0,(%1)"
@@ -41,12 +41,12 @@ static inline unsigned int xaddl(volatile unsigned int *dest, int incr)
}
typedef unsigned int RefCount;
-static inline RefCount IncrementRef(volatile RefCount *ptr)
+inline RefCount IncrementRef(volatile RefCount *ptr)
{ return xaddl(ptr, 1)+1; }
-static inline RefCount DecrementRef(volatile RefCount *ptr)
+inline RefCount DecrementRef(volatile RefCount *ptr)
{ return xaddl(ptr, -1)-1; }
-static inline int ExchangeInt(volatile int *dest, int newval)
+inline int ExchangeInt(volatile int *dest, int newval)
{
int ret;
__asm__ __volatile__("lock; xchgl %0,(%1)"
@@ -56,7 +56,7 @@ static inline int ExchangeInt(volatile int *dest, int newval)
return ret;
}
-static inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int newval)
+inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int newval)
{
int ret;
__asm__ __volatile__("lock; cmpxchgl %2,(%1)"
@@ -66,7 +66,7 @@ static inline ALboolean CompExchangeInt(volatile int *dest, int oldval, int newv
return ret == oldval;
}
-static inline void *ExchangePtr(XchgPtr *dest, void *newval)
+inline void *ExchangePtr(XchgPtr *dest, void *newval)
{
void *ret;
__asm__ __volatile__(
@@ -82,7 +82,7 @@ static inline void *ExchangePtr(XchgPtr *dest, void *newval)
return ret;
}
-static inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *newval)
+inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *newval)
{
void *ret;
__asm__ __volatile__(
@@ -104,14 +104,14 @@ static inline ALboolean CompExchangePtr(XchgPtr *dest, void *oldval, void *newva
#include <windows.h>
typedef LONG RefCount;
-static inline RefCount IncrementRef(volatile RefCount *ptr)
+inline RefCount IncrementRef(volatile RefCount *ptr)
{ return InterlockedIncrement(ptr); }
-static inline RefCount DecrementRef(volatile RefCount *ptr)
+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)
+inline int ExchangeInt(volatile int *ptr, int newval)
{
union {
volatile int *i;
@@ -119,11 +119,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)
+inline void *ExchangePtr(XchgPtr *ptr, void *newval)
{
return InterlockedExchangePointer(ptr, newval);
}
-static inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval)
+inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval)
{
union {
volatile int *i;
@@ -131,7 +131,7 @@ static inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newva
} u = { ptr };
return InterlockedCompareExchange(u.l, newval, oldval) == oldval;
}
-static inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval)
+inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval)
{
return InterlockedCompareExchangePointer(ptr, newval, oldval) == oldval;
}
@@ -141,12 +141,12 @@ static inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval
#include <libkern/OSAtomic.h>
typedef int32_t RefCount;
-static inline RefCount IncrementRef(volatile RefCount *ptr)
+inline RefCount IncrementRef(volatile RefCount *ptr)
{ return OSAtomicIncrement32Barrier(ptr); }
-static inline RefCount DecrementRef(volatile RefCount *ptr)
+inline RefCount DecrementRef(volatile RefCount *ptr)
{ return OSAtomicDecrement32Barrier(ptr); }
-static inline int ExchangeInt(volatile int *ptr, int newval)
+inline int ExchangeInt(volatile int *ptr, int newval)
{
/* Really? No regular old atomic swap? */
int oldval;
@@ -155,7 +155,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)
+inline void *ExchangePtr(XchgPtr *ptr, void *newval)
{
void *oldval;
do {
@@ -163,11 +163,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)
+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)
+inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval)
{
return OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr);
}
diff --git a/Alc/helpers.c b/Alc/helpers.c
index 6681fde7..94dedcf8 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -69,8 +69,24 @@ DEFINE_DEVPROPKEY(DEVPKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80,
#endif
#include "alMain.h"
+#include "atomic.h"
+#include "uintmap.h"
#include "compat.h"
+
+extern inline RefCount IncrementRef(volatile RefCount *ptr);
+extern inline RefCount DecrementRef(volatile RefCount *ptr);
+extern inline int ExchangeInt(volatile int *ptr, int newval);
+extern inline void *ExchangePtr(XchgPtr *ptr, void *newval);
+extern inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval);
+extern inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval);
+
+extern inline void LockUIntMapRead(UIntMap *map);
+extern inline void UnlockUIntMapRead(UIntMap *map);
+extern inline void LockUIntMapWrite(UIntMap *map);
+extern inline void UnlockUIntMapWrite(UIntMap *map);
+
+
ALuint CPUCapFlags = 0;
diff --git a/Alc/uintmap.h b/Alc/uintmap.h
index d692e878..2c70f161 100644
--- a/Alc/uintmap.h
+++ b/Alc/uintmap.h
@@ -22,13 +22,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)
+inline void LockUIntMapRead(UIntMap *map)
{ ReadLock(&map->lock); }
-static inline void UnlockUIntMapRead(UIntMap *map)
+inline void UnlockUIntMapRead(UIntMap *map)
{ ReadUnlock(&map->lock); }
-static inline void LockUIntMapWrite(UIntMap *map)
+inline void LockUIntMapWrite(UIntMap *map)
{ WriteLock(&map->lock); }
-static inline void UnlockUIntMapWrite(UIntMap *map)
+inline void UnlockUIntMapWrite(UIntMap *map)
{ WriteUnlock(&map->lock); }
#endif /* AL_UINTMAP_H */
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h
index 358b3c9f..547768d6 100644
--- a/OpenAL32/Include/alBuffer.h
+++ b/OpenAL32/Include/alBuffer.h
@@ -35,8 +35,7 @@ enum UserFmtChannels {
ALuint BytesFromUserFmt(enum UserFmtType type);
ALuint ChannelsFromUserFmt(enum UserFmtChannels chans);
-static inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans,
- enum UserFmtType type)
+inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type)
{
return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type);
}
@@ -61,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)
+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 772324cc..57e7a15f 100644
--- a/OpenAL32/Include/alEffect.h
+++ b/OpenAL32/Include/alEffect.h
@@ -177,7 +177,7 @@ typedef struct ALeffect {
ALuint id;
} ALeffect;
-static inline ALboolean IsReverbEffect(ALenum type)
+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 c8bdf906..91db5462 100644
--- a/OpenAL32/Include/alFilter.h
+++ b/OpenAL32/Include/alFilter.h
@@ -34,7 +34,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)
+inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample)
{
ALfloat outsmp;
@@ -51,7 +51,7 @@ static inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat
return outsmp;
}
-static inline ALfloat ALfilterState_processSingleC(const ALfilterState *filter, ALfloat sample)
+inline ALfloat ALfilterState_processSingleC(const ALfilterState *filter, ALfloat sample)
{
return filter->b[0] * sample +
filter->b[1] * filter->x[0] +
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index fa02582a..51e9cc7c 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -32,6 +32,9 @@
#include "alThunk.h"
+extern inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type);
+extern inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type);
+
static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels chans, enum UserFmtType type, const ALvoid *data, ALboolean storesrc);
static void ConvertData(ALvoid *dst, enum UserFmtType dstType, const ALvoid *src, enum UserFmtType srcType, ALsizei numchans, ALsizei len);
static ALboolean IsValidType(ALenum type);
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 522226d7..1413ef6e 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -34,6 +34,7 @@
ALboolean DisabledEffects[MAX_EFFECTS];
+extern inline ALboolean IsReverbEffect(ALenum type);
static void InitEffectParams(ALeffect *effect, ALenum type);
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index 899ff5f0..85d411f0 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -29,6 +29,9 @@
#include "alError.h"
+extern inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample);
+extern inline ALfloat ALfilterState_processSingleC(const ALfilterState *filter, ALfloat sample);
+
static void InitFilterParams(ALfilter *filter, ALenum type);