From fc11adc87eb4232f86fcacae95493747e8068809 Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi Date: Mon, 8 Jun 2020 23:21:22 -0400 Subject: [PATCH 1/2] Remove macros likely() and unlikely() --- include/AutomatableModel.h | 2 +- include/lmms_basics.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 25039eb0dc2..d1f86ff53e2 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -148,7 +148,7 @@ class LMMS_EXPORT AutomatableModel : public Model, public JournallingObject template inline T value( int frameOffset = 0 ) const { - if( unlikely( hasLinkedModels() || m_controllerConnection != NULL ) ) + if( Q_UNLIKELY( hasLinkedModels() || m_controllerConnection != NULL ) ) { return castValue( controllerValue( frameOffset ) ); } diff --git a/include/lmms_basics.h b/include/lmms_basics.h index 9618108563e..77a24649820 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -55,9 +55,6 @@ typedef uint16_t fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL) typedef uint32_t jo_id_t; // (unique) ID of a journalling object -// use for improved branch prediction -#define likely(x) Q_LIKELY(x) -#define unlikely(x) Q_UNLIKELY(x) // windows headers define "min" and "max" macros, breaking the methods bwloe #undef min From 0df9ca7dcb19cb8c805af0354692049a06149340 Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi Date: Tue, 9 Jun 2020 19:56:10 -0400 Subject: [PATCH 2/2] Remove only use of macro Q_UNLIKELY() --- include/AutomatableModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index d1f86ff53e2..c332858b7b6 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -148,7 +148,7 @@ class LMMS_EXPORT AutomatableModel : public Model, public JournallingObject template inline T value( int frameOffset = 0 ) const { - if( Q_UNLIKELY( hasLinkedModels() || m_controllerConnection != NULL ) ) + if( hasLinkedModels() || m_controllerConnection != NULL ) { return castValue( controllerValue( frameOffset ) ); }