From d51db77c8d87f210785a8a8c6dd875f7bacddb3c Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 15 Oct 2019 01:57:12 +0300 Subject: 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 --- tools/source/ref/globname.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tools/source') diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 0a87bcf17b5d..6cbff020669c 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -27,11 +27,6 @@ #include // ImpSvGlobalName ------------------------------------------------------------ -ImpSvGlobalName::ImpSvGlobalName() -{ - memset( &szData, 0, sizeof( szData ) ); -} - ImpSvGlobalName::ImpSvGlobalName( const ImpSvGlobalName & rObj ) : szData(rObj.szData) { @@ -80,8 +75,7 @@ SvGlobalName::SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, SvGlobalName::SvGlobalName( const css::uno::Sequence < sal_Int8 >& aSeq ) { // create SvGlobalName from a platform independent representation - SvGUID aResult; - memset( &aResult, 0, sizeof( aResult ) ); + SvGUID aResult = {}; if ( aSeq.getLength() == 16 ) { aResult.Data1 = ( ( ( ( ( static_cast(aSeq[0]) << 8 ) + static_cast(aSeq[1]) ) << 8 ) + static_cast(aSeq[2]) ) << 8 ) + static_cast(aSeq[3]); @@ -206,8 +200,7 @@ bool SvGlobalName::MakeId( const OUString & rIdStr ) pStr++; } - sal_Int8 szRemain[ 8 ]; - memset( szRemain, 0, sizeof( szRemain ) ); + sal_Int8 szRemain[ 8 ] = {}; pStr++; for( i = 0; i < 16; i++ ) { -- cgit v1.2.3