astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2019-09-20 15:07:27 +02:00
parent ad8abdb0c3
commit 049f6475ee
3 changed files with 25 additions and 30 deletions

View File

@ -37,20 +37,18 @@ class TokenList;
class Variable;
namespace ValueFlow {
struct increment {
template <class T>
void operator()(T& x) const
{
x++;
}
};
struct decrement {
template <class T>
void operator()(T& x) const
{
x--;
}
};
struct increment {
template <class T>
void operator()(T& x) const {
x++;
}
};
struct decrement {
template <class T>
void operator()(T& x) const {
x--;
}
};
class CPPCHECKLIB Value {
public:
typedef std::pair<const Token *, std::string> ErrorPathItem;
@ -115,8 +113,7 @@ struct decrement {
}
template <class F>
void visitValue(F f)
{
void visitValue(F f) {
switch (valueType) {
case ValueType::INT:
case ValueType::BUFFER_SIZE:
@ -153,16 +150,14 @@ struct decrement {
return !(*this == rhs);
}
void decreaseRange()
{
void decreaseRange() {
if (bound == Bound::Lower)
visitValue(increment{});
else if (bound == Bound::Upper)
visitValue(decrement{});
}
void invertRange()
{
void invertRange() {
if (bound == Bound::Lower)
bound = Bound::Upper;
else if (bound == Bound::Upper)
@ -291,9 +286,13 @@ struct decrement {
return valueKind == ValueKind::Possible;
}
bool isImpossible() const { return valueKind == ValueKind::Impossible; }
bool isImpossible() const {
return valueKind == ValueKind::Impossible;
}
void setImpossible() { valueKind = ValueKind::Impossible; }
void setImpossible() {
valueKind = ValueKind::Impossible;
}
void setInconclusive(bool inconclusive = true) {
if (inconclusive)

View File

@ -1443,8 +1443,7 @@ private:
ASSERT_EQUALS("", errout.str());
}
void nullpointer37()
{
void nullpointer37() {
check("void f(int value, char *string) {\n"
" char *ptr1 = NULL, *ptr2 = NULL;\n"
" unsigned long count = 0;\n"
@ -1463,8 +1462,7 @@ private:
ASSERT_EQUALS("", errout.str());
}
void nullpointer38()
{
void nullpointer38() {
check("void f(int * x) {\n"
" std::vector<int*> v;\n"
" if (x) {\n"
@ -2143,8 +2141,7 @@ private:
ASSERT_EQUALS("", errout.str());
}
void nullpointerSubFunction()
{
void nullpointerSubFunction() {
check("void g(int* x) { *x; }\n"
"void f(int* x) {\n"
" if (x)\n"

View File

@ -3716,8 +3716,7 @@ private:
return "";
}
static std::string isImpossibleContainerSizeValue(const std::list<ValueFlow::Value>& values, MathLib::bigint i)
{
static std::string isImpossibleContainerSizeValue(const std::list<ValueFlow::Value>& values, MathLib::bigint i) {
if (values.size() != 1)
return "values.size():" + std::to_string(values.size());
if (!values.front().isContainerSizeValue())