astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2019-10-30 17:58:19 +01:00
parent 816aa7e211
commit 8c591308cb
3 changed files with 27 additions and 17 deletions

View File

@ -5,11 +5,13 @@
#include "symboldatabase.h" #include "symboldatabase.h"
#include <cassert> #include <cassert>
void ProgramMemory::setValue(nonneg int varid, const ValueFlow::Value &value) { void ProgramMemory::setValue(nonneg int varid, const ValueFlow::Value &value)
{
values[varid] = value; values[varid] = value;
} }
bool ProgramMemory::getIntValue(nonneg int varid, MathLib::bigint* result) const { bool ProgramMemory::getIntValue(nonneg int varid, MathLib::bigint* result) const
{
const std::map<int, ValueFlow::Value>::const_iterator it = values.find(varid); const std::map<int, ValueFlow::Value>::const_iterator it = values.find(varid);
const bool found = it != values.end() && it->second.isIntValue(); const bool found = it != values.end() && it->second.isIntValue();
if (found) if (found)
@ -17,11 +19,13 @@ bool ProgramMemory::getIntValue(nonneg int varid, MathLib::bigint* result) const
return found; return found;
} }
void ProgramMemory::setIntValue(nonneg int varid, MathLib::bigint value) { void ProgramMemory::setIntValue(nonneg int varid, MathLib::bigint value)
{
values[varid] = ValueFlow::Value(value); values[varid] = ValueFlow::Value(value);
} }
bool ProgramMemory::getTokValue(nonneg int varid, const Token** result) const { bool ProgramMemory::getTokValue(nonneg int varid, const Token** result) const
{
const std::map<int, ValueFlow::Value>::const_iterator it = values.find(varid); const std::map<int, ValueFlow::Value>::const_iterator it = values.find(varid);
const bool found = it != values.end() && it->second.isTokValue(); const bool found = it != values.end() && it->second.isTokValue();
if (found) if (found)
@ -29,28 +33,34 @@ bool ProgramMemory::getTokValue(nonneg int varid, const Token** result) const {
return found; return found;
} }
bool ProgramMemory::hasValue(nonneg int varid) { bool ProgramMemory::hasValue(nonneg int varid)
{
return values.find(varid) != values.end(); return values.find(varid) != values.end();
} }
void ProgramMemory::swap(ProgramMemory &pm) { void ProgramMemory::swap(ProgramMemory &pm)
{
values.swap(pm.values); values.swap(pm.values);
} }
void ProgramMemory::clear() { void ProgramMemory::clear()
{
values.clear(); values.clear();
} }
bool ProgramMemory::empty() const { bool ProgramMemory::empty() const
{
return values.empty(); return values.empty();
} }
void ProgramMemory::replace(const ProgramMemory &pm) { void ProgramMemory::replace(const ProgramMemory &pm)
{
for (auto&& p:pm.values) for (auto&& p:pm.values)
values[p.first] = p.second; values[p.first] = p.second;
} }
void ProgramMemory::insert(const ProgramMemory &pm) { void ProgramMemory::insert(const ProgramMemory &pm)
{
for (auto&& p:pm.values) for (auto&& p:pm.values)
values.insert(p); values.insert(p);
} }