remove remaining pointless conversions to QString
we have perfectly good overloads which work with ProString itself, or at least with QStringRef. Change-Id: I45f39b8c2f83216f20849dd58eb3b8d78726083d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
981f8ad2e4
commit
8bd0c3d4fc
@ -534,29 +534,28 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
if (args.count() >= 2) {
|
if (args.count() >= 2) {
|
||||||
const auto opts = split_value_list(args.at(1).toQStringRef());
|
const auto opts = split_value_list(args.at(1).toQStringRef());
|
||||||
for (const ProString &opt : opts) {
|
for (const ProString &opt : opts) {
|
||||||
opt.toQString(m_tmp3);
|
if (opt.startsWith(QLatin1String("ibase="))) {
|
||||||
if (m_tmp3.startsWith(QLatin1String("ibase="))) {
|
ibase = opt.mid(6).toInt();
|
||||||
ibase = m_tmp3.mid(6).toInt();
|
} else if (opt.startsWith(QLatin1String("obase="))) {
|
||||||
} else if (m_tmp3.startsWith(QLatin1String("obase="))) {
|
obase = opt.mid(6).toInt();
|
||||||
obase = m_tmp3.mid(6).toInt();
|
} else if (opt.startsWith(QLatin1String("width="))) {
|
||||||
} else if (m_tmp3.startsWith(QLatin1String("width="))) {
|
width = opt.mid(6).toInt();
|
||||||
width = m_tmp3.mid(6).toInt();
|
} else if (opt == QLatin1String("zeropad")) {
|
||||||
} else if (m_tmp3 == QLatin1String("zeropad")) {
|
|
||||||
zeropad = true;
|
zeropad = true;
|
||||||
} else if (m_tmp3 == QLatin1String("padsign")) {
|
} else if (opt == QLatin1String("padsign")) {
|
||||||
sign = PadSign;
|
sign = PadSign;
|
||||||
} else if (m_tmp3 == QLatin1String("alwayssign")) {
|
} else if (opt == QLatin1String("alwayssign")) {
|
||||||
sign = AlwaysSign;
|
sign = AlwaysSign;
|
||||||
} else if (m_tmp3 == QLatin1String("leftalign")) {
|
} else if (opt == QLatin1String("leftalign")) {
|
||||||
leftalign = true;
|
leftalign = true;
|
||||||
} else {
|
} else {
|
||||||
evalError(fL1S("format_number(): invalid format option %1.").arg(m_tmp3));
|
evalError(fL1S("format_number(): invalid format option %1.")
|
||||||
|
.arg(opt.toQString(m_tmp3)));
|
||||||
goto formfail;
|
goto formfail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args.at(0).toQString(m_tmp3);
|
if (args.at(0).contains(QLatin1Char('.'))) {
|
||||||
if (m_tmp3.contains(QLatin1Char('.'))) {
|
|
||||||
evalError(fL1S("format_number(): floats are currently not supported."));
|
evalError(fL1S("format_number(): floats are currently not supported."));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -564,7 +563,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
qlonglong num = args.at(0).toLongLong(&ok, ibase);
|
qlonglong num = args.at(0).toLongLong(&ok, ibase);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
evalError(fL1S("format_number(): malformed number %2 for base %1.")
|
evalError(fL1S("format_number(): malformed number %2 for base %1.")
|
||||||
.arg(ibase).arg(m_tmp3));
|
.arg(ibase).arg(args.at(0).toQString(m_tmp3)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QString outstr;
|
QString outstr;
|
||||||
@ -707,12 +706,11 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
bool lines = false;
|
bool lines = false;
|
||||||
bool singleLine = true;
|
bool singleLine = true;
|
||||||
if (args.count() > 1) {
|
if (args.count() > 1) {
|
||||||
args.at(1).toQString(m_tmp2);
|
if (!args.at(1).compare(QLatin1String("false"), Qt::CaseInsensitive))
|
||||||
if (!m_tmp2.compare(QLatin1String("false"), Qt::CaseInsensitive))
|
|
||||||
singleLine = false;
|
singleLine = false;
|
||||||
else if (!m_tmp2.compare(QLatin1String("blob"), Qt::CaseInsensitive))
|
else if (!args.at(1).compare(QLatin1String("blob"), Qt::CaseInsensitive))
|
||||||
blob = true;
|
blob = true;
|
||||||
else if (!m_tmp2.compare(QLatin1String("lines"), Qt::CaseInsensitive))
|
else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive))
|
||||||
lines = true;
|
lines = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,12 +783,11 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
bool lines = false;
|
bool lines = false;
|
||||||
bool singleLine = true;
|
bool singleLine = true;
|
||||||
if (args.count() > 1) {
|
if (args.count() > 1) {
|
||||||
args.at(1).toQString(m_tmp2);
|
if (!args.at(1).compare(QLatin1String("false"), Qt::CaseInsensitive))
|
||||||
if (!m_tmp2.compare(QLatin1String("false"), Qt::CaseInsensitive))
|
|
||||||
singleLine = false;
|
singleLine = false;
|
||||||
else if (!m_tmp2.compare(QLatin1String("blob"), Qt::CaseInsensitive))
|
else if (!args.at(1).compare(QLatin1String("blob"), Qt::CaseInsensitive))
|
||||||
blob = true;
|
blob = true;
|
||||||
else if (!m_tmp2.compare(QLatin1String("lines"), Qt::CaseInsensitive))
|
else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive))
|
||||||
lines = true;
|
lines = true;
|
||||||
}
|
}
|
||||||
QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2));
|
QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2));
|
||||||
@ -1321,8 +1318,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
.arg(function.toQString(m_tmp1)));
|
.arg(function.toQString(m_tmp1)));
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
}
|
}
|
||||||
const QString &rhs(args.at(1).toQString(m_tmp1)),
|
const ProString &rhs = args.at(1);
|
||||||
&lhs(values(map(args.at(0))).join(statics.field_sep));
|
const QString &lhs = values(map(args.at(0))).join(statics.field_sep);
|
||||||
bool ok;
|
bool ok;
|
||||||
int rhs_int = rhs.toInt(&ok);
|
int rhs_int = rhs.toInt(&ok);
|
||||||
if (ok) { // do integer compare
|
if (ok) { // do integer compare
|
||||||
@ -1334,8 +1331,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (func_t == T_GREATERTHAN)
|
if (func_t == T_GREATERTHAN)
|
||||||
return returnBool(lhs > rhs);
|
return returnBool(lhs > rhs.toQStringRef());
|
||||||
return returnBool(lhs < rhs);
|
return returnBool(lhs < rhs.toQStringRef());
|
||||||
}
|
}
|
||||||
case T_EQUALS:
|
case T_EQUALS:
|
||||||
if (args.count() != 2) {
|
if (args.count() != 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user