Fixed test failures in testio caused by my last commit.

This commit is contained in:
PKEuS 2012-06-08 10:35:08 -07:00
parent c463d97386
commit e191f0d7d4
2 changed files with 3 additions and 3 deletions

View File

@ -471,7 +471,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
varTypeTok = varTypeTok->next(); varTypeTok = varTypeTok->next();
if (scan && varTypeTok) { 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); invalidScanfArgTypeError(tok, tok->str(), numFormat);
} else if (!scan) { } else if (!scan) {
switch (*i) { switch (*i) {
@ -480,7 +480,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
invalidPrintfArgTypeError_s(tok, numFormat); invalidPrintfArgTypeError_s(tok, numFormat);
break; break;
case 'n': 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); invalidPrintfArgTypeError_n(tok, numFormat);
break; break;
case 'c': case 'c':

View File

@ -2238,7 +2238,7 @@ void CheckOther::checkDuplicateBranch()
// check for duplicates // check for duplicates
if (branch1 == branch2) if (branch1 == branch2)
duplicateBranchError(scope->classDef, scope->classEnd->tokAt(1)); duplicateBranchError(scope->classDef, scope->classEnd->next());
} }
} }
} }