]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Gcc-3.3 tidyups.
authorrobertc <>
Thu, 19 Jun 2003 19:11:59 +0000 (19:11 +0000)
committerrobertc <>
Thu, 19 Jun 2003 19:11:59 +0000 (19:11 +0000)
Keywords:

* Gave lib/ the same AM CXX and CFLAGS as src/
* In mempool, extract method on the free cache cleanup, and use a more correct type for Free, to avoid a warning on our use of 'type punned' pointers.
* Make squid_rn_inithead typesafe, and adjust usage throughout.
* rfc1738_do_escape needed adjustment for the use of char comparison with 0xFF.
* Make ACL Request/Reply HeaderStrategy singleton instance variable a pointer rather than instance to allow for stricter scoping rules.
* VectorMap<Key,Value>::indexUsed (unsigned char const index) had a tautology assert.

doc/release-notes/release-3.0.sgml
include/radix.h
lib/Makefile.am
lib/MemPool.c
lib/radix.c
lib/rfc1738.c
src/ACLReplyHeaderStrategy.h
src/ACLRequestHeaderStrategy.h
src/HttpHdrRange.cc
src/asn.cc
src/delay_pools.cc

index bbbfa132c25f2989624c9064c186a506714135e0..a7f645f93bf6fa3d1c86e3f9e6a9d7225c3f51e9 100644 (file)
@@ -2,7 +2,7 @@
 <article>
 <title>Squid 3.0 release notes</title>
 <author>Squid Developers</author>
-<date>$Id: release-3.0.sgml,v 1.7 2003/06/12 23:56:38 wessels Exp $</date>
+<date>$Id: release-3.0.sgml,v 1.8 2003/06/19 13:11:59 robertc Exp $</date>
 
 <abstract>
 This document contains the release notes for version 3.0 of Squid.
@@ -116,6 +116,7 @@ This fixes two issues:<itemize><item>Transparently intercepted requests is no lo
  <item>Complain if open of /dev/null fails; avoids infinite loop in ipcCreate().
  <item>Properly quote the quoting character '%' in log_quote() and username_quote().
  <item>in icmpRecv(), Handle the case when recv() returns EAGAIN and do not treat it like an error.
+ <item>Update squid to build with gcc/g++ 3.3 with no warnings.
 </itemize>
 
 <sect>Changes to squid.conf
index 76bee3668e8b8c895c8f5d71028975a5c7d35399..ac6a6eb57cdfc35dd3d04bd4d0385855ef2a5d63 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: radix.h,v 1.16 2003/01/23 00:36:47 robertc Exp $
+ * $Id: radix.h,v 1.17 2003/06/19 13:12:00 robertc Exp $
  */
 
 #ifndef SQUID_RADIX_H
@@ -119,7 +119,7 @@ struct squid_radix_node_head {
 
 
 SQUIDCEXTERN void squid_rn_init (void);
-SQUIDCEXTERN int squid_rn_inithead(void **, int);
+SQUIDCEXTERN int squid_rn_inithead(struct squid_radix_node_head **, int);
 SQUIDCEXTERN int squid_rn_refines(void *, void *);
 SQUIDCEXTERN int squid_rn_walktree(struct squid_radix_node_head *, int (*)(struct squid_radix_node *, void *), void *);
 SQUIDCEXTERN struct squid_radix_node *squid_rn_addmask(void *, int, int);
index d3558d69587dc0187ad186e615bc56ae4fbd6d59..47288effda8a92ce2af2a24a589ae26b63615c74 100644 (file)
@@ -1,10 +1,13 @@
 ## Process this file with automake to produce Makefile.in
 #
-#  $Id: Makefile.am,v 1.10 2003/03/10 04:56:21 robertc Exp $
+#  $Id: Makefile.am,v 1.11 2003/06/19 13:12:00 robertc Exp $
 #
 
 SUBDIRS = libTrie
 
+AM_CFLAGS = @SQUID_CFLAGS@
+AM_CXXFLAGS = @SQUID_CXXFLAGS@
+
 if ENABLE_XPROF_STATS
 XPROF_STATS_SOURCE = Profiler.c
 else
index 628cce286f6ab891509c0c0a77b48ccffe3600ec..92a908419a6c3ef0c194ac6aa6b079203b337386 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: MemPool.c,v 1.16 2003/02/08 01:45:47 robertc Exp $
+ * $Id: MemPool.c,v 1.17 2003/06/19 13:12:00 robertc Exp $
  *
  * DEBUG: section 63    Low Level Memory Pool Management
  * AUTHOR: Alex Rousskov, Andres Kroonmaa
@@ -567,20 +567,10 @@ memPoolFree(MemPool * pool, void *obj)
 
 }
 
-/* removes empty Chunks from pool */
 static void
-memPoolCleanOne(MemPool * pool, time_t maxage)
+memPoolConvertFreeCacheToChunkSpecific(MemPool * const pool)
 {
-    MemChunk *chunk, *freechunk, *listTail;
-    void **Free;
-    time_t age;
-
-    if (!pool)
-       return;
-    if (!pool->Chunks)
-       return;
-
-    memPoolFlushMetersFull(pool);
+    void *Free;
     /*
      * OK, so we have to go through all the global freeCache and find the Chunk
      * any given Free belongs to, and stuff it into that Chunk's freelist 
@@ -590,15 +580,31 @@ memPoolCleanOne(MemPool * pool, time_t maxage)
        lastPool = pool;
        pool->allChunks = splay_splay((const void **)&Free, pool->allChunks, memCompObjChunks);
        assert(splayLastResult == 0);
-       chunk = pool->allChunks->data;
+       MemChunk *chunk = pool->allChunks->data;
        assert(chunk->inuse_count > 0);
        chunk->inuse_count--;
-       pool->freeCache = *Free;        /* remove from global cache */
-       *Free = chunk->freeList;        /* stuff into chunks freelist */
+       pool->freeCache = *(void **)Free;       /* remove from global cache */
+       *(void **)Free = chunk->freeList;       /* stuff into chunks freelist */
        chunk->freeList = Free;
        chunk->lastref = squid_curtime;
     }
 
