Skip to content

Commit 55d1c21

Browse files
committed
Make i32 and u32 strong number types
1 parent 8c25ee8 commit 55d1c21

82 files changed

Lines changed: 1064 additions & 1028 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

al/auxeffectslot.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ auto getFactoryByType(EffectSlotType const type) -> gsl::not_null<EffectStateFac
9999

100100

101101
[[nodiscard]]
102-
auto LookupEffectSlot(std::nothrow_t, gsl::not_null<al::Context*> const context, u32 const id)
102+
auto LookupEffectSlot(std::nothrow_t, gsl::not_null<al::Context*> const context, ALuint const id)
103103
noexcept -> al::EffectSlot*
104104
{
105105
const auto lidx = (id-1) >> 6;
@@ -114,7 +114,7 @@ auto LookupEffectSlot(std::nothrow_t, gsl::not_null<al::Context*> const context,
114114
}
115115

116116
[[nodiscard]]
117-
auto LookupEffectSlot(gsl::not_null<al::Context*> const context, u32 const id)
117+
auto LookupEffectSlot(gsl::not_null<al::Context*> const context, ALuint const id)
118118
-> gsl::not_null<al::EffectSlot*>
119119
{
120120
if(auto *const slot = LookupEffectSlot(std::nothrow, context, id)) [[likely]]
@@ -123,8 +123,8 @@ auto LookupEffectSlot(gsl::not_null<al::Context*> const context, u32 const id)
123123
}
124124

125125
[[nodiscard]]
126-
auto LookupEffect(std::nothrow_t, gsl::not_null<al::Device*> const device, u32 const id) noexcept
127-
-> al::Effect*
126+
auto LookupEffect(std::nothrow_t, gsl::not_null<al::Device*> const device, ALuint const id)
127+
noexcept -> al::Effect*
128128
{
129129
const auto lidx = (id-1) >> 6;
130130
const auto slidx = (id-1) & 0x3f;
@@ -138,7 +138,7 @@ auto LookupEffect(std::nothrow_t, gsl::not_null<al::Device*> const device, u32 c
138138
}
139139

140140
[[nodiscard]]
141-
auto LookupEffect(gsl::not_null<al::Context*> const context, u32 const id)
141+
auto LookupEffect(gsl::not_null<al::Context*> const context, ALuint const id)
142142
-> gsl::not_null<al::Effect*>
143143
{
144144
if(auto *const effect = LookupEffect(std::nothrow, al::get_not_null(context->mALDevice), id))
@@ -147,8 +147,8 @@ auto LookupEffect(gsl::not_null<al::Context*> const context, u32 const id)
147147
}
148148

149149
[[nodiscard]]
150-
auto LookupBuffer(std::nothrow_t, gsl::not_null<al::Device*> const device, u32 const id) noexcept
151-
-> al::Buffer*
150+
auto LookupBuffer(std::nothrow_t, gsl::not_null<al::Device*> const device, ALuint const id)
151+
noexcept -> al::Buffer*
152152
{
153153
const auto lidx = (id-1) >> 6;
154154
const auto slidx = (id-1) & 0x3f;
@@ -162,7 +162,7 @@ auto LookupBuffer(std::nothrow_t, gsl::not_null<al::Device*> const device, u32 c
162162
}
163163

164164
[[nodiscard]]
165-
auto LookupBuffer(gsl::not_null<al::Context*> const context, u32 const id)
165+
auto LookupBuffer(gsl::not_null<al::Context*> const context, ALuint const id)
166166
-> gsl::not_null<al::Buffer*>
167167
{
168168
if(auto *const buffer = LookupBuffer(std::nothrow, al::get_not_null(context->mALDevice), id))
@@ -295,7 +295,7 @@ auto AllocEffectSlot(gsl::not_null<al::Context*> const context) -> gsl::not_null
295295
{
296296
auto const sublist = std::ranges::find_if(context->mEffectSlotList,
297297
[](EffectSlotSubList const &slist) { return slist.mFreeMask != 0; });
298-
auto const lidx = gsl::narrow_cast<u32>(std::distance(context->mEffectSlotList.begin(),
298+
auto const lidx = gsl::narrow_cast<ALuint>(std::distance(context->mEffectSlotList.begin(),
299299
sublist));
300300
auto const slidx = sublist->mFreeMask.countr_zero().c_val;
301301
ASSUME(slidx < 64);
@@ -416,7 +416,7 @@ try {
416416
slots.reserve(eids.size());
417417

418418
std::ranges::transform(eids, std::back_inserter(slots),
419-
[context](u32 const eid) -> gsl::not_null<al::EffectSlot*>
419+
[context](ALuint const eid) -> gsl::not_null<al::EffectSlot*>
420420
{
421421
auto const slot = LookupEffectSlot(context, eid);
422422
if(slot->mRef.load(std::memory_order_relaxed) != 0)
@@ -834,7 +834,7 @@ al::EffectSlot::~EffectSlot()
834834
mSlot->InUse = false;
835835
}
836836

837-
auto al::EffectSlot::initEffect(u32 const effectId, ALenum const effectType,
837+
auto al::EffectSlot::initEffect(ALuint const effectId, ALenum const effectType,
838838
EffectProps const &effectProps, gsl::not_null<Context*> const context) -> void
839839
{
840840
const auto newtype = EffectSlotTypeFromEnum(effectType);
@@ -903,7 +903,7 @@ void al::EffectSlot::updateProps(gsl::not_null<Context*> const context) const
903903
}
904904
}
905905

906-
void al::EffectSlot::SetName(gsl::not_null<Context*> const context, u32 const id,
906+
void al::EffectSlot::SetName(gsl::not_null<Context*> const context, ALuint const id,
907907
std::string_view const name)
908908
{
909909
const auto slotlock = std::lock_guard{context->mEffectSlotLock};

al/auxeffectslot.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct Context;
5151
struct Buffer;
5252

5353
struct EffectSlot {
54-
u32 mEffectId{};
54+
ALuint mEffectId{};
5555
float mGain{1.0f};
5656
bool mAuxSendAuto{true};
5757
al::intrusive_ptr<EffectSlot> mTarget;
@@ -74,7 +74,7 @@ struct EffectSlot {
7474
gsl::not_null<EffectSlotBase*> mSlot;
7575

7676
/* Self ID */
77-
u32 mId{};
77+
ALuint mId{};
7878

7979
explicit EffectSlot(gsl::not_null<al::Context*> context);
8080
EffectSlot(const EffectSlot&) = delete;
@@ -89,11 +89,11 @@ struct EffectSlot {
8989
return al::intrusive_ptr{this};
9090
}
9191

92-
auto initEffect(u32 effectId, ALenum effectType, const EffectProps &effectProps,
92+
auto initEffect(ALuint effectId, ALenum effectType, const EffectProps &effectProps,
9393
gsl::not_null<Context*> context) -> void;
9494
void updateProps(gsl::not_null<Context*> context) const;
9595

96-
static void SetName(gsl::not_null<Context*> context, u32 id, std::string_view name);
96+
static void SetName(gsl::not_null<Context*> context, ALuint id, std::string_view name);
9797

9898
#if ALSOFT_EAX
9999
void eax_initialize(EaxFxSlotIndexValue index);

0 commit comments

Comments
 (0)