From 16a4b7ad733f179498e39eac3d4092c55e6c0a07 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 30 Aug 2013 12:04:15 +0300 Subject: WaE: C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits 1UL is not a portable way to get a size_t -sized one. Change-Id: I8fac16b7e1f1b8bbccb4bd11eacc9449fc3f8c33 --- sal/rtl/alloc_arena.cxx | 8 ++++---- sal/rtl/alloc_cache.cxx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sal') diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 9017a5ac2305..f37d512dffff 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -452,7 +452,7 @@ rtl_arena_segment_alloc ( } /* roundup to next power of 2 */ - size = (1UL << msb); + size = (((sal_Size)1) << msb); } index = lowbit(RTL_MEMORY_P2ALIGN(arena->m_freelist_bitmap, size)); @@ -619,7 +619,7 @@ rtl_arena_constructor (void * obj) head = &(arena->m_freelist_head[i]); rtl_arena_segment_constructor (head); - head->m_size = (1UL << i); + head->m_size = (((sal_Size)1) << i); head->m_type = RTL_ARENA_SEGMENT_TYPE_HEAD; } @@ -658,7 +658,7 @@ rtl_arena_destructor (void * obj) { head = &(arena->m_freelist_head[i]); - assert(head->m_size == (1UL << i)); + assert(head->m_size == (((sal_Size)1) << i)); assert(head->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD); rtl_arena_segment_destructor (head); @@ -694,7 +694,7 @@ rtl_arena_activate ( if (!RTL_MEMORY_ISP2(quantum)) { /* roundup to next power of 2 */ - quantum = (1UL << highbit(quantum)); + quantum = (((sal_Size)1) << highbit(quantum)); } quantum_cache_max = RTL_MEMORY_P2ROUNDUP(quantum_cache_max, quantum); diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index d514cfc84514..138315533ec7 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -859,9 +859,9 @@ rtl_cache_activate ( if (flags & RTL_CACHE_FLAG_QUANTUMCACHE) { /* next power of 2 above 3 * qcache_max */ - if(slabsize < (1UL << highbit(3 * source->m_qcache_max))) + if(slabsize < (((sal_Size)1) << highbit(3 * source->m_qcache_max))) { - slabsize = (1UL << highbit(3 * source->m_qcache_max)); + slabsize = (((sal_Size)1) << highbit(3 * source->m_qcache_max)); } } else @@ -875,7 +875,7 @@ rtl_cache_activate ( slabsize = RTL_MEMORY_P2ROUNDUP(slabsize, source->m_quantum); if (!RTL_MEMORY_ISP2(slabsize)) - slabsize = 1UL << highbit(slabsize); + slabsize = (((sal_Size)1) << highbit(slabsize)); cache->m_slab_size = slabsize; if (cache->m_slab_size > source->m_quantum) -- cgit