Merge pull request #277 from Dmitry-Me/getridofassertinisdigit

Get rid of assert in isdigit
This commit is contained in:
Daniel Marjamäki 2014-03-27 17:18:06 +01:00
commit ab25741fee
3 changed files with 12 additions and 1 deletions

View File

@ -108,6 +108,11 @@ void CheckOther::checkZeroDivision()
*/ */
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
// MS Visual C++ memory leak debug tracing
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag( _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ) | _CRTDBG_LEAK_CHECK_DF);
#endif
CppCheckExecutor exec; CppCheckExecutor exec;
#ifdef _WIN32 #ifdef _WIN32
char exename[1024] = {0}; char exename[1024] = {0};

View File

@ -13,4 +13,10 @@
# define CPPCHECKLIB # define CPPCHECKLIB
#endif #endif
// MS Visual C++ memory leak debug tracing
#if defined(_MSC_VER) && defined(_DEBUG)
# define _CRTDBG_MAP_ALLOC
# include <crtdbg.h>
#endif
#endif // configH #endif // configH

View File

@ -76,7 +76,7 @@ void Token::update_property_info()
_type = eVariable; _type = eVariable;
else if (_type != eVariable && _type != eFunction && _type != eType) else if (_type != eVariable && _type != eFunction && _type != eType)
_type = eName; _type = eName;
} else if (std::isdigit(_str[0]) || (_str.length() > 1 && _str[0] == '-' && std::isdigit((unsigned char)_str[1]))) } else if (std::isdigit((unsigned char)_str[0]) || (_str.length() > 1 && _str[0] == '-' && std::isdigit((unsigned char)_str[1])))
_type = eNumber; _type = eNumber;
else if (_str.length() > 1 && _str[0] == '"' && _str[_str.length()-1] == '"') else if (_str.length() > 1 && _str[0] == '"' && _str[_str.length()-1] == '"')
_type = eString; _type = eString;