Commit Graph

17173 Commits

Author SHA1 Message Date
Daniel Marjamäki 31c3532b55 Visual C++: Updated the FileLister (applied patch FileLister_ReworkRecursiveAddFiles submitted by kush_eplus) 2008-11-24 14:01:33 +00:00
Reijo Tomperi c022057c70 bug fix, didn't compile on Linux (3 utf characters on top of file again) 2008-11-24 08:59:10 +00:00
Daniel Marjamäki a521e4274f Visual C++: Updated the project file
* removed 'commoncheck'
 * added 'checkfunctionusage' 
 * added 'token'
2008-11-24 07:47:13 +00:00
Daniel Marjamäki e0027bef66 Borland C++: Minor updates so cppcheck compiles with Borland C++ 2008-11-24 07:35:03 +00:00
Reijo Tomperi 895b1d5561 Refactoring: Started making CppCheck class more generally usable (e.g. as a part of IDE). 2008-11-23 22:01:09 +00:00
Reijo Tomperi beee37c86b Refactoring: Updated makefile to be more up-to-date after big refactoring changes. 2008-11-23 20:12:43 +00:00
Daniel Marjamäki 5330524f48 Function usage: Better handling of '!foo()' 2008-11-23 17:28:26 +00:00
Reijo Tomperi 578027f05f Project files: Changed both targets to same file, using custom makefile 2008-11-23 15:29:12 +00:00
Daniel Marjamäki a26d44daf5 Function usage: Minor update in the pattern for using function 2008-11-23 14:36:20 +00:00
Daniel Marjamäki c6264022f9 Function Usage: Handling '.. else foo()' 2008-11-23 14:26:47 +00:00
Daniel Marjamäki 954371e3f8 Function usage: Handling callbacks better: 'void (*f)() = cond ? foo : NULL' 2008-11-23 14:21:37 +00:00
Daniel Marjamäki bb46a0cc42 Function usage: handling 'return foo();' better 2008-11-23 14:17:03 +00:00
Daniel Marjamäki 2db9c34d24 codeblocks: Added project file for cppcheck 2008-11-23 14:10:55 +00:00
Reijo Tomperi a6ad4045d4 Refactoring: IsName() and IsNumber() are no longer static and they don't take a parameter. 2008-11-23 12:21:40 +00:00
Daniel Marjamäki 43fc511f55 Added test file for function usage 2008-11-23 11:44:25 +00:00
Daniel Marjamäki ce14eb6590 Function Usage: Make sure it's detected that func is used in code such as 'if ( func() ) { ..' 2008-11-23 11:40:41 +00:00
Reijo Tomperi 29a1468523 Refactoring: Renamed some member variables: variable -> _variable 2008-11-23 11:08:07 +00:00
Reijo Tomperi 0b2e7a0ef3 Refactoring: at() changed to tokAt() and getstr() changed to strAt() 2008-11-23 10:09:16 +00:00
Daniel Marjamäki 79854620c7 Function usage: Fixes in the check 2008-11-23 07:33:14 +00:00
Daniel Marjamäki 0c9784fc0c Refactoring: The Tokenizer::FillFunctionList has no use of its parameter. Enabled the CheckFunctionUsage 2008-11-23 06:21:44 +00:00
Reijo Tomperi b8c7543149 Bug fix: Didn't compile on Debian, missing #include 2008-11-22 22:54:56 +00:00
Reijo Tomperi 3ba83b6620 Refactoring: token.* files added, Some functions from Tokenizer moved under TOKEN. Renamed few functions, like gettok() -> at(), combineWithNext() and deleteNext() are also new
names for old functions. Usage was gettok( tok, 2 ), but now it is tok->at( 2 ).
2008-11-22 22:49:14 +00:00
Daniel Marjamäki 2a85d68803 Memory leak: Added checking for 'kcalloc' 2008-11-22 21:10:12 +00:00
Daniel Marjamäki 9ba5d0b14f Memory leak: The 'realloc' shouldn't be treated exactly like 'malloc' 2008-11-22 20:28:39 +00:00
Daniel Marjamäki 0d3a99adb0 increased constness of member variable _tokenizer in the Check* classes 2008-11-22 20:00:36 +00:00
Daniel Marjamäki a60dad3562 CheckBufferOverrun: increased constness of _tokenizer member 2008-11-22 19:47:10 +00:00
Daniel Marjamäki 07b5ebe72b Check Function Usage: Removed much of the old checking and made some refactoring 2008-11-22 19:39:12 +00:00
Daniel Marjamäki 6687bc7b9a Function Usage: Added a new class for checking function usage 2008-11-22 18:51:01 +00:00
Daniel Marjamäki d68e2ae966 tokenizer: simplifyConditions tries to simplify conditions.. those that are always true to '( true )' and those that are always false to '( false )' 2008-11-22 17:53:22 +00:00
Daniel Marjamäki e33985dbf0 Memory leak: Handle conditions that are always true / false 2008-11-22 11:30:50 +00:00
Daniel Marjamäki 2db69e6072 tokenizer: Added DeallocateTokens to the destructor so it's not necessary to cleanup manually 2008-11-22 09:44:02 +00:00
Daniel Marjamäki 9ce8918895 tokenizer: Added functions "alwaysTrue" and "alwaysFalse" to check if a
condition is always true / false
2008-11-22 09:32:57 +00:00
Reijo Tomperi 125692bc65 Refactoring: CommonCheck.* files are removed. Rest of the global functions from there were moved to Tokenizer class 2008-11-21 21:14:24 +00:00
Daniel Marjamäki 66412ed4ae Memory leak: Added checking for 'fopen' and 'popen' 2008-11-21 18:17:40 +00:00
Daniel Marjamäki a82b46dad6 Memory leak: Better handling when calling functions 2008-11-21 18:02:20 +00:00
Daniel Marjamäki 7f4cc495df unsigned division and char variable usage - moved checks to "--style" 2008-11-21 08:20:21 +00:00
Reijo Tomperi 51e9d98a5f Refactoring: Errors are no longer logged via global functions to a global stream. Instead callback function is used via interface.
ErrorLogger interface was added and taken into use.
2008-11-20 22:19:26 +00:00
Reijo Tomperi 180e3b99e6 Refactoring: Some global functions moved to Tokenizer class 2008-11-20 20:54:52 +00:00
Daniel Marjamäki dd5abf2c05 cleanup 2008-11-20 19:23:05 +00:00
Daniel Marjamäki 63bc26d662 Function list: Remove functions with duplicate names to prevent false positives 2008-11-20 19:18:55 +00:00
Daniel Marjamäki 2e445b195c Memory leak: Minor update to make the checking stronger 2008-11-19 18:57:35 +00:00
Daniel Marjamäki 7a048cf35e Memory leak: Readded some checks that were removed in r481 2008-11-19 18:46:28 +00:00
Daniel Marjamäki 452ada698e Memory leak: Moved false positive to "--all" upon some special case conditions (bug 2313129) 2008-11-19 17:46:09 +00:00
Daniel Marjamäki a8e1cd8920 Buffer overrun: Fixed a segmentation fault 2008-11-18 19:59:50 +00:00
Daniel Marjamäki 8f3c688020 Memory leak: limit the max call depth to 2 2008-11-18 19:44:27 +00:00
Daniel Marjamäki d6075a2125 Memory leak: Minor fix to prevent hang 2008-11-17 20:29:50 +00:00
Daniel Marjamäki 745d885808 minor update to startup message 2008-11-17 18:58:06 +00:00
Daniel Marjamäki 1cd9496039 preprocessor: Better warning when illegal character found 2008-11-17 18:42:58 +00:00
Daniel Marjamäki 2018c25d20 Memory leak: moved simplifyTokens rule to '--all' 2008-11-17 17:31:07 +00:00
Daniel Marjamäki 7e8b3c86f6 Memory leak: Better handling of 'if (0 != p)' 2008-11-17 17:02:06 +00:00