[Libreoffice-commits] core.git: compilerplugins/clang include/package package/inc package/source

Noel Grandin noel at peralex.com
Tue Jul 7 04:01:41 PDT 2015


 compilerplugins/clang/unusedmethods.cxx     |   19 +++++-----
 compilerplugins/clang/unusedmethods.py      |    2 +
 include/package/Deflater.hxx                |    1 
 package/inc/ByteChucker.hxx                 |    7 ---
 package/inc/ZipFile.hxx                     |   12 ------
 package/inc/ZipPackage.hxx                  |    1 
 package/inc/ZipPackageBuffer.hxx            |    1 
 package/inc/ZipPackageEntry.hxx             |    1 
 package/source/xstor/owriteablestream.hxx   |    6 ---
 package/source/xstor/xstorage.hxx           |    7 ---
 package/source/zipapi/MemoryByteGrabber.hxx |   50 ----------------------------
 11 files changed, 12 insertions(+), 95 deletions(-)

New commits:
commit e546ed01e6bf6dbd8a30cecead4b0b75e2afe92a
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Jul 7 10:12:55 2015 +0200

    loplugin:unusedmethods package
    
    Change-Id: I19d6bbb9288d72b99d1023b4983b1c3fff7570e8
    Reviewed-on: https://gerrit.libreoffice.org/16811
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx
index bdd606b..7dc57e9 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -142,19 +142,20 @@ bool UnusedMethods::VisitCallExpr(CallExpr* expr)
     if (ignoreLocation(expr)) {
         return true;
     }
-    CXXMethodDecl* decl = dyn_cast_or_null<CXXMethodDecl>(
-        expr->getDirectCallee());
-    if (decl == nullptr) {
-        return true;
-    }
-    logCallToRootMethods(decl);
+    FunctionDecl* calleeFunctionDecl = expr->getDirectCallee();
     // 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
-    if (decl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate
-        || decl->isFunctionTemplateSpecialization())
+    if (calleeFunctionDecl->getTemplatedKind() != clang::FunctionDecl::TemplatedKind::TK_NonTemplate
+        || calleeFunctionDecl->isFunctionTemplateSpecialization())
     {
-        TraverseCXXMethodDecl(decl);
+        TraverseFunctionDecl(calleeFunctionDecl);
+    }
+
+    CXXMethodDecl* calleeMethodDecl = dyn_cast_or_null<CXXMethodDecl>(calleeFunctionDecl);
+    if (calleeMethodDecl == nullptr) {
+        return true;
     }
+    logCallToRootMethods(calleeMethodDecl);
     return true;
 }
 
diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py
index 3ee4b38..22d7089 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -27,6 +27,8 @@ exclusionSet = set([
     "void unoidl::detail::SourceProviderScannerData::setSource(const void *,unsigned long)",
     # TODO track instantiations of template class constructors
     "void comphelper::IEventProcessor::release()",
+    "void SotMutexHolder::acquire()",
+    "void SotMutexHolder::release()",
     # used by Windows build
     "_Bool basegfx::B2ITuple::equalZero() const",
     "class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const",
diff --git a/include/package/Deflater.hxx b/include/package/Deflater.hxx
index d2be247..802712e 100644
--- a/include/package/Deflater.hxx
+++ b/include/package/Deflater.hxx
@@ -45,7 +45,6 @@ protected:
 public:
     ~Deflater();
     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 );
     bool SAL_CALL needsInput(  );
     void SAL_CALL finish(  );
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx
index e317e8a..fc1167e 100644
--- a/package/inc/ByteChucker.hxx
+++ b/package/inc/ByteChucker.hxx
@@ -64,13 +64,6 @@ public:
         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)
     {
         p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >>  0 ) & 0xFF);
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index 18d2f0a..83ffd1c 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -67,18 +67,6 @@ protected:
 
     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
     com::sun::star::uno::Reference < com::sun::star::io::XInputStream >  createUnbufferedStream(
             const rtl::Reference<SotMutexHolder>& aMutexHolder,
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index 1318876..18f8639 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -191,7 +191,6 @@ public:
     static OUString static_getImplementationName();
     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 );
-    bool SAL_CALL static_supportsService(OUString const & rServiceName);
 };
 #endif
 
diff --git a/package/inc/ZipPackageBuffer.hxx b/package/inc/ZipPackageBuffer.hxx
index 8f1b9ff..df1d8db 100644
--- a/package/inc/ZipPackageBuffer.hxx
+++ b/package/inc/ZipPackageBuffer.hxx
@@ -40,7 +40,6 @@ public:
     virtual ~ZipPackageBuffer();
 
     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; }
 
     // XInputStream
diff --git a/package/inc/ZipPackageEntry.hxx b/package/inc/ZipPackageEntry.hxx
index fe19772..c1e5c8f 100644
--- a/package/inc/ZipPackageEntry.hxx
+++ b/package/inc/ZipPackageEntry.hxx
@@ -64,7 +64,6 @@ public:
     void SetMediaType ( const OUString & sNewType) { msMediaType = sNewType; }
     void doSetParent ( ZipPackageFolder * pNewParent, bool bInsert );
     bool IsFolder ( ) { return mbIsFolder; }
-    const ZipPackageFolder* GetParent () const { return mpParent; }
     void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; }
 
     virtual bool saveChild( const OUString &rPath,
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 9da76c7..2438e26 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -191,12 +191,6 @@ public:
     void Commit();
     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::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index 6e7879f..c1371a3 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -213,8 +213,6 @@ struct OStorage_Impl
 
     ::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,
-                            const OUString& aPass );
 
     void InsertIntoPackageFolder(
             const OUString& aName,
@@ -232,8 +230,6 @@ struct OStorage_Impl
                             const OUString& aName,
                             bool bDirect );
 
-    void SetModified( bool bModified );
-
     SotElement_Impl* FindElement( const OUString& rName );
 
     SotElement_Impl* InsertStream( const OUString& aName, bool bEncr );
@@ -250,7 +246,6 @@ struct OStorage_Impl
 
     void RemoveElement( SotElement_Impl* pElement );
     static void ClearElement( SotElement_Impl* pElement );
-    void DisposeChildren();
 
     void CloneStreamElement(
                     const OUString& aStreamName,
@@ -298,8 +293,6 @@ class OStorage  : public ::com::sun::star::lang::XTypeProvider
 
 protected:
 
-    void Commit_Impl();
-
     SotElement_Impl* OpenStreamElement_Impl( const OUString& aStreamName, sal_Int32 nOpenMode, bool bEncr );
 
     void BroadcastModifiedIfNecessary();
diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx
index 0e2a739..ce8e0e2 100644
--- a/package/source/zipapi/MemoryByteGrabber.hxx
+++ b/package/source/zipapi/MemoryByteGrabber.hxx
@@ -59,48 +59,13 @@ public:
         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 )
         throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException)
     {
         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...
-    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()
     {
         if (mnCurrent + 2 > mnEnd )
@@ -121,21 +86,6 @@ public:
         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()
     {
         if (mnCurrent + 4 > mnEnd )


More information about the Libreoffice-commits mailing list