aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compilercontrolflow_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/qml/compiler/qv4compilercontrolflow_p.h
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff)
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontrolflow_p.h')
-rw-r--r--src/qml/compiler/qv4compilercontrolflow_p.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4compilercontrolflow_p.h b/src/qml/compiler/qv4compilercontrolflow_p.h
index 13716fe29f..9bda20905a 100644
--- a/src/qml/compiler/qv4compilercontrolflow_p.h
+++ b/src/qml/compiler/qv4compilercontrolflow_p.h
@@ -159,7 +159,7 @@ struct ControlFlow {
virtual Handler getHandler(HandlerType type, const QString &label = QString()) = 0;
BytecodeGenerator::ExceptionHandler *parentExceptionHandler() {
- return parent ? parent->exceptionHandler() : 0;
+ return parent ? parent->exceptionHandler() : nullptr;
}
virtual BytecodeGenerator::ExceptionHandler *exceptionHandler() {
@@ -184,7 +184,7 @@ protected:
QString label;
if (cg->_labelledStatement) {
label = cg->_labelledStatement->label.toString();
- cg->_labelledStatement = 0;
+ cg->_labelledStatement = nullptr;
}
return label;
}
@@ -196,10 +196,10 @@ protected:
struct ControlFlowLoop : public ControlFlow
{
QString loopLabel;
- BytecodeGenerator::Label *breakLabel = 0;
- BytecodeGenerator::Label *continueLabel = 0;
+ BytecodeGenerator::Label *breakLabel = nullptr;
+ BytecodeGenerator::Label *continueLabel = nullptr;
- ControlFlowLoop(Codegen *cg, BytecodeGenerator::Label *breakLabel, BytecodeGenerator::Label *continueLabel = 0)
+ ControlFlowLoop(Codegen *cg, BytecodeGenerator::Label *breakLabel, BytecodeGenerator::Label *continueLabel = nullptr)
: ControlFlow(cg, Loop), loopLabel(ControlFlow::loopLabel()), breakLabel(breakLabel), continueLabel(continueLabel)
{
}
@@ -407,7 +407,7 @@ struct ControlFlowFinally : public ControlFlowUnwind
ControlFlowFinally(Codegen *cg, AST::Finally *finally)
: ControlFlowUnwind(cg, Finally), finally(finally)
{
- Q_ASSERT(finally != 0);
+ Q_ASSERT(finally != nullptr);
generator()->setExceptionHandler(&unwindLabel);
}