Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] More dead code.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 12 Jul 2019 05:35:47 +0000 (07:35 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 12 Jul 2019 05:39:31 +0000 (07:39 +0200)
src/mc/compare.cpp

index e8457a3..b8071a7 100644 (file)
@@ -254,10 +254,7 @@ static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgr
       continue;
     }
 
       continue;
     }
 
-    if (heapinfo1->type < 0) {
-      fprintf(stderr, "Unkown mmalloc block type.\n");
-      abort();
-    }
+    xbt_assert(heapinfo1->type >= 0, "Unkown mmalloc block type: %d", heapinfo1->type);
 
     void* addr_block1 = ((void*)(((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase));
 
 
     void* addr_block1 = ((void*)(((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase));
 
@@ -371,10 +368,7 @@ static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgr
             continue;
           }
 
             continue;
           }
 
-          if (heapinfo2b->type < 0) {
-            fprintf(stderr, "Unknown mmalloc block type.\n");
-            abort();
-          }
+          xbt_assert(heapinfo2b->type >= 0, "Unkown mmalloc block type: %d", heapinfo2b->type);
 
           for (size_t j2 = 0; j2 < (size_t)(BLOCKSIZE >> heapinfo2b->type); j2++) {
 
 
           for (size_t j2 = 0; j2 < (size_t)(BLOCKSIZE >> heapinfo2b->type); j2++) {
 
@@ -695,7 +689,6 @@ static bool heap_area_differ_with_type(simgrid::mc::StateComparator& state, cons
     default:
       THROW_IMPOSSIBLE;
   }
     default:
       THROW_IMPOSSIBLE;
   }
-  return false;
 }
 
 /** Infer the type of a part of the block from the type of the block
 }
 
 /** Infer the type of a part of the block from the type of the block