Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid casting errors in printf on MacOSX
[simgrid.git] / src / mc / explo / udpor / UnfoldingEvent.cpp
index 8b71842..865b701 100644 (file)
@@ -58,9 +58,9 @@ std::string UnfoldingEvent::to_string() const
   }
   dependencies_string += "]";
 
-  return xbt::string_printf("Event %lu, Actor %ld: %s (%zu dependencies: %s)", this->id, associated_transition->aid_,
-                            associated_transition->to_string().c_str(), immediate_causes.size(),
-                            dependencies_string.c_str());
+  return xbt::string_printf("Event %lu, Actor %ld: %s (%lu dependencies: %s)", this->id, associated_transition->aid_,
+                            associated_transition->to_string().c_str(),
+                            static_cast<long unsigned>(immediate_causes.size()), dependencies_string.c_str());
 }
 
 EventSet UnfoldingEvent::get_history() const
@@ -121,21 +121,15 @@ bool UnfoldingEvent::immediately_conflicts_with(const UnfoldingEvent* other) con
   auto combined_events = History(EventSet{this, other}).get_all_events();
 
   // See the definition of immediate conflicts in the original paper on UDPOR
-  {
-    combined_events.remove(this);
-    if (not combined_events.is_valid_configuration()) {
-      return false;
-    }
-    combined_events.insert(this);
-  }
+  combined_events.remove(this);
+  if (not combined_events.is_valid_configuration())
+    return false;
+  combined_events.insert(this);
 
-  {
-    combined_events.remove(other);
-    if (not combined_events.is_valid_configuration()) {
-      return false;
-    }
-    combined_events.insert(other);
-  }
+  combined_events.remove(other);
+  if (not combined_events.is_valid_configuration())
+    return false;
+  combined_events.insert(other);
 
   return true;
 }