diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-04-26 15:50:12 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-27 12:03:57 +0000 |
commit | 1520d0d6f3fdb78a09dfb436ba1d2f6804805311 (patch) | |
tree | 5ede5faf6a720fa87ca67e4646350c2b69aae6bd /compilerplugins | |
parent | e02a29c0a733e4c2a98ed9c7c290928314bb307d (diff) |
cppcheck: silence warnings in compilerplugins
mostly missing explicit before ctors and
uninitialized member vars
one odd use of std::find
> compilerplugins/clang/implicitboolconversion.cxx
> 800 stlIfFind warning Suspicious condition.
> The result of find() is an iterator, but it is not properly checked.
Change-Id: Iade53494cd7fe8ddb0e110e431449ae5a517fe3b
Reviewed-on: https://gerrit.libreoffice.org/24398
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/implicitboolconversion.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/memoryvar.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/oncevar.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/passstuffbyref.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/plugin.hxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/sallogareas.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/staticanonymous.cxx | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx index 226f49db6f1b..8c472125939f 100644 --- a/compilerplugins/clang/implicitboolconversion.cxx +++ b/compilerplugins/clang/implicitboolconversion.cxx @@ -797,7 +797,7 @@ bool ImplicitBoolConversion::TraverseCXXStdInitializerListExpr( bool ret = RecursiveASTVisitor::TraverseCXXStdInitializerListExpr(expr); assert(!nested.empty()); for (auto i: nested.top()) { - if (!std::find(e->begin(), e->end(), i)) { + if (std::find(e->begin(), e->end(), i) == e->end()) { reportWarning(i); } } diff --git a/compilerplugins/clang/memoryvar.cxx b/compilerplugins/clang/memoryvar.cxx index 9cacdeee3ef0..b407c76f7709 100644 --- a/compilerplugins/clang/memoryvar.cxx +++ b/compilerplugins/clang/memoryvar.cxx @@ -25,7 +25,7 @@ class MemoryVar: public RecursiveASTVisitor<MemoryVar>, public loplugin::Plugin { public: - explicit MemoryVar(InstantiationData const & data): Plugin(data) {} + explicit MemoryVar(InstantiationData const & data): Plugin(data), mbChecking(false) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/oncevar.cxx b/compilerplugins/clang/oncevar.cxx index 6a348b4235b9..5c203dfa22e4 100644 --- a/compilerplugins/clang/oncevar.cxx +++ b/compilerplugins/clang/oncevar.cxx @@ -28,7 +28,7 @@ class OnceVar: public RecursiveASTVisitor<OnceVar>, public loplugin::Plugin { public: - explicit OnceVar(InstantiationData const & data): Plugin(data) {} + explicit OnceVar(InstantiationData const & data): Plugin(data), mbChecking(false) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx index 5ffec998059c..c30b6fb6d9ca 100644 --- a/compilerplugins/clang/passstuffbyref.cxx +++ b/compilerplugins/clang/passstuffbyref.cxx @@ -31,7 +31,7 @@ class PassStuffByRef: public RecursiveASTVisitor<PassStuffByRef>, public loplugin::Plugin { public: - explicit PassStuffByRef(InstantiationData const & data): Plugin(data) {} + explicit PassStuffByRef(InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false), mbFoundDisqualifier(false) {} virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx index 778d951d74ca..c630a3ec055b 100644 --- a/compilerplugins/clang/plugin.hxx +++ b/compilerplugins/clang/plugin.hxx @@ -112,7 +112,7 @@ class RewritePlugin : public Rewriter::RewriteOptions { RewriteOptions(); - RewriteOptions( RewriteOption option ); + explicit RewriteOptions( RewriteOption option ); const int flags; }; // syntactic sugar to be able to write 'RemoveLineIfEmpty | RemoveWholeStatement' diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx index a9f6e350f364..512177d4cdb2 100644 --- a/compilerplugins/clang/sallogareas.cxx +++ b/compilerplugins/clang/sallogareas.cxx @@ -27,7 +27,7 @@ if appropriate. */ SalLogAreas::SalLogAreas( const InstantiationData& data ) - : Plugin( data ) + : Plugin(data), inFunction(nullptr) { } diff --git a/compilerplugins/clang/staticanonymous.cxx b/compilerplugins/clang/staticanonymous.cxx index da5724bded60..ff62a56358d4 100644 --- a/compilerplugins/clang/staticanonymous.cxx +++ b/compilerplugins/clang/staticanonymous.cxx @@ -21,7 +21,7 @@ class StaticAnonymous , public Plugin { public: - StaticAnonymous( const InstantiationData& data ); + explicit StaticAnonymous( const InstantiationData& data ); virtual void run() override; bool VisitFunctionDecl( FunctionDecl* func ); |