Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new paje event declared on header of trace file, tesh's updated
[simgrid.git] / src / simix / smx_deployment.c
index 54ae08a..31cd8fd 100644 (file)
@@ -119,6 +119,7 @@ static void parse_process_finalize(void)
  */
 void SIMIX_launch_application(const char *file)
 {
+  int parse_status;
   xbt_assert0(simix_global,
               "SIMIX_global_init has to be called before SIMIX_launch_application.");
   surf_parse_reset_parser();
@@ -128,8 +129,9 @@ void SIMIX_launch_application(const char *file)
   surfxml_add_callback(ETag_surfxml_process_cb_list, parse_process_finalize);
 
   surf_parse_open(file);
-  xbt_assert1((!surf_parse()), "Parse error in %s", file);
+  parse_status = surf_parse();
   surf_parse_close();
+  xbt_assert1(!parse_status, "Parse error in %s", file);
 }
 
 /**
@@ -173,10 +175,10 @@ void SIMIX_function_register_default(xbt_main_func_t code)
  */
 xbt_main_func_t SIMIX_get_registered_function(const char *name)
 {
+       xbt_main_func_t res = NULL;
   xbt_assert0(simix_global,
               "SIMIX_global_init has to be called before SIMIX_get_registered_function.");
 
-  xbt_main_func_t res =
-    xbt_dict_get_or_null(simix_global->registered_functions, name);
+  res = xbt_dict_get_or_null(simix_global->registered_functions, name);
   return res ? res : default_function;
 }