[Libreoffice-commits] core.git: 7 commits - connectivity/source desktop/source dtrans/source extensions/source sal/osl sfx2/source vcl/opengl vcl/win

Stephan Bergmann sbergman at redhat.com
Wed Jul 5 08:12:26 UTC 2017


 connectivity/source/drivers/ado/AKeys.cxx              |    8 ----
 connectivity/source/drivers/ado/APreparedStatement.cxx |   10 -----
 connectivity/source/drivers/ado/AStatement.cxx         |    3 -
 connectivity/source/drivers/ado/Awrapado.cxx           |   31 +++++------------
 desktop/source/lib/init.cxx                            |    6 ---
 dtrans/source/win32/clipb/MtaOleClipb.cxx              |    1 
 dtrans/source/win32/dtobj/FmtFilter.cxx                |    1 
 extensions/source/activex/SOActiveX.cxx                |    3 -
 extensions/source/ole/servprov.cxx                     |    3 -
 sal/osl/w32/module.cxx                                 |    4 --
 sfx2/source/doc/graphhelp.cxx                          |    8 ++--
 vcl/opengl/win/WinDeviceInfo.cxx                       |    3 -
 vcl/win/gdi/salprn.cxx                                 |    1 
 13 files changed, 21 insertions(+), 61 deletions(-)

New commits:
commit d3067c9d37fbb4c085b536c13b1ab9875a27df35
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:53 2017 +0200

    loplugin:casttovoid (clang-cl): vcl
    
    Change-Id: I4c54f7edc0422382e1cd7fca95c2e7ab2b4bab1c

diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index 383cce8d6b98..cb9f1d2943e6 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -36,9 +36,8 @@ namespace {
  * Beware of the implicit trailing '\0' when using this with string constants.
 */
 template<typename T, size_t N>
-size_t ArrayLength(T (&aArr)[N])
+size_t ArrayLength(T (&)[N])
 {
-    (void) aArr;
     return N;
 }
 
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 860351c3e990..11731ddd657d 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -1407,7 +1407,6 @@ void WinSalPrinter::markInvalid()
 // since SEH does not mix with standard exception handling's cleanup
 static int lcl_StartDocW( HDC hDC, DOCINFOW* pInfo, WinSalPrinter* pPrt )
 {
-    (void) pPrt;
     int nRet = 0;
     CATCH_DRIVER_EX_BEGIN;
     nRet = ::StartDocW( hDC, pInfo );
commit b7e7d2d1b1620c326e9cc2f22e41bfd4604480ca
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:47 2017 +0200

    loplugin:casttovoid (clang-cl): sfx2
    
    Change-Id: If96173b69f07712c1914cc711279527e69870100

diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 7e78818c0732..407a035f15ba 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -78,7 +78,6 @@ SvMemoryStream* GraphicHelper::getFormatStrFromGDI_Impl( const GDIMetaFile* pGDI
 // static
 void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
 {
-    (void)pGDIMeta;  // unused
     void* pResult = nullptr;
 
 #ifdef _WIN32
@@ -103,6 +102,8 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
                 pResult = GetEnhMetaFileA( aWinFile.getStr() );
         }
     }
+#else
+    (void)pGDIMeta;  // unused
 #endif
 
     return pResult;
@@ -112,8 +113,6 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
 // static
 void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, const Size& aMetaSize )
 {
-    (void)pGDIMeta;  // unused
-    (void)aMetaSize; // unused
     void* pResult = nullptr;
 
 #ifdef _WIN32
@@ -168,6 +167,9 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co
             }
         }
     }
+#else
+    (void)pGDIMeta;  // unused
+    (void)aMetaSize; // unused
 #endif
 
 
commit 409aab708a51211dd7a10bfc415c99b46b1ec7a2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:40 2017 +0200

    loplugin:casttovoid (clang-cl): sal
    
    Change-Id: I03e22f73404e1e52761bce1757b224cf6368bd61

diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx
index 1c78a6fad33c..317d4820ae05 100644
--- a/sal/osl/w32/module.cxx
+++ b/sal/osl/w32/module.cxx
@@ -93,10 +93,8 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 /*nRtldM
 /*****************************************************************************/
 /* osl_loadModuleAscii */
 /*****************************************************************************/
-oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode )
+oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 )
 {
-    (void) nRtldMode; /* avoid warnings */
-
     HMODULE h;
     UINT errorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
     oslModule ret = nullptr;
commit 9d04754308517e155bcb7332e803b098d17a53d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:32 2017 +0200

    loplugin:casttovoid (clang-cl): extensions
    
    Change-Id: I91eeddd37a745592a9aa0f0827f65db257e1dfad

diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx
index f93ad01018e2..c42683dfbc1f 100644
--- a/extensions/source/activex/SOActiveX.cxx
+++ b/extensions/source/activex/SOActiveX.cxx
@@ -986,8 +986,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
                 CComVariant dummyResult;
                 CComVariant aPropVar;
                 aPropVar.vt = VT_BOOL; aPropVar.boolVal = VARIANT_FALSE;
-                HRESULT hres = ExecuteFunc( mpDispFrame, L"close", &aPropVar, 1, &dummyResult );
-                (void)hres;
+                (void) ExecuteFunc( mpDispFrame, L"close", &aPropVar, 1, &dummyResult );
                 mpDispFrame = CComPtr<IDispatch>();
             }
 
diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx
index 967dcec6595d..86ecc75b0f45 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -623,8 +623,7 @@ OleServer_Impl::OleServer_Impl( const Reference<XMultiServiceFactory>& smgr):
         a >>= m_bridgeSupplier;
     }
 
-    bool ret = provideInstance( m_smgr, const_cast<GUID*>(&OID_ServiceManager) );
-    (void)ret;
+    (void) provideInstance( m_smgr, const_cast<GUID*>(&OID_ServiceManager) );
 }
 
 OleServer_Impl::~OleServer_Impl()
commit 1621a121b344b100a1c2f39fb03791e3e748a8eb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:23 2017 +0200

    loplugin:casttovoid (clang-cl): dtrans
    
    Change-Id: Ie58ab849def17157472e6827c84ee51e14c24b7d

diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx
index aa7681267129..e80b048d7101 100644
--- a/dtrans/source/win32/clipb/MtaOleClipb.cxx
+++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx
@@ -288,7 +288,6 @@ CMtaOleClipboard::~CMtaOleClipboard( )
     sal_uInt32 dwResult = WaitForSingleObject(
         m_hClipboardChangedNotifierThread, MAX_WAIT_SHUTDOWN );
 
-    (void) dwResult;
     OSL_ENSURE( dwResult == WAIT_OBJECT_0, "clipboard notifier thread could not terminate" );
 
     if ( nullptr != m_hClipboardChangedNotifierThread )
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index fc9681f28448..0a2f2446cd1e 100644
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -339,7 +339,6 @@ std::wstring getShellLinkTarget(const std::wstring& aLnkFile)
     catch(sal::systools::ComError& ex)
     {
         OSL_FAIL(ex.what());
-        (void)ex;
     }
     return target;
 }
commit 58cff1a3bd4a02867eb30e54f3235d9434b12c79
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:14 2017 +0200

    loplugin:casttovoid (clang-cl): desktop
    
    Change-Id: Id14f6d0f234188b9e4576380f45dd3eec8d857b7

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 286b93e66e79..b9dedadb47e7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1846,12 +1846,6 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 
 #else
     (void) pBuffer;
-    (void) nCanvasWidth;
-    (void) nCanvasHeight;
-    (void) nTilePosX;
-    (void) nTilePosY;
-    (void) nTileWidth;
-    (void) nTileHeight;
 #endif
 }
 
commit d57c6ff67423151b8d79b5c21c118a22f2813115
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jul 5 10:11:05 2017 +0200

    loplugin:casttovoid (clang-cl): connectivity
    
    Change-Id: I68eef2cff5fffe61bd1ca2abc6d8ef42810406cb

diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx
index 150933368f87..63a45cc6d31f 100644
--- a/connectivity/source/drivers/ado/AKeys.cxx
+++ b/connectivity/source/drivers/ado/AKeys.cxx
@@ -66,13 +66,7 @@ sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XProper
     OLEVariant vOptional;
     vOptional.setNoArg();
 
