diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-17 13:14:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-23 08:08:56 +0200 |
commit | c45d3badc96481db093560b94d8bf51ead6bd17c (patch) | |
tree | 4bb6c9220678a12b327e46ca2acd01e77fc8e2c4 /sal/rtl | |
parent | 003d0ccf902d2449320dd24119564565a384f365 (diff) |
new loplugin: commaoperator
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 9 | ||||
-rw-r--r-- | sal/rtl/alloc_cache.cxx | 27 | ||||
-rw-r--r-- | sal/rtl/alloc_global.cxx | 3 | ||||
-rw-r--r-- | sal/rtl/alloc_impl.hxx | 50 | ||||
-rw-r--r-- | sal/rtl/cipher.cxx | 9 |
5 files changed, 73 insertions, 25 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 3e6adbe481ab..6a7f7405b852 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -365,7 +365,8 @@ rtl_arena_hash_remove ( { if (segment->m_addr == addr) { - *segpp = segment->m_fnext, segment->m_fnext = segment->m_fprev = segment; + *segpp = segment->m_fnext; + segment->m_fnext = segment->m_fprev = segment; break; } @@ -785,7 +786,8 @@ rtl_arena_deactivate ( while ((segment = arena->m_hash_table[i]) != nullptr) { /* pop from hash table */ - arena->m_hash_table[i] = segment->m_fnext, segment->m_fnext = segment->m_fprev = segment; + arena->m_hash_table[i] = segment->m_fnext; + segment->m_fnext = segment->m_fprev = segment; /* coalesce w/ adjacent free segment(s) */ rtl_arena_segment_coalesce (arena, segment); @@ -1034,7 +1036,8 @@ SAL_CALL rtl_arena_free ( rtl_arena_segment_coalesce (arena, segment); /* determine (new) next and prev segment */ - next = segment->m_snext, prev = segment->m_sprev; + next = segment->m_snext; + prev = segment->m_sprev; /* entire span free when prev is a span, and next is either a span or a list head */ if (((prev->m_type == RTL_ARENA_SEGMENT_TYPE_SPAN)) && diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index ebe1b171355a..1241f4260109 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -189,7 +189,8 @@ rtl_cache_hash_remove ( { if (bufctl->m_addr == addr) { - *ppHead = bufctl->m_next, bufctl->m_next = nullptr; + *ppHead = bufctl->m_next; + bufctl->m_next = nullptr; break; } @@ -322,7 +323,8 @@ rtl_cache_slab_destroy ( rtl_cache_bufctl_type * bufctl = slab->m_sp; /* pop from freelist */ - slab->m_sp = bufctl->m_next, bufctl->m_next = nullptr; + slab->m_sp = bufctl->m_next; + bufctl->m_next = nullptr; /* return bufctl struct to bufctl cache */ rtl_cache_free (gp_cache_bufctl_cache, bufctl); @@ -914,7 +916,8 @@ rtl_cache_deactivate ( rtl_cache_magazine_type * mag; /* prevent recursion */ - mag_cache = cache->m_magazine_cache, cache->m_magazine_cache = nullptr; + mag_cache = cache->m_magazine_cache; + cache->m_magazine_cache = nullptr; /* cleanup cpu layer */ if ((mag = cache->m_cpu_curr) != nullptr) @@ -978,7 +981,8 @@ rtl_cache_deactivate ( while ((bufctl = cache->m_hash_table[i]) != nullptr) { /* pop from hash table */ - cache->m_hash_table[i] = bufctl->m_next, bufctl->m_next = nullptr; + cache->m_hash_table[i] = bufctl->m_next; + bufctl->m_next = nullptr; /* return to bufctl cache */ rtl_cache_free (gp_cache_bufctl_cache, bufctl); @@ -1137,7 +1141,8 @@ SAL_CALL rtl_cache_alloc ( if (!((cache->m_constructor)(obj, cache->m_userarg))) { /* construction failure */ - rtl_freeMemory(obj), obj = nullptr; + rtl_freeMemory(obj); + obj = nullptr; } } return obj; @@ -1194,7 +1199,8 @@ SAL_CALL rtl_cache_alloc ( if (!((cache->m_constructor)(obj, cache->m_userarg))) { /* construction failure */ - rtl_cache_slab_free (cache, obj), obj = nullptr; + rtl_cache_slab_free (cache, obj); + obj = nullptr; } } return (obj); @@ -1643,19 +1649,22 @@ rtl_cache_fini() if (gp_cache_bufctl_cache != nullptr) { - cache = gp_cache_bufctl_cache, gp_cache_bufctl_cache = nullptr; + cache = gp_cache_bufctl_cache; + gp_cache_bufctl_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } if (gp_cache_slab_cache != nullptr) { - cache = gp_cache_slab_cache, gp_cache_slab_cache = nullptr; + cache = gp_cache_slab_cache; + gp_cache_slab_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } if (gp_cache_magazine_cache != nullptr) { - cache = gp_cache_magazine_cache, gp_cache_magazine_cache = nullptr; + cache = gp_cache_magazine_cache; + gp_cache_magazine_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx index 6dd24f186af7..1e344f38b3a3 100644 --- a/sal/rtl/alloc_global.cxx +++ b/sal/rtl/alloc_global.cxx @@ -173,7 +173,8 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT } else if (p != nullptr) { - rtl_freeMemory (p), p = nullptr; + rtl_freeMemory (p); + p = nullptr; } return p; } diff --git a/sal/rtl/alloc_impl.hxx b/sal/rtl/alloc_impl.hxx index 61c0e88100e5..3666996cb8ac 100644 --- a/sal/rtl/alloc_impl.hxx +++ b/sal/rtl/alloc_impl.hxx @@ -74,16 +74,31 @@ highbit(sal_Size n) return 0; #if SAL_TYPES_SIZEOFLONG == 8 if (n & 0xffffffff00000000ul) - k |= 32, n >>= 32; + { + k |= 32; + n >>= 32; + } #endif if (n & 0xffff0000) - k |= 16, n >>= 16; + { + k |= 16; + n >>= 16; + } if (n & 0xff00) - k |= 8, n >>= 8; + { + k |= 8; + n >>= 8; + } if (n & 0xf0) - k |= 4, n >>= 4; + { + k |= 4; + n >>= 4; + } if (n & 0x0c) - k |= 2, n >>= 2; + { + k |= 2; + n >>= 2; + } if (n & 0x02) k++; @@ -102,16 +117,31 @@ lowbit(sal_Size n) return 0; #if SAL_TYPES_SIZEOFLONG == 8 if (!(n & 0xffffffff)) - k |= 32, n >>= 32; + { + k |= 32; + n >>= 32; + } #endif if (!(n & 0xffff)) - k |= 16, n >>= 16; + { + k |= 16; + n >>= 16; + } if (!(n & 0xff)) - k |= 8, n >>= 8; + { + k |= 8; + n >>= 8; + } if (!(n & 0xf)) - k |= 4, n >>= 4; + { + k |= 4; + n >>= 4; + } if (!(n & 0x3)) - k |= 2, n >>= 2; + { + k |= 2; + n >>= 2; + } if (!(n & 0x1)) k++; return k; diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 0bcaa49f5038..4660e6a868c0 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -1175,7 +1175,10 @@ static rtlCipherError rtl_cipherARCFOUR_init_Impl ( for (x = 0, y = 0; x < CIPHER_CBLOCK_ARCFOUR; x++) { y = (y + S[x] + K[x]) % CIPHER_CBLOCK_ARCFOUR; - t = S[x], S[x] = S[y], S[y] = t; /* swap S[x] and S[y] */ + /* swap S[x] and S[y] */ + t = S[x]; + S[x] = S[y]; + S[y] = t; } /* Initialize counters X and Y. */ @@ -1217,7 +1220,9 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( ctx->m_Y = y; /* Swap S[x] and S[y]. */ - t = S[x], S[x] = S[y], S[y] = t; + t = S[x]; + S[x] = S[y]; + S[y] = t; /* Evaluate next key byte S[t]. */ t = (S[x] + S[y]) % CIPHER_CBLOCK_ARCFOUR; |