aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/parser
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-02-26 14:38:54 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-02-26 15:52:26 +0000
commit4fd17d627106fde01284075038e15cc0680611bc (patch)
tree25c5b7e8ec774d362ad97e86d0ecd1d8527fbac5 /src/lib/corelib/parser
parent0b8f0b771080e51a59664782ced6b3a1cc5111ca (diff)
Return initializer list where it is possible
This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/parser')
-rw-r--r--src/lib/corelib/parser/qmlerror.cpp4
-rw-r--r--src/lib/corelib/parser/qmljslexer.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/corelib/parser/qmlerror.cpp b/src/lib/corelib/parser/qmlerror.cpp
index 2a951df12..e72e79f87 100644
--- a/src/lib/corelib/parser/qmlerror.cpp
+++ b/src/lib/corelib/parser/qmlerror.cpp
@@ -147,7 +147,7 @@ bool QmlError::isValid() const
QUrl QmlError::url() const
{
if (d) return d->url;
- else return QUrl();
+ else return {};
}
/*!
@@ -165,7 +165,7 @@ void QmlError::setUrl(const QUrl &url)
QString QmlError::description() const
{
if (d) return d->description;
- else return QString();
+ else return {};
}
/*!
diff --git a/src/lib/corelib/parser/qmljslexer.cpp b/src/lib/corelib/parser/qmljslexer.cpp
index 2c96aa8cf..ef57ab84a 100644
--- a/src/lib/corelib/parser/qmljslexer.cpp
+++ b/src/lib/corelib/parser/qmljslexer.cpp
@@ -73,7 +73,7 @@ static unsigned char convertHex(ushort c)
static QChar convertHex(QChar c1, QChar c2)
{
- return QChar((convertHex(c1.unicode()) << 4) + convertHex(c2.unicode()));
+ return {(convertHex(c1.unicode()) << 4) + convertHex(c2.unicode())};
}
static QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4)
@@ -267,7 +267,7 @@ QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok)
}
*ok = false;
- return QChar();
+ return {};
}
int Lexer::scanToken()