857 Commits

Author SHA1 Message Date
Edoardo Prezioso
ff1cb241a8 Remove some redundant semicolons - part 1 2011-12-02 22:39:33 +01:00
Edoardo Prezioso
767413adad 1)internal check found a 'findmatch' with simple string argument;
2)Style: uniform 'while (...)' when inside it there's an assignment;
3)Replace '0' with 'NULL' where there's comparison with a pointer.
2011-12-01 12:04:47 +01:00
Edoardo Prezioso
1084e4bece 1) Shut up GCC compiler for 'missing braces around assignment';
2) Tokenizer::simplifyGoto: Code refactoring in order to skip code inside '()|[]' parentheses without counting.
2011-11-30 20:58:39 +01:00
PKEuS
6b6f780057 code cleanups and refactorings 2011-11-26 21:02:04 +01:00
Marek Zmysłowski
3ae96600b5 Fixed #3212 (Simplify the double pointer cast) 2011-11-25 07:23:54 +01:00
Thomas Jarosch
5025d1019f Use Token::simpleMatch instead of Token::Match
"--enable=internal" reported:
[lib/tokenize.cpp:3563]: (warning) Found simple pattern inside Token::Match() call: ") ;"
2011-11-24 10:11:45 +01:00
Daniel Marjamäki
17f891ad34 Tokenizer::setVarId: Fixed problem with class declarations with inheritance. skip them. 2011-11-21 21:18:56 +01:00
Daniel Marjamäki
9aa8a49677 Tokenizer::setVarId: fixed 'using' bug 2011-11-21 18:04:42 +01:00
Daniel Marjamäki
004dcf834b Fixed #3281 (Tokenizer::simplifyKnownVariables : static constant value is not used) 2011-11-20 21:50:26 +01:00
Edoardo Prezioso
6889a28d31 1) Run runastyle;
2) Clarify some comments in 'Tokenizer::simplifyFlowControl' and in 'Tokenizer::eraseDeadCode';
3) Add some 'const' variables inside 'Tokenizer::eraseDeadCode'.
2011-11-20 19:06:55 +01:00
Edoardo Prezioso
d0d5a2fcd8 Completed ticket #3230 (Refactoring: add function to remove tokens when a label is found.) and fixed ticket #3264 (False positive: Variable is assigned a value that is never used). 2011-11-20 18:37:00 +01:00
Daniel Marjamäki
097637a66c Fixed #3316 (Cppcheck reporting internal errors - code compiles cleanly) 2011-11-20 16:22:21 +01:00
Edoardo Prezioso
42e369a4b4 Change every 'tokAt(..)->link()' to 'linkAt(..)'. 2011-11-20 14:24:27 +01:00
Daniel Marjamäki
1cf45a5cde Fixed #3280 (False positive: assigned value that is never used) 2011-11-20 12:09:07 +01:00
Daniel Marjamäki
8c091ff968 Fixed #3340 (Internal error. Token::Match called with varid 0... union is causing problems) 2011-11-20 08:13:28 +01:00
Thomas Jarosch
c317c8979c Run astyle 2011-11-14 09:21:42 +01:00
Edoardo Prezioso
2c64d299ca Change every 'tokAt(...)->str()' to 'strAt(...)'. 2011-11-13 13:10:59 +01:00
Edoardo Prezioso
b28a44dc3b Change: 'next()->next()'->'tokAt(2)', 'previous()->previous()'->'tokAt(-2)'. 2011-11-12 22:33:03 +01:00
Edoardo Prezioso
ed6a0e14c4 Add simplification of the consecutive braces before the end of 'tokenize()' function. 2011-11-12 16:59:20 +01:00
Edoardo Prezioso
5cbfbe31c1 Add removal of consecutive braces, i.e.: '{ { ... } }'->'{ ... }'.
Changed a little bit the dead code tests.
2011-11-12 12:07:10 +01:00
Daniel Marjamäki
5a35beebf7 added todo comment 2011-11-11 11:07:03 +01:00
Daniel Marjamäki
34e40502c6 Fixed #3314 (cppcheck incorrectly reporting Syntax error.) 2011-11-11 10:53:49 +01:00
Richard Quirk
f56aa19fac Fix varid 0 with function pointer and virtual methods 2011-11-09 21:07:55 +01:00
Daniel Marjamäki
2d00cabee1 Fixed #3279 (Token::Match called with varid 0) 2011-11-09 18:49:17 +01:00
Edoardo Prezioso
0569953753 Fixed ticket #3309 (false positive: (style) Boolean result is used in bitwise operation. Clarify expression with parentheses) 2011-11-08 22:48:14 +01:00
Edoardo Prezioso
3cc9a333c9 Fixed tokenizer: don't change '*(str+num)' if '*' means a product with a previous variable or number.
Ditto for '&str[num]' (still commented).
2011-11-08 18:14:43 +01:00
Edoardo Prezioso
a546fc6e9d Fixed ticket #3310 (segmentation fault of cppcheck) 2011-11-08 17:37:24 +01:00
Edoardo Prezioso
aaa77c4709 Improve tokenizer: remove more redundant parenthesis and add a prototype code for: '&str[num]'=>'(str+num)' with reporting non obvious test failures. 2011-11-07 23:40:06 +01:00
Edoardo Prezioso
6e2f2816de Improve same expression check: remove '%op%' pattern and add ',' for the same expressions as an argument inside a function.
Improve compound assignment simplification: use already defined 'isAssignmentOp' and extend the adding parenthesis to a generic operator, not only to the arithmetical ones. See: http://en.cppreference.com/w/cpp/language/operator_precedence
2011-11-06 14:35:53 +01:00
Daniel Marjamäki
5edf153602 Fixed #3294 (Token::Match multi compare false negative) 2011-11-05 19:24:21 +01:00
Daniel Marjamaki
b96ab6ba26 Fixed #3188 (Function parser false positive) 2011-11-05 12:23:05 +01:00
Daniel Marjamäki
085a6285fa Fixed #3117 (Tokenizer::simplifyKnownVariables : Don't simplify static variable that is changed) 2011-11-05 08:30:11 +01:00
Daniel Marjamäki
9b8ffe7219 Fixed #3248 (Tokenizer: better handling of char constants that are compared with numeric constants) 2011-11-03 20:03:31 +01:00
Daniel Marjamaki
b6b5416b42 Tokenizer: Fixed failed unit test 2011-11-02 20:42:38 +01:00
Daniel Marjamaki
0884204c2f Fixed #3279 (Token::Match called with varid 0) 2011-11-02 18:31:13 +01:00
Daniel Marjamaki
937a4497ca Fixed #3272 (Internal error) 2011-11-01 18:03:32 +01:00
Edoardo Prezioso
9dd3360cd6 Fix some complainted choices made in my older commits.
Note: probably you should do 'make clean' before using 'make' to rebuild it again. Maybe it's me but 'make' reports various errors when linking.
2011-11-01 13:23:47 +01:00
Daniel Marjamäki
a7f27a83a7 Fixed #3271 (Regression: something related to symbol database / varid) 2011-10-31 18:33:15 +01:00
Edoardo Prezioso
ba5909ef1d General code tweaking, nothing strange. 2011-10-31 02:24:59 +01:00
Edoardo Prezioso
433f4640a9 Fix some GCC warnings regarding the sign conversion. 2011-10-30 18:34:49 +01:00
Edoardo Prezioso
42fd4e2f52 Tokenizer: Change 'var++|--;' into '++|--var;' and remove redundant 'tokAt(0)'. 2011-10-29 22:25:49 +02:00
Daniel Marjamäki
92333b585a Fixed #3092 (Tokenizer::setVarId : shadow variable in member function gets the wrong varid) 2011-10-29 21:25:58 +02:00
Daniel Marjamäki
a809bb3471 astyle formatting 2011-10-29 19:51:11 +02:00
Daniel Marjamäki
acaa9c456f Fixed #3152 (Tokenizer: template constructor is removed) 2011-10-29 19:45:47 +02:00
Daniel Marjamäki
8f49eb6a7e Tokenizer: Make sure that friend classes don't get varid. Ticket: #2962 2011-10-29 18:22:58 +02:00
Edoardo Prezioso
5d868766c7 Tokenizer time improvements (time says real: -1 second)
1)change tokAt(1|-1) with next()|previous() with conditions where necessary;
2)change strAt(1|-1) with next()|previous()->str() with conditions where necessary;
3)change tokAt(n)->str(), with n != -1,1, to strat(n);
4)change simplifyFuncInWhile implementation because it was too slow and stupid.
2011-10-29 01:57:53 +02:00
Edoardo Prezioso
dd719b41bf Definitely check correctly 'sizeof %num%' when '%num%' has '-' sign. 2011-10-29 00:11:38 +02:00
Thomas Jarosch
ef8f49bbf3 Use new findsimplematch API for simple patterns 2011-10-28 12:49:03 +02:00
Edoardo Prezioso
bab740289c Complete todo: convert 'for' into 'while'.
It's not possible to enable this code because of the disaster it will be created for all the checks with the 'for' pattern.
2011-10-28 00:50:54 +02:00
PKEuS
49fd057e17 Tokenizer: Simplify 'foo(void)' to 'foo()' 2011-10-27 19:56:59 +02:00