aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-06 01:48:58 -0800
committerChris Robinson <[email protected]>2022-12-06 01:48:58 -0800
commit4d757068c4784a18026089fd812949703bd9470a (patch)
tree1a1c2f819d14acc7a32cc26f10ffa1227c72b744 /core
parent25a6814cf36bee82b24cb1b5f40769e66c327db4 (diff)
Avoid using a macro to wrap standard attributes
Diffstat (limited to 'core')
-rw-r--r--core/ambdec.cpp2
-rw-r--r--core/bformatdec.cpp2
-rw-r--r--core/converter.cpp2
-rw-r--r--core/device.h2
-rw-r--r--core/except.cpp2
-rw-r--r--core/logging.cpp4
-rw-r--r--core/logging.h6
-rw-r--r--core/mastering.cpp2
-rw-r--r--core/mixer/hrtfbase.h4
-rw-r--r--core/uhjfilter.cpp2
-rw-r--r--core/voice.cpp22
11 files changed, 25 insertions, 25 deletions
diff --git a/core/ambdec.cpp b/core/ambdec.cpp
index 8b7467ce..83c521c0 100644
--- a/core/ambdec.cpp
+++ b/core/ambdec.cpp
@@ -61,7 +61,7 @@ al::optional<std::string> make_error(size_t linenum, const char *fmt, ...)
va_start(args, fmt);
va_copy(args2, args);
const int msglen{std::vsnprintf(&str[plen], str.size()-plen, fmt, args)};
- if(msglen >= 0 && static_cast<size_t>(msglen) >= str.size()-plen) [[alunlikely]]
+ if(msglen >= 0 && static_cast<size_t>(msglen) >= str.size()-plen) [[unlikely]]
{
str.resize(static_cast<size_t>(msglen) + plen + 1u);
std::vsnprintf(&str[plen], str.size()-plen, fmt, args2);
diff --git a/core/bformatdec.cpp b/core/bformatdec.cpp
index 5c3f1864..b93c2f44 100644
--- a/core/bformatdec.cpp
+++ b/core/bformatdec.cpp
@@ -115,7 +115,7 @@ void BFormatDec::processStablize(const al::span<FloatBufferLine> OutBuffer,
auto &DelayBuf = mStablizer->DelayBuf[i];
auto buffer_end = OutBuffer[i].begin() + SamplesToDo;
- if(SamplesToDo >= FrontStablizer::DelayLength) [[allikely]]
+ if(SamplesToDo >= FrontStablizer::DelayLength) [[likely]]
{
auto delay_end = std::rotate(OutBuffer[i].begin(),
buffer_end - FrontStablizer::DelayLength, buffer_end);
diff --git a/core/converter.cpp b/core/converter.cpp
index e0fbaecd..35b1f289 100644
--- a/core/converter.cpp
+++ b/core/converter.cpp
@@ -143,7 +143,7 @@ void Multi2Mono(uint chanmask, const size_t step, const float scale, float *REST
std::fill_n(dst, frames, 0.0f);
for(size_t c{0};chanmask;++c)
{
- if((chanmask&1)) [[allikely]]
+ if((chanmask&1)) [[likely]]
{
for(size_t i{0u};i < frames;i++)
dst[i] += LoadSample<T>(ssrc[i*step + c]);
diff --git a/core/device.h b/core/device.h
index a287dd57..6317067e 100644
--- a/core/device.h
+++ b/core/device.h
@@ -277,7 +277,7 @@ struct DeviceBase {
void ProcessBs2b(const size_t SamplesToDo);
inline void postProcess(const size_t SamplesToDo)
- { if(PostProcess) [[allikely]] (this->*PostProcess)(SamplesToDo); }
+ { if(PostProcess) [[likely]] (this->*PostProcess)(SamplesToDo); }
void renderSamples(const al::span<float*> outBuffers, const uint numSamples);
void renderSamples(void *outBuffer, const uint numSamples, const size_t frameStep);
diff --git a/core/except.cpp b/core/except.cpp
index 5e757ed7..8e3536bd 100644
--- a/core/except.cpp
+++ b/core/except.cpp
@@ -19,7 +19,7 @@ void base_exception::setMessage(const char* msg, std::va_list args)
std::va_list args2;
va_copy(args2, args);
int msglen{std::vsnprintf(nullptr, 0, msg, args)};
- if(msglen > 0) [[allikely]]
+ if(msglen > 0) [[likely]]
{
mMessage.resize(static_cast<size_t>(msglen)+1);
std::vsnprintf(&mMessage[0], mMessage.length(), msg, args2);
diff --git a/core/logging.cpp b/core/logging.cpp
index ec81764c..8efa6a70 100644
--- a/core/logging.cpp
+++ b/core/logging.cpp
@@ -26,7 +26,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
va_start(args, fmt);
va_copy(args2, args);
const int msglen{std::vsnprintf(str, sizeof(stcmsg), fmt, args)};
- if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[alunlikely]]
+ if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[unlikely]]
{
dynmsg.resize(static_cast<size_t>(msglen) + 1u);
str = dynmsg.data();
@@ -66,7 +66,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
va_start(args, fmt);
va_copy(args2, args);
const int msglen{std::vsnprintf(str, sizeof(stcmsg), fmt, args)};
- if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[alunlikely]]
+ if(msglen >= 0 && static_cast<size_t>(msglen) >= sizeof(stcmsg)) [[unlikely]]
{
dynmsg.resize(static_cast<size_t>(msglen) + 1u);
str = dynmsg.data();
diff --git a/core/logging.h b/core/logging.h
index 87f1c0f5..e90de661 100644
--- a/core/logging.h
+++ b/core/logging.h
@@ -19,17 +19,17 @@ extern FILE *gLogFile;
#if !defined(_WIN32) && !defined(__ANDROID__)
#define TRACE(...) do { \
- if(gLogLevel >= LogLevel::Trace) [[alunlikely]] \
+ if(gLogLevel >= LogLevel::Trace) [[unlikely]] \
fprintf(gLogFile, "[ALSOFT] (II) " __VA_ARGS__); \
} while(0)
#define WARN(...) do { \
- if(gLogLevel >= LogLevel::Warning) [[alunlikely]] \
+ if(gLogLevel >= LogLevel::Warning) [[unlikely]] \
fprintf(gLogFile, "[ALSOFT] (WW) " __VA_ARGS__); \
} while(0)
#define ERR(...) do { \
- if(gLogLevel >= LogLevel::Error) [[alunlikely]] \
+ if(gLogLevel >= LogLevel::Error) [[unlikely]] \
fprintf(gLogFile, "[ALSOFT] (EE) " __VA_ARGS__); \
} while(0)
diff --git a/core/mastering.cpp b/core/mastering.cpp
index 6a085c3a..a4f66fbb 100644
--- a/core/mastering.cpp
+++ b/core/mastering.cpp
@@ -295,7 +295,7 @@ void SignalDelay(Compressor *Comp, const uint SamplesToDo, FloatBufferLine *OutB
float *delaybuf{al::assume_aligned<16>(Comp->mDelay[c].data())};
auto inout_end = inout + SamplesToDo;
- if(SamplesToDo >= lookAhead) [[allikely]]
+ if(SamplesToDo >= lookAhead) [[likely]]
{
auto delay_end = std::rotate(inout, inout_end - lookAhead, inout_end);
std::swap_ranges(inout, delay_end, delaybuf);
diff --git a/core/mixer/hrtfbase.h b/core/mixer/hrtfbase.h
index c8c78263..656b9445 100644
--- a/core/mixer/hrtfbase.h
+++ b/core/mixer/hrtfbase.h
@@ -50,7 +50,7 @@ inline void MixHrtfBlendBase(const float *InSamples, float2 *RESTRICT AccumSampl
const ConstHrirSpan NewCoeffs{newparams->Coeffs};
const float newGainStep{newparams->GainStep};
- if(oldparams->Gain > GainSilenceThreshold) [[allikely]]
+ if(oldparams->Gain > GainSilenceThreshold) [[likely]]
{
size_t ldelay{HrtfHistoryLength - oldparams->Delay[0]};
size_t rdelay{HrtfHistoryLength - oldparams->Delay[1]};
@@ -66,7 +66,7 @@ inline void MixHrtfBlendBase(const float *InSamples, float2 *RESTRICT AccumSampl
}
}
- if(newGainStep*static_cast<float>(BufferSize) > GainSilenceThreshold) [[allikely]]
+ if(newGainStep*static_cast<float>(BufferSize) > GainSilenceThreshold) [[likely]]
{
size_t ldelay{HrtfHistoryLength+1 - newparams->Delay[0]};
size_t rdelay{HrtfHistoryLength+1 - newparams->Delay[1]};
diff --git a/core/uhjfilter.cpp b/core/uhjfilter.cpp
index 0ee06d06..ac5f2d40 100644
--- a/core/uhjfilter.cpp
+++ b/core/uhjfilter.cpp
@@ -140,7 +140,7 @@ void UhjEncoder<N>::encode(float *LeftOut, float *RightOut,
float *inout{al::assume_aligned<16>(buffer)};
auto inout_end = inout + SamplesToDo;
- if(SamplesToDo >= sFilterDelay) [[allikely]]
+ if(SamplesToDo >= sFilterDelay) [[likely]]
{
auto delay_end = std::rotate(inout, inout_end - sFilterDelay, inout_end);
std::swap_ranges(inout, delay_end, distbuf);
diff --git a/core/voice.cpp b/core/voice.cpp
index 0b4884a0..be72b691 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -366,7 +366,7 @@ void DoHrtfMix(const float *samples, const uint DstBufferSize, DirectParams &par
std::begin(HrtfSamples));
std::copy_n(samples, DstBufferSize, src_iter);
/* Copy the last used samples back into the history buffer for later. */
- if(IsPlaying) [[allikely]]
+ if(IsPlaying) [[likely]]
std::copy_n(std::begin(HrtfSamples) + DstBufferSize, parms.Hrtf.History.size(),
parms.Hrtf.History.begin());
@@ -473,7 +473,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
VoiceBufferItem *BufferListItem{mCurrentBuffer.load(std::memory_order_relaxed)};
VoiceBufferItem *BufferLoopItem{mLoopBuffer.load(std::memory_order_relaxed)};
const uint increment{mStep};
- if(increment < 1) [[alunlikely]]
+ if(increment < 1) [[unlikely]]
{
/* If the voice is supposed to be stopping but can't be mixed, just
* stop it before bailing.
@@ -536,7 +536,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
}
}
}
- else if(!BufferListItem) [[alunlikely]]
+ else if(!BufferListItem) [[unlikely]]
Counter = std::min(Counter, 64u);
std::array<float*,DeviceBase::MixerChannelsMax> SamplePointers;
@@ -596,7 +596,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
/* If the voice is stopping, only one mixing iteration will
* be done, so ensure it fades out completely this mix.
*/
- if(vstate == Stopping) [[alunlikely]]
+ if(vstate == Stopping) [[unlikely]]
Counter = std::min(Counter, DstBufferSize);
}
ASSUME(DstBufferSize > 0);
@@ -604,7 +604,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
}
float **voiceSamples{};
- if(!BufferListItem) [[alunlikely]]
+ if(!BufferListItem) [[unlikely]]
{
const size_t srcOffset{(increment*DstBufferSize + DataPosFrac)>>MixerFracBits};
auto prevSamples = mPrevSamples.data();
@@ -639,7 +639,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
}
size_t samplesLoaded{0};
- if(DataPosInt < 0) [[alunlikely]]
+ if(DataPosInt < 0) [[unlikely]]
{
if(static_cast<uint>(-DataPosInt) >= SrcBufferSize)
goto skip_mix;
@@ -688,7 +688,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
}
/* Store the last source samples used for next time. */
- if(vstate == Playing) [[allikely]]
+ if(vstate == Playing) [[likely]]
{
prevSamples = mPrevSamples.data();
for(auto *chanbuffer : MixingSamples)
@@ -755,7 +755,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
}
skip_mix:
/* If the voice is stopping, we're now done. */
- if(vstate == Stopping) [[alunlikely]]
+ if(vstate == Stopping) [[unlikely]]
break;
/* Update positions */
@@ -770,7 +770,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
/* Do nothing extra when there's no buffers, or if the voice position
* is still negative.
*/
- if(!BufferListItem || DataPosInt < 0) [[alunlikely]]
+ if(!BufferListItem || DataPosInt < 0) [[unlikely]]
continue;
if(mFlags.test(VoiceIsStatic))
@@ -834,7 +834,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
mFlags.set(VoiceIsFading);
/* Don't update positions and buffers if we were stopping. */
- if(vstate == Stopping) [[alunlikely]]
+ if(vstate == Stopping) [[unlikely]]
{
mPlayState.store(Stopped, std::memory_order_release);
return;
@@ -888,7 +888,7 @@ void Voice::prepare(DeviceBase *device)
*/
uint num_channels{(mFmtChannels == FmtUHJ2 || mFmtChannels == FmtSuperStereo) ? 3 :
ChannelsFromFmt(mFmtChannels, minu(mAmbiOrder, device->mAmbiOrder))};
- if(num_channels > device->mSampleData.size()) [[alunlikely]]
+ if(num_channels > device->mSampleData.size()) [[unlikely]]
{
ERR("Unexpected channel count: %u (limit: %zu, %d:%d)\n", num_channels,
device->mSampleData.size(), mFmtChannels, mAmbiOrder);