[Libreoffice-commits] core.git: compilerplugins/clang desktop/source

Stephan Bergmann sbergman at redhat.com
Thu Aug 31 16:01:41 UTC 2017


 compilerplugins/clang/constparams.cxx |    9 ++-------
 desktop/source/minidump/minidump.cxx  |    4 ++--
 2 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 36910b444cee523766fb812ec85ad8f2b5096680
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Aug 31 17:55:52 2017 +0200

    Revert loplugin:constparam behavior when param is subject of cast
    
    ...cf. 72cfd4d024aa9deb68010824a804f252e37b8388 "loplugin:constparams: Also
    handle ObjCObjectPointerType"
    
    Change-Id: Ieec294d721002cac0c37bf2590a9ce20b3e123e3

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;
 }
 


More information about the Libreoffice-commits mailing list