gcc 4.5 compatibility

This commit is contained in:
Daniel Marjamäki 2018-03-30 20:57:25 +02:00
parent dbe962ad5d
commit 95ccd9483b
2 changed files with 4 additions and 4 deletions

View File

@ -346,9 +346,9 @@ MathLib::biguint MathLib::toULongNumber(const std::string & str)
static unsigned int encodeMultiChar(const std::string& str) static unsigned int encodeMultiChar(const std::string& str)
{ {
unsigned int retval(str.front()); unsigned int retval = 0;
for (std::string::const_iterator it=str.begin()+1; it!=str.end(); ++it) { for (std::string::const_iterator it=str.begin(); it!=str.end(); ++it) {
retval = retval<<8 | *it; retval = (retval << 8) | *it;
} }
return retval; return retval;
} }

View File

@ -5137,7 +5137,7 @@ void SymbolDatabase::setValueTypeInTokenList()
if (tok->isNumber()) { if (tok->isNumber()) {
if (MathLib::isFloat(tok->str())) { if (MathLib::isFloat(tok->str())) {
ValueType::Type type = ValueType::Type::DOUBLE; ValueType::Type type = ValueType::Type::DOUBLE;
const char suffix = tok->str().back(); const char suffix = tok->str()[tok->str().size() - 1];
if (suffix == 'f' || suffix == 'F') if (suffix == 'f' || suffix == 'F')
type = ValueType::Type::FLOAT; type = ValueType::Type::FLOAT;
else if (suffix == 'L' || suffix == 'l') else if (suffix == 'L' || suffix == 'l')