+}
+
+/* removes empty Chunks from pool */
+static void
+memPoolCleanOne(MemPool * pool, time_t maxage)
+{
+    MemChunk *chunk, *freechunk, *listTail;
+    time_t age;
+
+    if (!pool)
+       return;
+    if (!pool->Chunks)
+       return;
+
+    memPoolFlushMetersFull(pool);
+    memPoolConvertFreeCacheToChunkSpecific(pool);
     /* Now we have all chunks in this pool cleared up, all free items returned to their home */
     /* We start now checking all chunks to see if we can release any */
     /* We start from pool->Chunks->next, so first chunk is not released */
index 1e5ebfe25ef8677b61ea27b3d4fb55b0d565f6bd..1f2c181b02d0a13e9d565f0bb3ecaf707aaa1827 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: radix.c,v 1.19 2003/01/23 00:37:01 robertc Exp $
+ * $Id: radix.c,v 1.20 2003/06/19 13:12:00 robertc Exp $
  *
  * DEBUG: section 53     Radix tree data structure implementation
  * AUTHOR: NetBSD Derived
@@ -950,7 +950,7 @@ squid_rn_walktree(struct squid_radix_node_head *h, int (*f) (struct squid_radix_
 }
 
 int
-squid_rn_inithead(void **head, int off)
+squid_rn_inithead(struct squid_radix_node_head **head, int off)
 {
     register struct squid_radix_node_head *rnh;
     register struct squid_radix_node *t, *tt, *ttt;
@@ -1005,7 +1005,7 @@ squid_rn_init(void)
     addmask_key = cplim = rn_ones + squid_max_keylen;
     while (cp < cplim)
        *cp++ = -1;
-    if (squid_rn_inithead((void **) &squid_mask_rnhead, 0) == 0) {
+    if (squid_rn_inithead(&squid_mask_rnhead, 0) == 0) {
        fprintf(stderr, "rn_init2 failed.\n");
        exit(-1);
     }
index dc5fb2f7a4112d98261a0693e99833cd1f563f76..bbce0d0e832cb1e1d320e68d11de18b501ac06f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rfc1738.c,v 1.24 2003/01/23 00:37:01 robertc Exp $
+ * $Id: rfc1738.c,v 1.25 2003/06/19 13:12:00 robertc Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -128,8 +128,7 @@ rfc1738_do_escape(const char *url, int encode_reserved)
            do_escape = 1;
        }
        /* RFC 1738 says any non-US-ASCII are encoded */
-       if (((unsigned char) *p >= (unsigned char) 0x80) &&
-           ((unsigned char) *p <= (unsigned char) 0xFF)) {
+       if (((unsigned char) *p >= (unsigned char) 0x80)) { 
            do_escape = 1;
        }
        /* Do the triplet encoding, or just copy the char */
index d56436830ba62d8b211085716a5a07446e8e85f9..f4d6bd672470c1242b46865d51c7464e3a54e13a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLReplyHeaderStrategy.h,v 1.1 2003/02/25 12:22:34 robertc Exp $
+ * $Id: ACLReplyHeaderStrategy.h,v 1.2 2003/06/19 13:12:01 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -55,7 +55,7 @@ public:
     ACLReplyHeaderStrategy(ACLReplyHeaderStrategy const &);
 
 private:
-    static ACLReplyHeaderStrategy Instance_;
+    static ACLReplyHeaderStrategy *Instance_;
     ACLReplyHeaderStrategy(){}
 
     ACLReplyHeaderStrategy&operator=(ACLReplyHeaderStrategy const &);
@@ -77,10 +77,13 @@ template <http_hdr_type header>
 ACLReplyHeaderStrategy<header> *
 ACLReplyHeaderStrategy<header>::Instance()
 {
-    return &Instance_;
+    if (!Instance_)
+        Instance_ = new ACLReplyHeaderStrategy<header>;
+
+    return Instance_;
 }
 
 template <http_hdr_type header>
-ACLReplyHeaderStrategy<header> ACLReplyHeaderStrategy<header>::Instance_;
+ACLReplyHeaderStrategy<header> * ACLReplyHeaderStrategy<header>::Instance_(NULL);
 
 #endif /* SQUID_REPLYHEADERSTRATEGY_H */
index 7da4a39e4b4c453e575d876f5e2a9531afa04670..c70b88a19aac41e8c22bc74c57ab4afec6f7e940 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLRequestHeaderStrategy.h,v 1.3 2003/02/25 12:22:34 robertc Exp $
+ * $Id: ACLRequestHeaderStrategy.h,v 1.4 2003/06/19 13:12:01 robertc Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -55,7 +55,7 @@ public:
     ACLRequestHeaderStrategy(ACLRequestHeaderStrategy const &);
 
 private:
-    static ACLRequestHeaderStrategy Instance_;
+    static ACLRequestHeaderStrategy *Instance_;
     ACLRequestHeaderStrategy(){}
 
     ACLRequestHeaderStrategy&operator=(ACLRequestHeaderStrategy const &);
@@ -77,10 +77,13 @@ template <http_hdr_type header>
 ACLRequestHeaderStrategy<header> *
 ACLRequestHeaderStrategy<header>::Instance()
 {
-    return &Instance_;
+    if (!Instance_)
+        Instance_ = new ACLRequestHeaderStrategy<header>;
+
+    return Instance_;
 }
 
 template <http_hdr_type header>
-ACLRequestHeaderStrategy<header> ACLRequestHeaderStrategy<header>::Instance_;
+ACLRequestHeaderStrategy<header> * ACLRequestHeaderStrategy<header>::Instance_ (NULL);
 
 #endif /* SQUID_REQUESTHEADERSTRATEGY_H */
index e510877469d8efb6e3ecd064c91e3ac553d433da..3de32b2d00effdb4eb64c3319fff3c6cf1265530 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHdrRange.cc,v 1.34 2003/06/18 12:24:02 robertc Exp $
+ * $Id: HttpHdrRange.cc,v 1.35 2003/06/19 13:12:01 robertc Exp $
  *
  * DEBUG: section 64    HTTP Range Header
  * AUTHOR: Alex Rousskov
@@ -612,6 +612,7 @@ void
 HttpHdrRangeIter::updateSpec()
 {
     assert (debt_size == 0);
+    assert (valid);
 
     if (pos.incrementable()) {
         debt(currentSpec()->length);
index c46e95de64d1308f9472ddc6a693726f9a92d963..1a787fdfc53d3e10f34b00e80866799de194bfbf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.92 2003/03/06 06:21:37 robertc Exp $
+ * $Id: asn.cc,v 1.93 2003/06/19 13:12:04 robertc Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -186,7 +186,7 @@ asnInit(void)
     if (0 == inited++)
         squid_rn_init();
 
-    squid_rn_inithead((void **) &AS_tree_head, 8);
+    squid_rn_inithead(&AS_tree_head, 8);
 
     cachemgrRegister("asndb", "AS Number Database", asnStats, 0, 1);
 }
index aa3e5536e6d6e10332a6ba33264d8d3ddd4a456b..35e884a4f479c3b5b6175e334c5204fffb7689b8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: delay_pools.cc,v 1.39 2003/05/20 12:17:39 robertc Exp $
+ * $Id: delay_pools.cc,v 1.40 2003/06/19 13:12:05 robertc Exp $
  *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
@@ -803,7 +803,6 @@ template <class Key, class Value>
 bool
 VectorMap<Key,Value>::indexUsed (unsigned char const index) const
 {
-    assert (index <= IND_MAP_SZ);
     return index < size();
 }