Borland C++: Fixed compiler errors (operands must be same type)

This commit is contained in:
Daniel Marjamäki 2010-02-20 08:53:33 +01:00
parent 50b5278315
commit 57f63f65c2
2 changed files with 3 additions and 3 deletions

View File

@ -455,7 +455,7 @@ void CheckMemoryLeakInFunction::parse_noreturn()
tok = tok->link();
if (tok->str() == "(")
{
const std::string function_name((tok->previous() && tok->previous()->isName()) ? tok->strAt(-1) : "");
const std::string function_name((tok->previous() && tok->previous()->isName()) ? tok->strAt(-1).c_str() : "");
tok = tok->link();

View File

@ -4801,8 +4801,8 @@ bool Tokenizer::simplifyCalculations()
MathLib::isInt(tok->str()) &&
MathLib::isInt(tok->tokAt(2)->str()))
{
const std::string prev(tok->previous() ? tok->strAt(-1) : "");
const std::string after(tok->tokAt(3) ? tok->strAt(3) : "");
const std::string prev(tok->previous() ? tok->strAt(-1).c_str() : "");
const std::string after(tok->tokAt(3) ? tok->strAt(3).c_str() : "");
if ((prev == "(" || prev == "&&" || prev == "||") && (after == ")" || after == "&&" || after == "||"))
{
const int op1(MathLib::toLongNumber(tok->str()));