From: wessels <> Date: Tue, 25 Apr 2006 04:30:52 +0000 (+0000) Subject: Cosmetic: Change 'stale_flags' structure members to type bool. stale_flags X-Git-Tag: SQUID_3_0_PRE4~231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f848b2cac1131e974db84556803286d9877824e;p=thirdparty%2Fsquid.git Cosmetic: Change 'stale_flags' structure members to type bool. stale_flags is only used locally by refresh.cc and it is somewhat silly to be so conservative with memory. --- diff --git a/src/refresh.cc b/src/refresh.cc index a2085fbed6..c7f81a574e 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -1,6 +1,6 @@ /* - * $Id: refresh.cc,v 1.68 2004/12/23 22:17:22 hno Exp $ + * $Id: refresh.cc,v 1.69 2006/04/24 22:30:52 wessels Exp $ * * DEBUG: section 22 Refresh Calculation * AUTHOR: Harvest Derived @@ -58,16 +58,10 @@ typedef enum { typedef struct { - -unsigned int expires: - 1; - -unsigned int min: - 1; - -unsigned int lmfactor: - 1; - unsigned int max; + bool expires; + bool min; + bool lmfactor; + bool max; } stale_flags; @@ -169,7 +163,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, time_t age, const */ if (entry->expires > -1) { - sf->expires = 1; + sf->expires = true; if (entry->expires > check_time) { debug(22, 3) ("FRESH: expires %d >= check_time %d \n", @@ -190,7 +184,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, time_t age, const if (age > R->max) { debug(22, 3) ("STALE: age %d > max %d \n", (int) age, (int) R->max); - sf->max = 1; + sf->max = true; return (age - R->max); } @@ -203,7 +197,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, time_t age, const * stale according to the last-modified factor algorithm. */ time_t stale_age = static_cast((entry->timestamp - entry->lastmod) * R->pct); - sf->lmfactor = 1; + sf->lmfactor = true; if (age >= stale_age) { debug(22, 3) ("STALE: age %d > stale_age %d\n", @@ -222,7 +216,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, time_t age, const */ if (age <= R->min) { debug(22, 3) ("FRESH: age %d <= min %d\n", (int) age, (int) R->min); - sf->min = 1; + sf->min = true; return -1; }