From 71ee625aab4b28e21dd017e5a843002311652638 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 14 Mar 2014 09:33:20 +0100 Subject: [PATCH] MathLib: replaced isHexDigit function by isxdigit. --- lib/mathlib.cpp | 11 ++--------- lib/mathlib.h | 7 ------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/mathlib.cpp b/lib/mathlib.cpp index 91505552d..a7b6e11d0 100644 --- a/lib/mathlib.cpp +++ b/lib/mathlib.cpp @@ -240,13 +240,13 @@ bool MathLib::isHex(const std::string& s) return false; break; case DIGIT: - if (isHexDigit(*it)) + if (isxdigit(*it)) state = DIGITS; else return false; break; case DIGITS: - if (isHexDigit(*it)) + if (isxdigit(*it)) state = DIGITS; else if (*it == 'u' || *it == 'U') state = SUFFIX_U; @@ -294,13 +294,6 @@ bool MathLib::isHex(const std::string& s) || (state == SUFFIX_ULL) || (state == SUFFIX_LLU); } -bool MathLib::isHexDigit(char c) -{ - return (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9' - || c == 'A' || c == 'B' || c == 'C' || c == 'D' || c == 'E' || c == 'F' - || c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f'); -} - /*! \brief Does the string represent a binary number? * In case leading or trailing white space is provided, the function * returns false. diff --git a/lib/mathlib.h b/lib/mathlib.h index 94729daa0..708cff03b 100644 --- a/lib/mathlib.h +++ b/lib/mathlib.h @@ -74,13 +74,6 @@ public: * @return true if given character is octal digit. */ static bool isOctalDigit(char c); - - /** - * Return true if given character is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. - * @param c The character to check - * @return true if given character is hex digit. - */ - static bool isHexDigit(char c); }; template<> CPPCHECKLIB std::string MathLib::toString(double value); // Declare specialization to avoid linker problems