Fixed test failures in testio caused by my last commit.
This commit is contained in:
parent
c463d97386
commit
e191f0d7d4
|
@ -471,7 +471,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
|
|||
varTypeTok = varTypeTok->next();
|
||||
|
||||
if (scan && varTypeTok) {
|
||||
if ((!variableInfo->isPointer() && !variableInfo->isArray()) || varTypeTok->str() == "const")
|
||||
if ((!variableInfo->isPointer() && !variableInfo->isArray()) || varTypeTok->strAt(-1) == "const")
|
||||
invalidScanfArgTypeError(tok, tok->str(), numFormat);
|
||||
} else if (!scan) {
|
||||
switch (*i) {
|
||||
|
@ -480,7 +480,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
|
|||
invalidPrintfArgTypeError_s(tok, numFormat);
|
||||
break;
|
||||
case 'n':
|
||||
if ((varTypeTok && isKnownType(variableInfo, varTypeTok) && ((!variableInfo->isPointer() && !variableInfo->isArray()) || varTypeTok->str() == "const")) || argListTok->type() == Token::eString)
|
||||
if ((varTypeTok && isKnownType(variableInfo, varTypeTok) && ((!variableInfo->isPointer() && !variableInfo->isArray()) || varTypeTok->strAt(-1) == "const")) || argListTok->type() == Token::eString)
|
||||
invalidPrintfArgTypeError_n(tok, numFormat);
|
||||
break;
|
||||
case 'c':
|
||||
|
|
|
@ -2238,7 +2238,7 @@ void CheckOther::checkDuplicateBranch()
|
|||
|
||||
// check for duplicates
|
||||
if (branch1 == branch2)
|
||||
duplicateBranchError(scope->classDef, scope->classEnd->tokAt(1));
|
||||
duplicateBranchError(scope->classDef, scope->classEnd->next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue