@@ -730,9 +730,9 @@ auto GetSourceState(gsl::not_null<al::Source*> const source, Voice const *const
730730
731731auto EnsureSources (gsl::not_null<al::Context*> const context, usize const needed) -> bool
732732{
733- auto count = std::accumulate (context->mSourceList .cbegin (), context->mSourceList .cend (), 0_uz,
734- [](usize const cur, const SourceSubList &sublist) noexcept -> usize
735- { return cur + sublist.mFreeMask .popcount (). c_val ; });
733+ auto count = std::accumulate (context->mSourceList .cbegin (), context->mSourceList .cend (),
734+ 0_usize, [](usize const cur, const SourceSubList &sublist) noexcept -> usize
735+ { return cur + sublist.mFreeMask .popcount (); });
736736
737737 try {
738738 while (needed > count)
@@ -783,7 +783,7 @@ void FreeSource(gsl::not_null<al::Context*> const context, gsl::not_null<al::Sou
783783 context->mSourceNames .erase (source->mId );
784784
785785 auto const id = source->mId - 1 ;
786- auto const lidx = usize {id >> 6 };
786+ auto const lidx = std:: size_t {id >> 6 };
787787 auto const slidx = id & 0x3f ;
788788
789789 if (auto *const voice = GetSourceVoice (source, context))
@@ -838,7 +838,7 @@ auto LookupBuffer(std::nothrow_t, gsl::not_null<al::Device*> const device,
838838
839839 if (lidx >= device->BufferList .size ()) [[unlikely]]
840840 return nullptr ;
841- auto &sublist = device->BufferList [gsl::narrow_cast<usize >(lidx)];
841+ auto &sublist = device->BufferList [gsl::narrow_cast<std:: size_t >(lidx)];
842842 if ((sublist.mFreeMask & (1_u64 << slidx)) != 0 ) [[unlikely]]
843843 return nullptr ;
844844 return std::to_address (std::next (sublist.mBuffers ->begin (),
@@ -863,7 +863,7 @@ auto LookupFilter(std::nothrow_t, gsl::not_null<al::Device*> const device,
863863
864864 if (lidx >= device->FilterList .size ()) [[unlikely]]
865865 return nullptr ;
866- auto &sublist = device->FilterList [gsl::narrow_cast<usize >(lidx)];
866+ auto &sublist = device->FilterList [gsl::narrow_cast<std:: size_t >(lidx)];
867867 if ((sublist.mFreeMask & (1_u64 << slidx)) != 0 ) [[unlikely]]
868868 return nullptr ;
869869 return std::to_address (std::next (sublist.mFilters ->begin (),
@@ -888,7 +888,7 @@ auto LookupEffectSlot(std::nothrow_t, gsl::not_null<al::Context*> const context,
888888
889889 if (lidx >= context->mEffectSlotList .size ()) [[unlikely]]
890890 return nullptr ;
891- auto &sublist = context->mEffectSlotList [gsl::narrow_cast<usize >(lidx)];
891+ auto &sublist = context->mEffectSlotList [gsl::narrow_cast<std:: size_t >(lidx)];
892892 if ((sublist.mFreeMask & (1_u64 << slidx)) != 0 ) [[unlikely]]
893893 return nullptr ;
894894 return std::to_address (std::next (sublist.mEffectSlots ->begin (),
@@ -1464,12 +1464,12 @@ struct PairStruct { T First; U Second; };
14641464template <typename T, typename U>
14651465PairStruct (T, U) -> PairStruct<T, U>;
14661466
1467- template <typename T, usize N>
1467+ template <typename T, std:: size_t N>
14681468auto GetCheckers (gsl::not_null<al::Context*> const context, SourceProp const prop,
14691469 std::span<T,N> const values)
14701470{
14711471 return PairStruct{
1472- [=](usize const expect) -> void
1472+ [=](std:: size_t const expect) -> void
14731473 {
14741474 if (values.size () == expect) return ;
14751475 context->throw_error (AL_INVALID_ENUM , " Property {:#04x} expects {} value{}, got {}" ,
@@ -1999,7 +1999,7 @@ void SetProperty(const gsl::not_null<al::Source*> Source,
19991999
20002000 if (sendidx >= device->NumAuxSends )
20012001 Context->throw_error (AL_INVALID_VALUE , " Invalid send {}" , sendidx);
2002- auto &send = Source->mSend [gsl::narrow_cast<usize >(sendidx)];
2002+ auto &send = Source->mSend [gsl::narrow_cast<std:: size_t >(sendidx)];
20032003
20042004 if (filterid)
20052005 {
@@ -2048,11 +2048,11 @@ void SetProperty(const gsl::not_null<al::Source*> Source,
20482048}
20492049
20502050
2051- template <typename T, usize N>
2051+ template <typename T, std:: size_t N>
20522052auto GetSizeChecker (gsl::not_null<al::Context*> const context, SourceProp const prop,
20532053 std::span<T,N> const values)
20542054{
2055- return [=](usize const expect) -> void
2055+ return [=](std:: size_t const expect) -> void
20562056 {
20572057 if (values.size () == expect) [[likely]] return ;
20582058 context->throw_error (AL_INVALID_ENUM , " Property {:#04x} expects {} value{}, got {}" ,
@@ -3518,7 +3518,7 @@ try {
35183518 /* A buffer failed (invalid ID or format), or there was some other
35193519 * unexpected error, so release the buffers we had.
35203520 */
3521- source->mQueue .resize (gsl::narrow_cast<usize >(NewListStart));
3521+ source->mQueue .resize (gsl::narrow_cast<std:: size_t >(NewListStart));
35223522 throw ;
35233523 }
35243524 /* All buffers good. */
@@ -3556,7 +3556,7 @@ try {
35563556
35573557 /* Make sure enough buffers have been processed to unqueue. */
35583558 const auto bids = std::views::counted (buffers, nb);
3559- auto processed = 0_uz ;
3559+ auto processed = 0_usize ;
35603560 if (source->mState != AL_INITIAL ) [[likely]]
35613561 {
35623562 const auto Current = std::invoke ([source,context]() -> const VoiceBufferItem*
@@ -3567,7 +3567,7 @@ try {
35673567 });
35683568 const auto qiter = std::ranges::find (source->mQueue , Current,
35693569 [](al::BufferQueueItem const &item) { return &item; });
3570- processed = gsl::narrow_cast<usize>( std::distance (source->mQueue .begin (), qiter));
3570+ processed = isize{ std::distance (source->mQueue .begin (), qiter)}. reinterpret_as <usize>( );
35713571 }
35723572 if (processed < bids.size ())
35733573 context->throw_error (AL_INVALID_VALUE , " Unqueueing {} buffer{} (only {} processed)" ,
@@ -3576,7 +3576,7 @@ try {
35763576 std::ranges::generate (bids, [source]() noexcept -> ALuint
35773577 {
35783578 auto bid = 0u ;
3579- if (auto * buffer = source->mQueue .front ().mBuffer .get ())
3579+ if (auto const * const buffer = source->mQueue .front ().mBuffer .get ())
35803580 bid = buffer->mId ;
35813581 source->mQueue .pop_front ();
35823582 return bid;
@@ -3750,7 +3750,7 @@ void al::Source::eax_fail_unknown_receiving_fx_slot_id() {eax_fail("Unknown rece
37503750
37513751void al::Source::eax_set_sends_defaults (EaxSends& sends, const EaxFxSlotIds& ids) noexcept
37523752{
3753- for (auto const i : std::views::iota (0_uz, usize {EAX_MAX_FXSLOTS }))
3753+ for (auto const i : std::views::iota (0_uz, std:: size_t {EAX_MAX_FXSLOTS }))
37543754 {
37553755 auto & send = sends[i];
37563756 send.guidReceivingFXSlotID = *(ids[i]);
@@ -3863,7 +3863,7 @@ void al::Source::eax5_set_active_fx_slots_defaults(EAX50ACTIVEFXSLOTS& slots) no
38633863
38643864void al::Source::eax5_set_speaker_levels_defaults (EaxSpeakerLevels& speaker_levels) noexcept
38653865{
3866- for (auto const i : std::views::iota (0_uz, usize {eax_max_speakers}))
3866+ for (auto const i : std::views::iota (0_uz, std:: size_t {eax_max_speakers}))
38673867 {
38683868 auto & speaker_level = speaker_levels[i];
38693869 speaker_level.lSpeakerID = gsl::narrow_cast<eax_long>(EAXSPEAKER_FRONT_LEFT + i);
@@ -3968,7 +3968,7 @@ void al::Source::eax4_translate(const Eax4Props& src, Eax5Props& dst) noexcept
39683968 //
39693969 dst.sends = src.sends ;
39703970
3971- for (auto const i : std::views::iota (0_uz, usize {EAX_MAX_FXSLOTS }))
3971+ for (auto const i : std::views::iota (0_uz, std:: size_t {EAX_MAX_FXSLOTS }))
39723972 dst.sends [i].guidReceivingFXSlotID = *(eax5_fx_slot_ids[i]);
39733973
39743974 // Active FX slots.
@@ -4018,7 +4018,7 @@ auto al::Source::eax_create_direct_filter_param() const noexcept -> EaxAlLowPass
40184018 * source.mObstruction .flObstructionLFRatio ;
40194019 auto gainhf_mb = gsl::narrow_cast<float >(source.mObstruction .lObstruction );
40204020
4021- for (const auto i : std::views::iota (0_uz, usize {EAX_MAX_FXSLOTS }))
4021+ for (const auto i : std::views::iota (0_uz, std:: size_t {EAX_MAX_FXSLOTS }))
40224022 {
40234023 if (!mEaxActiveFxSlots .test (i))
40244024 continue ;
@@ -4123,7 +4123,7 @@ void al::Source::eax_update_direct_filter()
41234123
41244124void al::Source::eax_update_room_filters ()
41254125{
4126- for (const auto i : std::views::iota (0_uz, usize {EAX_MAX_FXSLOTS }))
4126+ for (const auto i : std::views::iota (0_uz, std:: size_t {EAX_MAX_FXSLOTS }))
41274127 {
41284128 if (!mEaxActiveFxSlots .test (i))
41294129 continue ;
@@ -4444,7 +4444,7 @@ void al::Source::eax5_defer_speaker_levels(const EaxCall& call, EaxSpeakerLevels
44444444
44454445 for (const auto &value : values)
44464446 {
4447- const auto index = gsl::narrow_cast<usize >(value.lSpeakerID - EAXSPEAKER_FRONT_LEFT );
4447+ const auto index = gsl::narrow_cast<std:: size_t >(value.lSpeakerID - EAXSPEAKER_FRONT_LEFT );
44484448 props[index].lLevel = value.lLevel ;
44494449 }
44504450}
@@ -4774,7 +4774,7 @@ void al::Source::eax_get(const EaxCall &call) const
47744774}
47754775
47764776void al::Source::eax_set_al_source_send (al::intrusive_ptr<al::EffectSlot> slot,
4777- usize const sendidx, const EaxAlLowPassParam &filter)
4777+ std:: size_t const sendidx, const EaxAlLowPassParam &filter)
47784778{
47794779 if (sendidx >= EAX_MAX_FXSLOTS )
47804780 return ;
@@ -4819,7 +4819,7 @@ void al::Source::eax_commit_active_fx_slots()
48194819
48204820 // Deactivate EFX auxiliary effect slots for inactive slots. Active slots
48214821 // will be updated with the room filters.
4822- for (const auto i : std::views::iota (0_uz, usize {EAX_MAX_FXSLOTS }))
4822+ for (const auto i : std::views::iota (0_uz, std:: size_t {EAX_MAX_FXSLOTS }))
48234823 {
48244824 if (!mEaxActiveFxSlots .test (i))
48254825 eax_set_al_source_send ({}, i, EaxAlLowPassParam{1 .0f , 1 .0f });
0 commit comments