Commit Graph

876 Commits

Author SHA1 Message Date
Robert Reif 7502cea4d3 Fixed (simplifyTypedef: wrong simplification for sizeof(array)) 2011-02-08 19:47:14 -05:00
Robert Reif e9ec4bc3e4 Fixed (cppcheck hangs with 100% cpu load) 2011-02-03 07:58:49 +01:00
Robert Reif 8eb92001b3 Fixed (Tokenizer: Remove redundant 'MyClass::' inside MyClass class declaration) 2011-02-02 07:40:08 +01:00
Pete Johns 098f0bf3e6 Fixed (Make TODO_ASSERT_EQUALS take three arguments (value, to_be, as_is)?...
Removed replaced EXPECTED with...

WANTED (to-be):     The future expected value.
CURRENT (as-is):    Documenting how cppcheck behaves now.

This removes the need for an ASSERT_EQUALS but enforces the check for every TODO_ASSERT_EQUALS.
2011-01-30 23:20:11 +11:00
Daniel Marjamäki 524498e439 Tokenizer: collapse operator function names into a single token. ticket: 2011-01-27 18:44:20 +01:00
Daniel Marjamäki b10f0aabd6 Fixed (simplifyTypedef: upx-ucl) 2011-01-23 09:04:34 +01:00
Raphael Geissert da998fec68 Tokenizer: simplify restrict 2011-01-16 11:37:03 +01:00
Robert Reif beb2db82a2 Fixed (false negative: division by zero when using enum) 2011-01-16 11:24:58 +01:00
Daniel Marjamäki 5920dbb7e7 Fixed (Tokenizer: simplification of enum) 2011-01-15 08:21:06 +01:00
Robert Reif 8ecba0af90 Fixed (False positive: not initialised/not assigned Static variable in copy constructors.) 2011-01-15 08:04:50 +01:00
Robert Reif 708a75e363 Fixed (syntax error when 'void f(typedef int x)' is used. causes segmentation fault.) 2011-01-14 07:41:22 +01:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Robert Reif bfc95e01c1 Fixed (### Internal error in Cppcheck. Please report it.) 2011-01-07 08:02:47 +01:00
Robert Reif d7e170b3ca typedef: fixed problem. ticket: 2011-01-06 07:52:59 +01:00
Robert Reif 157498e694 Fixed (typedef: struct with inheritance) 2011-01-05 17:42:55 +01:00
Daniel Marjamäki d700f25518 Fixed (Tokenizer::simplifyKnownVariables: variables in conditions) 2011-01-04 21:35:35 +01:00
Daniel Marjamäki 2c6421d162 Merge branch 'master' of https://github.com/rgeissert/cppcheck into rgeissert-realloc 2011-01-04 18:21:18 +01:00
Robert Reif 63208e87d3 typedef: delete unhandled typedefs. ticket: 2011-01-04 07:43:40 +01:00
Robert Reif a782d3ddf7 typedef: fix testcase 4. ticket: 2011-01-04 07:39:41 +01:00
Raphael Geissert 3d9550b0bf Simplify "x = realloc (0, n);" to "x = malloc(n);" 2011-01-02 17:46:10 -06:00
Daniel Marjamäki d2714fefda typedef: Fixed testcase. ticket: 2011-01-02 17:28:47 +01:00
Daniel Marjamäki 320604f073 typedef: added more tests. ticket: 2011-01-02 07:42:47 +01:00
Daniel Marjamäki 307178d3c2 Tokenizer: Better handling of duplicate enums. Ticket: 2010-12-30 20:55:23 +01:00
Robert Reif 3900ac731e simplifyTypedef: Better handling of 'typedef int RexxFunctionHandler();'. Ticket: 2010-12-29 20:25:47 +01:00
Robert Reif 137d0e2ba7 typedef: fixed problem with 'typedef int pread_f(int);'. ticket: 2010-12-29 09:18:41 +01:00
Robert Reif e82b1f8946 typedef: fix typedef simplification. ticket: 2010-12-28 21:21:13 +01:00
Daniel Marjamäki 0667fcf53c Fixed (simplifyTypedef: wrong simplification of 'typedef FMAC1 void (*a)();') 2010-12-28 14:04:44 +01:00
Robert Reif 1b92eeae1e Fixed (simplifyTypedef: function pointers are not simplified into valid code) 2010-12-28 08:01:32 +01:00
Daniel Marjamäki 6f8f0e1aa1 Fixed (Tokenizer::simplifyKnownVariables: wrong simplification after return) 2010-12-25 10:07:57 +01:00
Daniel Marjamäki 18fd12006a Tokenizer::simplifyGoto: Don't simplify 'goto' inside unhandled macro calls. Ticket: 2010-12-23 22:03:58 +01:00
Daniel Marjamäki 472ecd8805 Tokenizer: Fixed calculation simplification of '0*(*p)'. Ticket: 2010-12-23 18:59:18 +01:00
Robert Reif fc7e2d1ac1 Fixed (false positive for function pointer returning typedef) 2010-12-22 18:37:23 +01:00
Daniel Marjamäki 41ac2c252f Fixed (Tokenizer: Remove for-loop if condition is false) 2010-12-18 21:43:12 +01:00
Robert Reif bf136f0123 Fixed (False positive: (style) Template instantiation 'Foo' hides typedef with same name) 2010-12-16 07:48:46 +01:00
vBm 46a11183a5 Fixed some spelling mistakes 2010-12-15 18:45:53 +01:00
Daniel Marjamäki 69bacde479 Tokenizer: Cleanup redundant statement '; x = x + 0;'. Ticket: 2010-12-09 19:35:52 +01:00
Robert Reif f12c0c7ada Tokenizer: add assert(_settings) to Tokenizer to insure the tokenizer always has settings. Ticket: 2010-12-01 18:00:55 +01:00
Daniel Marjamäki add8584612 Fixed (segmentation fault of cppcheck) 2010-11-29 17:46:10 +01:00
Robert Reif 07f4067fa8 typedef: better handling of __typeof__ 2010-11-11 17:02:04 +01:00
Robert Reif a09c221014 typedefs: handle __typeof__ 2010-11-11 06:40:49 +01:00
Robert Reif 8a379d4826 Fixed (Tokenizer::simplifyTypedef function pointer bug) 2010-11-06 15:15:50 +01:00
Robert Reif c49a8a99a3 Fixed (Tokenizer::simplifyTypedef : wrong simplification of 'typedef float vec_t[3];') 2010-11-06 13:28:44 +01:00
Daniel Marjamäki c39fbb86db Tokenizer::simplifyKnownVariables : Fixed TODO test case when simplifying pointer alias in function call 2010-11-06 13:24:33 +01:00
Daniel Marjamäki e901ee2e68 Added TODO unit test for ticket . simplify 'typedef float x[3];' 2010-11-06 09:31:43 +01:00
Robert Reif 431201dd67 Fixed (Tokenizer::simplifyFunctionReturn bug) 2010-11-06 06:53:09 +01:00
Daniel Marjamäki 52faadda89 Tokenizer: simplify calculations with zero better 2010-11-05 20:35:31 +01:00
Daniel Marjamäki 4fdb420454 Tokenizer: simplifyknownvariables, improved handling of string constant 2010-11-05 20:05:57 +01:00
Daniel Marjamäki a38b14d582 Tokenizer: Remove redundant semi colons 2010-10-26 21:05:20 +02:00
Daniel Marjamäki 02ba2b202e Fixed (Tokenizer::simplifyTypedef: regression - wrong simplification of 'typedef char TString[256];') 2010-10-20 06:09:29 +02:00
Robert Reif 267d1f273e Fixed (Tokenizer::simplifyTypedef: wrong handling of array) 2010-10-13 20:02:37 +02:00
Daniel Marjamäki 2334192bff Fixed (False positive: Array 'str[1]' index 1 out of bounds) 2010-10-12 21:52:02 +02:00
Robert Reif 24eba7ef02 Unit Testing: Added more typedef tests 2010-10-08 16:00:21 +02:00
Daniel Marjamäki e4c3b390cc Fixed (cppcheck fails to scan OpenBSDs ftp source code) 2010-10-02 13:28:44 +02:00
Pete Johns 9a9302cba1 Prevent Tokenizer::simplifyCalculations() from removing parantheses from calls to Functors. 2010-10-02 21:19:05 +10:00
Robert Reif 2fc2859b68 Fixed (Enum 'qboolean' hides typedef with same name) 2010-09-08 06:45:57 +02:00
Daniel Marjamäki cfe694330f Fixed (Internal Error on multiple append calls on same string object) 2010-09-06 21:34:51 +02:00
Robert Reif fbffaade2e Fixed (Parser error in template function) 2010-09-02 19:09:06 +02:00
Daniel Marjamäki 7ec3c72a19 Fixed (operator new [] simplified wrong) 2010-08-30 21:06:22 +02:00
Robert Reif 0d530711f6 Fixed (segmentation fault of cppcheck with wrong syntax of -std=c++0x) 2010-08-30 07:25:17 +02:00
Daniel Marjamäki d45186d645 Added --debug-warnings that we can use to enable various debug warnings 2010-08-27 20:28:00 +02:00
Robert Reif 499a12c896 Tokenizer::simplifyTypedef: Report about unhandled typedefs. Ticket: 2010-08-26 20:44:13 +02:00
Daniel Marjamäki ca9cdf5bf5 Tokenizer: If syntax errors are found then don't return a token list. Ticket: 2010-08-25 22:10:21 +02:00
Robert Reif 4a6070d2af fix 2 problems related to ticket 1976:
1. nested unnamed anonymous structures and unions were not supported.
 2. declaration split up in class had bug if proceeded by access specifier.
2010-08-25 20:17:31 +02:00
Robert Reif d961a6ec9e Tokenizer: Fixed cppcheck and compiler warnings 2010-08-24 07:28:56 +02:00
Robert Reif 7173e01926 Fixed (tokenizer::simplifyEnum add support for C++0x enums) 2010-08-21 07:44:56 +02:00
Robert Reif f123e951ec Fixed (typedef array incorrectly simplified) 2010-08-20 07:11:02 +02:00
Daniel Marjamäki cfa7b4906e Symbol database: bug fixes. Ticket: 2010-08-18 22:42:04 +02:00
Daniel Marjamäki 2e2baa23a6 Fixed (### Internal error in Cppcheck. Please report it) 2010-07-28 21:03:15 +02:00
Daniel Marjamäki 7c5219324e Refactoring: Cleanup include that checkheaders reported as not needed 2010-07-26 22:05:51 +02:00
Daniel Marjamäki e1612bc175 Fixed (Internal error when enum assigned to sizeof without brackets) 2010-07-22 22:21:12 +02:00
Robert Reif c572e6af87 Fixed (False positive with -s: Variable hides typedef with same name) 2010-07-13 08:08:12 +02:00
Robert Reif b0f1d5669b Fixed (### Internal error in Cppcheck. Please report it.) 2010-07-07 07:40:11 +02:00
Robert Reif 1799e4a575 Fixed (### Internal error in Cppcheck. Please report it.) 2010-07-06 08:26:30 +02:00
Robert Reif c949a29d1e Fixed (simplifyTypedef: better typedef support) 2010-07-05 23:03:54 +02:00
Robert Reif 28c265b20c Fixed (simplifyTypedef: better typedef support) 2010-07-02 15:22:29 +02:00
Robert Reif b33fb48618 Fixed (Tokenizer: remove restrict keyword) 2010-06-30 08:10:39 +02:00
Daniel Marjamäki 46e2f1e64b --author=Robert Reif <reif@earthlink.net>
Fixed  (false positive: Variable hides typedef with same name)
2010-06-28 15:33:27 +02:00
Robert Reif ec61c6fa26 Fixed (simplifyTypedef: duplicate typedefs not handled properly) 2010-06-18 07:16:05 +02:00
Robert Reif f116e74f6e Fixed (Segmentation fault while scanning Qt's qcups.cpp) 2010-06-17 06:59:01 +02:00
Robert Reif 61e7e759f0 Fixed (structure templates) 2010-06-16 07:13:52 +02:00
Daniel Marjamäki f3fbdc96e1 Fixed (Tokenizer: template destructor is lost) 2010-06-12 08:32:05 +02:00
Robert Reif 6b65b77acf Fixed ((error) ### Internal error in Cppcheck. Please report it.) 2010-06-10 07:18:55 +02:00
Daniel Marjamäki 08b6e6ee09 Fixed (False positive: Resource leak with while) 2010-05-30 13:15:15 +02:00
Daniel Marjamäki 83c62eca9c Tokenizer: simplify loops that continue while errno is EINTR 2010-05-30 12:49:39 +02:00
Daniel Marjamäki 46b5e4e79a Fixed (Wrong reporting of leak with close() in a while loop condition) 2010-05-29 22:20:10 +02:00
Daniel Marjamäki d09e1df0d7 Fixed (Wrong precedence for shift operators when simplifying calculations?) 2010-05-29 20:27:08 +02:00
Robert Reif 1a25183e8f Fixed (simplifyTypedef: support for more typedefs) 2010-05-29 07:52:06 +02:00
Robert Reif 3fb0260ef1 Fixed (remove Microsoft variants of inline) 2010-05-29 07:43:58 +02:00
Robert Reif 26a7d29760 Fixed (simplifyTypedef: support for more typedefs) 2010-05-28 06:55:54 +02:00
Robert Reif 8881a0c361 Fixed (simplifyTypedef: support for more typedefs) 2010-05-27 07:00:33 +02:00
Robert Reif 019e1f9dfe Fixed (simplifyTypedef: support for more typedefs) 2010-05-25 20:43:44 +02:00
Daniel Marjamäki 78255fdfc5 Tokenizer: Removed the Tokenizer::simplifyNamespaces. Ticket: 2010-05-23 13:51:41 +02:00
Robert Reif b20cf06b66 Fixed (simplifyTypedef: support for more typedefs) 2010-05-23 10:46:39 +02:00
Robert Reif 41c43c1790 Fixed (False positive: Function parameter 'x' is passed by value. It could be passed by reference instead.) 2010-05-18 18:20:11 +02:00
Robert Reif 0d7474042a Fixed (segmentation fault of cppcheck) 2010-05-18 07:11:23 +02:00
Robert Reif 9dfbd3946a Fixed (Tokenizer::simplifyTypedef causes segfault for boost library) 2010-05-17 19:58:27 +02:00
Erik Lax 19aaa32a99 Fixed (Tokenizer::simplifyKnownVariables and pointer assignments) 2010-05-16 19:38:44 +02:00
Daniel Marjam�ki 8b1ffefd74 Fixed (Internal error) 2010-05-14 18:40:15 +02:00
Robert Reif f8cceface5 Fixed (False positive: (style) Variable 'xxx' is assigned a value that is never used) 2010-05-13 13:59:41 +02:00
Robert Reif 963108d957 Fixed (simplifyTypedef: support for more typedefs) 2010-05-11 21:41:33 +02:00
Robert Reif a390f3c8f4 Better handling of function pointer typedef 2010-05-10 17:50:40 +02:00
Robert Reif ac7515cdcc Fixed (simplifyTypedef: add support for typedefs of functions) 2010-05-10 07:12:06 +02:00
Daniel Marjamäki 6bb93b5eb7 Fixed (Tokenizer: improve handling of pointer aliasing) 2010-04-25 15:12:47 +02:00
Daniel Marjamäki 8ccd95a643 Fixed (buffer overrun: memmove) 2010-04-24 21:48:58 +02:00
Robert Reif 99a7755218 tokenizer improvements: remove calling convention () 2010-04-24 09:40:05 +02:00
Robert Reif f4ce5a37d7 Fixed (False positive - C-style pointer casting) 2010-04-22 20:08:29 +02:00
Robert Reif 90541386da Fixed (tokenizer: remove calling convention) 2010-04-21 21:08:47 +02:00
Robert Reif bee4608b27 Fixed (False -s positive: Template instantiation hides typedef with same name) 2010-04-18 09:13:55 +02:00
Daniel Marjamäki c0e9a546f7 Refactoring: Refactoring the Settings class 2010-04-17 09:23:54 +02:00
Daniel Marjamäki c718a7c595 astyle: Update to astyle 1.24 2010-04-15 20:08:51 +02:00
Daniel Marjamäki 3fa2137ee3 Fixed ('Index out of bounds' false positive) 2010-04-15 19:09:19 +02:00
Robert Reif d2bb4964d0 Fixed (typedef struct incorrectly simplified) 2010-04-14 19:06:51 +02:00
Reijo Tomperi 0912836c25 Fix: sizeof(char*) was not simplified correctly 2010-04-13 23:17:27 +03:00
Reijo Tomperi 4a33b226e6 Fix (false positive on if( (f = fopen("foo", "r")) == ((FILE*)NULL) ))
http://sourceforge.net/apps/trac/cppcheck/ticket/1599
2010-04-13 22:57:52 +03:00
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00
Robert Reif 67fafd4028 Fixed (typedef struct incorrectly simplified) 2010-04-12 19:05:31 +02:00
Daniel Marjamäki e9b4ea44a2 Refactoring: Disable inconclusive checks. They can still be activated for debugging/testing purposes 2010-04-10 14:05:33 +02:00
Zachary Blair 3152816619 Fixed (Tokenizer: delete register keyword everywhere) 2010-04-10 09:58:09 +02:00
Reijo Tomperi 6dc3860ae9 Fix more -Wshadow compile warnings 2010-04-09 22:40:37 +03:00
Robert Reif bc0a318b6d Fixed (unnamed anonymous struct can segfault) 2010-04-08 17:40:23 +02:00
Daniel Marjamäki f5b1a4db36 Refactoring unit testing 2010-04-04 19:28:15 +02:00
Daniel Marjamäki 0cad22314e Reverted 'astyle fix'. Those changes are not in sync with my astyle configuration/setup. 2010-04-02 07:30:58 +02:00
Martin Ettl 193aa7d1d3 astyle fix 2010-04-02 02:21:53 +02:00
Robert Reif 62d2845014 Fixed (false negatives: array index out of bounds) 2010-03-28 15:56:13 +02:00
Reijo Tomperi 86fabd03b3 Fix (hang due to commit 772aa95c8a)
http://sourceforge.net/apps/trac/cppcheck/ticket/1532
2010-03-27 21:52:31 +02:00
Robert Reif 9c2248254e Here is a patch that adds support for derived structs and fixes a bug that missed some nested structs. () 2010-03-19 16:17:25 +01:00
Robert Reif 5ea7e32bf9 Partial fix for (false positives: function can be const and struct or union member is never used) 2010-03-18 18:14:52 +01:00
Daniel Marjamäki 89719b023e unit testing: made Tokenizer functions public so they can be unit tested 2010-03-17 22:08:02 +01:00
Robert Reif b3856cbc5e Fixed (typedef name hiding check combined with forward declaration leeds to false positive) 2010-03-17 17:31:08 +01:00
Daniel Marjamäki 12c45a1aba Fixed (false positive: Uninitialized variable) 2010-03-16 19:53:09 +01:00
Daniel Marjamäki 772aa95c8a Fixed (false positive: Uninitialized variable when pointer given to struct) 2010-03-13 11:52:48 +01:00
Daniel Marjamäki 587081cab5 Fixed (Invalid warning about shadowed variable) 2010-03-10 16:47:39 +01:00
Daniel Marjamäki 770d2ff835 Simplify enum: Fixed segmentation fault if code ends with enum type id 2010-03-07 13:01:56 +01:00
Daniel Marjamäki fa493b7fd1 Fixed (segmentation fault of cppcheck) 2010-03-07 12:50:45 +01:00
Reijo Tomperi b88126a669 Fix (False positive: Resource leak when fclose() is inside while)
http://sourceforge.net/apps/trac/cppcheck/ticket/1469
2010-03-06 16:28:52 +02:00
Daniel Marjamäki fe30c1ca9d Fixed (false positive: uninitialized variable) 2010-03-06 13:48:43 +01:00
Reijo Tomperi d881fd7a31 Partial fix (takes too long (days) to process some files)
Fix template functions that return "&T".
http://sourceforge.net/apps/trac/cppcheck/ticket/1464
2010-03-03 23:02:32 +02:00
Daniel Marjamäki 50210857a6 Fixed (false positive: memory leak when using realloc) 2010-02-27 19:41:14 +01:00
Daniel Marjamäki a8ee4a03f0 Fixed (PATCH: Variable hides typedef with same name false positive) 2010-02-27 07:27:51 +01:00
Daniel Marjamäki ce0131a1e6 Fixed (false positive: Memory leak in while loop) 2010-02-26 22:14:56 +01:00
Robert Reif 54bf67e766 Fixed (PATCH: Variable hides typedef with same name false positive) 2010-02-26 21:43:00 +01:00
Robert Reif f4d600e93b Fixed (PATCH: Variable hides enumerator with same name false negative) 2010-02-26 21:40:57 +01:00
Daniel Marjamäki 377d3091a9 Fixed (Simplify goto better) 2010-02-25 20:03:39 +01:00
Robert Reif f9d444ed52 Fixed (segfault in Tokenizer::simplifyRedundantParanthesis()) 2010-02-25 07:24:32 +01:00
Reijo Tomperi 01c5bdfc68 Add TODO test case for (Simplify goto better)
http://sourceforge.net/apps/trac/cppcheck/ticket/1452
2010-02-24 22:55:16 +02:00
Robert Reif 7d8adfb4df Fixed (segmentation fault of cppcheck) 2010-02-24 17:50:02 +01:00
Robert Reif d9df3d5c6e Fixed (### Internal error in Cppcheck. Please report it.) 2010-02-23 22:12:55 +01:00
Robert Reif 24628013f1 Fixed (new check: check for typedef name hiding) 2010-02-20 09:07:29 +01:00
Robert Reif 5c6ec0364d Fixed (### Internal error in Cppcheck. Please report it.) 2010-02-18 07:24:24 +01:00
Robert Reif deb71fc566 Fixed (false positive: operator = should return reference to itself) 2010-02-17 22:42:08 +01:00
Robert Reif f15c408f13 Fixed (enum token/template parameter confusion - False positive) 2010-02-16 07:33:23 +01:00
Daniel Marjamäki 8853f304af Fixed (False positive: (error) Possible null pointer dereference) 2010-02-08 18:25:08 +01:00
Daniel Marjamäki ed8f3bc806 Fixed (Internal error when using ?-operator and nested {}) 2010-02-07 09:14:59 +01:00
Daniel Marjamäki 0a31e5e3ee Fixed (false positive: uninitialized variable) 2010-02-06 16:51:32 +01:00
Robert Reif b78845174d Fixed (Fixed enum bug when expression contain comma) 2010-02-06 09:49:56 +01:00
Robert Reif 6cbfc5f894 Fixed (add expression support to simplifyEnum) 2010-02-05 07:37:17 +01:00
Daniel Marjamäki 0ba665d77f Fixed (Division by zero with __alignof__()) 2010-02-03 21:23:44 +01:00
Robert Reif f2eac901c0 Fixed (simplifyTypedef doesn't support deeply nested classes) 2010-02-03 07:58:36 +01:00
Robert Reif b704fc7bc7 Fixed (add nested struct support to simplifyEnum and simplifyTypedef) 2010-02-01 19:59:24 +01:00
Robert Reif 64afcc8179 Fixed (simplify typedefs with global and nested namespace) 2010-01-31 21:46:18 +01:00
Daniel Marjamäki 1375a60e3f Fixed (improve check: Unintialized variable not detected when using a reference (&)) 2010-01-31 16:29:12 +01:00
Daniel Marjamäki 1a59e1bc68 Tokenizer: remove redundant assignments and variables 2010-01-31 09:52:19 +01:00
Daniel Marjamäki e15a16eb15 Tokenizer: Remove redundant assignments and variables 2010-01-31 09:33:57 +01:00
Daniel Marjamäki e1efad0c27 Tokenizer: remove the keyword 'inline' 2010-01-31 08:11:29 +01:00
Robert Reif d17d199415 Tokenizer: fix for multiple array definitions for a single typedef 2010-01-31 07:16:19 +01:00
Robert Reif 7cbdb9f8a1 Fixed (simplify typedef of complex arrays) 2010-01-30 19:41:22 +01:00
Daniel Marjamäki 8716c771a4 Tokenizer: improved the simplifyInitVar 2010-01-30 14:25:11 +01:00
Daniel Marjamäki 3b08712930 Fixed (improve check: nullpointer dereference not found when it is initialized with NULL-cast) 2010-01-30 09:33:16 +01:00
Robert Reif 882e2225e0 Fixed 1329 (simplify typedef of function pointer returning template) 2010-01-30 08:00:11 +01:00
Daniel Marjamäki f9d5fb3191 Fixed (False positive: Redundant code: Found a statement that begins with numeric constant) 2010-01-29 22:28:49 +01:00
Robert Reif fc54ed1eef Fixed (remove simplified enum definitions) 2010-01-29 15:57:26 +01:00
Robert Reif 45b6b9e5a1 Fixed (### Internal error in Cppcheck. Please report it.) 2010-01-27 19:03:24 +01:00
Robert Reif 8be8c266ac Fixed (unnamed enums not simplified properly) 2010-01-25 07:45:16 +01:00
Robert Reif 989e8393e4 Fixed (Internal error with typedef in parameter list) 2010-01-24 22:40:35 +01:00
Daniel Marjamäki 65881b9346 Fixed (False Negative : memory leak with template class) 2010-01-24 20:04:09 +01:00
Daniel Marjamäki 8a9eba980b Function pointers: re-enabled the simplifyFunctionPointers 2010-01-23 07:43:12 +01:00
Robert Reif 13ca2510cc Fixed ((error) ### Internal error in Cppcheck. Please report it. (typedef in fun proto)) 2010-01-22 20:26:07 +01:00
Daniel Marjamäki 1552c0f7f2 Fixed (False Uninitialized variable when using goto) 2010-01-22 20:20:43 +01:00
Robert Reif 9f853cb164 Fixed (typedef causes internal error in vlc/modules/access/imem.c) 2010-01-22 17:27:40 +01:00
Robert Reif 9f0b9551cf This patch simplifies the function pointer return type code and allows more complex return types. 2010-01-21 18:01:09 +01:00
Robert Reif e9e64033e7 Improved typedef simplification of function pointers 2010-01-21 07:51:08 +01:00
Daniel Marjamäki 3447030564 Merge branch 'master' of git@github.com:danmar/cppcheck 2010-01-20 21:19:32 +01:00
Daniel Marjamäki 96359b14ff Simplify function pointers 2010-01-20 21:19:06 +01:00
Robert Reif e163f878ab Handle/simplify function pointer typedefs 2010-01-20 21:16:40 +01:00
Reijo Tomperi b83d257852 Fix (false positive: index out of bounds)
http://sourceforge.net/apps/trac/cppcheck/ticket/1296
2010-01-20 21:26:54 +02:00
Robert Reif cd31cd9298 Fixed (tokenize typedef of reference) 2010-01-18 19:06:50 +01:00
Daniel Marjamäki 3aa67cd537 Added TODO test for better pointer aliasing with memset 2010-01-17 08:43:10 +01:00
Robert Reif 70dbb8ba17 Fixed (Cppcheck hangs when analysing the code 'typedef struct { } A, *B, **C;') 2010-01-17 08:16:17 +01:00
Daniel Marjamäki fbefb8df34 Fixed (links in typedef not handled correctly) 2010-01-16 19:42:37 +01:00
Robert Reif a0caea4ee6 Refactoring the handling of typedefs 2010-01-16 09:18:21 +01:00
Robert Reif 0212225859 Tokenizer: fixed typedef issues 2010-01-13 07:59:47 +01:00
Daniel Marjamäki 2358c51694 Tokenizer: some cleanup of std:: 2010-01-12 21:25:31 +01:00
Robert Reif 5e8e4fd3e9 Fixed (Internal error in Cppcheck while parsing struct) 2010-01-12 17:38:36 +01:00
Robert Reif 7b6bf80057 Fixed (tokenize typedef of union) 2010-01-11 22:58:57 +01:00
Robert Reif 94d5e32aa1 Fixed (tokenize typedef of array) 2010-01-11 17:09:04 +01:00
Robert Reif 19ba151531 Fixed (tokenize typedef of unnamed struct) 2010-01-10 08:49:02 +01:00
Robert Reif b30b07beee Fixed (segmentation fault of cppcheck when scanning templates) 2010-01-07 18:09:35 +01:00
Daniel Marjamäki 57d1da3910 Ticket : Handle tokensBack in the Token class. When adding&removing tokens the Token class can make sure that this pointer is updated accordingly. It is very important that the tokensBack has the same scope as the token list, otherwise there will be a dead pointer problem. 2010-01-06 20:19:27 +01:00
Robert Reif 13f627d0d5 Fixed (are enums processed properly?) 2010-01-04 17:22:06 +01:00
Slava Semushin b816968f28 Fixed (Segmentation fault when we define function which was already defined by preprocessor)
http://sourceforge.net/apps/trac/cppcheck/ticket/1197
2010-01-02 03:25:37 +06:00
Daniel Marjamäki ddfd0b948e Fixed (1.39: Internal error) 2010-01-01 21:06:30 +01:00
Robert Reif f8f0a31e41 Fixed (### Internal error in Cppcheck. Please report it.) 2009-12-30 20:56:16 +01:00
Daniel Marjamäki 160f795710 Fixed (Tokenizer: wrong simplification of 'do { .. } while (0)' if the body contains continue or break) 2009-12-29 12:15:39 +01:00
Daniel Marjamäki 84ce6ba75a Robert Reif: Fixed (add support to tokenize typedefs with templates) 2009-12-29 07:28:00 +01:00
Daniel Marjamäki 28f2bf2150 Robert Reif: Fixed (add tokenize support for typedefs with enum definitions) 2009-12-28 17:57:52 +01:00
Daniel Marjamäki 197bcf17ba Tokenizer: Simplify 'while (0)' better 2009-12-28 08:37:34 +01:00
Daniel Marjamäki c7cede1d76 Fixed (New check: return pointer of stack memory) 2009-12-27 13:08:41 +01:00
Daniel Marjamäki 44a629ec74 Fixed (Tokenizer: Wrong simplification of calculations) 2009-12-25 14:47:15 +01:00
Daniel Marjamäki 4dac46b2d7 Fixed (Segfault with template) 2009-12-22 20:10:08 +01:00
Daniel Marjamäki 5b87a51aa5 Robert Reif: Fixed (Only trivial typedefs are tokenized properly) 2009-12-22 19:10:33 +01:00
Reijo Tomperi 798e07dee4 Added test case for else if simplification 2009-12-08 01:22:24 +02:00
Reijo Tomperi bd024b7a2d Fix (Internal error - incrementing single char in char array)
http://sourceforge.net/apps/trac/cppcheck/ticket/1065
2009-12-07 23:42:30 +02:00
Daniel Marjamäki cd4e355f17 Fixed (Internal error for 'int vals[] = { 0x13, 1?0x01:0x00 };') 2009-12-06 10:58:27 +01:00
Daniel Marjamäki 75f6e20e61 Fixed (Internal error: In tokenizer for: 'do { sizeof 1; } while (0);') 2009-12-06 08:46:59 +01:00
Reijo Tomperi 5a40a8c2dd CRLF -> LF fix 2009-12-05 22:17:58 +02:00
Daniel Marjamäki 96268b4caf Fixed (wrong line number with goto) 2009-12-02 19:47:35 +01:00
Daniel Marjamäki 153a13272c ericsesterhenn: Fix (False positive resource leak) 2009-11-30 16:45:19 +01:00
Daniel Marjamäki e6b5fe99f6 Fixed (Internal error: sizeof a++) 2009-11-29 17:25:35 +01:00
Daniel Marjamäki e7d7507c65 Fixed (lib/tokenize.cpp:4615: bool Tokenizer::validate() const: Assertion 0 failed) 2009-11-29 12:14:42 +01:00
Reijo Tomperi 2c51542cf1 Fix (strcat(strcat()) causes assertion in Tokenizer::validate)
Test case provided by povaddict
http://sourceforge.net/apps/trac/cppcheck/ticket/1018
2009-11-27 23:21:13 +02:00
Daniel Marjamäki c94ecfe1a3 Fixed (SIGABRT: Tokenizer::validate for openttd/src/ai/ai_config.cpp) 2009-11-27 17:32:53 +01:00
Daniel Marjamäki 128b2b8c59 Fixed (CppCheck crashes on Win XP when scanning large directories/subdirectories) 2009-11-23 18:59:50 +01:00
Daniel Marjamäki 9b397afeca Temporary fix for (cppcheck cannot check my sources with segfaulting) 2009-11-22 13:38:45 +01:00
Daniel Marjamäki 531d0fa685 Fixed (Division by zero false positive with nested macros) 2009-11-20 20:42:28 +01:00
Slava Semushin 5369965e55 Fixed (Tokenizer::simplifyTypedef() incorrectly substitute type inside namespace)
http://sourceforge.net/apps/trac/cppcheck/ticket/983
2009-11-20 00:02:16 +06:00
Slava Semushin 2ec5438186 Fixed (Tokenizer: correctly simplify sizeof of class members)
http://sourceforge.net/apps/trac/cppcheck/ticket/954
2009-11-14 01:07:44 +06:00
Daniel Marjamäki b2cec721c0 Fixed (Preincremented struct member confused with numeric constant) 2009-11-12 22:16:24 +01:00
Reijo Tomperi d2db4d3a27 Test case for (segmentation fault of cppcheck)
http://sourceforge.net/apps/trac/cppcheck/ticket/903
2009-11-12 21:04:11 +02:00
Daniel Marjamäki 0c8d327809 Fixed (Tokenizer: known result of strlen) 2009-11-07 08:25:39 +01:00
Daniel Marjamäki 58c54d2ed4 Fixed (Tokenizer: remove unneeded const after *) 2009-11-05 21:30:05 +01:00
Reijo Tomperi de4ca924b5 Fixed (False positive with --all when return value of open() is positive in a loop)
http://sourceforge.net/apps/trac/cppcheck/ticket/896
2009-11-05 00:58:15 +02:00
Daniel Marjamäki 3e4dd22eed fixed todo testcase 2009-11-01 21:00:43 +01:00
Reijo Tomperi 618eed3d59 Fixed segmentation fault.
Had to change one test case to TODO for now.
2009-11-01 21:49:43 +02:00
Daniel Marjamäki 319cdc2b43 Fixed (Tokenizer: The Tokenizer::simplifyTemplates doesn't handle recursive templates) 2009-11-01 19:03:52 +01:00
Daniel Marjamäki fec7acdc27 Templates: Better handling of recursive templates 2009-11-01 15:56:00 +01:00
Daniel Marjamäki a337708ae5 Fixed (Tokenizer: handle templates with partial specialisation) 2009-10-31 12:34:52 +01:00
Reijo Tomperi 4a61bd0432 Fix (The CheckClass::getVarList method detects 'const' as a variable name.)
http://sourceforge.net/apps/trac/cppcheck/ticket/870
2009-10-29 21:54:51 +02:00
Reijo Tomperi 59acfbc4df Fix (false positive memset array of pointers)
http://sourceforge.net/apps/trac/cppcheck/ticket/863
Also fix test cases for 64 bit systems.
2009-10-27 20:23:45 +02:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00
Daniel Marjamäki 88070b044b Fixed (Tokenizer: sizeof(*a) returns incorrect result) 2009-10-22 23:00:27 +02:00
Daniel b80a954f55 Fixed (Tokenizer: Simplify 'sizeof *ptr' correctly) 2009-10-21 21:08:00 +02:00
Reijo Tomperi 9d42194562 Fix (Tokenizer: Known variable variable not simplified)
http://sourceforge.net/apps/trac/cppcheck/ticket/767
2009-10-20 23:58:46 +03:00
Daniel Marjamäki 50e542c183 Fixed (Tokenizer: sizeof is incorrectly simplified) 2009-10-18 18:06:32 +02:00
Daniel Marjamäki 2ec1b676ea Pointer Aliasing: Handle pointer aliasing through the Tokenizer::simplifyKnownVariables 2009-10-17 18:21:13 +02:00
Slava Semushin 237dcb9533 Fixed (Tokenizer: don't replace sizeof() of unknown type to zero)
http://sourceforge.net/apps/trac/cppcheck/ticket/809
2009-10-10 19:26:03 +07:00
Reijo Tomperi 8fc21dda27 Fix (Tokenizer: Simplify sizeof for function parameters)
http://sourceforge.net/apps/trac/cppcheck/ticket/801
2009-10-07 12:05:44 +03:00
Reijo Tomperi 06dd66bff4 Fix (Tokenizer: Simplify sizeof for string array and string pointer)
http://sourceforge.net/apps/trac/cppcheck/ticket/487
2009-10-07 11:08:53 +03:00
Reijo Tomperi 8472e58413 Refactored sizeof simplification and fixed one TODO assert. 2009-10-07 10:54:34 +03:00
Reijo Tomperi 2e69d50458 Fix (segmentation fault while scanning)
http://sourceforge.net/apps/trac/cppcheck/ticket/796
2009-10-06 21:03:15 +03:00
Reijo Tomperi c55140d4cd Fix (double free not found)
http://sourceforge.net/apps/trac/cppcheck/ticket/580
2009-10-06 12:44:53 +03:00
Reijo Tomperi 13fbd616da Moved some test cases from testtokenize into testsimplifytokens and added one TODO case. 2009-10-06 12:40:50 +03:00
Reijo Tomperi edb28d2856 Fix (Improve simplifyQuestionMark() in tokenize.cpp)
http://sourceforge.net/apps/trac/cppcheck/ticket/365
2009-10-05 17:34:38 +03:00
Reijo Tomperi 036f3894f1 Fix simplifyRedundantParanthesis() to work after '}' 2009-10-05 14:30:05 +03:00
Reijo Tomperi 5a0a5422c3 Fix (Tokenizer: remove useless brackets around variable assignment)
http://sourceforge.net/apps/trac/cppcheck/ticket/776
2009-10-05 14:22:35 +03:00
Reijo Tomperi fc684d7b5a Fix (Tokenizer: impove simplification inside if())
http://sourceforge.net/apps/trac/cppcheck/ticket/778
2009-10-05 14:10:09 +03:00
Reijo Tomperi 8bb812548c Fix (Tokenizer: double casting simplified incorrectly)
http://sourceforge.net/apps/trac/cppcheck/ticket/777
2009-10-05 00:12:12 +03:00
Reijo Tomperi 498beb7d9a Fix (Tokenizer: Simplify 2[a] -> a[2])
http://sourceforge.net/apps/trac/cppcheck/ticket/784
2009-10-04 23:33:41 +03:00
Daniel Marjamäki ee1bcb728c use '<' comparisons instead of '>' () 2009-10-04 07:51:12 +02:00
Slava Semushin b0d8b6ca8b Fixed (Tokenizer: replace typedef for pointers to struct)
http://sourceforge.net/apps/trac/cppcheck/ticket/780
2009-10-03 22:02:23 +07:00
Reijo Tomperi 39092150e2 Fix (Tokenizer: Goto incorrectly simplified)
http://sourceforge.net/apps/trac/cppcheck/ticket/763
2009-10-01 10:25:32 +03:00
Reijo Tomperi f9871c2d54 Fix (false positive: possible null pointer dereference , while)
http://sourceforge.net/apps/trac/cppcheck/ticket/745
2009-09-30 21:42:14 +03:00
Reijo Tomperi 7852d38f54 Fix (Tokenizer: typedef inside class is incorrectly simplified)
http://sourceforge.net/apps/trac/cppcheck/ticket/761
2009-09-30 14:35:00 +03:00
Reijo Tomperi bb1a9a07e4 Fix (Tokenizer: Goto not simplified)
http://sourceforge.net/apps/trac/cppcheck/ticket/760
2009-09-30 14:30:53 +03:00
Reijo Tomperi 500dedb8a3 Added TODO test cases: simplifyTypedef, simplifyTypedef2, simplifyTypedef3 2009-09-30 10:11:09 +03:00
Reijo Tomperi fdde2182b9 Fix GPL comments in all files. ">." was missing from the end. 2009-09-27 18:08:31 +03:00
Reijo Tomperi d1f3953cce Fix (String length for strings like this "\x61" is calculated wrong)
http://sourceforge.net/apps/trac/cppcheck/ticket/720
2009-09-27 17:04:10 +03:00
Slava Semushin 313479cf8d Tokenizer::simplifySizeof(): use Token::getStrLength().
Fixed wrong result when string contains escaped quotes.

Correction for 0e729fedc0 commit.
2009-09-23 23:02:53 +07:00
Daniel Marjamäki 0e729fedc0 Fixed (segmentation fault: sizeof string) 2009-09-22 20:50:00 +02:00
Reijo Tomperi 0fff5a23bf Fix (false positive: Invalid deallocation)
http://sourceforge.net/apps/trac/cppcheck/ticket/701
2009-09-20 23:38:32 +03:00
Reijo Tomperi 55fc473a00 Fix (Tokenizer: (65536*72/100) incorrectly simplified to zero)
http://sourceforge.net/apps/trac/cppcheck/ticket/684
2009-09-15 23:38:54 +03:00
Daniel Marjamäki 020321769c Fixed (Assertion 'begin != __null' failed) 2009-09-14 21:49:41 +02:00
Slava Semushin d16a0b7a80 TestSimplifyTokens::sizeof_(): don't append leading space.
No functional change.
2009-09-13 17:59:59 +07:00
Slava Semushin 0fb89f8afa Fixed (Tokenizer::simplifyCasts() breaks link() if casts function)
http://sourceforge.net/apps/trac/cppcheck/ticket/645
2009-09-13 17:31:32 +07:00
Reijo Tomperi 241f585d34 Fix (division by zero not detected when using atol or atof)
http://sourceforge.net/apps/trac/cppcheck/ticket/594
Simplify atol("0") into 0 (and other atol() calls also)
2009-09-12 23:54:47 +03:00
Daniel Marjamäki 7479b943cc Fixed (Tokenizer::simplifyComma: Wrong simplification in cast) 2009-09-12 08:12:00 +02:00
Reijo Tomperi 908aaff1fa New test case in TestSimplifyTokens::template_default_parameter 2009-09-09 23:57:28 +03:00
Reijo Tomperi ed425158d9 astyle fix 2009-09-06 15:12:38 +03:00
Slava Semushin c1958054af Added test cases for . 2009-09-06 18:29:39 +07:00
Daniel Marjamäki 535fe17ffd Templates: Scaled up the handling of default values for template parameters () 2009-09-06 08:22:45 +02:00
Reijo Tomperi 75a65a02a8 Fix another issue related to (Crash during tokenizing (wrong) K&R function declaration)
http://sourceforge.net/apps/trac/cppcheck/ticket/647
2009-09-05 23:41:39 +03:00
Reijo Tomperi a3d9863725 Fix (Crash during tokenizing (wrong) K&R function declaration)
http://sourceforge.net/apps/trac/cppcheck/ticket/647
Thanks to undingen for providing a patch
2009-09-05 22:21:25 +03:00
Slava Semushin a9273c9d39 Fixed (Tokenizer: expand nested strcat() calls)
http://sourceforge.net/apps/trac/cppcheck/ticket/629
2009-09-05 23:46:27 +07:00
Daniel Marjamäki 7a9e4a7bd4 templates: remove typename tokens 2009-09-03 22:19:44 +02:00
Daniel Marjamäki 2719724a97 templates: Quick fix for the problem with default value for a template argument 2009-09-03 21:46:07 +02:00
Daniel Marjamäki 401f8aaa96 Templates: Added todo testcase for handling default values for template arguments. Related with ticket 2009-09-02 22:54:50 +02:00
Reijo Tomperi fc343b3e9e astyle fix 2009-08-29 23:33:12 +03:00
Slava Semushin 085187b445 Tokenizer: enhance simplifyNot() and rename to simplifyLogicalOperators().
Don't replace "and" everything becuse it may be used as variable name.

Better fix for 
Corrections for commit eb05cf904d
2009-08-29 20:42:14 +07:00
Slava Semushin eb05cf904d Fixed (Tokenizer: replace "and" by "&&")
http://sourceforge.net/apps/trac/cppcheck/ticket/620
2009-08-29 19:26:01 +07:00
Slava Semushin ae413a1ef0 Fixed (Tokenizer: Wrong handling of enum)
http://sourceforge.net/apps/trac/cppcheck/ticket/618
2009-08-29 16:42:42 +07:00
Daniel Marjam�ki cbc237c37b fixed failed assertions when running the testrunner 2009-08-28 17:05:25 +02:00
danmar 4f6b79b761 Fixed (cppcheck dumps core on valid code) 2009-08-28 12:57:29 +02:00
danmar bb2bda0be4 Fixed (Tokenizer: Calculations are wrong) 2009-08-28 12:13:46 +02:00
Daniel Marjamäki 9bdd1def58 added testcase for the Tokenizer::simplifyGoto 2009-08-26 18:54:28 +02:00
Daniel Marjamäki f94aab35e7 Fixed (Tokenizer: simplify 'goto') 2009-08-26 18:46:56 +02:00
Daniel Marjamäki c25e1963b1 Fixed (Tokenizer: simplify 'goto') 2009-08-24 23:10:12 +02:00
Reijo Tomperi 9d1907be66 Fix ticket (Tokenizer: if(!(fclose(fd) == 0)) is simplified incorrectly)
http://sourceforge.net/apps/trac/cppcheck/ticket/600
2009-08-20 22:37:05 +03:00
Slava Semushin 1fd2c0ff28 Fixed ticket (Tokenizer: improve detection of arrays)
http://sourceforge.net/apps/trac/cppcheck/ticket/572
2009-08-09 15:16:37 +07:00
Reijo Tomperi d719606201 Fixed ticket (set variable id for "struct ABC **p")
http://sourceforge.net/apps/trac/cppcheck/ticket/564
2009-08-07 00:31:39 +03:00
Reijo Tomperi 80953633ee Fix ticket (set variable id for **p)
http://sourceforge.net/apps/trac/cppcheck/ticket/563
2009-08-06 23:11:29 +03:00
Daniel Marjamäki 1c59e4a51b Fixed (Tokenizer: Simplify: 'if(!(a->x=b()))') 2009-08-05 19:45:05 +02:00
Daniel Marjamäki 706ba34a6d Refactoring the unit testing 2009-08-04 21:32:14 +02:00
Slava Semushin ed86eda07d Fixed ticket (Tokenizer: improve calculation simplification)
http://sourceforge.net/apps/trac/cppcheck/ticket/549
2009-08-02 15:45:33 +07:00
Reijo Tomperi 2fa3b4ce60 Added more tests to test case TestSimplifyTokens::ifassign1 2009-07-30 01:39:28 +03:00
Reijo Tomperi b56fdb83da Fixed ticket (Tokenizer: simplify if((x==0)))
http://sourceforge.net/apps/trac/cppcheck/ticket/529
2009-07-30 00:37:01 +03:00
Slava Semushin c8caefa94c Fixed ticket (Tokenizer converts commas in for-loops)
http://sourceforge.net/apps/trac/cppcheck/ticket/519
2009-07-28 23:40:15 +07:00
Slava Semushin 600f3a834d Fixed ticket (false positive:: memory leak when using comma near delete[])
http://sourceforge.net/apps/trac/cppcheck/ticket/514
2009-07-28 02:13:08 +07:00
Reijo Tomperi 358aa5be8d Improve test case TestSimplifyTokens::comma_keyword 2009-07-27 00:08:18 +03:00
Daniel Marjamäki b4a6d74e42 astyle formatting 2009-07-26 22:13:08 +02:00
Slava Semushin a73346e889 Fixed ticket (Tokenizer: simplify statements with "," better)
https://sourceforge.net/apps/trac/cppcheck/ticket/496
2009-07-26 18:03:11 +07:00
Daniel Marjamäki 9136d8cf80 Tokenizer: simplify return statements - remove redundant parantheses 2009-07-24 21:55:35 +02:00
Daniel Marjamäki 024778d6eb tokenizer: simplify '?:' better when the condition is always true 2009-07-23 10:12:02 +02:00
Daniel Marjamäki 1d514e1afe Fixed (Templates are not expanded correctly) 2009-07-22 13:29:42 +02:00
Daniel Marjamäki 2ccc01f5ed tokenizer: improved the Tokenizer::simplifyIfNot 2009-07-18 10:18:46 +02:00
Daniel Marjamäki 69b1df3bb8 tokenizer: simplify the '?:' operator 2009-07-14 12:06:38 +02:00
Daniel Marjamäki f4de77cefc simplify tokens: simplify test cases 2009-07-14 11:37:26 +02:00
Daniel Marjamäki 17008879ac minor refactoring: header cleanup. use forward declarations instead of includes 2009-07-13 19:11:31 +02:00
Daniel Marjamäki 0ea09b1cb6 templates: simplified a todo test case by removing a redundant function from the code 2009-07-08 09:38:59 +02:00
Reijo Tomperi e858ab2f0d Fix ticket (False positive: Member variable not assigned a value in copy constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/457
Simplify "a = 0, b = 0;" into "a = 0; b = 0;"
2009-07-05 21:29:09 +03:00
Reijo Tomperi 290aefaa3d TODO Test case TestSimplifyTokens::remove_comma added 2009-07-04 18:06:25 +03:00
Reijo Tomperi 26358debcf Fix ticket (false positive:: resource leak)
http://sourceforge.net/apps/trac/cppcheck/ticket/448
Tokenizer improved to simplify "if( (p)==-1 )"
2009-07-03 21:57:44 +03:00
Daniel Marjamäki 453a5cdd47 Fixed ticket (false positive: resource leak in while loop) 2009-06-20 13:58:30 +02:00
Daniel Marjamäki 03944f1b96 Tokenizer: Fixed problem when simplifying casts 2009-06-19 19:25:56 +02:00
Reijo Tomperi e8d1905e6d Fix ticket (delete a,b; not tokenized correctly)
http://sourceforge.net/apps/trac/cppcheck/ticket/418
2009-06-19 00:00:16 +03:00
Daniel Marjamäki af7c63155e Fixed (Templates: template functions that return a pointer are not simplified correctly)
* Fixed so that the tokenizer handle variable declarations better when the variable is assigned the return value of a template function
 * Fixed so that the simplifyTemplates detect that a template function is used when its return value is taken
2009-06-14 14:57:47 +02:00
Daniel Marjamäki be52e573f3 Fixed ticket (Templates: template functions that return a pointer are not simplified correctly) 2009-06-14 11:28:25 +02:00
Reijo Tomperi 092bd79ec4 Fix ticket (False positive (memory leak) with comma)
http://apps.sourceforge.net/trac/cppcheck/ticket/386
2009-06-11 00:12:26 +03:00
Daniel Marjamäki d8f95f68c3 Fixed ticket (False positive with "char a[]")
Updated the tokenizer so "char a[]" is tokenized into "char *a"
2009-06-10 19:36:00 +02:00
Slava Semushin 09fce76e30 Fixed ticket (Simplify sizeof for pointers)
https://apps.sourceforge.net/trac/cppcheck/ticket/348
2009-06-01 17:01:45 +07:00
Slava Semushin e5c0383594 Strip redundant std::string usage from tests.
Done by command:
git grep -l ASSERT_EQUALS | xargs sed -i 's|ASSERT_EQUALS(std::string(\(".\+"\)),|ASSERT_EQUALS(\1,|'

Should be no functional change.
2009-06-01 02:50:25 +07:00
Reijo Tomperi 2de4c516e9 Fixed ticket (Simplify sizeof for pointer arrays) by patch submitted by php-coderrr
http://apps.sourceforge.net/trac/cppcheck/ticket/338
2009-05-31 22:33:44 +03:00
Daniel Marjamäki aba7518aeb Fixed ticket ('!' and 'not' tokens interpreted differently even though they mean the same) 2009-05-31 10:42:27 +02:00
Reijo Tomperi 58eda6e978 Fix ticket (Replace developer names in source files with AUTHORS file)
http://apps.sourceforge.net/trac/cppcheck/ticket/325
2009-05-30 08:48:12 +03:00
Daniel Marjamäki b9b542d05b Fixed ticket (tokenizer: incorrect removal of decrement/increment) 2009-05-25 14:21:58 +02:00
Daniel Marjamäki 2d2c0e42cc Fix ticket (pre-increment causes style false positive) 2009-05-25 08:31:20 +02:00
Daniel Marjamäki 7fdd497c44 Fix ticket (pre-increment causes style false positive) 2009-05-25 08:26:11 +02:00
Reijo Tomperi f2a5527e60 Fix (if() is not properly tokenized)
http://apps.sourceforge.net/trac/cppcheck/ticket/289
2009-05-09 23:12:14 +03:00
Daniel Marjamäki e9eba16053 templates: fixed problem when for example calling static member function in a template class () 2009-05-09 08:02:59 +02:00
Daniel Marjamäki dae530d8de template: no usage -> no expansion () 2009-05-08 16:19:22 +02:00
Daniel Marjamäki 51beadd81c templates: instantiations in a template class () 2009-05-06 21:03:11 +02:00
Reijo Tomperi e098bffd28 Added test case TestSimplifyTokens::template7 2009-05-05 23:09:15 +03:00
Daniel Marjamäki feba87187a templates: speedup by breaking out inner loops () 2009-05-05 20:16:57 +02:00
Reijo Tomperi 241ad528a9 Fix ticket Simplify if( a == 0 ), if( 0 == a ) into if( !a )
http://apps.sourceforge.net/trac/cppcheck/ticket/275
2009-05-01 13:07:10 +03:00
Reijo Tomperi 51d97fa831 Fix ticket (Tokenizer: Handle L "text")
http://apps.sourceforge.net/trac/cppcheck/ticket/212
2009-04-05 22:21:38 +03:00
Reijo Tomperi 14bdf1ee62 Fix ticket (missing function implementation in namespace causes crash)
http://apps.sourceforge.net/trac/cppcheck/ticket/239
2009-03-31 00:59:33 +03:00
Daniel Marjamäki e45bb20f92 tokenizer: don't replace sizeof when size can't be determined () 2009-03-29 16:36:34 +02:00
Daniel Marjamäki 65070cc067 Simplify if conditions more.. simplifyIfAssign + simplifyIfNot 2009-03-24 18:23:21 +01:00
Daniel Marjamäki 7905cbc5e7 simplify tokens: move assignment out from condition (Ticket ) 2009-03-23 18:20:56 +01:00
Daniel Marjamäki a6ad972aad Fix Ticket 180 (Templates: Expanding member functions that are not implemented inline) 2009-03-15 20:03:29 +01:00
Daniel Marjamäki 9b06b22053 templates: replace constructor/destructor names when expanding template classes 2009-03-15 17:07:05 +01:00
Daniel Marjamäki 6eadbaae04 templates: better handling of templates with multiple type arguments 2009-03-14 21:26:32 +01:00
Reijo Tomperi 3c4704a00c Fix ticket (Handling of namespaces)
http://apps.sourceforge.net/trac/cppcheck/ticket/151
2009-03-13 01:07:05 +02:00
Daniel Marjamäki 4c28882a12 expanding template classes 2009-03-12 22:17:42 +01:00
Daniel Marjamäki 1514e65464 astyle style fixes 2009-03-11 19:14:45 +01:00
Daniel Marjamäki 77cf2213fe templates: simplify template functions with 1 type argument 2009-03-11 18:50:24 +01:00
Daniel Marjamäki eac29d151c made the Tokenizer::simplifyCasts more generic 2009-03-10 21:26:08 +01:00
Daniel Marjamäki f8cd34198b simplify casts 2009-03-09 19:47:21 +01:00
Reijo Tomperi 42a9eb9e53 Fix ticket (Segmentation fault when static_cast is in for loop) 2009-03-05 21:32:02 +02:00
Reijo Tomperi 69c23301db Fix ticket Add/Change (the printout of the token list is wrong) 2009-03-03 20:17:23 +00:00
Reijo Tomperi fc8f47145a Copyrights updated 2009-03-01 19:52:33 +00:00
Daniel Marjamäki 4e465f7073 variable declarations: don't simplify when declaring and assigning array in the same statement 2009-02-28 20:40:37 +00:00
Daniel Marjamäki 045477e6ac moved sizeof tests to the TestSimplifyTokens class 2009-02-28 09:09:55 +00:00
Daniel Marjamäki f4a8bc85f2 simplify tokens: fixed bug when removing redundant parantheses around variable 2009-02-27 06:07:38 +00:00
Daniel Marjamäki c1da4ae57d simplify tokens: remove redundant parantheses around variable.. 'p = (q);' 2009-02-25 19:55:24 +00:00
Daniel Marjamäki a844fa017e fixed failed tests 2009-02-18 20:04:34 +00:00
Daniel Marjamäki 19c8473294 reverted [1254] it was made by mistake 2009-02-18 20:01:44 +00:00
Daniel Marjamäki dc2ecb8980 stl push_back: Added check (invalid iterator) 2009-02-18 19:58:50 +00:00
Daniel Marjamäki 1043b76d31 Added Tokenizer::elseif for breaking up 'else if' into 'else { if ..' 2009-02-17 19:18:26 +00:00
Daniel Marjamäki 56d685c179 tokenizer: Remove redundant parantheses around number. Ticket: 2009-02-15 13:28:54 +00:00
Reijo Tomperi fba8c54758 Fix ticket (Convert + + into + and + - into -) and add test case for it 2009-02-14 20:56:08 +00:00
Reijo Tomperi 413bf32cf2 Fixed typos in test case and enabled it. 2009-02-14 18:44:50 +00:00
Reijo Tomperi 916090b389 Improved test case "double_plus" 2009-02-12 20:49:05 +00:00
Reijo Tomperi 030b35c975 Added test case double_plus and improved Token::printOut 2009-02-12 20:32:59 +00:00
Reijo Tomperi 200a159c67 Fix ticket (False positive (style) Redundant code, begins with string) 2009-02-08 08:52:03 +00:00
Reijo Tomperi 2f7dec2fc3 Partial support for sizeof x, by converting it into sizeof(x). Does not handle complex structures. Closing ticket 2009-01-27 20:47:00 +00:00
Reijo Tomperi 176dd41306 Fixed Ticket , Check copyright texts in files, now that we have new developers. 2009-01-21 20:04:20 +00:00
Reijo Tomperi e435a1f1d6 Refactoring: Added src/ and test/ folders. Moved source files to those folders, updated makefile and codeblocks project file. 2009-01-06 14:18:36 +00:00