Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix compilation errors about unused or uninitialized variables.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 12 Jun 2012 12:27:27 +0000 (14:27 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 12 Jun 2012 12:27:27 +0000 (14:27 +0200)
These are not real fixes and should be properly corrected,
hence the "FIXME" comments.

src/xbt/mmalloc/mm_diff.c

index faf89a9..1fd0770 100644 (file)
@@ -199,7 +199,8 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap,
     
   size_t i, j;
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
     
   size_t i, j;
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
-  size_t frag_size, frag_size_pointed;
+  size_t frag_size = 0;         /* FIXME: arbitrary initialization */
+  /* size_t frag_size_pointed; FIXME: unused */
 
   i = 1;
 
 
   i = 1;
 
@@ -280,7 +281,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap,
                    distance++;
                  }
                }else{ // Fragmented block
                    distance++;
                  }
                }else{ // Fragmented block
-                 frag_size_pointed = pow(2, mdp1->heapinfo[block_pointed1].type);
+                 /* frag_size_pointed = pow(2, mdp1->heapinfo[block_pointed1].type); FIXME: unused*/
                  address_pointed1 = (char*)mdp1 + ((char*)address_pointed1 - (char*)s_heap);
                  address_pointed2 = (char*)mdp2 + ((char*)address_pointed2 - (char*)s_heap);
                  addr_block_pointed1 = (void*) (((ADDR2UINT((size_t)block_pointed1)) - 1) * BLOCKSIZE + (char*)heapbase1);
                  address_pointed1 = (char*)mdp1 + ((char*)address_pointed1 - (char*)s_heap);
                  address_pointed2 = (char*)mdp2 + ((char*)address_pointed2 - (char*)s_heap);
                  addr_block_pointed1 = (void*) (((ADDR2UINT((size_t)block_pointed1)) - 1) * BLOCKSIZE + (char*)heapbase1);
@@ -397,7 +398,7 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void* s_heap,
                          distance++;
                        }
                      }else{ // Fragmented block
                          distance++;
                        }
                      }else{ // Fragmented block
-                       frag_size_pointed = pow(2, mdp1->heapinfo[block_pointed1].type);
+                       /* frag_size_pointed = pow(2, mdp1->heapinfo[block_pointed1].type); FIXME: unused */
                        address_pointed1 = (char*)mdp1 + ((char*)address_pointed1 - (char*)s_heap);
                        address_pointed2 = (char*)mdp2 + ((char*)address_pointed2 - (char*)s_heap);
                        addr_block_pointed1 = (void*) (((ADDR2UINT((size_t)block_pointed1)) - 1) * BLOCKSIZE + (char*)heapbase1);
                        address_pointed1 = (char*)mdp1 + ((char*)address_pointed1 - (char*)s_heap);
                        address_pointed2 = (char*)mdp2 + ((char*)address_pointed2 - (char*)s_heap);
                        addr_block_pointed1 = (void*) (((ADDR2UINT((size_t)block_pointed1)) - 1) * BLOCKSIZE + (char*)heapbase1);