[Libreoffice-commits] core.git: sal/rtl

Chris Sherlock chris.sherlock79 at gmail.com
Sat Jul 22 15:00:13 UTC 2017


 sal/rtl/alloc_arena.cxx |   22 +++++++++++-----------
 sal/rtl/alloc_cache.cxx |    6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 9f2cd53913389d14f344e6cc0841a066b13bc669
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sun Jul 23 00:58:45 2017 +1000

    followup b714ba73c - remove excessive braces
    
    Change-Id: I59fe131c6d14d9058fedaf89a2e9d5ceca444aa5

diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 7baa46f0cf36..90be828c0d32 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -140,10 +140,10 @@ inline void rtl_arena_segment_get(
     assert(!*ppSegment);
 
     head = &(arena->m_segment_reserve_head);
-    if ((head->m_snext != head) || rtl_arena_segment_populate (arena))
+    if (head->m_snext != head || rtl_arena_segment_populate (arena))
     {
         (*ppSegment) = head->m_snext;
-        QUEUE_REMOVE_NAMED((*ppSegment), s);
+        QUEUE_REMOVE_NAMED(*ppSegment, s);
     }
 }
 
@@ -158,8 +158,8 @@ inline void rtl_arena_segment_put(
 {
     rtl_arena_segment_type * head;
 
-    assert(QUEUE_STARTED_NAMED((*ppSegment), s));
-    assert(QUEUE_STARTED_NAMED((*ppSegment), f));
+    assert(QUEUE_STARTED_NAMED(*ppSegment, s));
+    assert(QUEUE_STARTED_NAMED(*ppSegment, f));
 
     (*ppSegment)->m_addr = 0;
     (*ppSegment)->m_size = 0;
@@ -200,8 +200,8 @@ inline void rtl_arena_freelist_remove(
     rtl_arena_segment_type * segment
 )
 {
-    if ((segment->m_fnext->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD) &&
-        (segment->m_fprev->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD)    )
+    if (segment->m_fnext->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD &&
+        segment->m_fprev->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD)
     {
         rtl_arena_segment_type * head;
 
@@ -674,7 +674,7 @@ void rtl_arena_deactivate(rtl_arena_type * arena)
     RTL_MEMORY_LOCK_RELEASE(&(g_arena_list.m_lock));
 
     /* cleanup quantum cache(s) */
-    if ((arena->m_qcache_max > 0) && (arena->m_qcache_ptr))
+    if (arena->m_qcache_max > 0 && arena->m_qcache_ptr)
     {
         int  i, n = (arena->m_qcache_max >> arena->m_quantum_shift);
         for (i = 1; i <= n; i++)
@@ -852,7 +852,7 @@ void * SAL_CALL rtl_arena_alloc(
     {
         sal_Size size;
 
-        size = RTL_MEMORY_ALIGN((*pSize), arena->m_quantum);
+        size = RTL_MEMORY_ALIGN(*pSize, arena->m_quantum);
         if (size > arena->m_qcache_max)
         {
             /* allocate from segment list */
@@ -872,7 +872,7 @@ void * SAL_CALL rtl_arena_alloc(
                 /* resize */
                 assert(segment->m_size >= size);
                 oversize = segment->m_size - size;
-                if ((oversize >= arena->m_quantum) && (oversize >= arena->m_qcache_max))
+                if (oversize >= arena->m_quantum && oversize >= arena->m_qcache_max)
                 {
                     rtl_arena_segment_type * remainder = nullptr;
                     rtl_arena_segment_get (arena, &remainder);
@@ -939,9 +939,9 @@ void SAL_CALL rtl_arena_free (
                 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) &&
+                if (prev->m_type == RTL_ARENA_SEGMENT_TYPE_SPAN &&
                     ((next->m_type == RTL_ARENA_SEGMENT_TYPE_SPAN)  ||
-                     (next->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD))    )
+                     (next->m_type == RTL_ARENA_SEGMENT_TYPE_HEAD)))
                 {
                     assert(
                         prev->m_addr == segment->m_addr
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index 04a982d99bc9..4ac83d332eab 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -304,7 +304,7 @@ void rtl_cache_slab_destroy(
         rtl_cache_slab_destructor (slab, nullptr);
     }
 
-    if ((refcnt == 0) || (cache->m_features & RTL_CACHE_FEATURE_BULKDESTROY))
+    if (refcnt == 0 || cache->m_features & RTL_CACHE_FEATURE_BULKDESTROY)
     {
         /* free memory */
         rtl_arena_free (cache->m_source, addr, cache->m_slab_size);
@@ -351,7 +351,7 @@ void * rtl_cache_slab_alloc (rtl_cache_type * cache)
     RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock));
 
     head = &(cache->m_free_head);
-    if ((head->m_slab_next != head) || rtl_cache_slab_populate (cache))
+    if (head->m_slab_next != head || rtl_cache_slab_populate (cache))
     {
         rtl_cache_slab_type   * slab;
         rtl_cache_bufctl_type * bufctl;
@@ -580,7 +580,7 @@ inline rtl_cache_magazine_type * rtl_cache_depot_exchange_alloc(
 {
     rtl_cache_magazine_type * full;
 
-    assert((!empty) || (empty->m_mag_used == 0));
+    assert(!empty || empty->m_mag_used == 0);
 
     /* dequeue full magazine */
     full = rtl_cache_depot_dequeue (&(cache->m_depot_full));


More information about the Libreoffice-commits mailing list