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 /store | |
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 'store')
-rw-r--r-- | store/source/storcach.cxx | 1 | ||||
-rw-r--r-- | store/source/storcach.hxx | 2 | ||||
-rw-r--r-- | store/source/stordata.hxx | 10 |
3 files changed, 4 insertions, 9 deletions
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index 76a0c6d185c8..08f63a46e0fb 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -181,7 +181,6 @@ PageCache::PageCache (sal_uInt16 nPageSize) { static size_t const theSize = SAL_N_ELEMENTS(m_hash_table_0); static_assert(theSize == theTableSize, "must be equal"); - memset(m_hash_table_0, 0, sizeof(m_hash_table_0)); } PageCache::~PageCache() diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index ec7d6d138aa3..7032ade7b2dd 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -45,7 +45,7 @@ class PageCache : static_assert((theTableSize & (theTableSize-1)) == 0, "table size should be a power of 2"); Entry ** m_hash_table; - Entry * m_hash_table_0[theTableSize]; + Entry * m_hash_table_0[theTableSize] = {}; size_t m_hash_size; size_t m_hash_shift; size_t const m_page_shift; diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 4e4741d509d7..6255fc1adccd 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -278,8 +278,8 @@ struct OStorePageNameBlock */ G m_aGuard; K m_aKey; - sal_uInt32 m_nAttrib; - sal_Char m_pData[STORE_MAXIMUM_NAMESIZE]; + sal_uInt32 m_nAttrib = 0; + sal_Char m_pData[STORE_MAXIMUM_NAMESIZE] = {}; /** size. */ @@ -287,11 +287,7 @@ struct OStorePageNameBlock /** Construction. */ - OStorePageNameBlock() - : m_aGuard(), m_aKey(), m_nAttrib (0) - { - memset (m_pData, 0, sizeof(m_pData)); - } + OStorePageNameBlock() = default; /** guard (external representation). */ |