Skip to content

Commit 59cccb8

Browse files
committed
Reimplemented version.h:
- Use macros to form version number and string. CPPCHECK_MAJOR, CPPCHECK_MINOR and CPPCHECK_DEVMINOR now contain the parts of the version number. - "dev" status is now detected by comparison of CPPCHECK_MINOR and CPPCHECK_DEVMINOR, version string created accordingly. Fixed two comments.
1 parent 4c18967 commit 59cccb8

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

cli/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void CheckOther::checkZeroDivision()
8686
* - Macros are expanded
8787
* -# Tokenize the file (see Tokenizer)
8888
* -# Run the runChecks of all check classes.
89-
* -# Simplify the tokenlist (Tokenizer::simplifyTokenList)
89+
* -# Simplify the tokenlist (Tokenizer::simplifyTokenList2)
9090
* -# Run the runSimplifiedChecks of all check classes
9191
*
9292
* When errors are found, they are reported back to the CppCheckExecutor through the ErrorLogger interface

lib/tokenize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ class CPPCHECKLIB Tokenizer {
585585

586586
/**
587587
* assert that tokens are ok - used during debugging for example
588-
* to catch problems in simplifyTokenList.
588+
* to catch problems in simplifyTokenList1/2.
589589
*/
590590
void validate() const;
591591

lib/version.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
#define CPPCHECK_VERSION_STRING "1.67 dev"
2-
#define CPPCHECK_VERSION 1,66,99,0
1+
#define CPPCHECK_MAJOR 1
2+
#define CPPCHECK_MINOR 66
3+
#define CPPCHECK_DEVMINOR 67
4+
5+
#define STRINGIFY(VER) #VER
6+
#if CPPCHECK_MINOR == CPPCHECK_DEVMINOR
7+
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR)
8+
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,0,0
9+
#else
10+
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR) " dev"
11+
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,99,0
12+
#endif
313
#define LEGALCOPYRIGHT L"Copyright (C) 2007-2014 Daniel Marjam\x00E4ki and Cppcheck team."

0 commit comments

Comments
 (0)