Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless statements.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 21 Feb 2013 17:01:45 +0000 (18:01 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 21 Feb 2013 17:12:05 +0000 (18:12 +0100)
src/mc/mc_compare.c
src/mc/mc_global.c
src/mc/mc_liveness.c
src/surf/storage.c
src/surf/surf_routing_none.c
src/xbt/mmalloc/mm_diff.c

index d0b8fff..bc91e37 100644 (file)
@@ -155,9 +155,7 @@ void stack_region_free_voidp(void *s){
 }
 
 static void heap_equality_free(heap_equality_t e){
-  if(e){
-    xbt_free(e);
-  }
+  xbt_free(e);
 }
 
 void heap_equality_free_voidp(void *e){
index f9f2ad1..f226c9c 100644 (file)
@@ -744,8 +744,7 @@ void MC_automaton_new_propositional_symbol(const char* id, void* fct) {
 /************ MC_ignore ***********/ 
 
 void heap_ignore_region_free(mc_heap_ignore_region_t r){
-  if(r)
-    xbt_free(r);
+  xbt_free(r);
 }
 
 void heap_ignore_region_free_voidp(void *r){
@@ -1342,10 +1341,8 @@ void MC_get_local_variables(const char *elf_file, xbt_dict_t location_list, xbt_
       }
 
       xbt_free(subprogram_start);
-      if(subprogram_end != NULL){
-        xbt_free(subprogram_end);
-        subprogram_end = NULL;
-      }
+      xbt_free(subprogram_end);
+      subprogram_end = NULL;
         
 
     }else if(strcmp(node_type, "(DW_TAG_variable)") == 0){ /* New variable */
index 8d01745..9b8e361 100644 (file)
@@ -303,7 +303,6 @@ int MC_automaton_evaluate_label(xbt_exp_label_t l){
 
 void pair_visited_free(mc_pair_visited_t pair){
   if(pair){
-    pair->automaton_state = NULL;
     xbt_dynar_free(&(pair->prop_ato));
     MC_free_snapshot(pair->system_state);
     xbt_free(pair);
@@ -337,7 +336,6 @@ mc_pair_stateless_t new_pair_stateless(mc_state_t sg, xbt_state_t st, int r){
 
 void pair_reached_free(mc_pair_reached_t pair){
   if(pair){
-    pair->automaton_state = NULL;
     xbt_dynar_free(&(pair->prop_ato));
     MC_free_snapshot(pair->system_state);
     xbt_free(pair);
index 66abf8f..9de73f7 100644 (file)
@@ -103,7 +103,6 @@ static surf_action_t storage_action_unlink(void *storage, surf_file_t stream)
   xbt_dict_remove(content_dict,stream->name);
 
   free(stream->name);
-  stream->content = NULL;
   xbt_free(stream);
 
   return action;
@@ -152,7 +151,6 @@ static surf_action_t storage_action_close(void *storage, surf_file_t fp)
   }
 
   free(fp->name);
-  fp->content = NULL;
   xbt_free(fp);
   surf_action_t action = storage_action_execute(storage,0, CLOSE);
   return action;
@@ -277,8 +275,7 @@ static void storage_finalize(void)
   surf_model_exit(surf_storage_model);
   surf_storage_model = NULL;
 
-  if(storage_list)
-    xbt_dynar_free(&storage_list);
+  xbt_dynar_free(&storage_list);
 
   xbt_swag_free
       (storage_running_action_set_that_does_not_need_being_checked);
@@ -612,8 +609,7 @@ static xbt_dict_t parse_storage_content(char *filename, unsigned long *used_size
       }
     }
   }
-  if (line)
-      free(line);
+  free(line);
   fclose(file);
   return parse_content;
 }
index 46d667b..d312a29 100644 (file)
@@ -68,8 +68,7 @@ AS_t model_none_create_sized(size_t childsize) {
 void model_none_finalize(AS_t as) {
   xbt_dict_free(&as->routing_sons);
   xbt_dynar_free(&as->index_network_elm);
-  if(as->link_up_down_list)
-    xbt_dynar_free(&as->link_up_down_list);
+  xbt_dynar_free(&as->link_up_down_list);
   xbt_free(as);
 }
 
index 8c67d8d..54194fd 100644 (file)
@@ -683,10 +683,8 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){
 }
 
 static void heap_area_pair_free(heap_area_pair_t pair){
-  if (pair){
-    xbt_free(pair);
-    pair = NULL;
-  }
+  xbt_free(pair);
+  pair = NULL;
 }
 
 static void heap_area_pair_free_voidp(void *d)