From a1d0defbc0e8012d100c3e90161ef14435f15a86 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Fri, 2 Apr 2010 21:42:06 +0300 Subject: [PATCH] astyle fix --- lib/checkother.cpp | 6 +++--- lib/mathlib.cpp | 10 +++++----- test/testmathlib.cpp | 8 ++++---- test/testother.cpp | 4 ++-- test/testsuite.h | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 155d0ea9d..78f77d164 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2474,9 +2474,9 @@ void CheckOther::checkMathFunctions() { mathfunctionCallError(tok); } - // acos( x ) x is defined for intervall [-1,+1], but not beyound - else if(Token::Match(tok, "acos ( %num% )") && - fabs(MathLib::toDoubleNumber(tok->tokAt(2)->str())) > 1.0) + // acos( x ) x is defined for intervall [-1,+1], but not beyound + else if (Token::Match(tok, "acos ( %num% )") && + fabs(MathLib::toDoubleNumber(tok->tokAt(2)->str())) > 1.0) { mathfunctionCallError(tok); } diff --git a/lib/mathlib.cpp b/lib/mathlib.cpp index 006e41a7e..18f055262 100644 --- a/lib/mathlib.cpp +++ b/lib/mathlib.cpp @@ -55,11 +55,11 @@ double MathLib::toDoubleNumber(const std::string &str) { return std::strtoul(str.c_str(), '\0', 16); } - // nullcheck - else if (str == "-0" || str == "-0.0" || str == "-0." - || str == "+0" || str == "+0.0" || str == "+0.") - return 0.0; - // otherwise, convert to double + // nullcheck + else if (str == "-0" || str == "-0.0" || str == "-0." + || str == "+0" || str == "+0.0" || str == "+0.") + return 0.0; + // otherwise, convert to double std::istringstream istr(str.c_str()); double ret; istr >> ret; diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index c59d75682..a682be854 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -116,9 +116,9 @@ private: ASSERT_EQUALS(100 , MathLib::toLongNumber("+10.0E+1")); ASSERT_EQUALS(-1 , MathLib::toLongNumber("-10.0E-1")); - // ----------------- - // to double number: - // ----------------- + // ----------------- + // to double number: + // ----------------- ASSERT_EQUALS(10.0 , MathLib::toDoubleNumber("10")); ASSERT_EQUALS(1000.0, MathLib::toDoubleNumber("10E+2")); ASSERT_EQUALS(100.0 , MathLib::toDoubleNumber("1.0E+2")); @@ -135,7 +135,7 @@ private: ASSERT_EQUALS(0.0 , MathLib::toDoubleNumber("+0.")); ASSERT_EQUALS(0.0 , MathLib::toDoubleNumber("-0.0")); ASSERT_EQUALS(0.0 , MathLib::toDoubleNumber("+0.0")); - + } void isint() diff --git a/test/testother.cpp b/test/testother.cpp index 229ad3c58..990bf3b02 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -2169,7 +2169,7 @@ private: void mathfunctionCall1() { - // log|log10 + // log|log10 check("void foo()\n" "{\n" " std::cout << log(-2) << std::endl;\n" @@ -2230,7 +2230,7 @@ private: "}"); TODO_ASSERT_EQUALS("", errout.str()); - // acos + // acos check("void foo()\n" "{\n" " std::cout << acos(1) << std::endl;\n" diff --git a/test/testsuite.h b/test/testsuite.h index 1eb5af95f..b872d15b9 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -43,9 +43,9 @@ protected: void assertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual); - // the vars expected and actual need to be of type double, in order to avoid overflow of unsigned int - // e.g: ASSERT_EQUALS(-100.0, MathLib::toDoubleNumber("-1.0E+2")); whould not work without this. - void assertEquals(const char *filename, int linenr, double expected, double actual); + // the vars expected and actual need to be of type double, in order to avoid overflow of unsigned int + // e.g: ASSERT_EQUALS(-100.0, MathLib::toDoubleNumber("-1.0E+2")); whould not work without this. + void assertEquals(const char *filename, int linenr, double expected, double actual); void todoAssertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual); void todoAssertEquals(const char *filename, int linenr, unsigned int expected, unsigned int actual);