Commit Graph

3985 Commits

Author SHA1 Message Date
Daniel Marjamäki 7acb04b44c Tokenizer: improved simplification of numeric calculations 2012-09-09 16:22:39 +02:00
PKEuS d44f10fc01 Fixed createLinks2() on this code: nvwa<(x > y)> 2012-09-09 15:31:23 +02:00
PKEuS a748678636 Removed redundant nullpointer checks in token.cpp 2012-09-09 14:34:07 +02:00
Daniel Marjamäki 511c5a62e7 Fixed #4141 (Crash when parsing divide by zero.) 2012-09-09 12:38:15 +02:00
Daniel Marjamäki 107b3b4401 Fixed #4171 (don't choke when parentheses are missing from macros) 2012-09-09 09:48:07 +02:00
Daniel Marjamäki 0c55d5cfa7 Fixed #4002 (syntax error for 'X( typedef, Y)') 2012-09-09 09:14:46 +02:00
Daniel Marjamäki 69a0062177 Tokenizer: don't crash for 'int'. Ralated with tickets #2978 and #3304 2012-09-08 20:59:25 +02:00
Daniel Marjamäki 853c6522dc Tokenizer::simplifyEnum: Readded refactorings. Tickets 3949,3950,4025,4053 has been solved as far as I see. 2012-09-08 12:42:24 +02:00
PKEuS 78d49ea4b8 Fixed #3732 - properly simplify struct declarations:
- Don't replace "{ {" if they are part of an initialization
- Properly split struct definition, variable declaration and variable initialization.

