Commit Graph

69 Commits

Author SHA1 Message Date
PKEuS b2835051df Refactorization: Renamed Token::Match pattern %var% to %name%, implement new pattern %var% which is true if varId > 0. 2015-01-31 12:32:04 +01:00
PKEuS 8225b12763 Fixed some cppcheck messages 2015-01-28 22:29:07 +01:00
Thomas Jarosch 4bec2b58fd Unused function check: Fix detection of func.usedOtherFile
Check if function is called from another file or not.
2015-01-07 11:29:37 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS 493ab541ab Fixed #6291 and #6293: Support :: in front of function name in checkUnusedFunctions
Simplified code in CheckUnusedFunctions
2014-12-09 22:04:51 +01:00
Daniel Marjamäki 0b9d80c95d Refactoring CheckUnusedFunctions so it uses new infrastructure for multifile analysis 2014-12-02 06:41:18 +01:00
Daniel Marjamäki a002654c47 Reverted refactoring 828417c for now. It caused a major slowdown in the unused functions checking. 2014-11-24 06:37:08 +01:00
Daniel Marjamäki 828417c934 CheckUnusedFunction: Refactorings to use same infrastructure for whole program analysis as CheckUninitVar and CheckBufferOverrun 2014-11-15 18:44:23 +01:00
Dmitry-Me 57c379d300 Cleanup variable names, reduce unneeded operations 2014-09-17 15:52:03 +04:00
PKEuS 8722bba52a Fixed false positive #4648 2014-08-31 20:33:27 +02:00
PKEuS d93d7401c6 Moved getSourceFilePath(), isC() and isCPP() from Tokenizer to TokenList
Conflicts:
	lib/tokenize.cpp
