diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-09-14 17:01:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-09-15 12:01:11 +0200 |
commit | b647996a9babbee7b33cf45192e57df6a124628b (patch) | |
tree | ddc6dfe8a62ec53fbacc4eeccfeb20019f3ef4f0 /store | |
parent | a19a67e20e847a42063559694ec5beec71abcfb3 (diff) |
replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.
Change-Id: I8344453780689f5120ba0870e44965b6d292450c
Diffstat (limited to 'store')
-rw-r--r-- | store/source/storbase.cxx | 4 | ||||
-rw-r--r-- | store/source/storcach.cxx | 14 | ||||
-rw-r--r-- | store/source/storcach.hxx | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx index 4bdc5dd5fe02..bb2cf277fd04 100644 --- a/store/source/storbase.cxx +++ b/store/source/storbase.cxx @@ -113,8 +113,8 @@ storeError PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize) { char name[RTL_CACHE_NAME_LENGTH + 1]; - sal_Size size = sal::static_int_cast< sal_Size >(nPageSize); - (void) snprintf (name, sizeof(name), "store_page_alloc_%" SAL_PRIuUINTPTR, size); + std::size_t size = sal::static_int_cast<std::size_t>(nPageSize); + (void) snprintf (name, sizeof(name), "store_page_alloc_%" SAL_PRI_SIZET "u", size); m_page_cache = rtl_cache_create (name, size, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0); if (!m_page_cache) diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index 1f5e147c29a8..d8449be56440 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -133,7 +133,7 @@ void EntryCache::destroy (Entry * entry) } // highbit():= log2() + 1 (complexity O(1)) -static int highbit(sal_Size n) +static int highbit(std::size_t n) { int k = 1; @@ -190,7 +190,7 @@ PageCache::PageCache (sal_uInt16 nPageSize) PageCache::~PageCache() { double s_x = 0.0; - sal_Size i, n = m_hash_size; + std::size_t i, n = m_hash_size; for (i = 0; i < n; i++) { int x = 0; @@ -219,15 +219,15 @@ PageCache::~PageCache() OSL_TRACE("Hits: %zu, Misses: %zu", m_nHit, m_nMissed); } -void PageCache::rescale_Impl (sal_Size new_size) +void PageCache::rescale_Impl (std::size_t new_size) { - sal_Size new_bytes = new_size * sizeof(Entry*); + std::size_t new_bytes = new_size * sizeof(Entry*); Entry ** new_table = static_cast<Entry**>(rtl_allocateMemory(new_bytes)); if (new_table != nullptr) { Entry ** old_table = m_hash_table; - sal_Size old_size = m_hash_size; + std::size_t old_size = m_hash_size; SAL_INFO( "store", @@ -241,7 +241,7 @@ void PageCache::rescale_Impl (sal_Size new_size) m_hash_size = new_size; m_hash_shift = highbit(m_hash_size) - 1; - sal_Size i; + std::size_t i; for (i = 0; i < old_size; i++) { Entry * curr = old_table[i]; @@ -276,7 +276,7 @@ Entry * PageCache::lookup_Impl (Entry * entry, sal_uInt32 nOffset) } if (lookups > 2) { - sal_Size new_size = m_hash_size, ave = m_hash_entries >> m_hash_shift; + std::size_t new_size = m_hash_size, ave = m_hash_entries >> m_hash_shift; for (; ave > 4; new_size *= 2, ave /= 2) continue; if (new_size != m_hash_size) diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index b9febd35f213..5125160dd7b9 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -65,7 +65,7 @@ class PageCache : } Entry * lookup_Impl (Entry * entry, sal_uInt32 nOffset); - void rescale_Impl (sal_Size new_size); + void rescale_Impl (std::size_t new_size); public: // Construction |