diff options
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index d970843dea..132ff48846 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -937,10 +937,10 @@ struct QRegExpMatchState const QRegExpEngine *eng; - inline QRegExpMatchState() : bigArray(0), captured(0) {} + inline QRegExpMatchState() : bigArray(nullptr), captured(nullptr) {} inline ~QRegExpMatchState() { free(bigArray); } - void drain() { free(bigArray); bigArray = 0; captured = 0; } // to save memory + void drain() { free(bigArray); bigArray = nullptr; captured = nullptr; } // to save memory void prepareForMatch(QRegExpEngine *eng); void match(const QChar *str, int len, int pos, bool minimal, bool oneTest, int caretIndex); @@ -1428,7 +1428,7 @@ void QRegExpMatchState::match(const QChar *str0, int len0, int pos0, #endif { in = str0; - if (in == 0) + if (in == nullptr) in = &char_null; pos = pos0; caretPos = caretIndex; @@ -2910,7 +2910,7 @@ int QRegExpEngine::getEscape() #ifndef QT_NO_REGEXP_ESCAPE if ((prevCh & ~0xff) == 0) { const char *p = strchr(tab, prevCh); - if (p != 0) + if (p != nullptr) return Tok_Char | backTab[p - tab]; } #endif @@ -3530,7 +3530,7 @@ int QRegExpEngine::parse(const QChar *pattern, int len) #endif box.cat(middleBox); box.cat(rightBox); - yyCharClass.reset(0); + yyCharClass.reset(); #ifndef QT_NO_REGEXP_CAPTURE for (int i = 0; i < nf; ++i) { @@ -3608,7 +3608,7 @@ int QRegExpEngine::parse(const QChar *pattern, int len) void QRegExpEngine::parseAtom(Box *box) { #ifndef QT_NO_REGEXP_LOOKAHEAD - QRegExpEngine *eng = 0; + QRegExpEngine *eng = nullptr; bool neg; int len; #endif @@ -3805,9 +3805,9 @@ struct QRegExpPrivate QRegExpMatchState matchState; inline QRegExpPrivate() - : eng(0), engineKey(QString(), QRegExp::RegExp, Qt::CaseSensitive), minimal(false) { } + : eng(nullptr), engineKey(QString(), QRegExp::RegExp, Qt::CaseSensitive), minimal(false) { } inline QRegExpPrivate(const QRegExpEngineKey &key) - : eng(0), engineKey(key), minimal(false) {} + : eng(nullptr), engineKey(key), minimal(false) {} }; #if !defined(QT_NO_REGEXP_OPTIM) @@ -3886,9 +3886,9 @@ static void prepareEngineForMatch(QRegExpPrivate *priv, const QString &str) static void invalidateEngine(QRegExpPrivate *priv) { - if (priv->eng != 0) { + if (priv->eng) { derefEngine(priv->eng, priv->engineKey); - priv->eng = 0; + priv->eng = nullptr; priv->matchState.drain(); } } |