Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / kernel / lmm / maxmin.cpp
index b082826..f36f3ca 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -87,9 +87,9 @@ void System::check_concurrency() const
       continue;
 
     const Element& elem    = var.cnsts_[0];
-    int belong_to_enabled  = elem.enabled_element_set_hook.is_linked();
-    int belong_to_disabled = elem.disabled_element_set_hook.is_linked();
-    int belong_to_active   = elem.active_element_set_hook.is_linked();
+    bool belong_to_enabled  = elem.enabled_element_set_hook.is_linked();
+    bool belong_to_disabled = elem.disabled_element_set_hook.is_linked();
+    bool belong_to_active   = elem.active_element_set_hook.is_linked();
 
     for (Element const& elem2 : var.cnsts_) {
       xbt_assert(belong_to_enabled == elem2.enabled_element_set_hook.is_linked(),
@@ -396,7 +396,7 @@ static inline void saturated_constraints_update(double usage, int cnst_light_num
   }
 }
 
-static inline void saturated_variable_set_update(ConstraintLight* cnst_light_tab,
+static inline void saturated_variable_set_update(const ConstraintLight* cnst_light_tab,
                                                  const dyn_light_t& saturated_constraints, System* sys)
 {
   /* Add active variables (i.e. variables that need to be set) from the set of constraints to saturate
@@ -827,8 +827,8 @@ void System::update_variable_penalty(Variable* var, double penalty)
   if (penalty == var->sharing_penalty_)
     return;
 
-  int enabling_var  = (penalty > 0 && var->sharing_penalty_ <= 0);
-  int disabling_var = (penalty <= 0 && var->sharing_penalty_ > 0);
+  bool enabling_var  = (penalty > 0 && var->sharing_penalty_ <= 0);
+  bool disabling_var = (penalty <= 0 && var->sharing_penalty_ > 0);
 
   XBT_IN("(sys=%p, var=%p, penalty=%f)", this, var, penalty);
 
@@ -872,7 +872,7 @@ void System::update_constraint_bound(Constraint* cnst, double bound)
  *  A recursive algorithm to optimize the system recalculation selecting only constraints that have changed. Each
  *  constraint change is propagated to the list of constraints for each variable.
  */
-void System::update_modified_set_rec(Constraint* cnst)
+void System::update_modified_set_rec(const Constraint* cnst)
 {
   for (Element const& elem : cnst->enabled_element_set_) {
     Variable* var = elem.variable;