diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-08-31 17:55:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-08-31 17:55:52 +0200 |
commit | 36910b444cee523766fb812ec85ad8f2b5096680 (patch) | |
tree | 08e84cd380694bb01f2030ff1c435438702b75c1 | |
parent | 1897812ed4ab11409de8a58a75c3b631332ba92d (diff) |
Revert loplugin:constparam behavior when param is subject of cast
...cf. 72cfd4d024aa9deb68010824a804f252e37b8388 "loplugin:constparams: Also
handle ObjCObjectPointerType"
Change-Id: Ieec294d721002cac0c37bf2590a9ce20b3e123e3
-rw-r--r-- | compilerplugins/clang/constparams.cxx | 9 | ||||
-rw-r--r-- | desktop/source/minidump/minidump.cxx | 4 |
2 files changed, 4 insertions, 9 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx index 50e1c98bfc3c..024c4d8e3430 100644 --- a/compilerplugins/clang/constparams.cxx +++ b/compilerplugins/clang/constparams.cxx @@ -188,6 +188,7 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl) || name == "egiGraphicExport" || name == "etiGraphicExport" || name == "epsGraphicExport" + || name == "releasePool" // vcl/osx/saldata.cxx ) return true; } @@ -422,13 +423,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar return false; } else if (isa<CastExpr>(parent)) { // all other cast expression subtypes if (auto e = dyn_cast<ExplicitCastExpr>(parent)) { - auto t = e->getTypeAsWritten(); - if (t->isAnyPointerType() - && !t->getPointeeType().isConstQualified()) - { - return false; - } - if (loplugin::TypeCheck(t).Void()) { + if (loplugin::TypeCheck(e->getTypeAsWritten()).Void()) { if (auto const sub = dyn_cast<DeclRefExpr>( e->getSubExpr()->IgnoreParenImpCasts())) { diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index ac63bd41096c..96753d6027af 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -40,7 +40,7 @@ std::map<std::string, std::string> readStrings(std::istream& file) } // Callback to get the response data from server. -static size_t WriteCallback(void *ptr, size_t size, +static size_t WriteCallback(void const *ptr, size_t size, size_t nmemb, void *userp) { if (!userp) @@ -48,7 +48,7 @@ static size_t WriteCallback(void *ptr, size_t size, std::string* response = static_cast<std::string *>(userp); size_t real_size = size * nmemb; - response->append(static_cast<char *>(ptr), real_size); + response->append(static_cast<char const *>(ptr), real_size); return real_size; } |