diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-06 22:21:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-07 14:42:07 +0100 |
commit | 7b1261f6f956271ec2a545f635e11432a5e64fa1 (patch) | |
tree | 60419323374af92164590d274134a3e7f0c6eae6 /sal/rtl | |
parent | d1a74c273d10e6ab228acac2b8ebc151362a41b3 (diff) |
loplugin:cstylecast: sal
Change-Id: I0ad9681a8b31d78cefce5b66040415154a1c7a99
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 15 | ||||
-rw-r--r-- | sal/rtl/alloc_cache.cxx | 18 |
2 files changed, 17 insertions, 16 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index b826f1347571..9f3b2d237274 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -137,7 +137,7 @@ rtl_arena_segment_populate ( /* insert onto reserve span list */ QUEUE_INSERT_TAIL_NAMED(&(arena->m_segment_reserve_span_head), span, s); QUEUE_START_NAMED(span, f); - span->m_addr = (sal_uIntPtr)(span); + span->m_addr = reinterpret_cast<sal_uIntPtr>(span); span->m_size = size; span->m_type = RTL_ARENA_SEGMENT_TYPE_SPAN; @@ -499,8 +499,9 @@ rtl_arena_segment_create ( RTL_MEMORY_LOCK_RELEASE(&(arena->m_lock)); span->m_size = size; - span->m_addr = (sal_uIntPtr)(arena->m_source_alloc)( - arena->m_source_arena, &(span->m_size)); + span->m_addr = reinterpret_cast<sal_uIntPtr>( + (arena->m_source_alloc)( + arena->m_source_arena, &(span->m_size))); RTL_MEMORY_LOCK_ACQUIRE(&(arena->m_lock)); if (span->m_addr != 0) @@ -851,7 +852,7 @@ rtl_arena_deactivate ( QUEUE_REMOVE_NAMED(segment, s); /* return span to g_machdep_arena */ - rtl_machdep_free (gp_machdep_arena, (void*)(segment->m_addr), segment->m_size); + rtl_machdep_free (gp_machdep_arena, reinterpret_cast<void*>(segment->m_addr), segment->m_size); } } @@ -992,7 +993,7 @@ SAL_CALL rtl_arena_alloc ( rtl_arena_hash_insert (arena, segment); (*pSize) = segment->m_size; - addr = (void*)(segment->m_addr); + addr = reinterpret_cast<void*>(segment->m_addr); } RTL_MEMORY_LOCK_RELEASE(&(arena->m_lock)); } @@ -1035,7 +1036,7 @@ SAL_CALL rtl_arena_free ( RTL_MEMORY_LOCK_ACQUIRE(&(arena->m_lock)); - segment = rtl_arena_hash_remove (arena, (sal_uIntPtr)(addr), size); + segment = rtl_arena_hash_remove (arena, reinterpret_cast<sal_uIntPtr>(addr), size); if (segment != 0) { rtl_arena_segment_type *next, *prev; @@ -1057,7 +1058,7 @@ SAL_CALL rtl_arena_free ( if (arena->m_source_free) { - addr = (void*)(prev->m_addr); + addr = reinterpret_cast<void*>(prev->m_addr); size = prev->m_size; /* remove from segment list */ diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index a8db5c23ed59..e85f7520ea16 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -229,7 +229,7 @@ rtl_cache_hash_remove ( /** RTL_CACHE_SLAB() */ #define RTL_CACHE_SLAB(addr, size) \ - (((rtl_cache_slab_type*)(RTL_MEMORY_P2END((sal_uIntPtr)(addr), (size)))) - 1) + ((reinterpret_cast<rtl_cache_slab_type*>(RTL_MEMORY_P2END(reinterpret_cast<sal_uIntPtr>(addr), (size)))) - 1) /** rtl_cache_slab_constructor() */ @@ -288,7 +288,7 @@ rtl_cache_slab_create ( } if (slab != 0) { - slab->m_data = (sal_uIntPtr)(addr); + slab->m_data = reinterpret_cast<sal_uIntPtr>(addr); /* dynamic freelist initialization */ slab->m_bp = slab->m_data; @@ -312,7 +312,7 @@ rtl_cache_slab_destroy ( rtl_cache_slab_type * slab ) { - void * addr = (void*)(slab->m_data); + void * addr = reinterpret_cast<void*>(slab->m_data); sal_Size refcnt = slab->m_ntypes; slab->m_ntypes = 0; if (cache->m_features & RTL_CACHE_FEATURE_HASH) @@ -422,12 +422,12 @@ rtl_cache_slab_alloc ( } bufctl->m_addr = slab->m_bp; - bufctl->m_slab = (sal_uIntPtr)(slab); + bufctl->m_slab = reinterpret_cast<sal_uIntPtr>(slab); } else { /* embedded bufctl */ - bufctl = (rtl_cache_bufctl_type*)(slab->m_bp); + bufctl = reinterpret_cast<rtl_cache_bufctl_type*>(slab->m_bp); } bufctl->m_next = 0; @@ -457,7 +457,7 @@ rtl_cache_slab_alloc ( cache->m_slab_stats.m_mem_alloc += cache->m_type_size; if (cache->m_features & RTL_CACHE_FEATURE_HASH) - addr = (void*)rtl_cache_hash_insert (cache, bufctl); + addr = reinterpret_cast<void*>(rtl_cache_hash_insert (cache, bufctl)); else addr = bufctl; } @@ -484,8 +484,8 @@ rtl_cache_slab_free ( /* determine slab from addr */ if (cache->m_features & RTL_CACHE_FEATURE_HASH) { - bufctl = rtl_cache_hash_remove (cache, (sal_uIntPtr)(addr)); - slab = (bufctl != 0) ? (rtl_cache_slab_type*)(bufctl->m_slab) : 0; + bufctl = rtl_cache_hash_remove (cache, reinterpret_cast<sal_uIntPtr>(addr)); + slab = (bufctl != 0) ? reinterpret_cast<rtl_cache_slab_type*>(bufctl->m_slab) : 0; } else { @@ -1326,7 +1326,7 @@ rtl_cache_wsupdate_init() g_cache_list.m_update_done = 0; (void) pthread_cond_init (&(g_cache_list.m_update_cond), NULL); if (pthread_create ( - &(g_cache_list.m_update_thread), NULL, rtl_cache_wsupdate_all, (void*)(10)) != 0) + &(g_cache_list.m_update_thread), NULL, rtl_cache_wsupdate_all, reinterpret_cast<void*>(10)) != 0) { /* failure */ g_cache_list.m_update_thread = (pthread_t)(0); |