From: Automatic source maintenance Date: Tue, 6 Apr 2010 00:12:56 +0000 (-0600) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_3_2_0_1~318 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a459e80a2d496b7a2f7c4a137050bf764724daea;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/FadingCounter.cc b/src/FadingCounter.cc index 8c896c2281..dd6364941d 100644 --- a/src/FadingCounter.cc +++ b/src/FadingCounter.cc @@ -8,7 +8,7 @@ #include "FadingCounter.h" FadingCounter::FadingCounter(): horizon(-1), precision(10), delta(-1), - lastTime(0), total(0) + lastTime(0), total(0) { counters.reserve(precision); while (counters.size() < static_cast(precision)) diff --git a/src/FadingCounter.h b/src/FadingCounter.h index 429a8d5f30..2d10bd427c 100644 --- a/src/FadingCounter.h +++ b/src/FadingCounter.h @@ -8,28 +8,29 @@ #include "Array.h" /// Counts events, forgetting old ones. Usefull for "3 errors/minute" limits. -class FadingCounter { - public: - FadingCounter(); +class FadingCounter +{ +public: + FadingCounter(); - /// 0=remember nothing; -1=forget nothing; new value triggers clear() - void configure(double horizonSeconds); + /// 0=remember nothing; -1=forget nothing; new value triggers clear() + void configure(double horizonSeconds); - void clear(); ///< forgets all events + void clear(); ///< forgets all events - int count(int howMany); ///< count fresh, return #events remembered - int remembered() const { return total; } ///< possibly stale #events + int count(int howMany); ///< count fresh, return #events remembered + int remembered() const { return total; } ///< possibly stale #events - /// read-only memory horizon in seconds; older events are forgotten - double horizon; + /// read-only memory horizon in seconds; older events are forgotten + double horizon; - private: - const int precision; ///< #counting slots, controls measur. occuracy - double delta; ///< sub-interval duration = horizon/precision +private: + const int precision; ///< #counting slots, controls measur. occuracy + double delta; ///< sub-interval duration = horizon/precision - double lastTime; ///< time of the last update - Vector counters; ///< events per delta (possibly stale) - int total; ///< number of remembered events (possibly stale) + double lastTime; ///< time of the last update + Vector counters; ///< events per delta (possibly stale) + int total; ///< number of remembered events (possibly stale) }; #endif /* SQUID_FADING_COUNTER_H */ diff --git a/src/adaptation/icap/ServiceRep.cc b/src/adaptation/icap/ServiceRep.cc index daf457426f..40212c2a24 100644 --- a/src/adaptation/icap/ServiceRep.cc +++ b/src/adaptation/icap/ServiceRep.cc @@ -55,7 +55,7 @@ Adaptation::Icap::ServiceRep::finalize() } theSessionFailures.configure(TheConfig.oldest_service_failure > 0 ? - TheConfig.oldest_service_failure : -1); + TheConfig.oldest_service_failure : -1); } void Adaptation::Icap::ServiceRep::invalidate() diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e1aa75ecf2..47d2330050 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -3745,7 +3745,7 @@ static void parse_icap_service_failure_limit(Adaptation::Icap::Config *cfg) } d = static_cast (xatoi(token)); - + m = static_cast (1); if (0 == d) @@ -3753,8 +3753,7 @@ static void parse_icap_service_failure_limit(Adaptation::Icap::Config *cfg) else if ((token = strtok(NULL, w_space)) == NULL) { debugs(3, 0, "No time-units on '" << config_input_line << "'"); self_destruct(); - } - else if ((m = parseTimeUnits(token)) == 0) + } else if ((m = parseTimeUnits(token)) == 0) self_destruct(); cfg->oldest_service_failure = (m * d);