Improve loplugin:passstuffbyref

Change-Id: I88ab4c51ff59312127681d3087d22b9c79192b94
This commit is contained in:
Stephan Bergmann
2015-03-03 08:55:35 +01:00
parent 8acdf876c5
commit 24a89b2772
4 changed files with 9 additions and 6 deletions

View File

@@ -47,7 +47,10 @@ bool PassStuffByRef::VisitFunctionDecl(const FunctionDecl * functionDecl) {
} }
// only warn on the definition/prototype of the function, // only warn on the definition/prototype of the function,
// not on the function implementation // not on the function implementation
if (functionDecl->isThisDeclarationADefinition() && functionDecl->getPreviousDecl() != nullptr) { if ((functionDecl->isThisDeclarationADefinition()
&& functionDecl->getPreviousDecl() != nullptr)
|| functionDecl->isDeleted())
{
return true; return true;
} }
// only consider base declarations, not overriden ones, or we warn on methods that // only consider base declarations, not overriden ones, or we warn on methods that
@@ -95,7 +98,7 @@ bool PassStuffByRef::VisitLambdaExpr(const LambdaExpr * expr) {
} }
bool PassStuffByRef::isFat(QualType type, std::string * name) { bool PassStuffByRef::isFat(QualType type, std::string * name) {
if (!type->isClassType()) { if (!type->isRecordType()) {
return false; return false;
} }
*name = type.getUnqualifiedType().getCanonicalType().getAsString(); *name = type.getUnqualifiedType().getCanonicalType().getAsString();

View File

@@ -131,7 +131,7 @@ void dumpMoveProtectAsAttribute(bool bMoveProtect, xmlTextWriterPtr xmlWriter);
void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter); void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter);
void dumpSizeProtectAsAttribute(bool bSizeProtect, xmlTextWriterPtr xmlWriter); void dumpSizeProtectAsAttribute(bool bSizeProtect, xmlTextWriterPtr xmlWriter);
void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter); void dumpHomogenMatrixLine3(com::sun::star::drawing::HomogenMatrixLine3 aLine, xmlTextWriterPtr xmlWriter);
void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter); void dumpTransformationAsElement(com::sun::star::drawing::HomogenMatrix3 const & aTransformation, xmlTextWriterPtr xmlWriter);
void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter); void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter);
void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter); void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter);
void dumpInteropGrabBagAsElement(const uno::Sequence< beans::PropertyValue>& aInteropGrabBag, xmlTextWriterPtr xmlWriter); void dumpInteropGrabBagAsElement(const uno::Sequence< beans::PropertyValue>& aInteropGrabBag, xmlTextWriterPtr xmlWriter);
@@ -1031,7 +1031,7 @@ void dumpHomogenMatrixLine3(drawing::HomogenMatrixLine3 aHomogenMatrixLine3, xml
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3); xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("column3"), "%f", aHomogenMatrixLine3.Column3);
} }
void dumpTransformationAsElement(drawing::HomogenMatrix3 aTransformation, xmlTextWriterPtr xmlWriter) void dumpTransformationAsElement(drawing::HomogenMatrix3 const & aTransformation, xmlTextWriterPtr xmlWriter)
{ {
xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" )); xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Transformation" ));
{ {

View File

@@ -119,7 +119,7 @@ using namespace com::sun::star;
namespace namespace
{ {
static inline bool IsPrevPos( const SwPosition rPos1, const SwPosition rPos2 ) static inline bool IsPrevPos( const SwPosition & rPos1, const SwPosition & rPos2 )
{ {
const SwCntntNode* pCNd; const SwCntntNode* pCNd;
return 0 == rPos2.nContent.GetIndex() && return 0 == rPos2.nContent.GetIndex() &&

View File

@@ -169,7 +169,7 @@ namespace
return aValue; return aValue;
} }
libcmis::PropertyPtr lcl_unoToCmisProperty( document::CmisProperty prop ) libcmis::PropertyPtr lcl_unoToCmisProperty( document::CmisProperty const & prop )
{ {
libcmis::PropertyTypePtr propertyType( new libcmis::PropertyType( ) ); libcmis::PropertyTypePtr propertyType( new libcmis::PropertyType( ) );