diff options
Diffstat (limited to 'router')
-rw-r--r-- | router/alc.cpp | 4 | ||||
-rw-r--r-- | router/router.cpp | 16 | ||||
-rw-r--r-- | router/router.h | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/router/alc.cpp b/router/alc.cpp index c99e7c93..1a8538b8 100644 --- a/router/alc.cpp +++ b/router/alc.cpp @@ -17,8 +17,8 @@ #define DECL(x) { #x, reinterpret_cast<void*>(x) } struct FuncExportEntry { - const ALCchar *funcName; - ALCvoid *address; + const char *funcName; + void *address; }; static const std::array<FuncExportEntry,95> alcFunctions{{ DECL(alcCreateContext), diff --git a/router/router.cpp b/router/router.cpp index 85a75aea..3d27af24 100644 --- a/router/router.cpp +++ b/router/router.cpp @@ -360,7 +360,7 @@ PtrIntMap::~PtrIntMap() mCapacity = 0; } -ALenum PtrIntMap::insert(ALvoid *key, ALint value) +ALenum PtrIntMap::insert(void *key, int value) { std::lock_guard<std::mutex> maplock{mLock}; auto iter = std::lower_bound(mKeys, mKeys+mSize, key); @@ -370,15 +370,15 @@ ALenum PtrIntMap::insert(ALvoid *key, ALint value) { if(mSize == mCapacity) { - ALvoid **newkeys{nullptr}; + void **newkeys{nullptr}; ALsizei newcap{mCapacity ? (mCapacity<<1) : 4}; if(newcap > mCapacity) - newkeys = static_cast<ALvoid**>( + newkeys = static_cast<void**>( al_calloc(16, (sizeof(mKeys[0])+sizeof(mValues[0]))*newcap) ); if(!newkeys) return AL_OUT_OF_MEMORY; - auto newvalues = reinterpret_cast<ALint*>(&newkeys[newcap]); + auto newvalues = reinterpret_cast<int*>(&newkeys[newcap]); if(mKeys) { @@ -404,9 +404,9 @@ ALenum PtrIntMap::insert(ALvoid *key, ALint value) return AL_NO_ERROR; } -ALint PtrIntMap::removeByKey(ALvoid *key) +int PtrIntMap::removeByKey(void *key) { - ALint ret = -1; + int ret = -1; std::lock_guard<std::mutex> maplock{mLock}; auto iter = std::lower_bound(mKeys, mKeys+mSize, key); @@ -425,9 +425,9 @@ ALint PtrIntMap::removeByKey(ALvoid *key) return ret; } -ALint PtrIntMap::lookupByKey(ALvoid *key) +int PtrIntMap::lookupByKey(void *key) { - ALint ret = -1; + int ret = -1; std::lock_guard<std::mutex> maplock{mLock}; auto iter = std::lower_bound(mKeys, mKeys+mSize, key); diff --git a/router/router.h b/router/router.h index 007b6a16..70335421 100644 --- a/router/router.h +++ b/router/router.h @@ -140,9 +140,9 @@ extern std::atomic<DriverIface*> CurrentCtxDriver; class PtrIntMap { - ALvoid **mKeys{nullptr}; + void **mKeys{nullptr}; /* Shares memory with keys. */ - ALint *mValues{nullptr}; + int *mValues{nullptr}; ALsizei mSize{0}; ALsizei mCapacity{0}; @@ -152,9 +152,9 @@ public: PtrIntMap() = default; ~PtrIntMap(); - ALenum insert(ALvoid *key, ALint value); - ALint removeByKey(ALvoid *key); - ALint lookupByKey(ALvoid *key); + ALenum insert(void *key, int value); + int removeByKey(void *key); + int lookupByKey(void *key); }; |