Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ansi C declaration of the variables (at the beginning of the blocks)
[simgrid.git] / src / simdag / sd_global.c
index d439547..df22d65 100644 (file)
@@ -123,7 +123,7 @@ static void sd_cfg_control_set(const char *control_string)
   /* To split the string in commands, and the cursors */
   xbt_dynar_t set_strings;
   char *str;
-  int cpt;
+  unsigned int cpt;
 
   if (!control_string)
     return;
@@ -359,6 +359,8 @@ void SD_create_environment(const char *platform_file) {
   surf_workstation_model_description[workstation_id].
       model_init(platform_file);
 
+  parse_platform_file(platform_file);
+
   _sd_init_status = 2;
 
   /* now let's create the SD wrappers for workstations and links */
@@ -366,7 +368,7 @@ void SD_create_environment(const char *platform_file) {
     __SD_workstation_create(surf_workstation, NULL);
   }
 
-  xbt_dict_foreach(network_link_set, cursor, name, surf_link) {
+  xbt_dict_foreach(link_set, cursor, name, surf_link) {
     __SD_link_create(surf_link, NULL);
   }
 
@@ -395,7 +397,7 @@ SD_task_t* SD_simulate(double how_long)
   SD_task_t *changed_tasks = NULL;
   int changed_task_number = 0;
   int changed_task_capacity = sd_global->task_number + 1;
-  int i;
+  unsigned int iter;
   static int first_time = 1;
 
   SD_CHECK_INIT_DONE();
@@ -451,7 +453,7 @@ SD_task_t* SD_simulate(double how_long)
       total_time += elapsed_time;
 
     /* let's see which tasks are done */
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       while ((action = xbt_swag_extract(model->common_public->
                                        states.done_action_set))) {
        task = action->data;
@@ -523,10 +525,10 @@ SD_task_t* SD_simulate(double how_long)
   }
 
   /* we must reset every task->state_changed */
-  i = 0;
-  while (changed_tasks[i] != NULL) {
-    changed_tasks[i]->state_changed = 0;
-    i++;
+  iter = 0;
+  while (changed_tasks[iter] != NULL) {
+    changed_tasks[iter]->state_changed = 0;
+    iter++;
   }
 
   INFO0("Simulation finished");