Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Remove redundant casts.
[simgrid.git] / src / mc / compare.cpp
index 98128c7..70c2982 100644 (file)
@@ -873,8 +873,8 @@ static bool heap_area_differ(StateComparator& state, const void* area1, const vo
 
   } else if ((heapinfo1->type > 0) && (heapinfo2->type > 0)) {      /* Fragmented block */
     // Fragment number:
-    ssize_t frag1 = ((uintptr_t)(ADDR2UINT(area1) % (BLOCKSIZE))) >> heapinfo1->type;
-    ssize_t frag2 = ((uintptr_t)(ADDR2UINT(area2) % (BLOCKSIZE))) >> heapinfo2->type;
+    ssize_t frag1 = (ADDR2UINT(area1) % BLOCKSIZE) >> heapinfo1->type;
+    ssize_t frag2 = (ADDR2UINT(area2) % BLOCKSIZE) >> heapinfo2->type;
 
     // Process address of the fragment_:
     void* real_addr_frag1 = (void*)((char*)real_addr_block1 + (frag1 << heapinfo1->type));
@@ -1147,8 +1147,7 @@ static bool global_variables_differ(simgrid::mc::StateComparator& state,
     // If the variable is not in this object, skip it:
     // We do not expect to find a pointer to something which is not reachable
     // by the global variables.
-    if ((char *) current_var.address < (char *) object_info->start_rw
-        || (char *) current_var.address > (char *) object_info->end_rw)
+    if ((char*)current_var.address < object_info->start_rw || (char*)current_var.address > object_info->end_rw)
       continue;
 
     const simgrid::mc::Type* bvariable_type = current_var.type;