]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Merge in 6th set of windows changes from Guido
authorrobertc <>
Tue, 11 Mar 2003 03:12:43 +0000 (03:12 +0000)
committerrobertc <>
Tue, 11 Mar 2003 03:12:43 +0000 (03:12 +0000)
Keywords:

Merge in 6th set of windows changes from Guido

src/ACLMaxUserIP.cc
src/DelayBucket.cc
src/DelayId.cc
src/DelayVector.cc

index b52d135d6a5fec423d4575f91d663bf595b75d85..842132e68c485f00051452c908b29b8333df7876 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLMaxUserIP.cc,v 1.1 2003/02/25 12:16:55 robertc Exp $
+ * $Id: ACLMaxUserIP.cc,v 1.2 2003/03/10 20:12:43 robertc Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -48,10 +48,10 @@ ACLMaxUserIP::clone() const
     return new ACLMaxUserIP(*this);
 }
 
-ACLMaxUserIP::ACLMaxUserIP (char const *theClass) : class_ (theClass), max(0)
+ACLMaxUserIP::ACLMaxUserIP (char const *theClass) : class_ (theClass), maximum(0)
 {}
 
-ACLMaxUserIP::ACLMaxUserIP (ACLMaxUserIP const & old) :class_ (old.class_), max (old.max), flags (old.flags)
+ACLMaxUserIP::ACLMaxUserIP (ACLMaxUserIP const & old) :class_ (old.class_), maximum (old.maximum), flags (old.flags)
 {}
 
 MemPool *ACLMaxUserIP::Pool(NULL);
@@ -91,13 +91,13 @@ ACLMaxUserIP::typeString() const
 bool
 ACLMaxUserIP::valid () const
 {
-    return max != 0;
+    return maximum != 0;
 }
 
 void
 ACLMaxUserIP::parse()
 {
-    if (max) {
+    if (maximum) {
         debug(28, 1) ("Attempting to alter already set User max IP acl\n");
         return;
     }
@@ -118,9 +118,9 @@ ACLMaxUserIP::parse()
     if (!t)
         fatal("aclParseUserMaxIP: Malformed ACL\n");
 
-    max = atoi(t);
+    maximum = atoi(t);
 
-    debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) max);
+    debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) maximum);
 
     return;
 }
@@ -141,7 +141,7 @@ ACLMaxUserIP::match(auth_user_request_t * auth_user_request,
      * one off is currently undecided (RBC)
      */
 
-    if (authenticateAuthUserRequestIPCount(auth_user_request) <= max)
+    if (authenticateAuthUserRequestIPCount(auth_user_request) <= maximum)
         return 0;
 
     /* this is a match */
@@ -185,7 +185,7 @@ ACLMaxUserIP::match(ACLChecklist *checklist)
 wordlist *
 ACLMaxUserIP::dump() const
 {
-    if (!max)
+    if (!maximum)
         return NULL;
 
     wordlist *W = NULL;
@@ -195,7 +195,7 @@ ACLMaxUserIP::dump() const
 
     char buf[128];
 
-    snprintf(buf, sizeof(buf), "%lu", (unsigned long int) max);
+    snprintf(buf, sizeof(buf), "%lu", (unsigned long int) maximum);
 
     wordlistAdd(&W, buf);
 
index fb83dff087baaca40bef07be18a48082d309ef5f..3c7966518a9aac1453c5ef4f8cfa5ba4f01911a3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DelayBucket.cc,v 1.4 2003/03/08 09:43:49 robertc Exp $
+ * $Id: DelayBucket.cc,v 1.5 2003/03/10 20:12:43 robertc Exp $
  *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
@@ -77,9 +77,9 @@ DelayBucket::update (DelaySpec const &rate, int incr)
 }
 
 int
-DelayBucket::bytesWanted (int min, int max) const
+DelayBucket::bytesWanted (int minimum, int maximum) const
 {
-    int result = XMAX(min, XMIN(max, level()));
+    int result = max(minimum, min(maximum, level()));
     return result;
 }
 
index bb39223d1e0a056112c0cf6575e897a5fee61cef..10a7ec0d7fde870dd1a82a5172e5c0ee3b843334 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DelayId.cc,v 1.5 2003/03/04 01:40:25 robertc Exp $
+ * $Id: DelayId.cc,v 1.6 2003/03/10 20:12:43 robertc Exp $
  *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
@@ -134,18 +134,18 @@ DelayId::setNoDelay(bool const newValue)
  * into account bytes already buffered - that is up to the caller.
  */
 int
-DelayId::bytesWanted(int min, int max) const
+DelayId::bytesWanted(int minimum, int maximum) const
 {
     /* unlimited */
 
     if (! (*this) || markedAsNoDelay)
-        return XMAX(min, max);
+        return max(minimum, maximum);
 
     /* limited */
-    int nbytes = XMAX(min, max);
+    int nbytes = max(minimum, maximum);
 
     if (compositeId.getRaw())
-        nbytes = compositeId->bytesWanted(min, nbytes);
+        nbytes = compositeId->bytesWanted(minimum, nbytes);
 
     return nbytes;
 }
index 7d632c53ab1b3bbf158007ad5a04e6ec8cc2e13c..882d88a4de18bb9873c4bd8fcedc16b01837777f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DelayVector.cc,v 1.4 2003/03/04 01:40:25 robertc Exp $
+ * $Id: DelayVector.cc,v 1.5 2003/03/10 20:12:43 robertc Exp $
  *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
@@ -164,17 +164,17 @@ DelayVector::Id::~Id()
 }
 
 int
-DelayVector::Id::bytesWanted (int min, int max) const
+DelayVector::Id::bytesWanted (int minimum, int maximum) const
 {
-    int nbytes = max;
+    int nbytes = maximum;
     const_iterator pos = ids.begin();
 
     while (pos != ids.end()) {
-        nbytes = XMIN (nbytes, (*pos)->bytesWanted(min, nbytes));
+        nbytes = min (nbytes, (*pos)->bytesWanted(minimum, nbytes));
         ++pos;
     }
 
-    nbytes = XMAX(min, nbytes);
+    nbytes = max(minimum, nbytes);
     return nbytes;
 }