Used std::stack instead of std::list
2012-09-08 10:51:31 +02:00
Daniel Marjamäki a39b58046f Tokenizer: Improved simplification of 'a?(1):b' 2012-09-08 10:45:00 +02:00
Daniel Marjamäki 2722f53edd Fixed #4142 (false positive (error) Uninitialized variable: b) 2012-09-08 10:15:37 +02:00
Daniel Marjamäki 2ce5cb3075 Tokenizer: Simplified parentheses better in such pattern: 'git merge --squash 4142 operator git merge --squash 4142 (%var%|)) ( %num%|%bool% ) %op%|;|,|)' 2012-09-08 07:01:35 +02:00
Daniel Marjamäki 6b56b4a9d3 Show that inconclusive message is inconclusive 2012-09-07 16:11:15 +02:00
PKEuS e87ebcc602 Added support for std::unique and std::remove_if to CheckStl::uselessCalls(). 2012-09-07 14:23:32 +02:00
PKEuS a4b5824dec New internal check: checkRedundantNextPrevious().
Fixed findings by new internal check
2012-09-07 12:36:40 +02:00
PKEuS e4a693eaab Refactorizations:
- Fixed several findings of CheckInternal.
- Removed some debug code from CheckOther::checkRedundantAssignment().
2012-09-07 11:59:20 +02:00
PKEuS 489df29346 Moved Tokenizer::typeConstToConstType() to Tokenizer::simplifyConst() 2012-09-07 11:41:41 +02:00
Ettl Martin 9a375744a4 fixed a wrong spelled word in comments 2012-09-07 11:34:58 +02:00
PKEuS c2d4afc525 Support default arguments in symboldatabase for arguments without name (#4055) 2012-09-06 20:50:46 +02:00
PKEuS 0c812c5ac3 Throw an InternalError when trying to divide (or modulo) by zero in MathLib. 2012-09-06 20:15:32 +02:00
PKEuS 20f989b6c4 Skip code in brackets in default argument declaration (fixes #4057) 2012-09-06 20:02:53 +02:00
PKEuS 31e7e41098 Fixed and refactorized broken CheckNullPointer::CanFunctionAssignPointer():
- return true if parameter is passed by reference (fixes #4111)
- Use symboldatabase
- Improved handling of inconclusive
2012-09-06 18:33:15 +02:00
Edoardo Prezioso 097d0816d0 Fixed #4150 (new ineffective statement check warning wrong). 2012-09-06 17:48:30 +02:00
PKEuS e2bc381550 Don't shift by a negative value in TemplateSimplifier::simplifyNumericCalculations() 2012-09-06 17:02:20 +02:00
PKEuS a8cdd15738 Fixed false positive #4077. 2012-09-06 16:30:10 +02:00
Daniel Marjamäki 1c7027140a Tokenizer: Improved simplifyRedundantParanthesis 2012-09-06 16:16:29 +02:00
PKEuS 6edec7bdce Fixed false positive #4123. 2012-09-06 16:10:51 +02:00
Arpit Chaudhary 67e40a85e5 Improved check for shifting by negative values and removed false positives 2012-09-05 16:09:40 +02:00
PKEuS 536492d5f0 Applied two suggestions of XhmikosR:
- Added UTF8 signature to VS10 solution
- Prefer prefix operator++ (cppcheck catch)
2012-09-05 15:34:37 +02:00
PKEuS f969530e1f Revert "Fixed #4087" which was committed by accident.
This reverts commit 0bbef8d803.
2012-09-05 13:57:57 +02:00
Nilesh Kumar c7633fc73c Fixed #3645 2012-09-05 13:48:00 +02:00
gaurav kaushik 9ad7dfd5fd Fixed #211 and #214 2012-09-05 12:58:09 +02:00
PKEuS e5b1a6ceb1 Merge branch 'master' of github.com:danmar/cppcheck 2012-09-05 12:18:11 +02:00
Zachary Blair 8546bcc94e Fixed #2029 (new check: free invalid address) 2012-09-04 23:31:23 -07:00
PKEuS 0bbef8d803 Fixed #4087 2012-09-04 21:50:50 +02:00
Daniel Marjamäki 2197b84d78 astyle formatting 2012-09-04 16:29:23 +02:00
PKEuS 8c70778b70 Refactorization: Fixed several messages when self-checking cppcheck 2012-09-04 15:29:51 +02:00
PKEuS 8924e8af43 Fixed #4143: Give correct line numbers in checkunusedvar.cpp 2012-09-04 14:53:24 +02:00
anuraggarg011 913670d254 Fixed #3304 (simple cases) 2012-09-04 13:41:14 +02:00
kbajaj91 be716e81d3 Fixed #4138 - False positive about variable assigned a value that is never
used in loops
2012-09-04 13:06:04 +02:00
Edoardo Prezioso f8591f9004 CheckOther::clarifyStatement: improved message to show what's the 'bad' and the 'good' expression. 2012-09-04 02:07:55 +02:00
Edoardo Prezioso 6fd60eebb0 Tokenizer: added a workaround for #3690 (Support MSVC's 'for each'). 2012-09-03 20:23:53 +02:00
Edoardo Prezioso 6100776847 Tokenizer: remove unneeded initialization of strings explicitely with "". 2012-09-03 20:22:27 +02:00
anuraggarg011 bf11248a09 Fixed #1620 (tokenizer: simplify well known math functions) 2012-09-03 18:51:15 +02:00
anuraggarg011 b156c727b0 Fixed #3939: Support ****foo++; 2012-09-03 17:10:27 +02:00
Ankita Gupta c3a65dca40 Fixed #3793 (improve check: calculation in sizeof) 2012-09-03 15:56:10 +02:00
Edoardo Prezioso 804fbe3f8f Tokenizer::simplifyEmptyNamespaces: remove useless condition.
Token::deleteThis handles the !tok->next situation well.
2012-09-03 14:22:31 +02:00
PKEuS 27cafd495a Don't bailout for noreturn functions in checkRedundantAssignments outside switch. 2012-09-03 12:03:30 +02:00
PKEuS d98ee357d4 Fixed crash #4135 when using Q_DECLARE_METATYPE 2012-09-03 11:30:36 +02:00
PKEuS 2be2738c6e Moved duplicate code into function in CheckOther::checkRedundantAssignment() 2012-09-03 10:46:51 +02:00