diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-15 01:57:12 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-17 09:53:42 +0200 |
commit | d51db77c8d87f210785a8a8c6dd875f7bacddb3c (patch) | |
tree | fd1ab208d49e85371fc9bb321539ce137bdaf719 /sot | |
parent | c8eaadb5d70f42723517bb028f363e37726be256 (diff) |
Remove some memset calls
Replace them with default initialization or calloc
Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgelem.cxx | 4 | ||||
-rw-r--r-- | sot/source/sdstor/stgelem.hxx | 8 | ||||
-rw-r--r-- | sot/source/sdstor/stgole.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/stgole.hxx | 4 |
4 files changed, 6 insertions, 12 deletions
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index 6ad0d9a6f438..f902c5f1944a 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -81,10 +81,6 @@ StgHeader::StgHeader() , m_nMasterChain( 0 ) , m_nMaster( 0 ) { - memset( m_cSignature, 0, sizeof( m_cSignature ) ); - memset( &m_aClsId, 0, sizeof( ClsId ) ); - memset( m_cReserved, 0, sizeof( m_cReserved ) ); - memset( m_nMasterFAT, 0, sizeof( m_nMasterFAT ) ); } void StgHeader::Init() diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx index 7dce8863a824..855b2b8795a2 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -35,8 +35,8 @@ class StgHeader { static const sal_uInt8 cFATPagesInHeader = 109; - sal_uInt8 m_cSignature[ 8 ]; // 00 signature (see below) - ClsId m_aClsId; // 08 Class ID + sal_uInt8 m_cSignature[ 8 ] = {}; // 00 signature (see below) + ClsId m_aClsId = {}; // 08 Class ID sal_Int32 m_nVersion; // 18 version number sal_uInt16 m_nByteOrder; // 1C Unicode byte order indicator sal_Int16 m_nPageSize; // 1E 1 << nPageSize = block size @@ -44,7 +44,7 @@ class StgHeader sal_uInt8 m_bDirty; // 22 internal dirty flag (should be // bool, but probably required to // be exactly one byte) - sal_uInt8 m_cReserved[ 9 ]; // 23 + sal_uInt8 m_cReserved[ 9 ] = {}; // 23 sal_Int32 m_nFATSize; // 2C total number of FAT pages sal_Int32 m_nTOCstrm; // 30 starting page for the TOC stream sal_Int32 m_nReserved; // 34 @@ -53,7 +53,7 @@ class StgHeader sal_Int32 m_nDataFATSize; // 40 # of data fat blocks sal_Int32 m_nMasterChain; // 44 chain to the next master block sal_Int32 m_nMaster; // 48 # of additional master blocks - sal_Int32 m_nMasterFAT[ cFATPagesInHeader ]; // 4C first [cFATPagesInHeader] master FAT pages + sal_Int32 m_nMasterFAT[ cFATPagesInHeader ] = {}; // 4C first [cFATPagesInHeader] master FAT pages public: StgHeader(); diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index f91da70ba66e..62c586a20773 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -92,8 +92,6 @@ void StgInternalStream::Commit() StgCompObjStream::StgCompObjStream( BaseStorage& rStg, bool bWr ) : StgInternalStream( rStg, "\1CompObj", bWr ) { - memset( &m_aClsId, 0, sizeof( ClsId ) ); - m_nCbFormat = SotClipboardFormatId::NONE; } bool StgCompObjStream::Load() diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index b6888823e4af..899b07fcd97e 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -41,9 +41,9 @@ public: class StgCompObjStream : public StgInternalStream { - ClsId m_aClsId; + ClsId m_aClsId = {}; OUString m_aUserName; - SotClipboardFormatId m_nCbFormat; + SotClipboardFormatId m_nCbFormat = SotClipboardFormatId::NONE; public: StgCompObjStream( BaseStorage&, bool ); ClsId& GetClsId() { return m_aClsId; } |