loplugin:unusedmethods package
Change-Id: I19d6bbb9288d72b99d1023b4983b1c3fff7570e8 Reviewed-on: https://gerrit.libreoffice.org/16811 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
3ddaeaab37
commit
e546ed01e6
@@ -142,19 +142,20 @@ bool UnusedMethods::VisitCallExpr(CallExpr* expr)
|
|||||||
if (ignoreLocation(expr)) {
|
if (ignoreLocation(expr)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
CXXMethodDecl* decl = dyn_cast_or_null<CXXMethodDecl>(
|
FunctionDecl* calleeFunctionDecl = expr->getDirectCallee();
|
||||||
expr->getDirectCallee());
|
|
||||||
if (decl == nullptr) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
logCallToRootMethods(decl);
|
|
||||||
// if we see a call to a templated method, it effectively instantiates a new method,
|
// if we see a call to a templated method, it effectively instantiates a new method,
|
||||||
// so we need to examine it's interior to see if it in turn calls anything else
|
// so we need to examine it's interior to see if it in turn calls anything else
|
||||||
if (decl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate
|
if (calleeFunctionDecl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate
|
||||||
|| decl->isFunctionTemplateSpecialization())
|
|| calleeFunctionDecl->isFunctionTemplateSpecialization())
|
||||||
{
|
{
|
||||||
TraverseCXXMethodDecl(decl);
|
TraverseFunctionDecl(calleeFunctionDecl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CXXMethodDecl* calleeMethodDecl = dyn_cast_or_null<CXXMethodDecl>(calleeFunctionDecl);
|
||||||
|
if (calleeMethodDecl == nullptr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
logCallToRootMethods(calleeMethodDecl);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@ exclusionSet = set([
|
|||||||
"void unoidl::detail::SourceProviderScannerData::setSource(const void *,unsigned long)",
|
"void unoidl::detail::SourceProviderScannerData::setSource(const void *,unsigned long)",
|
||||||
# TODO track instantiations of template class constructors
|
# TODO track instantiations of template class constructors
|
||||||
"void comphelper::IEventProcessor::release()",
|
"void comphelper::IEventProcessor::release()",
|
||||||
|
"void SotMutexHolder::acquire()",
|
||||||
|
"void SotMutexHolder::release()",
|
||||||
# used by Windows build
|
# used by Windows build
|
||||||
"_Bool basegfx::B2ITuple::equalZero() const",
|
"_Bool basegfx::B2ITuple::equalZero() const",
|
||||||
"class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const",
|
"class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const",
|
||||||
|
@@ -45,7 +45,6 @@ protected:
|
|||||||
public:
|
public:
|
||||||
~Deflater();
|
~Deflater();
|
||||||
Deflater(sal_Int32 nSetLevel, bool bNowrap);
|
Deflater(sal_Int32 nSetLevel, bool bNowrap);
|
||||||
void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
|
|
||||||
void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
|
void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
|
||||||
bool SAL_CALL needsInput( );
|
bool SAL_CALL needsInput( );
|
||||||
void SAL_CALL finish( );
|
void SAL_CALL finish( );
|
||||||
|
@@ -64,13 +64,6 @@ public:
|
|||||||
WriteBytes( a4Sequence );
|
WriteBytes( a4Sequence );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteUInt16(sal_uInt16 nuInt16)
|
|
||||||
{
|
|
||||||
p2Sequence[0] = static_cast< sal_Int8 >((nuInt16 >> 0 ) & 0xFF);
|
|
||||||
p2Sequence[1] = static_cast< sal_Int8 >((nuInt16 >> 8 ) & 0xFF);
|
|
||||||
WriteBytes( a2Sequence );
|
|
||||||
}
|
|
||||||
|
|
||||||
void WriteUInt32(sal_uInt32 nuInt32)
|
void WriteUInt32(sal_uInt32 nuInt32)
|
||||||
{
|
{
|
||||||
p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF);
|
p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF);
|
||||||
|
@@ -67,18 +67,6 @@ protected:
|
|||||||
|
|
||||||
bool bRecoveryMode;
|
bool bRecoveryMode;
|
||||||
|
|
||||||
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createMemoryStream(
|
|
||||||
ZipEntry & rEntry,
|
|
||||||
const ::rtl::Reference < EncryptionData > &rData,
|
|
||||||
bool bRawStream,
|
|
||||||
bool bDecrypt );
|
|
||||||
|
|
||||||
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createFileStream(
|
|
||||||
ZipEntry & rEntry,
|
|
||||||
const ::rtl::Reference < EncryptionData > &rData,
|
|
||||||
bool bRawStream,
|
|
||||||
bool bDecrypt );
|
|
||||||
|
|
||||||
// aMediaType parameter is used only for raw stream header creation
|
// aMediaType parameter is used only for raw stream header creation
|
||||||
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createUnbufferedStream(
|
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createUnbufferedStream(
|
||||||
const rtl::Reference<SotMutexHolder>& aMutexHolder,
|
const rtl::Reference<SotMutexHolder>& aMutexHolder,
|
||||||
|
@@ -191,7 +191,6 @@ public:
|
|||||||
static OUString static_getImplementationName();
|
static OUString static_getImplementationName();
|
||||||
static ::com::sun::star::uno::Sequence < OUString > static_getSupportedServiceNames();
|
static ::com::sun::star::uno::Sequence < OUString > static_getSupportedServiceNames();
|
||||||
static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory );
|
static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory );
|
||||||
bool SAL_CALL static_supportsService(OUString const & rServiceName);
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -40,7 +40,6 @@ public:
|
|||||||
virtual ~ZipPackageBuffer();
|
virtual ~ZipPackageBuffer();
|
||||||
|
|
||||||
inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
|
inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
|
||||||
inline const sal_Int8 * getConstArray () const { return m_aBuffer.getConstArray(); }
|
|
||||||
inline const com::sun::star::uno::Sequence < sal_Int8> getSequence () const { return m_aBuffer; }
|
inline const com::sun::star::uno::Sequence < sal_Int8> getSequence () const { return m_aBuffer; }
|
||||||
|
|
||||||
// XInputStream
|
// XInputStream
|
||||||
|
@@ -64,7 +64,6 @@ public:
|
|||||||
void SetMediaType ( const OUString & sNewType) { msMediaType = sNewType; }
|
void SetMediaType ( const OUString & sNewType) { msMediaType = sNewType; }
|
||||||
void doSetParent ( ZipPackageFolder * pNewParent, bool bInsert );
|
void doSetParent ( ZipPackageFolder * pNewParent, bool bInsert );
|
||||||
bool IsFolder ( ) { return mbIsFolder; }
|
bool IsFolder ( ) { return mbIsFolder; }
|
||||||
const ZipPackageFolder* GetParent () const { return mpParent; }
|
|
||||||
void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; }
|
void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; }
|
||||||
|
|
||||||
virtual bool saveChild( const OUString &rPath,
|
virtual bool saveChild( const OUString &rPath,
|
||||||
|
@@ -191,12 +191,6 @@ public:
|
|||||||
void Commit();
|
void Commit();
|
||||||
void Revert();
|
void Revert();
|
||||||
|
|
||||||
void Free( bool bMust ); // allows to try to disconnect from the temporary stream
|
|
||||||
// in case bMust is set to sal_True the method
|
|
||||||
// will throw exception in case the file is still busy
|
|
||||||
|
|
||||||
void SetModified(); // can be done only by parent storage after renaming
|
|
||||||
|
|
||||||
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetStreamProperties();
|
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetStreamProperties();
|
||||||
|
|
||||||
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
|
||||||
|
@@ -213,8 +213,6 @@ struct OStorage_Impl
|
|||||||
|
|
||||||
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
|
||||||
void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
|
void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
|
||||||
void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor,
|
|
||||||
const OUString& aPass );
|
|
||||||
|
|
||||||
void InsertIntoPackageFolder(
|
void InsertIntoPackageFolder(
|
||||||
const OUString& aName,
|
const OUString& aName,
|
||||||
@@ -232,8 +230,6 @@ struct OStorage_Impl
|
|||||||
const OUString& aName,
|
const OUString& aName,
|
||||||
bool bDirect );
|
bool bDirect );
|
||||||
|
|
||||||
void SetModified( bool bModified );
|
|
||||||
|
|
||||||
SotElement_Impl* FindElement( const OUString& rName );
|
SotElement_Impl* FindElement( const OUString& rName );
|
||||||
|
|
||||||
SotElement_Impl* InsertStream( const OUString& aName, bool bEncr );
|
SotElement_Impl* InsertStream( const OUString& aName, bool bEncr );
|
||||||
@@ -250,7 +246,6 @@ struct OStorage_Impl
|
|||||||
|
|
||||||
void RemoveElement( SotElement_Impl* pElement );
|
void RemoveElement( SotElement_Impl* pElement );
|
||||||
static void ClearElement( SotElement_Impl* pElement );
|
static void ClearElement( SotElement_Impl* pElement );
|
||||||
void DisposeChildren();
|
|
||||||
|
|
||||||
void CloneStreamElement(
|
void CloneStreamElement(
|
||||||
const OUString& aStreamName,
|
const OUString& aStreamName,
|
||||||
@@ -298,8 +293,6 @@ class OStorage : public ::com::sun::star::lang::XTypeProvider
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void Commit_Impl();
|
|
||||||
|
|
||||||
SotElement_Impl* OpenStreamElement_Impl( const OUString& aStreamName, sal_Int32 nOpenMode, bool bEncr );
|
SotElement_Impl* OpenStreamElement_Impl( const OUString& aStreamName, sal_Int32 nOpenMode, bool bEncr );
|
||||||
|
|
||||||
void BroadcastModifiedIfNecessary();
|
void BroadcastModifiedIfNecessary();
|
||||||
|
@@ -59,48 +59,13 @@ public:
|
|||||||
return nBytesToRead;
|
return nBytesToRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 SAL_CALL readSomeBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData,
|
|
||||||
sal_Int32 nMaxBytesToRead )
|
|
||||||
throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
|
||||||
{
|
|
||||||
return readBytes( aData, nMaxBytesToRead );
|
|
||||||
}
|
|
||||||
void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
|
void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
|
||||||
throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
mnCurrent += nBytesToSkip;
|
mnCurrent += nBytesToSkip;
|
||||||
}
|
}
|
||||||
sal_Int32 SAL_CALL available( )
|
|
||||||
throw(com::sun::star::io::NotConnectedException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
|
||||||
{
|
|
||||||
return mnEnd - mnCurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
// XSeekable chained...
|
// XSeekable chained...
|
||||||
sal_Int64 SAL_CALL seek( sal_Int64 location )
|
|
||||||
throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
|
||||||
{
|
|
||||||
if ( location < 0 || location > mnEnd )
|
|
||||||
throw com::sun::star::lang::IllegalArgumentException ();
|
|
||||||
mnCurrent = static_cast < sal_Int32 > ( location );
|
|
||||||
return mnCurrent;
|
|
||||||
}
|
|
||||||
sal_Int64 SAL_CALL getPosition( )
|
|
||||||
throw(com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
|
||||||
{
|
|
||||||
return mnCurrent;
|
|
||||||
}
|
|
||||||
sal_Int64 SAL_CALL getLength( )
|
|
||||||
throw(com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
|
|
||||||
{
|
|
||||||
return mnEnd;
|
|
||||||
}
|
|
||||||
sal_Int8 ReadInt8()
|
|
||||||
{
|
|
||||||
if (mnCurrent + 1 > mnEnd )
|
|
||||||
return 0;
|
|
||||||
return mpBuffer [mnCurrent++] & 0xFF;
|
|
||||||
}
|
|
||||||
sal_Int16 ReadInt16()
|
sal_Int16 ReadInt16()
|
||||||
{
|
{
|
||||||
if (mnCurrent + 2 > mnEnd )
|
if (mnCurrent + 2 > mnEnd )
|
||||||
@@ -121,21 +86,6 @@ public:
|
|||||||
return nInt32;
|
return nInt32;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt8 ReadUInt8()
|
|
||||||
{
|
|
||||||
if (mnCurrent + 1 > mnEnd )
|
|
||||||
return 0;
|
|
||||||
return mpBuffer [mnCurrent++] & 0xFF;
|
|
||||||
}
|
|
||||||
sal_uInt16 ReadUInt16()
|
|
||||||
{
|
|
||||||
if (mnCurrent + 2 > mnEnd )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
sal_uInt16 nInt16 = mpBuffer [mnCurrent++] & 0xFF;
|
|
||||||
nInt16 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 8;
|
|
||||||
return nInt16;
|
|
||||||
}
|
|
||||||
sal_uInt32 ReadUInt32()
|
sal_uInt32 ReadUInt32()
|
||||||
{
|
{
|
||||||
if (mnCurrent + 4 > mnEnd )
|
if (mnCurrent + 4 > mnEnd )
|
||||||
|
Reference in New Issue
Block a user