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 /filter | |
parent | Remaining loplugin:bufferadd (diff) | |
download | core-d51db77c8d87f210785a8a8c6dd875f7bacddb3c.tar.gz core-d51db77c8d87f210785a8a8c6dd875f7bacddb3c.zip |
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 'filter')
-rw-r--r-- | filter/source/msfilter/mscodec.cxx | 12 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 3 |
2 files changed, 1 insertions, 14 deletions
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx index b99e6cc4d63c..50b2de6dedb0 100644 --- a/filter/source/msfilter/mscodec.cxx +++ b/filter/source/msfilter/mscodec.cxx @@ -123,7 +123,6 @@ MSCodec_Xor95::MSCodec_Xor95(int nRotateDistance) : mnHash( 0 ), mnRotateDistance( nRotateDistance ) { - (void)memset( mpnKey, 0, sizeof( mpnKey ) ); } MSCodec_Xor95::~MSCodec_Xor95() @@ -435,10 +434,7 @@ void MSCodec_CryptoAPI::GetDigestFromSalt(const sal_uInt8* pSaltData, sal_uInt8* bool MSCodec_Std97::InitCipher(sal_uInt32 nCounter) { - sal_uInt8 pKeyData[64]; // 512-bit message block - - // Initialize KeyData array. - (void)memset (pKeyData, 0, sizeof(pKeyData)); + sal_uInt8 pKeyData[64] = {}; // 512-bit message block // Fill 40 bit of DigestValue into [0..4]. (void)memcpy (pKeyData, m_aDigestValue.data(), 5); @@ -631,18 +627,12 @@ EncryptionVerifierAES::EncryptionVerifierAES() : saltSize(SALT_LENGTH) , encryptedVerifierHashSize(SHA1_HASH_LENGTH) { - memset(salt, 0, sizeof(salt)); - memset(encryptedVerifier, 0, sizeof(encryptedVerifier)); - memset(encryptedVerifierHash, 0, sizeof(encryptedVerifierHash)); } EncryptionVerifierRC4::EncryptionVerifierRC4() : saltSize(SALT_LENGTH) , encryptedVerifierHashSize(SHA1_HASH_LENGTH) { - memset(salt, 0, sizeof(salt)); - memset(encryptedVerifier, 0, sizeof(encryptedVerifier)); - memset(encryptedVerifierHash, 0, sizeof(encryptedVerifierHash)); } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 5cfa5a968650..bb47254d46a3 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -370,7 +370,6 @@ void PptNotesAtom::Clear() PptColorSchemeAtom::PptColorSchemeAtom() { - memset(&aData[0], 0, 32); } Color PptColorSchemeAtom::GetColor( sal_uInt16 nNum ) const @@ -4532,8 +4531,6 @@ PPTRuler::PPTRuler() , nDefaultTab(0x240) , nTabCount(0) { - memset(nTextOfs, 0, sizeof(nTextOfs)); - memset(nBulletOfs, 0, sizeof(nBulletOfs)); } PPTRuler::~PPTRuler() |