path: root/src/tools/rcc
diff options
authorMarc Mutz <>2015-11-12 10:16:22 +0100
committerMarc Mutz <>2015-11-29 22:59:17 +0000
commit51089a5742a79467221b5781cb35a8cea023febf (patch)
tree95f765fa452cdfaa12f986e4d228d9a958c95100 /src/tools/rcc
parent14d189f7875b7def6f9745bfd20527a0fce19a44 (diff)
Use Q_UNLIKELY for every qFatal()/qCritical()
If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <> Reviewed-by: Olivier Goffart (Woboq GmbH) <>
Diffstat (limited to 'src/tools/rcc')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp
index d8d5728414..1405f19a3a 100644
--- a/src/tools/rcc/main.cpp
+++ b/src/tools/rcc/main.cpp
@@ -304,7 +304,7 @@ int main(int argc, char *argv[])
// rcc uses a QHash to store files in the resource system.
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
- if (!qEnvironmentVariableIsEmpty("QT_RCC_TEST") && !qt_qhash_seed.testAndSetRelaxed(-1, 0))
+ if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_RCC_TEST") && !qt_qhash_seed.testAndSetRelaxed(-1, 0)))
qFatal("Cannot force QHash seed for testing as requested");
return QT_PREPEND_NAMESPACE(runRcc)(argc, argv);