From 0ca7c0a5757a496af24d621ce54a3c93f24be976 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 18 Jun 2019 20:11:18 +0200 Subject: QMake: be less laissez-faire with implicit conversions to QChar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QChar currently is convertible from nearly every integral type. This is bad code hygiene and should be fixed come Qt 6. The present patch is the result of compile fixes from marking these constructors explicit. Amends 60ca2f5f7c38178cfe62d3dbe1b8dacfe43cbac9. Change-Id: I06887104d42f8327eb6196afcde5f942a74a6a78 Reviewed-by: Friedemann Kleint Reviewed-by: MÃ¥rten Nordheim --- qmake/library/proitems.cpp | 4 ++-- qmake/library/qmakeevaluator.cpp | 4 ++-- qmake/library/qmakeparser.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'qmake/library') diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index 41bed69f00..9330c2b1bf 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -238,7 +238,7 @@ ProString &ProString::append(const ProString &other, bool *pending) QChar *ptr; if (pending && !*pending) { ptr = prepareExtend(1 + other.m_length, 0, m_length); - *ptr++ = 32; + *ptr++ = QLatin1Char(' '); } else { ptr = prepareExtend(other.m_length, 0, m_length); } @@ -276,7 +276,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski QChar *ptr = prepareExtend(totalLength, 0, m_length); for (int i = startIdx; i < sz; ++i) { if (putSpace) - *ptr++ = 32; + *ptr++ = QLatin1Char(' '); else putSpace = true; const ProString &str = other.at(i); diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index ba617932ce..e15a4bfc50 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1583,8 +1583,8 @@ void QMakeEvaluator::updateFeaturePaths() } for (int i = 0; i < feature_roots.count(); ++i) - if (!feature_roots.at(i).endsWith((ushort)'/')) - feature_roots[i].append((ushort)'/'); + if (!feature_roots.at(i).endsWith(QLatin1Char('/'))) + feature_roots[i].append(QLatin1Char('/')); feature_roots.removeDuplicates(); diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 4c8360b459..ffe90ebda7 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -621,7 +621,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar if (c != term) { parseError(fL1S("Missing %1 terminator [found %2]") .arg(QChar(term)) - .arg(c ? QString(c) : QString::fromLatin1("end-of-line"))); + .arg(c ? QString(QChar(c)) : QString::fromLatin1("end-of-line"))); m_inError = true; // Just parse on, as if there was a terminator ... } else { -- cgit v1.2.3