diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-03-26 13:37:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-03-27 08:20:47 +0200 |
commit | 449d416335802b23cf0f8f4725042f92138019cd (patch) | |
tree | 9c72f7efcc8c817a1e20c72180c08340e16aabc6 /compilerplugins | |
parent | cbd1f3695f319c8aa4005d19e40a07c6b4dd116e (diff) |
Let prefix arguments to hasPathnamePrefix end in slash
...for better precision
Change-Id: I5f273b7c66ba931647805c415622b5ac767ff987
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/constantparam.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/includeform.cxx | 6 | ||||
-rw-r--r-- | compilerplugins/clang/memoryvar.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 8 | ||||
-rw-r--r-- | compilerplugins/clang/staticmethods.cxx | 8 | ||||
-rw-r--r-- | compilerplugins/clang/unnecessaryoverride.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/useuniqueptr.cxx | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx index 461eb52a2e97..cb5a380bac73 100644 --- a/compilerplugins/clang/constantparam.cxx +++ b/compilerplugins/clang/constantparam.cxx @@ -121,7 +121,7 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde return; SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( functionDecl->getLocation() ); StringRef filename = compiler.getSourceManager().getFilename(expansionLoc); - if (!loplugin::hasPathnamePrefix(filename, SRCDIR)) + if (!loplugin::hasPathnamePrefix(filename, SRCDIR "/")) return; filename = filename.substr(strlen(SRCDIR)+1); diff --git a/compilerplugins/clang/includeform.cxx b/compilerplugins/clang/includeform.cxx index 284b7dadccff..c26a2aea76d6 100644 --- a/compilerplugins/clang/includeform.cxx +++ b/compilerplugins/clang/includeform.cxx @@ -47,10 +47,10 @@ private: bool shouldUseAngles; if (uno) { shouldUseAngles - = (!(loplugin::hasPathnamePrefix(SearchPath, SRCDIR) - || loplugin::hasPathnamePrefix(SearchPath, BUILDDIR)) + = (!(loplugin::hasPathnamePrefix(SearchPath, SRCDIR "/") + || loplugin::hasPathnamePrefix(SearchPath, BUILDDIR "/")) || loplugin::hasPathnamePrefix( - SearchPath, WORKDIR "/UnpackedTarball")); + SearchPath, WORKDIR "/UnpackedTarball/")); } else { auto dir1 = std::string(SearchPath); loplugin::normalizeDotDotInFilePath(dir1); diff --git a/compilerplugins/clang/memoryvar.cxx b/compilerplugins/clang/memoryvar.cxx index 168cc8bf175f..17cb2701acd0 100644 --- a/compilerplugins/clang/memoryvar.cxx +++ b/compilerplugins/clang/memoryvar.cxx @@ -80,7 +80,7 @@ bool MemoryVar::TraverseFunctionDecl(FunctionDecl * decl) // I'm not getting accurate results from clang right now StringRef aFileName = getFilename(varLoc); // TODO these files are doing some weird stuff I don't know how to ignore yet - if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/vcl/source/filter")) { + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/vcl/source/filter/")) { return true; } if (loplugin::isSamePathname(aFileName, SRCDIR "/sw/source/core/layout/frmtool.cxx")) { diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 3f169972f6a2..b1e789a4a8c5 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -207,7 +207,7 @@ bool PluginHandler::checkIgnoreLocation(SourceLocation loc) // generated into the start of hash.cxx, #if'ed for __GNUC__, but // for clang-cl it is an issue) return true; - if( hasPathnamePrefix(bufferName, WORKDIR) ) + if( hasPathnamePrefix(bufferName, WORKDIR "/") ) { // workdir/CustomTarget/vcl/unx/kde4/tst_exclude_socket_notifiers.moc // includes @@ -219,11 +219,11 @@ bool PluginHandler::checkIgnoreLocation(SourceLocation loc) } std::string s(bufferName); normalizeDotDotInFilePath(s); - if (hasPathnamePrefix(s, WORKDIR)) + if (hasPathnamePrefix(s, WORKDIR "/")) return true; } - if( hasPathnamePrefix(bufferName, BUILDDIR) - || hasPathnamePrefix(bufferName, SRCDIR) ) + if( hasPathnamePrefix(bufferName, BUILDDIR "/") + || hasPathnamePrefix(bufferName, SRCDIR "/") ) return false; // ok return true; } diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index f4e1f068ec0e..50d432081f00 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -117,17 +117,17 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl) return true; } // the unotools and svl config code stuff is doing weird stuff with a reference-counted statically allocated pImpl class - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/unotools")) { + if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/unotools/")) { return true; } - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/svl")) { + if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/svl/")) { return true; } - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/framework") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/framework")) { + if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/framework/") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/framework/")) { return true; } // there is some odd stuff happening here I don't fully understand, leave it for now - if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/canvas") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/canvas")) { + if (loplugin::hasPathnamePrefix(aFilename, SRCDIR "/include/canvas/") || loplugin::hasPathnamePrefix(aFilename, SRCDIR "/canvas/")) { return true; } // classes that have static data and some kind of weird reference-counting trick in its constructor diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx index c5e483816383..338598985289 100644 --- a/compilerplugins/clang/unnecessaryoverride.cxx +++ b/compilerplugins/clang/unnecessaryoverride.cxx @@ -84,7 +84,7 @@ public: return; if (loplugin::isSamePathname(fn, SRCDIR "/svx/source/dialog/rubydialog.cxx")) return; - if (loplugin::hasPathnamePrefix(fn, SRCDIR "/canvas")) + if (loplugin::hasPathnamePrefix(fn, SRCDIR "/canvas/")) return; if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/ui/view/spelldialog.cxx")) return; diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index d8a4be063cb2..3b3e9ff49e81 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -167,7 +167,7 @@ void UseUniquePtr::CheckDeleteExpr(const CXXDestructorDecl* destructorDecl, cons return; // to ignore things like the CPPUNIT macros StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(fieldDecl->getLocStart())); - if (loplugin::hasPathnamePrefix(aFileName, WORKDIR)) + if (loplugin::hasPathnamePrefix(aFileName, WORKDIR "/")) return; // passes and stores pointers to member fields if (loplugin::isSamePathname(aFileName, SRCDIR "/sot/source/sdstor/stgdir.hxx")) |