Commit Graph

1198 Commits

Author SHA1 Message Date
Edoardo Prezioso 5d6a257c86 Fixed #3770 (Segmentation fault in K&R function parameters simplification) 2012-04-29 12:58:52 +02:00
Daniel Marjamäki df6f88b4fe Fixed #3755 (Tokenizer::setVarId: improve varid inside class for struct/class variables) 2012-04-26 18:38:47 +02:00
PKEuS 1e708e10d0 Fixed #2875 2012-04-26 10:35:40 +02:00
Daniel Marjamäki f84a4344ae Fixed #3754 (Tokenizer::simplifyKnownVariables: wrong for loop simplification) 2012-04-25 19:23:17 +02:00
Edoardo Prezioso 08ae15e42d Fixed the grammar in some reportError messages in the Tokenizer class, thanks to kimmov's suggestion. 2012-04-25 15:09:46 +02:00
PKEuS dd5e9aa454 Make use of recently implemented Token::type() functionality 2012-04-25 09:56:07 +02:00
PKEuS e0a3ca0845 Refactorizations in class Token: changed handling of different types of tokens.
- Replace _isNumber, _isName, _isBoolean attributes by a single _type attribute (enum Token::Type), because not two of the old booleans could be true at the same time.
-> Add support for lots of different other kinds of tokens. (More precise checking of token type possible)
-> Replaced instant checking of type for Operators, etc. by a value calculated at creation time. (Faster checking)
2012-04-23 21:05:26 +02:00
PKEuS 8cbed66089 Changed relationship between templatesimplifier and tokenizer:
- Pass a tokenizer to templatesimplifier to reduce code duplication (Make use of Tokenizer::reportError; remove redundant TemplateSimplifier::addtoken2) and amount of arguments passed to functions

Removed ctor and dtor implementation from TemplateSimplifier: This class shouldn't be instanciated.
2012-04-23 20:45:36 +02:00
Daniel Marjamäki 6ae135124e Tokenizer::setVarId: better handling of initializer lists 2012-04-23 18:26:27 +02:00
Daniel Marjamäki 706631f527 Fixed #3748 (False positive out of bounds with postincrement) 2012-04-22 12:22:49 +02:00
Daniel Marjamäki d5f6cfcfa8 Tokenizer: Use new setVarId function. Removed the old one. 2012-04-22 11:36:31 +02:00
PKEuS 3d2b5a30fe Implemented generic reportError functions in tokenizer (similar to Check::reportError) to reduce code duplication 2012-04-22 11:28:46 +02:00
Daniel Marjamäki 8c8c9d5e5b Tokenizer::setVarIdNew: don't treat '(sizeof *p)' as a variable declaration 2012-04-22 11:06:56 +02:00
Daniel Marjamäki d63093d9bb Tokenizer::setVarIdNew: Fixed issue found through TestUnusedVar tests 2012-04-22 10:59:58 +02:00
Daniel Marjamäki 871823e9c6 Tokenizer::setVarId: fixed problem for classes with inheritance 2012-04-22 10:38:06 +02:00
Daniel Marjamäki e39b7f1bfd Tokenizer::setVarIdNew: Fixed TestTokenizer::varid38 2012-04-22 10:24:19 +02:00
Daniel Marjamäki e745d971c8 Tokenizer::setVarIdNew: Fixed test case TestTokenizer::varid27 2012-04-22 10:19:29 +02:00
Daniel Marjamäki b4ffb5e0cf Tokenizer::setVarIdNew: Fixed TestTokenizer::varid39 test case 2012-04-22 09:51:00 +02:00
Daniel Marjamäki ed6673a9aa Tokenizer::setVarIdNew: Fixed TestTokenizer::varid44 2012-04-22 09:18:27 +02:00
Daniel Marjamäki 71050bc586 Tokenizer::setVarIdNew: fixed TestTokenizer::varid_in_class2 test case 2012-04-22 08:51:19 +02:00
Edoardo Prezioso be5a61b794 Fixed ticket #3721 (false positive: syntax error on valid C code ( K&R function style )). 2012-04-22 01:56:40 +02:00
Daniel Marjamäki 6d9b4a8032 Tokenizer::setVarIdNew: Fixed TestTokenizer::varid_operator test case 2012-04-21 19:29:24 +02:00
Daniel Marjamäki 1cc256339c Tokenizer::setVarIdNew: Fixed TestTokenizer::varid19 test case 2012-04-21 18:22:18 +02:00
Daniel Marjamäki 42a95c9202 Tokenizer::setVarIdNew: Fixed segfault when using new setVarId on invalid code 2012-04-21 18:02:26 +02:00
Daniel Marjamäki bd60dd46d0 Tokenizer::setVarIdNew: handle special case when there is an unknown macro. Ticket #2638 2012-04-21 17:57:20 +02:00
Daniel Marjamäki b86295fbcd Tokenizer::setVarIdNew: Improved C++ handling. All the TestTokenizer::varidclass?? tests pass now. 2012-04-21 17:25:44 +02:00
Daniel Marjamäki 6071a5afc3 Tokenizer::setVarIdNew: Fixed varidclass9 2012-04-21 13:39:43 +02:00
Daniel Marjamäki 85b470c41b Tokenizer::setVarIdNew: Better C++ handling (varidclass5 and varidclass13) 2012-04-21 13:11:30 +02:00
Daniel Marjamäki 1492d8990f Tokenizer::setVarId: better C++ handling 2012-04-19 20:58:52 +02:00
PKEuS 6a37c36ee8 Fixed #3741
Removed redundant nullpointer check (cppcheck catch)
2012-04-18 16:35:04 +02:00
PKEuS cb064dc20e Implemented generic mechanism for '<'-'>' "linkage" before link() works (Taken from Scope::findClosingBracket, but C++11 right angle bracket support added): Token::findClosingBracket
-> Replaced several indendation-counting mechanisms in tokenize.cpp

