Daniel Marjamäki
2e3a7db4eb
Fixed #4115 (Incorrect uninitialized variable error message with realloc macro)
2012-09-22 18:41:33 +02:00
Daniel Marjamäki
6c25f3662e
Tokenizer::simplifyEnum: Don't simplify enums in function heads. Ticket #3953
2012-09-21 16:17:20 +02:00
Edoardo Prezioso
8e1e8525a3
Partial rewrite of Tokenizer::simplifyComma:
...
skip '= { .. }' where possible;
hence remove '%num% after comma' check because it's redundant now;
replace round braces counter method with faster 'link skip';
if 'endAt' is 'NULL' after finding the ';' token, exit the function;
hence remove redundant 'tok != NULL' check after simplifying 'return' code.
2012-09-20 21:45:16 +02:00
Edoardo Prezioso
eb5a61edfe
Tokenizer: some changes to the code:
...
be sure '?:' ternary operation has whitespaces around the operators;
remove useless loop to get the 6 next tokens, use tokAt(6);
add '?1:0' to bool values when doing a sum with them.
remove useless 'enum' pattern checking in code executed after simplifyEnum;
after being sure the 'tok' is a standard type, begin the loop with the token next to it;
it's possible to remove two tokens before the current one without moving this.
2012-09-20 01:07:50 +02:00
Daniel Marjamäki
aa3cdc6b6f
Fixed #3565 (Variable hides enumerator (attached code example))
2012-09-19 19:19:13 +02:00
Ettl Martin
3f89e38275
fixed #4195 segmentation fault of cppcheck (invalid code); Added a testcase
2012-09-19 10:37:30 +02:00
Daniel Marjamäki
07d2935e81
Fixed #4164 (False positive: (error) Uninitialized variable: min)
2012-09-18 20:55:37 +02:00
Daniel Marjamäki
1f7d9ca22c
Fixed #4211 (Tokenizer::simplifyVarDecl: Improved handling of >> in templates)
2012-09-17 19:45:42 +02:00
Daniel Marjamäki
a99515ca91
Fixed #3933 (Negative array index issue (because sizeof struct is assumed to be 100))
2012-09-16 08:20:43 +02:00
Daniel Marjamäki
f1ebd99dc2
Fixed #3507 (false positive: comma-separated statements before return in methods)
2012-09-15 11:55:08 +02:00
Daniel Marjamäki
9f2e1ab98d
Fixed #4048 (Tokenizer::simplifyVarDecl: Improve handling of 'a::b const * p = 0;')
2012-09-14 16:46:45 +02:00
Daniel Marjamäki
19fdbf0fd0
Fixed #4185 (Incorrect 'Found duplicate if expressions' for strings with high bit set)
2012-09-13 16:44:10 +02:00
PKEuS
22a8e3f4e6
Replaced Tokenizer::getFunctionTokenByName() by SymbolDatabase::findFunctionByName(), which handles scopes slightly better.
2012-09-11 18:03:47 +02:00
Daniel Marjamäki
64faa780fe
Fixed #4087 (div by zero check is invalid for floats)
2012-09-11 16:50:42 +02:00
PKEuS
50f9dd52ab
Used enum instead of string in implementation for '--language='.
2012-09-11 08:53:27 +02:00
PKEuS
5940d77a62
Disabled C++ specific checks and simplifications when checking a C or non-C++ file.
2012-09-10 19:02:32 +02:00
PKEuS
87131f6105
Added new cmdline option --language= (alias of GCC-like -x) to enforce a specific language. Valid values: c, c++, java, c#. ( #3994 )
2012-09-10 18:51:32 +02:00
PKEuS
88f9e9991d
Fixed compiler warning ( #4136 )
2012-09-10 17:43:19 +02:00
PKEuS
ce9f6bdb56
Fixed segfault #4182
2012-09-10 17:33:52 +02:00
Daniel Marjamäki
cf8ac78069
Fixed test assertion failure caused by me
2012-09-09 18:33:41 +02:00
PKEuS
d44f10fc01
Fixed createLinks2() on this code: nvwa<(x > y)>
2012-09-09 15:31:23 +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
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
Daniel Marjamäki
1c7027140a
Tokenizer: Improved simplifyRedundantParanthesis
2012-09-06 16:16:29 +02:00
PKEuS
8c70778b70
Refactorization: Fixed several messages when self-checking cppcheck
2012-09-04 15:29:51 +02:00
anuraggarg011
913670d254
Fixed #3304 (simple cases)
2012-09-04 13:41:14 +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
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
c20adf91bf
Moved simplification of wide character string literals (L"foo") to tokenize(). Token::isLong flag used to indicate that string is a wchar_t literal.
2012-09-01 13:12:47 +02:00
Daniel Marjamäki
15bc552b37
Tokenizer: Fixed possible NULL pointer dereference
2012-09-01 10:11:18 +02:00
Daniel Marjamäki
a8d419820b
Tokenizer: removed unused variable
2012-09-01 09:57:48 +02:00
Edoardo Prezioso
0d26a79f2c
Tokenizer::simplifyEmptyNamespaces: new function.
...
It removes from the token list, if found, the following tokens: 'namespace %var% { }'. It won't involve C code.
2012-08-28 22:40:25 +02:00
PKEuS
bbce79d7b3
Small refactorization: Handle std::map more efficient in setVarIdStructMembers()
2012-08-28 12:57:11 +02:00
PKEuS
ea85dd305a
Fixed #4086 : Set varId in initialization list.
2012-08-28 12:44:40 +02:00
PKEuS
4bab7f0ee2
Removed unused and obsolete functions Tokenizer::getParameterName() and Tokenizer::getNameForFunctionParams()
2012-08-26 16:53:40 +02:00
PKEuS
662b0d2dbe
Simplify 0[foo] to *(foo) ( fixes #4083 )
2012-08-26 10:03:05 +02:00
Daniel Marjamäki
f127728582
Enable --std=c11 and --std=c++11 by default
2012-08-25 21:57:45 +02:00
Daniel Marjamäki
985ac662ee
Fixed #4035 (False positive: Memory leak: pTempFile)
2012-08-25 12:00:25 +02:00