diff options
author | Chris Robinson <[email protected]> | 2023-05-04 11:39:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-04 11:39:13 -0700 |
commit | 7cbf3ba2e2bab5c3aecb001e1d387c89309dbec4 (patch) | |
tree | 6fae4aae25d87e7435b2f0b0936b822360851c9b /al | |
parent | 6e0a0a2692a4303d6410c24bf83e09ca47ac6759 (diff) |
Use std::byte instead of a custom al::byte
Diffstat (limited to 'al')
-rw-r--r-- | al/buffer.cpp | 14 | ||||
-rw-r--r-- | al/buffer.h | 4 | ||||
-rw-r--r-- | al/event.cpp | 1 |
3 files changed, 9 insertions, 10 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp index ad74a7f7..1a042f46 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -26,6 +26,7 @@ #include <array> #include <atomic> #include <cassert> +#include <cstddef> #include <cstdint> #include <cstdlib> #include <cstring> @@ -44,7 +45,6 @@ #include "AL/alext.h" #include "albit.h" -#include "albyte.h" #include "alc/context.h" #include "alc/device.h" #include "alc/inprogext.h" @@ -277,7 +277,7 @@ ALuint SanitizeAlignment(FmtType type, ALuint align) /** Loads the specified data into the buffer, using the specified format. */ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size, - const FmtChannels DstChannels, const FmtType DstType, const al::byte *SrcData, + const FmtChannels DstChannels, const FmtType DstType, const std::byte *SrcData, ALbitfieldSOFT access) { if(ReadRef(ALBuf->ref) != 0 || ALBuf->MappedAccess != 0) UNLIKELY @@ -343,7 +343,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size, */ if(newsize != ALBuf->mDataStorage.size()) { - auto newdata = al::vector<al::byte,16>(newsize, al::byte{}); + auto newdata = al::vector<std::byte,16>(newsize, std::byte{}); if((access&AL_PRESERVE_DATA_BIT_SOFT)) { const size_t tocopy{minz(newdata.size(), ALBuf->mDataStorage.size())}; @@ -437,7 +437,7 @@ void PrepareCallback(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, /** Prepares the buffer to use caller-specified storage. */ void PrepareUserPtr(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, - const FmtChannels DstChannels, const FmtType DstType, al::byte *sdata, const ALuint sdatalen) + const FmtChannels DstChannels, const FmtType DstType, std::byte *sdata, const ALuint sdatalen) { if(ReadRef(ALBuf->ref) != 0 || ALBuf->MappedAccess != 0) UNLIKELY return context->setError(AL_INVALID_OPERATION, "Modifying storage for in-use buffer %u", @@ -506,7 +506,7 @@ void PrepareUserPtr(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, #endif decltype(ALBuf->mDataStorage){}.swap(ALBuf->mDataStorage); - ALBuf->mData = {static_cast<al::byte*>(sdata), sdatalen}; + ALBuf->mData = {static_cast<std::byte*>(sdata), sdatalen}; #ifdef ALSOFT_EAX eax_x_ram_clear(*context->mALDevice, *ALBuf); @@ -767,7 +767,7 @@ START_API_FUNC else { LoadData(context.get(), albuf, freq, static_cast<ALuint>(size), usrfmt->channels, - usrfmt->type, static_cast<const al::byte*>(data), flags); + usrfmt->type, static_cast<const std::byte*>(data), flags); } } } @@ -796,7 +796,7 @@ START_API_FUNC return context->setError(AL_INVALID_ENUM, "Invalid format 0x%04x", format); PrepareUserPtr(context.get(), albuf, freq, usrfmt->channels, usrfmt->type, - static_cast<al::byte*>(data), static_cast<ALuint>(size)); + static_cast<std::byte*>(data), static_cast<ALuint>(size)); } END_API_FUNC diff --git a/al/buffer.h b/al/buffer.h index 64ebe1f3..3df1fa4c 100644 --- a/al/buffer.h +++ b/al/buffer.h @@ -2,10 +2,10 @@ #define AL_BUFFER_H #include <atomic> +#include <cstddef> #include "AL/al.h" -#include "albyte.h" #include "alc/inprogext.h" #include "almalloc.h" #include "atomic.h" @@ -26,7 +26,7 @@ enum class EaxStorage : uint8_t { struct ALbuffer : public BufferStorage { ALbitfieldSOFT Access{0u}; - al::vector<al::byte,16> mDataStorage; + al::vector<std::byte,16> mDataStorage; ALuint OriginalSize{0}; diff --git a/al/event.cpp b/al/event.cpp index 1bc39d1e..acb4958a 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -17,7 +17,6 @@ #include "AL/al.h" #include "AL/alc.h" -#include "albyte.h" #include "alc/context.h" #include "alc/effects/base.h" #include "alc/inprogext.h" |