[Libreoffice-commits] core.git: basic/source desktop/source editeng/source embeddedobj/source jvmfwk/plugins setup_native/source sfx2/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 27 13:31:20 UTC 2018


 basic/source/comp/symtbl.cxx                                  |    2 +-
 basic/source/sbx/sbxbase.cxx                                  |    2 +-
 desktop/source/app/cmdlinehelp.cxx                            |    6 +++---
 editeng/source/editeng/editdoc.cxx                            |    2 +-
 embeddedobj/source/msole/olecomponent.cxx                     |    4 ++--
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx           |    2 +-
 setup_native/source/win32/customactions/inst_msu/inst_msu.cxx |    2 +-
 sfx2/source/appl/shutdowniconw32.cxx                          |    3 +--
 sw/source/core/text/txtcache.hxx                              |    7 ++++++-
 9 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 6a12a9e941283fe32d7714d4aee694c397996c3a
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat Oct 27 15:11:25 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Oct 27 15:30:59 2018 +0200

    tdf#120703 PVS: V530 The return value of function is required to be utilized
    
    Change-Id: Ifc170a45e25b3fd5b7f561cc50afb6452bb359bd
    Reviewed-on: https://gerrit.libreoffice.org/62420
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 5963153e23d0..2002f3fce278 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -441,7 +441,7 @@ void SbiProcDef::Match( std::unique_ptr<SbiProcDef> pOld )
         pIn  = pOld->pIn;
         std::unique_ptr<SbiSymDef> tmp(this);
         std::swap(pIn->m_Data[nPos], tmp);
-        tmp.release();
+        (void)tmp.release();
     }
 }
 
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 8697e8bd9ef3..5b68b90e32ec 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -127,7 +127,7 @@ void SbxBase::RemoveFactory( SbxFactory const * pFac )
         {
             std::unique_ptr<SbxFactory> tmp(std::move(*it));
             r.m_Factories.erase( it );
-            tmp.release();
+            (void)tmp.release();
             break;
         }
     }
diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx
index b7d40c31577e..0dbbe41dd660 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -220,9 +220,9 @@ namespace desktop
                         }
                     }
 
-                    freopen("CON", "r", stdin);
-                    freopen("CON", "w", stdout);
-                    freopen("CON", "w", stderr);
+                    (void)freopen("CON", "r", stdin);
+                    (void)freopen("CON", "w", stdout);
+                    (void)freopen("CON", "w", stderr);
 
                     std::ios::sync_with_stdio(true);
 
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 18d14cf82d81..9ed29b0a752a 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2100,7 +2100,7 @@ void EditDoc::Release(sal_Int32 nPos)
         SAL_WARN( "editeng", "EditDoc::Release - out of bounds pos " << nPos);
         return;
     }
-    maContents[nPos].release();
+    (void)maContents[nPos].release();
     maContents.erase(maContents.begin() + nPos);
 }
 
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index bcf2600236c1..f9440f651bb2 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -913,8 +913,8 @@ void OleComponent::InitEmbeddedCopyOfLink( OleComponent const * pOleLinkComponen
         if ( SUCCEEDED( hr ) && aMonType == MKSYS_FILEMONIKER )
         {
             ComSmart< IMalloc > pMalloc;
-            CoGetMalloc( 1, &pMalloc ); // if fails there will be a memory leak
-            OSL_ENSURE( pMalloc, "CoGetMalloc() failed!" );
+            hr = CoGetMalloc( 1, &pMalloc ); // if fails there will be a memory leak
+            OSL_ENSURE(SUCCEEDED(hr) && pMalloc, "CoGetMalloc() failed!");
 
             LPOLESTR pOleStr = nullptr;
             hr = pOleLink->GetSourceDisplayName( &pOleStr );
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index e5e9cb517ca3..c6f8eeb6a5c8 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -490,7 +490,7 @@ static void load_msvcr(OUString const & jvm_dll, OUStringLiteral msvcr)
     if (slash == -1)
         return;
 
-    LoadLibraryW(
+    (void)LoadLibraryW(
         o3tl::toW(OUString(jvm_dll.copy(0, slash+1) + msvcr).getStr()));
 }
 
diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
index 91464fdd17de..c8d649a6f4d9 100644
--- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
+++ b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
@@ -399,7 +399,7 @@ extern "C" __declspec(dllexport) UINT __stdcall UnpackMSUForInstall(MSIHANDLE hI
         CheckWin32Error("MsiSetPropertyW", MsiSetPropertyW(hInstall, L"inst_msu", sBinary.c_str()));
 
         // Don't delete the file: it will be done by following actions (inst_msu or cleanup_msu)
-        aDeleteFileGuard.release();
+        (void)aDeleteFileGuard.release();
         return ERROR_SUCCESS;
     }
     catch (std::exception& e)
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index b48b1e5e6875..b6fd1741a360 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -621,8 +621,7 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
         hModule = GetModuleHandleW( pModuleName );
         if ( hModule == nullptr )
         {
-            LoadLibraryW( pModuleName );
-            hModule = GetModuleHandleW( pModuleName );
+            hModule = LoadLibraryW(pModuleName);
         }
     }
 
diff --git a/sw/source/core/text/txtcache.hxx b/sw/source/core/text/txtcache.hxx
index c42018c8da86..0fa90c35debb 100644
--- a/sw/source/core/text/txtcache.hxx
+++ b/sw/source/core/text/txtcache.hxx
@@ -37,7 +37,12 @@ public:
     SwParaPortion *GetPara()       { return pLine.get(); }
     const SwParaPortion *GetPara() const { return pLine.get(); }
 
-    void SetPara( SwParaPortion *pNew, bool bDelete ) { if (!bDelete) pLine.release(); pLine.reset( pNew ); }
+    void SetPara(SwParaPortion* pNew, bool bDelete)
+    {
+        if (!bDelete)
+            (void)pLine.release();
+        pLine.reset(pNew);
+    }
 };
 
 class SwTextLineAccess : public SwCacheAccess


More information about the Libreoffice-commits mailing list