[Libreoffice-commits] core.git: 2 commits - sw/source vcl/headless

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 5 06:00:11 UTC 2019


 sw/source/uibase/config/uinums.cxx |    6 ------
 sw/source/uibase/inc/uinums.hxx    |    2 +-
 vcl/headless/svpdummies.cxx        |    3 ---
 vcl/headless/svpframe.cxx          |    4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 35d21e4bf6f66b3bbc7a44fcf184cb721b524a94
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 4 19:09:59 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 5 07:59:16 2019 +0200

    Remove redundant memsets
    
    ...since 1f8c2a2e5c8bda6e6e35a868e5ac7afdc7d32317 "coverity#1187868
    Uninitialized pointer field" introduced a default ctor zero-initializing all
    members of SystemEnvData
    
    Change-Id: Ifd31282ab4b82e26733afdd74c234a8a1b4dbb4c
    Reviewed-on: https://gerrit.libreoffice.org/80255
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx
index 21a054761ea2..9fab8f15f990 100644
--- a/vcl/headless/svpdummies.cxx
+++ b/vcl/headless/svpdummies.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
 #include <rtl/ustrbuf.hxx>
 #include <headless/svpdummies.hxx>
 #include <headless/svpinst.hxx>
@@ -25,8 +24,6 @@
 // SalObject
 SvpSalObject::SvpSalObject()
 {
-    // fast and easy cross-platform wiping of the data
-    memset( static_cast<void *>(&m_aSystemChildData), 0, sizeof( SystemEnvData ) );
     m_aSystemChildData.nSize = sizeof( SystemEnvData );
 }
 
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 4259a84d5a0b..977d83d08fcf 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
-
 #include <comphelper/lok.hxx>
 #include <vcl/syswin.hxx>
 #include <sal/log.hxx>
@@ -57,8 +55,6 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
     m_nMaxHeight( 0 )
 {
     // SAL_DEBUG("SvpSalFrame::SvpSalFrame: " << this);
-    // fast and easy cross-platform wiping of the data
-    memset( static_cast<void *>(&m_aSystemChildData), 0, sizeof( SystemEnvData ) );
     m_aSystemChildData.nSize        = sizeof( SystemEnvData );
 #ifdef IOS
     // Nothing
commit d03041e19215592f21ba1222d3cfa29e1f94260a
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 4 19:00:12 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 5 07:59:05 2019 +0200

    Drop bogus memsets
    
    ...that are both bad and unnecessary since
    54604f01330063635fb974b0ab4335d6af851551 "loplugin:useuniqueptr in
    SwNumRulesWithName" changed SwNumRulesWithName::aFormats from an array of raw
    pointers to an array of std::unique_ptr.
    
    (GCC -Wclass-memaccess didn't catch that because it apparently fails when the
    argument is of array instead of pointer type.)
    
    Change-Id: I6a4a03b1d16c203118fc83c0c3c44646be39a5b3
    Reviewed-on: https://gerrit.libreoffice.org/80254
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx
index e2663ceda664..f285855a176e 100644
--- a/sw/source/uibase/config/uinums.cxx
+++ b/sw/source/uibase/config/uinums.cxx
@@ -121,14 +121,8 @@ SwNumRulesWithName::SwNumRulesWithName( const SwNumRule &rCopy,
     }
 }
 
-SwNumRulesWithName::SwNumRulesWithName()
-{
-    memset(aFormats, 0, sizeof(aFormats));
-}
-
 SwNumRulesWithName::SwNumRulesWithName( const SwNumRulesWithName& rCopy )
 {
-    memset( aFormats, 0, sizeof( aFormats ));
     *this = rCopy;
 }
 
diff --git a/sw/source/uibase/inc/uinums.hxx b/sw/source/uibase/inc/uinums.hxx
index 9b822742083e..7da897aa5860 100644
--- a/sw/source/uibase/inc/uinums.hxx
+++ b/sw/source/uibase/inc/uinums.hxx
@@ -62,7 +62,7 @@ class SW_DLLPUBLIC SwNumRulesWithName final
     friend class SwChapterNumRules;
     void SetName(const OUString& rSet) {maName = rSet;}
     void SetNumFormat(size_t, SwNumFormat const&, OUString const&);
-    SwNumRulesWithName();
+    SwNumRulesWithName() = default;
 
 public:
     SwNumRulesWithName(const SwNumRule &, const OUString &);


More information about the Libreoffice-commits mailing list