Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill our _XBT_WIN32. Standard _WIN32 is sufficient
[simgrid.git] / src / mc / mc_base.cpp
index 5b61d7b..e8f1bb4 100644 (file)
@@ -199,7 +199,7 @@ static int prng_random(int min, int max)
   // Use rejection in order to avoid skew
   unsigned long x;
   do {
-#ifndef _XBT_WIN32
+#ifndef _WIN32
     x = (unsigned long) random();
 #else
     x = (unsigned long) rand();
@@ -227,16 +227,12 @@ void MC_simcall_handle(smx_simcall_t req, int value)
     return;
   }
 
-  unsigned i;
-  mc_smx_process_info_t pi = nullptr;
-
-  xbt_dynar_foreach_ptr(mc_model_checker->process().smx_process_infos, i, pi) {
-    if (req == &pi->copy.simcall) {
+  for (auto& pi : mc_model_checker->process().smx_process_infos)
+    if (req == &pi.copy.simcall) {
       mc_model_checker->simcall_handle(
-        mc_model_checker->process(), pi->copy.pid, value);
+        mc_model_checker->process(), pi.copy.pid, value);
       return;
     }
-  }
 
   xbt_die("Could not find the request");
 #endif