Fixed two compiler warnings spotted by edward-san (one of them was a real bug)

This commit is contained in:
PKEuS 2012-05-17 08:29:32 -07:00
parent a9cfe2814a
commit 77927583f4
2 changed files with 2 additions and 2 deletions

View File

@ -1457,7 +1457,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func)
const Variable *var = symbolDatabase->getVariableFromVarId(tok1->varId());
if (var && Token::simpleMatch(var->typeStartToken(), "std ::") // assume all std::*::size() and std::*::empty() are const
&& Token::Match(tok1->tokAt(2), "size|empty|cend|crend|cbegin|crbegin|max_size|length|count|capacity|get_allocator|c_str|str ( )") || Token::Match(tok1->tokAt(2), "rfind|copy"))
&& (Token::Match(tok1->tokAt(2), "size|empty|cend|crend|cbegin|crbegin|max_size|length|count|capacity|get_allocator|c_str|str ( )") || Token::Match(tok1->tokAt(2), "rfind|copy")))
tok1 = tok1->next();
else if (var) { // Check if the function is const
const Scope* type = var->type();

View File

@ -835,7 +835,7 @@ void Variable::evaluate()
if (_start)
setFlag(fIsClass, !_start->isStandardType() && !isPointer() && !isReference());
if (_access == Argument && _name) {
const Token* tok = _name->next();
tok = _name->next();
while (tok->str() == "[")
tok = tok->link();
setFlag(fHasDefault, tok->str() == "=");