-#if OSL_DEBUG_LEVEL > 0
-    KeyTypeEnum eKey =
-#endif
-        OAdoKey::Map2KeyRule(getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
-#if OSL_DEBUG_LEVEL > 0
-    (void)eKey;
-#endif
+    OAdoKey::Map2KeyRule(getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
 
     WpADOKey aKey = pKey->getImpl();
     OUString sName = aKey.get_Name();
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
index 97f2f615deb0..4d8206a93508 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -197,16 +197,6 @@ void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const DataTypeEn
         if(pParam)
         {
             m_pParameters->Append(pParam);
-#if OSL_DEBUG_LEVEL > 0
-            pParam = nullptr;
-            m_pParameters->get_Item(OLEVariant(sal_Int32(parameterIndex-1)),&pParam);
-            WpADOParameter aParam(pParam);
-            if(pParam)
-            {
-                DataTypeEnum eType = aParam.GetADOType();
-                (void)eType;
-            }
-#endif
         }
     }
     else
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
index 3e8d0f5d2e3b..c7348fde31fd 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -724,11 +724,10 @@ sal_Bool OStatement_Base::convertFastPropertyValue(
                 break;
         }
     }
-    catch( const Exception& e )
+    catch( const Exception& )
     {
         bModified = true;   // will ensure that the property is set
         OSL_FAIL( "OStatement_Base::convertFastPropertyValue: caught something strange!" );
-        (void)e;
     }
     return bModified;
 }
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index 34e5ea8a9692..53275c04a7a0 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -513,8 +513,7 @@ void WpADOField::get_Value(OLEVariant& aValVar) const
 {
     assert(pInterface);
     aValVar.setEmpty();
-    bool bOk = SUCCEEDED(pInterface->get_Value(&aValVar));
-    (void)bOk;
+    pInterface->get_Value(&aValVar);
 }
 
 OLEVariant WpADOField::get_Value() const
@@ -1038,15 +1037,13 @@ void WpADOColumn::put_Name(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 void WpADOColumn::put_RelatedColumn(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_RelatedColumn(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_RelatedColumn(bstr.asBSTR());
 }
 
 DataTypeEnum WpADOColumn::get_Type() const
@@ -1149,8 +1146,7 @@ void WpADOKey::put_Name(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 
 KeyTypeEnum WpADOKey::get_Type() const
@@ -1179,8 +1175,7 @@ void WpADOKey::put_RelatedTable(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_RelatedTable(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_RelatedTable(bstr.asBSTR());
 }
 
 RuleEnum WpADOKey::get_DeleteRule() const
@@ -1233,8 +1228,7 @@ void WpADOIndex::put_Name(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 
 bool WpADOIndex::get_Clustered() const
@@ -1355,8 +1349,7 @@ void WpADOTable::put_Name(const OUString& _rName)
 {
     assert(pInterface);
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 
 OUString WpADOTable::get_Type() const
@@ -1447,8 +1440,7 @@ OUString WpADOGroup::get_Name() const
 void WpADOGroup::put_Name(const OUString& _rName)
 {
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 
 RightsEnum WpADOGroup::GetPermissions(
@@ -1492,8 +1484,7 @@ OUString WpADOUser::get_Name() const
 void WpADOUser::put_Name(const OUString& _rName)
 {
     OLEString bstr(_rName);
-    bool bErg = SUCCEEDED(pInterface->put_Name(bstr.asBSTR()));
-    (void)bErg;
+    pInterface->put_Name(bstr.asBSTR());
 }
 
 bool WpADOUser::ChangePassword(const OUString& _rPwd,const OUString& _rNewPwd)
@@ -1543,9 +1534,7 @@ WpBase::WpBase(IDispatch* pInt)
 {
     if (pIUnknown)
     {
-        ULONG nCount = pIUnknown->AddRef();
-        (void)nCount;
-        //  OSL_ENSURE(nCount == 1,"Count is greater than 1");
+        pIUnknown->AddRef();
     }
 }
 


More information about the Libreoffice-commits mailing list