From: Arnaud Giersch Date: Thu, 6 May 2021 21:38:41 +0000 (+0200) Subject: Reduce scope for variable. X-Git-Tag: v3.28~318 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/35e66f1b2c4ea53b8d44b527e27cdd10e16b3d55 Reduce scope for variable. --- diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 2725b02654..42853860d0 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -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). "