From: Arnaud Giersch Date: Fri, 12 Jul 2019 05:35:47 +0000 (+0200) Subject: [sonar] More dead code. X-Git-Tag: v3.24~299 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/61ca498cecddb9899801287b32c2bad7da025c44 [sonar] More dead code. --- diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index e8457a3c12..b8071a78c7 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -254,10 +254,7 @@ static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgr 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)); @@ -371,10 +368,7 @@ static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgr 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++) { @@ -695,7 +689,6 @@ static bool heap_area_differ_with_type(simgrid::mc::StateComparator& state, cons default: THROW_IMPOSSIBLE; } - return false; } /** Infer the type of a part of the block from the type of the block