Skip to content

Commit

Permalink
add ProString::toLongLong() and make use of it
Browse files Browse the repository at this point in the history
this is just a bit cleaner.

Change-Id: I03e628aca9e2e53c602a4db724da277a0e2c2486
Reviewed-by: Joerg Bornemann <[email protected]>
(cherry picked from qtbase/e6b755e702fd6d8ebeb25ecd7a5059e62da6c971)
Reviewed-by: Jake Petroules <[email protected]>
  • Loading branch information
ossilator committed Oct 10, 2016
1 parent 4c1a080 commit 396c7e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/linguist/shared/proitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class ProString {
bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
int toLongLong(bool *ok = 0, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
int toInt(bool *ok = 0, int base = 10) const { return toQStringRef().toInt(ok, base); }
short toShort(bool *ok = 0, int base = 10) const { return toQStringRef().toShort(ok, base); }

Expand Down
2 changes: 1 addition & 1 deletion src/linguist/shared/qmakebuiltins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
break;
}
bool ok;
qlonglong num = m_tmp3.toLongLong(&ok, ibase);
qlonglong num = args.at(0).toLongLong(&ok, ibase);
if (!ok) {
evalError(fL1S("format_number(): malformed number %2 for base %1.")
.arg(ibase).arg(m_tmp3));
Expand Down

0 comments on commit 396c7e5

Please sign in to comment.