From 95ccd9483bef02179e25196c72b5dbd8cafe7741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 30 Mar 2018 20:57:25 +0200 Subject: [PATCH] gcc 4.5 compatibility --- lib/mathlib.cpp | 6 +++--- lib/symboldatabase.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mathlib.cpp b/lib/mathlib.cpp index a76a04f3f..f15c64a82 100644 --- a/lib/mathlib.cpp +++ b/lib/mathlib.cpp @@ -346,9 +346,9 @@ MathLib::biguint MathLib::toULongNumber(const std::string & str) static unsigned int encodeMultiChar(const std::string& str) { - unsigned int retval(str.front()); - for (std::string::const_iterator it=str.begin()+1; it!=str.end(); ++it) { - retval = retval<<8 | *it; + unsigned int retval = 0; + for (std::string::const_iterator it=str.begin(); it!=str.end(); ++it) { + retval = (retval << 8) | *it; } return retval; } diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index b20b4f87f..bc60164fb 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -5137,7 +5137,7 @@ void SymbolDatabase::setValueTypeInTokenList() if (tok->isNumber()) { if (MathLib::isFloat(tok->str())) { 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') type = ValueType::Type::FLOAT; else if (suffix == 'L' || suffix == 'l')