aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
Diffstat (limited to 'alc')
-rw-r--r--alc/alc.cpp2
-rw-r--r--alc/alconfig.cpp3
-rw-r--r--alc/backends/alsa.cpp3
-rw-r--r--alc/backends/dsound.cpp3
-rw-r--r--alc/backends/jack.cpp5
-rw-r--r--alc/backends/pipewire.cpp9
-rw-r--r--alc/backends/portaudio.cpp3
-rw-r--r--alc/backends/pulseaudio.cpp3
-rw-r--r--alc/backends/wasapi.cpp4
9 files changed, 21 insertions, 14 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index 2da5c5db..149223f4 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -180,7 +180,7 @@ BOOL APIENTRY DllMain(HINSTANCE module, DWORD reason, LPVOID /*reserved*/)
case DLL_PROCESS_ATTACH:
/* Pin the DLL so we won't get unloaded until the process terminates */
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- reinterpret_cast<WCHAR*>(module), &module);
+ al::bit_cast<WCHAR*>(module), &module);
break;
}
return TRUE;
diff --git a/alc/alconfig.cpp b/alc/alconfig.cpp
index 56cad9e0..ceb7d97b 100644
--- a/alc/alconfig.cpp
+++ b/alc/alconfig.cpp
@@ -38,6 +38,7 @@
#include <string>
#include <utility>
+#include "albit.h"
#include "alfstream.h"
#include "alstring.h"
#include "core/helpers.h"
@@ -418,7 +419,7 @@ void ReadALConfig()
if((configURL=CFBundleCopyResourceURL(mainBundle, CFSTR(".alsoftrc"), CFSTR(""), nullptr)) &&
CFURLGetFileSystemRepresentation(configURL, true, fileName, sizeof(fileName)))
{
- f = al::ifstream{reinterpret_cast<char*>(fileName)};
+ f = al::ifstream{al::bit_cast<char*>(fileName)};
if(f.is_open())
LoadConfigFromFile(f);
}
diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp
index 01021868..b162f84e 100644
--- a/alc/backends/alsa.cpp
+++ b/alc/backends/alsa.cpp
@@ -35,6 +35,7 @@
#include <thread>
#include <utility>
+#include "albit.h"
#include "albyte.h"
#include "alc/alconfig.h"
#include "almalloc.h"
@@ -1204,7 +1205,7 @@ bool AlsaBackendFactory::init()
error = false;
#define LOAD_FUNC(f) do { \
- p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(alsa_handle, #f)); \
+ p##f = al::bit_cast<decltype(p##f)>(GetSymbol(alsa_handle, #f)); \
if(p##f == nullptr) { \
error = true; \
missing_funcs += "\n" #f; \
diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp
index 51dc36f6..8b967c95 100644
--- a/alc/backends/dsound.cpp
+++ b/alc/backends/dsound.cpp
@@ -44,6 +44,7 @@
#include <algorithm>
#include <functional>
+#include "albit.h"
#include "alnumeric.h"
#include "comptr.h"
#include "core/device.h"
@@ -778,7 +779,7 @@ bool DSoundBackendFactory::init()
}
#define LOAD_FUNC(f) do { \
- p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(ds_handle, #f)); \
+ p##f = al::bit_cast<decltype(p##f)>(GetSymbol(ds_handle, #f)); \
if(!p##f) \
{ \
CloseLib(ds_handle); \
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp
index 791002ca..dbc2b038 100644
--- a/alc/backends/jack.cpp
+++ b/alc/backends/jack.cpp
@@ -31,6 +31,7 @@
#include <thread>
#include <functional>
+#include "albit.h"
#include "alc/alconfig.h"
#include "alnumeric.h"
#include "core/device.h"
@@ -126,7 +127,7 @@ bool jack_load()
error = false;
#define LOAD_FUNC(f) do { \
- p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(jack_handle, #f)); \
+ p##f = al::bit_cast<decltype(p##f)>(GetSymbol(jack_handle, #f)); \
if(p##f == nullptr) { \
error = true; \
missing_funcs += "\n" #f; \
@@ -135,7 +136,7 @@ bool jack_load()
JACK_FUNCS(LOAD_FUNC);
#undef LOAD_FUNC
/* Optional symbols. These don't exist in all versions of JACK. */
-#define LOAD_SYM(f) p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(jack_handle, #f))
+#define LOAD_SYM(f) p##f = al::bit_cast<decltype(p##f)>(GetSymbol(jack_handle, #f))
LOAD_SYM(jack_error_callback);
#undef LOAD_SYM
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp
index d3c8e77e..5b1596aa 100644
--- a/alc/backends/pipewire.cpp
+++ b/alc/backends/pipewire.cpp
@@ -37,6 +37,7 @@
#include <type_traits>
#include <utility>
+#include "albit.h"
#include "albyte.h"
#include "alc/alconfig.h"
#include "almalloc.h"
@@ -210,7 +211,7 @@ bool pwire_load()
}
#define LOAD_FUNC(f) do { \
- p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(pwire_handle, #f)); \
+ p##f = al::bit_cast<decltype(p##f)>(GetSymbol(pwire_handle, #f)); \
if(p##f == nullptr) missing_funcs += "\n" #f; \
} while(0);
PWIRE_FUNCS(LOAD_FUNC)
@@ -328,11 +329,11 @@ To as(From) noexcept = delete;
* - pw_metadata
*/
template<>
-pw_proxy* as(pw_registry *reg) noexcept { return reinterpret_cast<pw_proxy*>(reg); }
+pw_proxy* as(pw_registry *reg) noexcept { return al::bit_cast<pw_proxy*>(reg); }
template<>
-pw_proxy* as(pw_node *node) noexcept { return reinterpret_cast<pw_proxy*>(node); }
+pw_proxy* as(pw_node *node) noexcept { return al::bit_cast<pw_proxy*>(node); }
template<>
-pw_proxy* as(pw_metadata *mdata) noexcept { return reinterpret_cast<pw_proxy*>(mdata); }
+pw_proxy* as(pw_metadata *mdata) noexcept { return al::bit_cast<pw_proxy*>(mdata); }
struct PwContextDeleter {
diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp
index 9c94587d..d652d4cd 100644
--- a/alc/backends/portaudio.cpp
+++ b/alc/backends/portaudio.cpp
@@ -26,6 +26,7 @@
#include <cstdlib>
#include <cstring>
+#include "albit.h"
#include "alc/alconfig.h"
#include "alnumeric.h"
#include "core/device.h"
@@ -376,7 +377,7 @@ bool PortBackendFactory::init()
return false;
#define LOAD_FUNC(f) do { \
- p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(pa_handle, #f)); \
+ p##f = al::bit_cast<decltype(p##f)>(GetSymbol(pa_handle, #f)); \
if(p##f == nullptr) \
{ \
CloseLib(pa_handle); \
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp
index 6f706c7f..6e8bfe1b 100644
--- a/alc/backends/pulseaudio.cpp
+++ b/alc/backends/pulseaudio.cpp
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include <utility>
+#include "albit.h"
#include "albyte.h"
#include "alc/alconfig.h"
#include "almalloc.h"
@@ -1381,7 +1382,7 @@ bool PulseBackendFactory::init()
}
#define LOAD_FUNC(x) do { \
- p##x = reinterpret_cast<decltype(p##x)>(GetSymbol(pulse_handle, #x)); \
+ p##x = al::bit_cast<decltype(p##x)>(GetSymbol(pulse_handle, #x)); \
if(!(p##x)) { \
ret = false; \
missing_funcs += "\n" #x; \
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index e66656ce..ea6ecbe0 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -207,7 +207,7 @@ NameGUIDPair get_device_name_and_guid(IMMDevice *device)
}
PropVariant pvprop;
- hr = ps->GetValue(reinterpret_cast<const PROPERTYKEY&>(DEVPKEY_Device_FriendlyName), pvprop.get());
+ hr = ps->GetValue(al::bit_cast<PROPERTYKEY>(DEVPKEY_Device_FriendlyName), pvprop.get());
if(FAILED(hr))
{
WARN("GetValue Device_FriendlyName failed: 0x%08lx\n", hr);
@@ -222,7 +222,7 @@ NameGUIDPair get_device_name_and_guid(IMMDevice *device)
}
pvprop.clear();
- hr = ps->GetValue(reinterpret_cast<const PROPERTYKEY&>(PKEY_AudioEndpoint_GUID), pvprop.get());
+ hr = ps->GetValue(al::bit_cast<PROPERTYKEY>(PKEY_AudioEndpoint_GUID), pvprop.get());
if(FAILED(hr))
{
WARN("GetValue AudioEndpoint_GUID failed: 0x%08lx\n", hr);