loplugin:staticmethods

Change-Id: If97f01a05294fa7efd59a8934c7b6f65cda5084a
This commit is contained in:
Noel Grandin
2015-04-10 11:07:36 +02:00
parent 26ec80f47d
commit ee094bd46f
25 changed files with 61 additions and 49 deletions

View File

@@ -103,7 +103,8 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
return true;
}
// the DDE has a dummy implementation on Linux and a real one on Windows
if (getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart()) == SRCDIR "/include/svl/svdde.hxx") {
std::string aFilename = getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart());
if (aFilename == SRCDIR "/include/svl/svdde.hxx") {
return true;
}
std::string aParentName = pCXXMethodDecl->getParent()->getQualifiedNameAsString();
@@ -127,10 +128,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 (startsWith(getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart()), SRCDIR "/include/unotools")) {
if (startsWith(aFilename, SRCDIR "/include/unotools")) {
return true;
}
if (startsWith(getFilename(pCXXMethodDecl->getCanonicalDecl()->getLocStart()), SRCDIR "/include/svl")) {
if (startsWith(aFilename, SRCDIR "/include/svl")) {
return true;
}
if (startsWith(aFilename, SRCDIR "/include/framework") || startsWith(aFilename, SRCDIR "/framework")) {
return true;
}
// there is some odd stuff happening here I don't fully understand, leave it for now
if (startsWith(aFilename, SRCDIR "/include/canvas") || startsWith(aFilename, SRCDIR "/canvas")) {
return true;
}
// classes that have static data and some kind of weird reference-counting trick in it's constructor
@@ -145,7 +153,14 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
std::string fqn = aParentName + "::" + pCXXMethodDecl->getNameAsString();
// only empty on Linux, not on windows
if (fqn == "OleEmbeddedObject::GetVisualRepresentationInNativeFormat_Impl"
|| fqn == "OleEmbeddedObject::GetRidOfComponent") {
|| fqn == "OleEmbeddedObject::GetRidOfComponent"
|| fqn == "connectivity::mozab::ProfileAccess::isProfileLocked"
|| startsWith(fqn, "SbxDecimal::")
|| fqn == "SbiDllMgr::Call" || fqn == "SbiDllMgr::FreeDll") {
return true;
}
// used in a function-pointer-table
if (startsWith(fqn, "SbiRuntime::Step")) {
return true;
}