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 /lotuswordpro/source | |
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 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpgrfobj.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpgrfobj.hxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpsdwdrawheader.hxx | 16 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfcolor.cxx | 4 |
4 files changed, 8 insertions, 18 deletions
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 29339e04857e..13745c206740 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -93,8 +93,6 @@ LwpGraphicObject::LwpGraphicObject(LwpObjectHeader const &objHdr, LwpSvStream* p , m_bIsLinked(0) , m_bCompressed(0) { - memset(m_sDataFormat, 0, sizeof(m_sDataFormat)); - memset(m_sServerContextFormat, 0, sizeof(m_sServerContextFormat)); } LwpGraphicObject::~LwpGraphicObject() diff --git a/lotuswordpro/source/filter/lwpgrfobj.hxx b/lotuswordpro/source/filter/lwpgrfobj.hxx index 3332124f4ad5..0c26f1c6e062 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.hxx +++ b/lotuswordpro/source/filter/lwpgrfobj.hxx @@ -94,8 +94,8 @@ public: LwpGraphicObject(LwpObjectHeader const &objHdr, LwpSvStream* pStrm); virtual ~LwpGraphicObject() override; private: - unsigned char m_sDataFormat[AFID_MAX_FILE_FORMAT_SIZE]; - unsigned char m_sServerContextFormat[AFID_MAX_CONTEXT_FORMAT_SIZE]; + unsigned char m_sDataFormat[AFID_MAX_FILE_FORMAT_SIZE] = {}; + unsigned char m_sServerContextFormat[AFID_MAX_CONTEXT_FORMAT_SIZE] = {}; sal_Int32 m_nCachedBaseLine; sal_Int16 m_bIsLinked; AFID_CACHE m_Cache; diff --git a/lotuswordpro/source/filter/lwpsdwdrawheader.hxx b/lotuswordpro/source/filter/lwpsdwdrawheader.hxx index c1c13a15f603..36ab257c256e 100644 --- a/lotuswordpro/source/filter/lwpsdwdrawheader.hxx +++ b/lotuswordpro/source/filter/lwpsdwdrawheader.hxx @@ -180,20 +180,14 @@ struct SdwColor struct SdwClosedObjStyleRec { - sal_uInt8 nLineWidth; - sal_uInt8 nLineStyle; + sal_uInt8 nLineWidth = 0; + sal_uInt8 nLineStyle = 0; SdwColor aPenColor; SdwColor aForeColor; SdwColor aBackColor; - sal_uInt16 nFillType; - sal_uInt8 pFillPattern[8]; - SdwClosedObjStyleRec() - : nLineWidth(0) - , nLineStyle(0) - , nFillType(0) - { - memset(pFillPattern, 0, sizeof(pFillPattern)); - } + sal_uInt16 nFillType = 0; + sal_uInt8 pFillPattern[8] = {}; + SdwClosedObjStyleRec() = default; }; struct SdwDrawObjHeader diff --git a/lotuswordpro/source/filter/xfilter/xfcolor.cxx b/lotuswordpro/source/filter/xfilter/xfcolor.cxx index dc96c73851b9..357e659fbeae 100644 --- a/lotuswordpro/source/filter/xfilter/xfcolor.cxx +++ b/lotuswordpro/source/filter/xfilter/xfcolor.cxx @@ -63,9 +63,7 @@ OUString XFColor::ToString() const { - char buf[8]; - - memset(buf, 0, 8); + char buf[8] = {}; sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue); for( int i=1; i<7;i++ ) { |