Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce scope for variable.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 May 2021 21:38:41 +0000 (23:38 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 7 May 2021 08:29:32 +0000 (10:29 +0200)
src/s4u/s4u_Actor.cpp

index 2725b02..4285386 100644 (file)
@@ -314,12 +314,12 @@ bool is_maestro()
 void sleep_for(double duration)
 {
   xbt_assert(std::isfinite(duration), "duration is not finite!");
-  static unsigned int warned = 0; // At most 20 such warnings
 
   if (duration <= 0) /* that's a no-op */
     return;
 
   if (duration < sg_surf_precision) {
+    static unsigned int warned = 0; // At most 20 such warnings
     warned++;
     if (warned <= 20)
       XBT_INFO("The parameter to sleep_for() is smaller than the SimGrid numerical accuracy (%g < %g). "