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 / simix / smx_global.c
index e381b94..c204eca 100644 (file)
@@ -31,7 +31,7 @@ static void simix_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;
@@ -323,7 +323,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 {
 
   smx_process_t process = NULL;
-  int i;
+  unsigned int iter;
   double elapsed_time = 0.0;
   static int state_modifications = 1;
   static int first = 1;
@@ -353,11 +353,12 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     void *fun = NULL;
     void *arg = NULL;
 
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       if (xbt_swag_size(model->common_public->states.failed_action_set)
          || xbt_swag_size(model->common_public->states.
                           done_action_set)) {
        state_modifications = 1;
+        break;
       }
     }
 
@@ -374,7 +375,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
        DEBUG2("Launching %s on %s", args->name, args->hostname);
        process = SIMIX_process_create(args->name, args->code,
                                       args->data, args->hostname,
-                                      args->argc, args->argv);
+                                      args->argc, args->argv, args->properties);
        if (args->kill_time > SIMIX_get_clock()) {
          surf_timer_model->extension_public->set(args->kill_time,
                                                     (void *)
@@ -392,7 +393,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     }
 
     /* Wake up all process waiting for the action finish */
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       while ((action =
              xbt_swag_extract(model->common_public->states.
                               failed_action_set))) {
@@ -456,7 +457,7 @@ int SIMIX_timer_get(void **function, void **arg)
  *     \param function Create process function
  *
  */
-void SIMIX_function_register_process_create(smx_creation_func_t function)
+void SIMIX_function_register_process_create(smx_creation_func_t function)
 {
   xbt_assert0((simix_global->create_process_function == NULL),
              "Data already set");
@@ -471,7 +472,7 @@ void SIMIX_function_register_process_create(smx_creation_func_t * function)
  *     \param function Kill process function
  *
  */
-void SIMIX_function_register_process_kill(void_f_pvoid_t function)
+void SIMIX_function_register_process_kill(void_f_pvoid_t function)
 {
   xbt_assert0((simix_global->kill_process_function == NULL),
              "Data already set");
@@ -486,7 +487,7 @@ void SIMIX_function_register_process_kill(void_f_pvoid_t * function)
  *     \param function cleanup process function
  *
  */
-void SIMIX_function_register_process_cleanup(void_f_pvoid_t function)
+void SIMIX_function_register_process_cleanup(void_f_pvoid_t function)
 {
   simix_global->cleanup_process_function = function;
 }