2014-06-04 18:36:25 +02:00
PKEuS 9bfc2b618b Fixed crashes random crashes in multithreading caused by useless creation of CheckUnusedFunctions instance per thread. 2014-04-13 11:56:38 +02:00
PKEuS e8c7a723f5 Fixed five new true positives in cppcheck, silenced one new false positive (see #5618) 2014-03-27 15:50:30 +01:00
PKEuS 6c4e8761c8 Fixed false positive "unused function" #5113. 2014-03-26 12:34:21 +01:00
PKEuS 848d079c71 Refactorized detection of function usage in CheckUnusedFunction, fixed #5358 2014-03-26 09:12:41 +01:00
PKEuS 02f38772cc Refactorization: Use SymbolDatabase to find functions in CheckUnusedFunctions 2014-03-26 08:54:56 +01:00
Robert Reif e26bd5b99c Fixed #5563 (add __attribute__((destructor)) and improve __attribute__((constructor)) support) 2014-03-14 18:17:21 +01:00
Thomas Jarosch c80f272176 Run astyle 2014-03-14 15:51:15 +01:00
Sam Truscott 5dc13f3538 Tidy up the code for cppcheck style. 2014-03-13 16:47:00 +00:00
Sam Truscott 3d0524ecc6 Update the detection of the arguments in Qt's invokeMethod.
invokeMethod can invoke functions by name (string) rather than a
direct function call (i.e. reflection). The old code wasn't
correctly parsing out the argument which contained the name
of the function to call.

This resulted in that function being reported as unused when it is.
2014-03-13 16:43:25 +00:00
Sam Truscott 385478d89e Reflection no longer part of markup. Some tokeniser not done on markup. 2014-03-11 15:57:28 +01:00
Lauri Nurmi 70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00
Daniel Marjamäki 23efc68dd7 use nullptr 2014-02-16 10:32:10 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki a94fccf51a astyle formatting 2014-01-02 21:47:35 +01:00
Sam Truscott 4333dd3c75 Update Qt to support Markup structure 2014-01-02 18:18:24 +01:00
Daniel Marjamäki e446a28b3d Refactoring FileLister and Path so they don't depend on Library 2013-10-31 19:09:01 +01:00
Sam Truscott 6806fd8135 Extended Qt support through Library 2013-10-20 14:09:10 +02:00
Daniel Marjamäki 4a1d1ce1a1 Fixed #3471 (Unused functions: take __attribute__((constructor)) in to consideration) 2013-08-30 06:27:46 +02:00
Daniel Marjamäki 9b4f6a6b3d Fixed #4701 (false positive unusedFunction when using templates) 2013-08-23 06:47:52 +02:00
Daniel Marjamäki 4cd8c7c608 Merge pull request #128 from acmyo/master
Fix compiler warnings and comment/string typos
2013-01-16 08:00:59 -08:00
Daniel Marjamäki 0fb2d309a6 Fixed #4490 (False positive: unused function (function pointer is taken in global scope)) 2013-01-16 16:52:57 +01:00
Andrew C. Martin 4a73c93750 Fix compiler warnings and comment/string typos
- fix g++ warning:

> lib/checkother.cpp:3779: warning: comparison between signed and unsigned integer expressions

 - fix suncc warning (see [everything2](http://everything2.com/title/C%252B%252B%253A+static+extern+%2522C%2522)):

> "lib/checkmemoryleak.cpp", line 578: Warning (Anachronism): Formal argument __compar of type extern "C" int(*)(const void*,const void*) in call to bsearch(const void*, const void*, unsigned long, unsigned long, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).

- prefer empty() / isEmpty() over "size() > 0" (cases not caught by stlSize)

- fix word misspellings (mostly comments, a few output lines)

  - Parenthesis => Parentheses (both variations were used in the codebase)

  - fix typo and wording ("never alwayw") in gui/test/data/benchmark/simple.cpp's CheckOther::unsignedPositive():

```
-  "An unsigned variable will never alwayw be positive so it is either pointless or "
+  "An unsigned variable can't be negative so it is either pointless or "
```
2013-01-16 07:37:07 -07:00
Daniel Marjamäki 78f3c5f772 Unused functions: Fixed invalid pattern match 2013-01-16 06:43:19 +01:00
Daniel Marjamäki 2fa35a6f8d Fixed #4429 (unused functions: handle function declarations better) 2013-01-15 17:00:28 +01:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
PKEuS 24b98feadb Message refactorization: checkuninitvar.cpp, checkunusedfunctions.cpp, checkunusedvar.cpp 2012-11-01 18:40:20 +01:00
PKEuS cc1faad34a Removed bailouts in CheckClass::privateFunctions and CheckUnusedFunctions when checking code with templates (unnecessary after 2c10e9a6ca) 2012-07-29 08:05:54 -07:00
Daniel Marjamäki f967142436 Fixed #3875 (Static member method called with class name is considered unused) 2012-06-14 22:04:21 +02:00
PKEuS 1a5fbd61d2 Splitted class TokenList from Tokenizer 2012-05-05 09:33:26 -07:00
PKEuS c12d82aeb9 Fixed false negative in unused functions check when function returns reference
Removed some unnecessary loops
2012-04-09 11:00:31 +02:00
Ettl Martin 013ef6157d fixed regression 2012-02-26 13:35:35 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
Daniel Marjamäki b7988a3dab Fixed #3336 (False positive: Member function is not used (used by template function)) 2011-12-03 12:19:26 +01:00
Edoardo Prezioso a32b05197d Change every 'tokAt(1)' to 'next()' and every 'tokAt(-1)' to 'previous()'.
Added a safety check to ensure that a 'previous()' call doesn't crash (not sure if it's needed or not).
2011-11-20 15:59:37 +01:00
Daniel Marjamaki 8514466c68 Visual Studio: Fixed compiler error 2011-10-30 09:53:14 +01:00
Daniel Marjamäki 24a2b6e6ba Fixed #3195 (operator() from a functor-struct is never used) 2011-10-29 20:04:43 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Robert Reif 1dc7c0edf9 fix #3127 ([False positive] _tmain function i VS 2010 project) 2011-09-21 20:16:20 -04:00
Robert Reif 958a53eaa8 run astyle 2011-09-18 12:58:28 -04:00