Daniel Marjamäki
1c59e4a51b
Fixed #528 (Tokenizer: Simplify: 'if(!(a->x=b()))')
2009-08-05 19:45:05 +02:00
Reijo Tomperi
e0f416e52e
astyle fix
2009-08-02 22:11:17 +03:00
Slava Semushin
35e35b38a7
MathLib: introduce and use calculate() method.
...
No functional change.
2009-08-02 19:29:30 +07:00
Slava Semushin
98e8e69c8e
src/tokenize.cpp: don't call std::string.c_str() for Token::str() argument.
...
In 4286fdbabb
commit I introduce
Token::str() method with std::string argument and now we may get rid
of useless std::string.c_str() calls.
No functional change.
2009-08-02 15:54:46 +07:00
Slava Semushin
ed86eda07d
Fixed ticket #549 (Tokenizer: improve calculation simplification)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/549
2009-08-02 15:45:33 +07:00
Slava Semushin
0445edf6fe
Fixed #542 (Tokenizer: allow numbers in templates parameters)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/542
2009-08-01 23:17:35 +07:00
Slava Semushin
0e2273833e
Fixed ticket #539 (Tokenizer: don't replace constants variables with varid 0)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/539
2009-08-01 20:57:54 +07:00
Slava Semushin
8588012df7
Fixed #521 (Tokenizer: improve static variable detection)
...
Also change cppcheck default behavior to don't show "If you see this,
there is a bug" message for each variable without varId. This feature
was very helpful for developers but may annoying users.
http://sourceforge.net/apps/trac/cppcheck/ticket/521
2009-08-01 00:40:36 +07:00
Slava Semushin
fa8e1c82f0
Fixed ticket #534 (Segmentation fault when checking VLC sourcecode)
...
Fixed all valgrind errors.
http://sourceforge.net/apps/trac/cppcheck/ticket/534
2009-07-31 23:06:16 +07:00
Slava Semushin
5db677bc30
Fixed ticket #523 (Tokenizer: set varId for types with long namespaces)
...
FIXME: skip namespaces by the best way.
http://sourceforge.net/apps/trac/cppcheck/ticket/533
2009-07-31 00:40:41 +07:00
Slava Semushin
681b836389
Fixed ticket #532 (Tokenizer: set varId for types which have comma in template parameter)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/532
2009-07-31 00:25:26 +07:00
Reijo Tomperi
b56fdb83da
Fixed ticket #529 (Tokenizer: simplify if((x==0)))
...
http://sourceforge.net/apps/trac/cppcheck/ticket/529
2009-07-30 00:37:01 +03:00
Slava Semushin
8b0c1daf98
Fixed ticket #522 (Tokenizer: recognize comma in container with STL type declaration)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/522
2009-07-29 02:46:33 +07:00
Slava Semushin
f50aa1e188
Fixed ticket #520 (Tokenizer: properly set varId for containers with STL types)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/520
2009-07-29 00:54:13 +07:00
Slava Semushin
c8caefa94c
Fixed ticket #519 (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 #514 (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
Slava Semushin
5ce151983e
Replace simpleMatch() to operator==() from std::string.
...
No functional change.
2009-07-28 00:13:11 +07:00
Daniel Marjamäki
b4a6d74e42
astyle formatting
2009-07-26 22:13:08 +02:00
Slava Semushin
a73346e889
Fixed ticket #496 (Tokenizer: simplify statements with "," better)
...
https://sourceforge.net/apps/trac/cppcheck/ticket/496
2009-07-26 18:03:11 +07:00
Daniel Marjamäki
2544bd8805
astyle formatting
2009-07-25 16:27:18 +02:00
Slava Semushin
8643936e0c
Fixed ticket #500 (Tokenizer: simplify the "(p != NULL)" conditions)
...
Also teach simplifyIfNot() to handle variables like Foo::var.
https://sourceforge.net/apps/trac/cppcheck/ticket/500
2009-07-25 18:23:03 +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
62f681094f
tokenizer: added todo for simplifying '(true?x:y)' => '(x)'
2009-07-22 19:39:31 +02:00
Daniel Marjamäki
1d514e1afe
Fixed #497 (Templates are not expanded correctly)
2009-07-22 13:29:42 +02:00
Slava Semushin
53c120c701
Fixed ticket #479 (varId not assigned to reference to standart container)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/479
2009-07-18 17:41:46 +07:00
Daniel Marjamäki
2ccc01f5ed
tokenizer: improved the Tokenizer::simplifyIfNot
2009-07-18 10:18:46 +02:00
Vesa Pikki
962757c257
Added support for checking files via commandline arguments.
2009-07-16 08:20:29 +03:00
Daniel Marjamäki
54f676177e
doxygen: added a todo to simplify 'for' loops better in the tokenizer
2009-07-14 15:30:23 +02:00
Daniel Marjamäki
69b1df3bb8
tokenizer: simplify the '?:' operator
2009-07-14 12:06:38 +02:00
Daniel Marjamäki
4f2520bef3
doxygen: made the todos visible in the doxygen output
2009-07-14 08:17:12 +02:00
Daniel Marjamäki
17008879ac
minor refactoring: header cleanup. use forward declarations instead of includes
2009-07-13 19:11:31 +02:00
Kimmo Varis
6393498966
Astyle fixes.
2009-07-13 16:51:35 +03:00
Daniel Marjamäki
a6ac747830
tokenizer: Don't simplify declarations of static variables
2009-07-06 11:45:14 +02:00
Reijo Tomperi
8b0e481d46
Refactoring: Rename member functions to follow naming guidelines.
2009-07-05 23:16:43 +03:00
Reijo Tomperi
e858ab2f0d
Fix ticket #457 (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
26358debcf
Fix ticket #448 (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
Reijo Tomperi
bdf1987cc4
Fix ticket #435 (False positive: Invalid number of character when ({}) is used in code)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/435
2009-06-22 23:54:11 +03:00
Daniel Marjamäki
453a5cdd47
Fixed ticket #411 (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
5f7d88b36c
Fix ticket #416 (False positive: Redundant code)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/416
2009-06-19 19:03:09 +03:00
Reijo Tomperi
e8d1905e6d
Fix ticket #418 (delete a,b; not tokenized correctly)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/418
2009-06-19 00:00:16 +03:00
Slava Semushin
fafc261611
Fixed ticket #278 (variable id: references are not handled correctly)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/278
2009-06-18 23:30:04 +07:00
Slava Semushin
8c327f82b3
Fixed ticket #346 (adding a "const" token prevents detection of memory leak)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/346
2009-06-15 00:32:34 +07:00
Daniel Marjamäki
af7c63155e
Fixed #387 (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
c56c913635
Merge branch 'master' of git@github.com:danmar/cppcheck
2009-06-14 11:30:22 +02:00
Daniel Marjamäki
be52e573f3
Fixed ticket #387 (Templates: template functions that return a pointer are not simplified correctly)
2009-06-14 11:28:25 +02:00
Slava Semushin
4286fdbabb
Token: introduce str(const std::string &) method.
...
Get rid of useless std::string.c_str() calls.
No functional change.
2009-06-14 13:55:23 +07:00
Slava Semushin
bc32d04efa
Replace tok->previous()->previous() call to tok->tokAt(-2).
...
Done by command:
git grep -l 'previous()->previous()' | xargs sed -i 's|previous()->previous()|tokAt(-2)|'
No functional change.
2009-06-14 13:33:45 +07:00
Slava Semushin
4245047674
Replace tok->next()->next() call to tok->tokAt(2).
...
Done by command:
git grep -l 'next()->next()' | xargs sed -i 's|next()->next()|tokAt(2)|'
No functional change.
2009-06-14 13:33:45 +07:00
Reijo Tomperi
a6d2dceeb3
Fixed ticket #398 (valgrind shows error when running testrunner)
...
http://172.29.29.21/apps/trac/cppcheck/ticket/398
2009-06-13 00:17:06 +03:00
Slava Semushin
cba0d9e130
Fixed ticket #392 (false positive and wrong allocation and deallocation not detected)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/392
2009-06-12 21:14:01 +07:00
Slava Semushin
56a0660972
Tokenizer::createLinks(): correct comment.
...
No code change.
2009-06-12 20:49:49 +07:00
Slava Semushin
7bee0cd2df
Fixed ticket #390 (wrong allocation and deallocation not detected)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/390
2009-06-12 20:04:58 +07:00
Reijo Tomperi
092bd79ec4
Fix ticket #386 (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 #377 (False positive with "char a[]")
...
Updated the tokenizer so "char a[]" is tokenized into "char *a"
2009-06-10 19:36:00 +02:00
Daniel Marjamäki
dd473b074a
Fix #153 (Unsigned divide)
...
The "unsigned i" variable declaration wasn't handled well. So I added an "int" token.
2009-06-06 10:40:48 +02:00
Reijo Tomperi
9cd5558f5e
Fix ticket #364 (false positive:: division by zero)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/364
2009-06-06 00:33:13 +03:00
Slava Semushin
58781c761c
Fixed ticket #329 (snprintf size is out of bounds when two variables in one scope with similar names)
...
FIXME:
Because it's fix for simplifyTokenList() test should be moved to
test/testsimplifytokens.cpp file.
http://apps.sourceforge.net/trac/cppcheck/ticket/329
2009-06-05 09:53:34 +07:00
Reijo Tomperi
3428584925
Fix ticket #351 (false positive::resource leak)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/351
2009-06-03 22:02:16 +03:00
Slava Semushin
09fce76e30
Fixed ticket #348 (Simplify sizeof for pointers)
...
https://apps.sourceforge.net/trac/cppcheck/ticket/348
2009-06-01 17:01:45 +07:00
Slava Semushin
3d0926936f
Tokenizer::simplifyTokenList: use SizeOfType().
...
No functional change.
2009-06-01 16:59:35 +07:00
Slava Semushin
fa5cdcb128
Tokenizer::simplifyTokenList: reduce indent.
...
No functional change.
2009-06-01 16:27:04 +07:00
Slava Semushin
dc6168b9d7
Tokenizer::simplifyTokenList: some improvements.
...
Corrections for 2de4c516e9
commit:
- declare variable near their usage
- set right position of next token
2009-06-01 03:01:10 +07:00
Reijo Tomperi
2de4c516e9
Fixed ticket #338 (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
Slava Semushin
8822cbb713
src/tokenize.cpp(unwantedWords): propagate const modifier.
...
No functional change.
2009-06-01 02:04:29 +07:00
Daniel Marjamäki
2120edb89b
Variable Id: structs must not have variable id
2009-05-31 18:46:32 +02:00
Slava Semushin
5f57e4ac2d
Merge branch 'master' of git@github.com:danmar/cppcheck
2009-05-31 20:50:55 +07:00
Slava Semushin
fb0c217c3e
src/tokenize.cpp(combineWithNext): propagate const modifier.
...
No functional change.
2009-05-31 20:48:40 +07:00
Reijo Tomperi
3fe1b50e60
Fix ticket #344 (Tokenizer crash in Windows)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/344
2009-05-31 15:55:06 +03:00
Daniel Marjamäki
aba7518aeb
Fixed ticket #345 ('!' and 'not' tokens interpreted differently even though they mean the same)
2009-05-31 10:42:27 +02:00
Reijo Tomperi
58eda6e978
Fix ticket #325 (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
Reijo Tomperi
8876f0ee57
Fix ticket #342 (Simplify "if( (true) == true )")
...
http://apps.sourceforge.net/trac/cppcheck/ticket/342
2009-05-30 00:04:01 +03:00
Reijo Tomperi
a3be307c03
Fix bug related to ticket #330 , cppcheck hanged with some files containing "(("
...
http://apps.sourceforge.net/trac/cppcheck/ticket/330
2009-05-28 23:03:36 +03:00
Daniel Marjamäki
a3990648a9
Tokenizer: Simplifying redundant parantheses
...
http://apps.sourceforge.net/trac/cppcheck/ticket/330
2009-05-28 19:37:39 +02:00
Reijo Tomperi
adb1ed4947
Fix ticket #319 (Function names are tagged as variables)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/319
2009-05-27 23:34:08 +03:00
Daniel Marjamäki
ca6d927dfa
Fix ticket 330 (found memory leak when __builtin_expect uses)
2009-05-27 20:49:29 +02:00
Daniel Marjamäki
e89c03da92
Fix ticket 308 (cppcheck msg:: invalid number of ((). Cant process file)
2009-05-27 20:07:18 +02:00
Daniel Marjamäki
b9b542d05b
Fixed ticket #333 (tokenizer: incorrect removal of decrement/increment)
2009-05-25 14:21:58 +02:00
Daniel Marjamäki
2d2c0e42cc
Fix ticket #317 (pre-increment causes style false positive)
2009-05-25 08:31:20 +02:00
Daniel Marjamäki
7fdd497c44
Fix ticket #317 (pre-increment causes style false positive)
2009-05-25 08:26:11 +02:00
Reijo Tomperi
0f9b2efa43
Fix ticket #326 (Reported memory leak when pointer returned by assign to function's parameter)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/326
2009-05-22 23:36:03 +03:00
Slava Semushin
0f20ce738d
Replaced two Token::simpleMatch() calls to one Token::Match().
...
Suggested by hyd_danmar in ticket
http://apps.sourceforge.net/trac/cppcheck/ticket/323
No functional change.
2009-05-22 22:03:42 +07:00
Daniel Marjamäki
f182365bd2
Applied patch 0001-Use-Token-simpleMatch-instead-of-Token-Match-w
...
Author: php-coder
Ticket: http://apps.sourceforge.net/trac/cppcheck/ticket/323
2009-05-21 17:55:52 +02:00
Reijo Tomperi
997a784bb6
Added TODO test case TestPreprocessor::multiline_comment
...
Made tokenizer to printout token list in case of syntax error, if debug is used
2009-05-13 00:01:53 +03:00
Reijo Tomperi
e83db8ac7b
Fix ticket #288 (Tokenizer::syntaxError should use error logger instead of std::cout)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/288
2009-05-11 22:52:04 +03:00
Reijo Tomperi
f2a5527e60
Fix #289 (if() is not properly tokenized)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/289
2009-05-09 23:12:14 +03:00
Reijo Tomperi
63da926ed2
Fix ticket #294 (### Error: Invalid number of character ()
...
http://apps.sourceforge.net/trac/cppcheck/ticket/294
2009-05-09 22:32:29 +03:00
Daniel Marjamäki
e9eba16053
templates: fixed problem when for example calling static member function in a template class ( #293 )
2009-05-09 08:02:59 +02:00
Daniel Marjamäki
dae530d8de
template: no usage -> no expansion ( #292 )
2009-05-08 16:19:22 +02:00
Reijo Tomperi
dd8b738f7f
Initial fix for ticket #283 (segmentation fault when checking xterm sources)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/283
It should print out error message now instead of crashing. Cleanup is needed.
2009-05-07 23:17:29 +03:00
Daniel Marjamäki
917a48cd65
templates: don't expand forward declarations for templates
2009-05-07 16:05:07 +02:00
Daniel Marjamäki
51beadd81c
templates: instantiations in a template class ( #280 )
2009-05-06 21:03:11 +02:00
Daniel Marjamäki
feba87187a
templates: speedup by breaking out inner loops ( #257 )
2009-05-05 20:16:57 +02:00
Daniel Marjamäki
96ebf343f1
speedup: made the token simplifications a little faster
2009-05-03 21:32:22 +02:00
Daniel Marjamäki
7a8b980627
templates: extracted the template simplification into a separate function
2009-05-03 21:23:47 +02:00
Reijo Tomperi
0f59ef9064
Fix #276 (simplification: Variable value)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/276
2009-05-03 21:57:27 +03:00
Reijo Tomperi
cb209bbd41
Fix #279 (Refactoring: replace and remove Token::aaaa , Token::aaaa0 and Token::aaaa1)
...
http://apps.sourceforge.net/trac/cppcheck/ticket/279
2009-05-03 21:10:59 +03:00
Daniel Marjamäki
c9eab77683
varid: speedup of the algorithm for setting variable ids
2009-05-03 14:31:54 +02:00
Daniel Marjamäki
f6d6a3855e
varid: updated handling of variable id for class variables ( #26 )
2009-05-03 13:50:26 +02:00