Fixed build failure in checkclass.cpp
2012-04-18 16:02:03 +02:00
Daniel Marjamäki bb4184ca03 Tokenizer::setVarIdNew: better handling of class variables 2012-04-17 19:06:00 +02:00
Ettl Martin 09d41b2f84 ticket 2669: added todo testcase 2012-04-17 00:31:32 +02:00
PKEuS bac8ed7127 Refactorized stringification of tokens:
- Function that stringifies one token: Token::stringify()
- Functions that stringify a list of tokens: Token::stringifyList()
-- Single and powerful "base" function, used by several "light" functions
Refactorized
- testtokenize.cpp and testsimplifytokens.cpp: Use improved stringification functions instead of several local implementations
- Avoided redundand creation of std::string when using TestTokenizer::tokenizeAndStringify and in cmdlineparser.cpp
2012-04-16 19:51:07 +02:00
Daniel Marjamäki 5ad1840120 Tokenizer::setVarIdNew: Copied code from Tokenizer::setVarIdOld that sets varid in member functions 2012-04-16 19:48:58 +02:00
PKEuS 1c3c94dc67 New simplification: Remove 'extern "C"' from C++ code.
Refactorization in cppcheck.cpp: Catch exception as const reference instead of non-const reference.
2012-04-16 16:25:04 +02:00
PKEuS 66d947675f Refactorizations in tokenize.cpp:
- Removed a few indendation counters
- Removed unnecessary pattern "- >" because this code is simplified to "." before.
- Generalized pattern of simplifyFunctionReturn()
- Simplified removeExeptionSpecification, no longer recursive (-> #3385)
2012-04-16 10:49:09 +02:00
Daniel Marjamäki 8f866c6e4c Tokenizer::setVarIdNew: handle c++ keyword 'using' 2012-04-15 18:29:35 +02:00
Daniel Marjamäki c58d02f146 Tokenizer::setVarIdNew: in C code, allow that variable declaration starts with delete and throw 2012-04-15 18:23:12 +02:00
Daniel Marjamäki b0dc708b4d Tokenizer::setVarIdNew: variable declarations dont start with NOT/goto/return/delete/etc 2012-04-15 18:02:49 +02:00
Daniel Marjamäki 46bfe27831 Tokenizer::setVarIdNew: Better handling of function calls 2012-04-15 17:44:51 +02:00
Daniel Marjamäki 31f8a71f84 Tokenizer::setVarIdNew: Better handling for catch-exception-by-reference 2012-04-15 17:39:22 +02:00
Daniel Marjamäki 3c1dfc658c Tokenizer::setVarIdNew: use the new setVarId with a few more test cases. Improved setVarId: references in executable scopes must be initialized. 2012-04-15 14:32:47 +02:00
Daniel Marjamäki 27c37896a0 Tokenizer::setVarIdNew : use new setVarId function in TestTokenizer::varidReturn2. 2012-04-15 14:19:17 +02:00
Daniel Marjamäki 95dafd30dd Tokenizer::setVarIdNew : enable more testcases. better handling of unions and struct members. 2012-04-15 13:42:13 +02:00
Daniel Marjamäki 7669abb170 Tokenizer::setVarId : Starting to rewrite Tokenizer::setVarId. The purpose of the rewrite is to make this function faster. 2012-04-15 11:47:22 +02:00
Edoardo Prezioso 51789d8e20 Fixed ticket #3712 (false positive: syntax error on valid C code ( K&R function style )) 2012-04-13 00:39:40 +02:00
Daniel Marjamäki 23c71daf37 astyle formatting 2012-04-10 13:45:56 +02:00
Daniel Marjamäki c7093ca5d6 Tokenizer: allow that time is measured for certain slow simplifications 2012-04-10 13:45:34 +02:00
Daniel Marjamäki 6bae724cb6 Fixed #3705 (cppcheck crash (null pointer exception)) 2012-04-09 15:06:06 +02:00
Daniel Marjamäki bbdeebafda Fixed #3700 (false positive: (style) Variable 'H' is not assigned a value) 2012-04-09 12:55:26 +02:00
PKEuS 25167b58a9 Implemented #2990: Print relative paths if -rp or --relative-paths is given 2012-04-06 10:49:21 +02:00
Daniel Marjamäki 823fc9ac04 Fixed #3650 (Variable declaration: Doesn't handle template usage well) 2012-04-05 08:53:10 +02:00
Edoardo Prezioso b90d9c8a19 Make 'const' the new variable 'funcName'. 2012-04-03 22:51:56 +02:00
Edoardo Prezioso ecc5dea113 Fixed ticket #3703 (false positive: syntax error on valid C-code ( K&R - style )). 2012-04-03 20:12:34 +02:00
Edoardo Prezioso 5d91ef76fe Fixed ticket #3701 (false positive: syntax error on valid C code ( K&R function style ). 2012-04-03 19:49:58 +02:00
Edoardo Prezioso af02908d42 Fixed ticket #3580 (syntax error in multi variable declaration header). 2012-03-31 18:45:29 +02:00
Daniel Marjamäki 1309825bf1 Merge pull request #91 from HeisSpiter/e46c7eb32033b520374e9df8c13bc8589c0602d0
Handle Rtl memory functions in Tokenizer::simplifyMicrosoftMemoryFunctions()
2012-03-28 09:43:14 -07:00
Pierre Schweitzer e46c7eb320 Add the RTL memory functions for the simplifications on Windows code. 2012-03-27 21:24:46 +02:00
Daniel Marjamäki 01ddfb6f80 Fixed #3534 (Broken support for dollar signs in identifiers) 2012-03-27 19:35:41 +02:00
Daniel Marjamäki c07044b3d3 Fixed #3573 (Preprocessor: handle '!(X)' the same as '!X') 2012-03-26 19:01:45 +02:00
August Sodora fe9d491aae 3619 Check that tok2->next() exists before using 2012-03-25 10:24:29 +02:00
PKEuS 002389f836 Fixed #3677
Added forgotten testcase for #3672
2012-03-21 18:40:32 +01:00
Daniel Marjamäki a2351ba44f Fixed #3648 (Internal error: Token::Match called with varid 0) 2012-03-20 19:05:24 +01:00
Daniel Marjamäki d6c8de104c Revert "Fixed #3648 (Internal error: Token::Match called with varid 0)"
This reverts commit 1fa1ddccba.
2012-03-20 19:00:16 +01:00
Daniel Marjamäki 1fa1ddccba Fixed #3648 (Internal error: Token::Match called with varid 0) 2012-03-20 18:58:27 +01:00
PKEuS cb2a754983 Implemented support for C++11 right angle brackets (>>)
Implemented support for linkage between < and > (Information: It is possible that under certain circumstances comparision operators are linked, since its sometimes difficult to separate between them.)
2012-03-19 18:45:47 +01:00
PKEuS 7055526f4a Fixed #3672: bitwise and operator in if/while does no longer confuse setVarId code
Improvements to CheckUnusedVar:
- Improved handling of arrays of struct/class instances
- Differ between addressof and bitwise-and operator
- Made some members private to improve encapsulation
- Replaced some simple patterns by direct function calls
- Removed an unnecessary condition
2012-03-19 17:41:16 +01:00
PKEuS 3af32b0da2 Refactorizations in tokenizer:
- getSourceFilePath returns a const reference now
- Replaced some simple patterns by string comparisions/direct function calls
- Replaced a few indendation counters by easier code
- Replaced one offset variable by token pointer to avoid subsequent calls to tokAt with the same number
2012-03-17 11:48:40 +01:00
Daniel Marjamäki 555e8c6efc Fixed #36221 (Input streams: Wrong token list simplification) 2012-03-15 19:09:36 +01:00
Daniel Marjamäki a9d56f2738 Tokenizer: simplify known variable value inside conditional block 2012-03-12 17:32:30 +01:00
Daniel Marjamäki 680883a6a7 fixed #3649 (False Positive: Uninitialized variable using operator assignment) 2012-03-06 18:51:50 +01:00
Daniel Marjamäki 527d3791e6 Fixed #3596 (memory leak false positive on libedit sources) 2012-02-27 18:55:36 +01:00
PKEuS 1747813a8b Added check for invalid pointer casts (#1255)
Detect sign extension problems when variable is a reference (#3637)
Refactorizations:
- Tokenizer::getFiles returns a reference instead of a pointer, because its guaranteed that no nullpointer is returned
- Remove signed/unsigned in one step for "%type% signed|unsigned"
- Fixed recently introduced compiler warning in symboldatabase.cpp
2012-02-26 11:56:32 +01:00
Edoardo Prezioso 4d3013d43d Improve 'Tokenizer::elseif' code in order to not touch 'else if' inside a macro parenthesis. 2012-02-26 02:50:48 +01:00
PKEuS 9431fb1b7e Improved STL checks:
- Added performance checking for .c_str() for return values and function parameters (#1079)
- Added more containers (basic_string, C++11 containers) and more functions to checking (.at, .resize, .reserve, ...)
- Make use of symboldatabase in missingComparision check
2012-02-25 12:43:27 +01:00
Daniel Marjamäki 39b0f1ba95 Fixed #3608 (unreadVariable when variable used in inline assembly) 2012-02-19 16:04:35 +01:00
PKEuS b1ff900aaa Some refactorizations 2012-02-18 23:43:51 +01:00
Edoardo Prezioso d7a918e549 Fixed ticket #3616 (segmentation fault of cppcheck). 2012-02-18 17:58:50 +01:00
Daniel Marjamäki a118f82ca7 Tokenizer::simplifyVarDecl: Don't simplify inside parenhteses 2012-02-18 15:05:29 +01:00
Daniel Marjamäki 0705dbd34a Tokenizer::simplifyCasts: don't simplify 'f((double)(v1)*v2)' to 'f(*v2)' 2012-02-18 14:26:00 +01:00
Edoardo Prezioso 17cd5ec906 Fixed ticket #3604 (cppcheck(1.53) crash). 2012-02-17 21:14:38 +01:00
PKEuS 485e836535 Refactorizations in MathLib.
Fixed recently introduced bug on floating point numbers with multiple preceding zeros (for example 004.123)
2012-02-17 19:54:53 +01:00
PKEuS 8ea5df62c4 - Improved support for numbers in code:
-- Use MathLib::toLongNumber for conversion in tokenizer (Fix #3610)
-- Handle octal numbers in tokenizer
- Refactorizations in MathLib::toLongNumber and Settings
2012-02-17 15:47:08 +01:00
Ettl Martin d8c24c3afc fixed wrong spelled word. 2012-02-15 22:57:20 +01:00
PKEuS bb319c1c96 Improved Tokens and Tokenizer:
- Better handling of deleteThis() as last element of token list
- Code simplified
2012-02-13 17:44:08 +01:00
Daniel Marjamäki da8abeb63c Fixed #3584 (2 internal errors : Token::Match called with varid 0) 2012-02-12 17:30:47 +01:00
Daniel Marjamäki bbb707c460 Fixed #3587 (Wrong tokenizer simplification - variable assigned by operator>>) 2012-02-07 08:05:50 +01:00
Daniel Marjamäki 2be85e9d37 Fixed #3538 (false positive caused by bad tokenizer simplification) 2012-02-01 21:13:26 +01:00
Edoardo Prezioso f9ade9562c Fixed ticket #3572 (segmentation fault). 2012-01-31 22:32:28 +01:00
Edoardo Prezioso 66e1761ffe Fixed ticket #3571 (segmentation fault of cppcheck while scanning gcc-testsuite). 2012-01-31 18:42:19 +01:00
Edoardo Prezioso 9f81b48dc1 Fixed ticket #3558 (Tokenizer: improve simplifyVarDecl to take count of undefined size VLA's). 2012-01-30 23:41:43 +01:00
Edoardo Prezioso 0fd7504295 Related to ticket #3560 (conditional pointer user): remove also dead code in the lower scope if the actual scope isn't special. 2012-01-30 21:43:23 +01:00
Edoardo Prezioso 11e724df46 Tokenizer::simplifyTypedef: some optimizations on new code. 2012-01-30 17:08:35 +01:00
Edoardo Prezioso 7cd36f44b6 Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': finished. 2012-01-30 16:38:04 +01:00
Edoardo Prezioso 67d095a10e Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 16:20:15 +01:00
Edoardo Prezioso 7c596a2b90 Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 16:18:42 +01:00
Edoardo Prezioso 187c463475 Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 16:17:57 +01:00
Edoardo Prezioso b366bf69ad Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 16:16:08 +01:00
Edoardo Prezioso fa077ede94 Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 15:08:01 +01:00
Edoardo Prezioso 9438d1c2d0 Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 15:04:41 +01:00
Edoardo Prezioso fe3fd1a073 Tokenizer::simplifyTypedef: redundant assignment to 'offset'. 2012-01-30 13:33:27 +01:00
Edoardo Prezioso 5a1585dcfb Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress.. 2012-01-30 13:24:31 +01:00
Edoardo Prezioso d9e9c0aceb Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': in progress.. 2012-01-30 13:15:25 +01:00
Edoardo Prezioso 017f0090fa Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': begin conversion. 2012-01-30 13:10:50 +01:00
Edoardo Prezioso e530d770e1 Tokenizer::simplifyTypedef: to be sure there are no problems, promote to 'int' the variable 'offset'. 2012-01-30 13:04:10 +01:00
Edoardo Prezioso a93af0dba6 Tokenizer:: Use 'link' instead of 'parens' variable. 2012-01-30 12:22:37 +01:00
Daniel Marjamäki 9df6088ddd Revert "really fix #3527 (Internal error. Token::Match called with varid 0. Please report this to Cppcheck developers)"
This reverts commit a37031944e.

I don't want this hard coding of macro names. Feel free to come with a more generic solution if you want.
2012-01-30 06:15:41 +01:00
Robert Reif 415aaca6dd Merge branch 'master' of git://github.com/danmar/cppcheck 2012-01-28 20:59:51 -05:00
Robert Reif a37031944e really fix #3527 (Internal error. Token::Match called with varid 0. Please report this to Cppcheck developers) 2012-01-28 20:58:51 -05:00
Edoardo Prezioso fa77f98b1c Tokenizer: it's possible to set null lower bound for eraseDeadCode when used inside simplifyFlowControl.
Remove now unused 'beginindent' and moved 'goto' simplification together with 'return' group.
2012-01-28 21:37:30 +01:00
Edoardo Prezioso bb703f4d0b Fixed: (warning) Found simple pattern inside Token::Match() call. 2012-01-28 20:31:12 +01:00
Robert Reif 42afd2d63a fix #3561 (SymbolDatabase: throw foo; creates a variable with type throw) 2012-01-27 19:24:01 -05:00
Edoardo Prezioso 8289e2428d Tokenizer: Stylish change to condition. 2012-01-27 17:12:28 +01:00
Edoardo Prezioso 0dd4b9ad3a Temporary workaround to ticket #3459 (Simplify goto before loop) :
don't simplify code which contains the label pointed by 'goto'.
2012-01-27 16:56:12 +01:00
Edoardo Prezioso 6314d04a04 Tokenizer: Add 'BOOST_FOREACH' pattern where it was missing. 2012-01-27 16:47:26 +01:00
Edoardo Prezioso ca8e8d26c7 Tokenizer: extract realloc simplification and simplify also when each argument is done by more than one token.
Restyling of a comment in tokenize.h.
2012-01-27 13:56:06 +01:00
Edoardo Prezioso 421ae9df03 simplifyCondition: handle also '( a || true || b)' -> '(true)' and '( a && false && b)' -> '(false)'.
Clarify a comment about previous commit.
2012-01-26 23:14:44 +01:00
Edoardo Prezioso 0f1f3c0f5f Tokenizer::removeRedundantCondition: refactoring due to various reasons.
1) Remove the dead code with 'eraseDeadCode', not with 'eraseTokens' because of the possible presence of labels.
2) It's impossible that in tokenizer there is pattern like 'if (true|false) {code;} else if (cond) {code_cond;}' because the function 'Tokenizer::elseif' adds '{' between 'else' and 'if', hence a code path is redundant, so it's removed from code.
2012-01-26 22:32:11 +01:00
Edoardo Prezioso b6763313c5 Tokenizer::simplifyQuestionMark: use links instead of indentation level number. 2012-01-26 17:55:22 +01:00
Edoardo Prezioso 6e164ae7ed Fixed ticket #3557 (Tokenizer: simplification of '[]' doesn't work well):
extract undefined size array simplification and handle multiple arrays and combos between pointers and arrays, don't handle the definitions as arguments of function.
2012-01-26 17:25:52 +01:00
Edoardo Prezioso f428a29d8e Improve simplifyReturnStrncat when each argument is not composed by one token. 2012-01-26 16:09:32 +01:00
Edoardo Prezioso b6a0896ce6 Change 'simplifyReturn' to 'simplifyReturnStrncat' because it's not clear what this function does. 2012-01-26 11:49:08 +01:00
Edoardo Prezioso 5953ed7318 Fixed ticket #3528 (Tokenizer: improve simplifyFunctionParameters to take count of square brackets) 2012-01-23 16:10:15 +01:00
Daniel Marjamäki 9eb1a5864b Fixed #3502 (segmentation fault of cppcheck (struct{x y:};)) 2012-01-23 07:39:31 +01:00
PKEuS 36479499e7 - Solved FIXME: Made detection of code that is no pointer-dereference more robust, uncommented code (checknullpointer.cpp)
- Removed more indendation level counters
- Make use of symbol database more often
- Other refactorizations
2012-01-21 19:55:32 +01:00
Edoardo Prezioso b0dac2fa2e Tokenizer::copyTokens: add optional parameter which preserve the line number differences between tokens to be copied. 2012-01-21 17:18:16 +01:00
seb777 0be8af5214 Fix ticket #3530 (Add some windows data types to tokenizer) 2012-01-18 12:57:41 +01:00
Edoardo Prezioso 9019190a37 Tokenizer: various improvements to code. 2012-01-17 11:51:11 +01:00
Edoardo Prezioso 40739eb3fb Reverted some changes in commits 4b05c3e19f and 4b08b13845. 2012-01-16 11:44:31 +01:00
Edoardo Prezioso 4b05c3e19f Tokenizer::simplifyIfAddBraces: improve comments; handle independently 'a = { .. };'; reduce use of 'Token::(simple)Match' functions. 2012-01-15 19:53:11 +01:00
Edoardo Prezioso 4b08b13845 Tokenizer: reduce usage of Token::Match in some cases. 2012-01-15 15:00:52 +01:00
Edoardo Prezioso 963f6ce3ef Tokenizer: report syntaxError if there's nothing after 'if|for|while ()' and if there's nothing inside round brackets;
TestTokenizer: change test cases accordingly;
TestSimplifyTokens: ditto.
2012-01-15 14:50:01 +01:00
Robert Reif 6f3807d915 add some more windows types 2012-01-10 21:55:24 -05:00
Reijo Tomperi be7691c7b4 Refactoring: Move rest of the template simplification into TemplateSimplifier
simplifyCalculations() was temporarily moved into TemplateSimplifier also, it should be moved to a better place.
2012-01-09 21:33:11 +02:00
Reijo Tomperi 756b8762ab Catch InternalError by reference instead of creating a copy of it. 2012-01-09 18:30:36 +02:00
Edoardo Prezioso 2dd53ec966 Fixed ticket #3485 (segmentation fault of cppcheck ( {a:1;}; )) 2012-01-09 16:24:11 +01:00
Edoardo Prezioso 54f54761b4 Fixed ticket #3482 (segmentation fault of cppcheck ( switch(){case} )) 2012-01-09 14:37:20 +01:00
Reijo Tomperi 194327048a Add InternalError and change MathLib to throw it in case of an error.
- Previously MathLib errors did not provide a filename, but after this change at least source file name should be printed
and if token is provided, also line number should be printed.
- Change also Token to use InternalError
- Modify Cppcheck-class to catch InternalError instead of Token
- Run dmake to update Makefile
2012-01-08 22:19:44 +02:00
Reijo Tomperi 3c0ada52e6 Refactoring: Extract sizeof simplifying from template simplifying 2012-01-08 00:21:12 +02:00
Daniel Marjamäki a5264f6395 Symbol database: dump if --debug and --verbose is given 2012-01-07 08:21:34 +01:00
Reijo Tomperi 2a79399a53 astyle fix 2012-01-06 21:57:59 +02:00
Reijo Tomperi e91d239ea5 Refactor: Move file extension checks from Tokenizer to Path class. This has also functional change as now also file.JAVA is considered a Java file. 2012-01-06 21:56:28 +02:00
Reijo Tomperi eda04ad906 Refactoring: Move template code into templatesimplifier: simplifyTemplatesExpandTemplate() 2012-01-05 22:45:19 +02:00
Daniel Marjamäki 56a5e08f6b Use symbol database dump code written by Robert Reif. The symbol database is dumped if --debug is used. 2012-01-05 18:22:54 +01:00
Edoardo Prezioso a7029291fd Tokenizer::simplifyGoto: process also derived class/structs. 2012-01-04 17:08:53 +01:00
Edoardo Prezioso b0e4dc3ab8 Refactoring: replace forgotten code with function call 'simplifyRedundantConsecutiveBraces'. 2012-01-04 16:47:36 +01:00
Edoardo Prezioso 6f9cd110d0 Improve Tokenizer: improve 'simplifyDoublePlusAndDoubleMinus' when there are negative numbers. 2012-01-04 13:45:27 +01:00
Edoardo Prezioso 75fbe310ff Extract various functions inside the Tokenizer class and fix tokenization of 'return __LINE__ ;'. 2012-01-04 12:57:58 +01:00
Reijo Tomperi 0369681a2c Refactoring: Move template code into templatesimplifier: simplifyTemplatesGetTemplateNamePosition() 2012-01-03 23:49:50 +02:00