forked from qt-creator/qt-creator
ProWriter: Fix some Clang warnings
There are more in this file (mostly sign conversion), but not that easy to fix. Change-Id: Icf4354836ad791982d442236077d7e1e5df18f74 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
a6e72c4c6e
commit
3d67de6b39
@@ -38,7 +38,7 @@ using namespace QmakeProjectManager::Internal;
|
|||||||
static uint getBlockLen(const ushort *&tokPtr)
|
static uint getBlockLen(const ushort *&tokPtr)
|
||||||
{
|
{
|
||||||
uint len = *tokPtr++;
|
uint len = *tokPtr++;
|
||||||
len |= (uint)*tokPtr++ << 16;
|
len |= uint(*tokPtr++ << 16);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,10 +53,10 @@ static bool getLiteral(const ushort *tokPtr, const ushort *tokEnd, QString &tmp)
|
|||||||
break;
|
break;
|
||||||
case TokHashLiteral:
|
case TokHashLiteral:
|
||||||
tokPtr += 2;
|
tokPtr += 2;
|
||||||
// fallthrough
|
Q_FALLTHROUGH();
|
||||||
case TokLiteral: {
|
case TokLiteral: {
|
||||||
uint len = *tokPtr++;
|
int len = *tokPtr++;
|
||||||
tmp.setRawData((const QChar *)tokPtr, len);
|
tmp.setRawData(reinterpret_cast<const QChar *>(tokPtr), len);
|
||||||
count++;
|
count++;
|
||||||
tokPtr += len;
|
tokPtr += len;
|
||||||
break; }
|
break; }
|
||||||
@@ -138,13 +138,13 @@ static const ushort *skipToken(ushort tok, const ushort *&tokPtr, int &lineNo)
|
|||||||
case TokRemove:
|
case TokRemove:
|
||||||
case TokReplace:
|
case TokReplace:
|
||||||
tokPtr++;
|
tokPtr++;
|
||||||
// fallthrough
|
Q_FALLTHROUGH();
|
||||||
case TokTestCall:
|
case TokTestCall:
|
||||||
skipExpression(tokPtr, lineNo);
|
skipExpression(tokPtr, lineNo);
|
||||||
break;
|
break;
|
||||||
case TokForLoop:
|
case TokForLoop:
|
||||||
skipHashStr(tokPtr);
|
skipHashStr(tokPtr);
|
||||||
// fallthrough
|
Q_FALLTHROUGH();
|
||||||
case TokBranch:
|
case TokBranch:
|
||||||
skipBlock(tokPtr);
|
skipBlock(tokPtr);
|
||||||
skipBlock(tokPtr);
|
skipBlock(tokPtr);
|
||||||
@@ -170,14 +170,14 @@ static const ushort *skipToken(ushort tok, const ushort *&tokPtr, int &lineNo)
|
|||||||
}
|
}
|
||||||
Q_ASSERT_X(false, "skipToken", "unexpected item type");
|
Q_ASSERT_X(false, "skipToken", "unexpected item type");
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProWriter::compileScope(const QString &scope)
|
QString ProWriter::compileScope(const QString &scope)
|
||||||
{
|
{
|
||||||
if (scope.isEmpty())
|
if (scope.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
QMakeParser parser(0, 0, 0);
|
QMakeParser parser(nullptr, nullptr, nullptr);
|
||||||
ProFile *includeFile = parser.parsedProBlock(QStringRef(&scope), 0, QLatin1String("no-file"), 1);
|
ProFile *includeFile = parser.parsedProBlock(QStringRef(&scope), 0, QLatin1String("no-file"), 1);
|
||||||
if (!includeFile)
|
if (!includeFile)
|
||||||
return QString();
|
return QString();
|
||||||
@@ -206,11 +206,11 @@ bool ProWriter::locateVarValues(const ushort *tokPtr, const ushort *tokPtrEnd,
|
|||||||
const bool inScope = scope.isEmpty();
|
const bool inScope = scope.isEmpty();
|
||||||
int lineNo = *scopeStart + 1;
|
int lineNo = *scopeStart + 1;
|
||||||
QString tmp;
|
QString tmp;
|
||||||
const ushort *lastXpr = 0;
|
const ushort *lastXpr = nullptr;
|
||||||
bool fresh = true;
|
bool fresh = true;
|
||||||
|
|
||||||
QString compiledScope = compileScope(scope);
|
QString compiledScope = compileScope(scope);
|
||||||
const ushort *cTokPtr = (const ushort *)compiledScope.constData();
|
const ushort *cTokPtr = reinterpret_cast<const ushort *>(compiledScope.constData());
|
||||||
|
|
||||||
while (ushort tok = *tokPtr++) {
|
while (ushort tok = *tokPtr++) {
|
||||||
if (inScope && (tok == TokAssign || tok == TokAppend || tok == TokAppendUnique)) {
|
if (inScope && (tok == TokAssign || tok == TokAppend || tok == TokAppendUnique)) {
|
||||||
@@ -418,7 +418,7 @@ static void findProVariables(const ushort *tokPtr, const QStringList &vars,
|
|||||||
{
|
{
|
||||||
int lineNo = firstLine;
|
int lineNo = firstLine;
|
||||||
QString tmp;
|
QString tmp;
|
||||||
const ushort *lastXpr = 0;
|
const ushort *lastXpr = nullptr;
|
||||||
while (ushort tok = *tokPtr++) {
|
while (ushort tok = *tokPtr++) {
|
||||||
if (tok == TokBranch) {
|
if (tok == TokBranch) {
|
||||||
uint blockLen = getBlockLen(tokPtr);
|
uint blockLen = getBlockLen(tokPtr);
|
||||||
|
Reference in New Issue
Block a user