summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-14 15:04:18 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-06-07 17:19:16 +0200
commitb4ead572501179244aa036e7a590fa7536929f2b (patch)
treef1e706b221e78e294b3169965c005df768730203 /src/corelib/global/qlogging.cpp
parent327bfdb671e0e263c6fb027133a54985a65194c4 (diff)
Move away from using 0 as a pointer constant
Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r--src/corelib/global/qlogging.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 292a459e5d..49411306c2 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1100,8 +1100,8 @@ Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_MOVABLE_TYPE);
QBasicMutex QMessagePattern::mutex;
QMessagePattern::QMessagePattern()
- : literals(0)
- , tokens(0)
+ : literals(nullptr)
+ , tokens(nullptr)
, fromEnvironment(false)
{
#ifndef QT_BOOTSTRAPPED
@@ -1121,9 +1121,9 @@ QMessagePattern::~QMessagePattern()
for (int i = 0; literals[i]; ++i)
delete [] literals[i];
delete [] literals;
- literals = 0;
+ literals = nullptr;
delete [] tokens;
- tokens = 0;
+ tokens = nullptr;
}
void QMessagePattern::setPattern(const QString &pattern)
@@ -1173,7 +1173,7 @@ void QMessagePattern::setPattern(const QString &pattern)
// tokenizer
QVarLengthArray<const char*> literalsVar;
tokens = new const char*[lexemes.size() + 1];
- tokens[lexemes.size()] = 0;
+ tokens[lexemes.size()] = nullptr;
bool nestedIfError = false;
bool inIf = false;
@@ -1280,7 +1280,7 @@ void QMessagePattern::setPattern(const QString &pattern)
qt_message_print(error);
literals = new const char*[literalsVar.size() + 1];
- literals[literalsVar.size()] = 0;
+ literals[literalsVar.size()] = nullptr;
memcpy(literals, literalsVar.constData(), literalsVar.size() * sizeof(const char*));
}
@@ -1406,7 +1406,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
#endif
// we do not convert file, function, line literals to local encoding due to overhead
- for (int i = 0; pattern->tokens[i] != 0; ++i) {
+ for (int i = 0; pattern->tokens[i]; ++i) {
const char *token = pattern->tokens[i];
if (token == endifTokenC) {
skip = false;