]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1085: Compiler errors compiling with GCC 3.4 series
authorhno <>
Mon, 8 Nov 2004 06:29:50 +0000 (06:29 +0000)
committerhno <>
Mon, 8 Nov 2004 06:29:50 +0000 (06:29 +0000)
18 files changed:
include/Array.h
include/Stack.h
include/fatal.h [new file with mode: 0644]
src/ACLBrowser.cc
src/ACLChecklist.cc
src/ACLDomainData.cc
src/ACLReplyHeaderStrategy.h
src/ACLRequestHeaderStrategy.h
src/clientStream.cc
src/client_side_request.cc
src/fs/aufs/store_io_aufs.cc
src/fs/diskd/store_io_diskd.cc
src/fs/ufs/StoreFSufs.h
src/fs/ufs/store_io_ufs.cc
src/squid.h
src/store_client.cc
src/structs.h
src/ufscommon.cc

index 94484e44909ede4d4d069445c365056c1924a5bf..e337224f77e13a8f05939bbcfb49f96062609327 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Array.h,v 1.16 2003/09/22 08:50:51 robertc Exp $
+ * $Id: Array.h,v 1.17 2004/11/07 23:29:50 hno Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -34,6 +34,9 @@
 #ifndef SQUID_ARRAY_H
 #define SQUID_ARRAY_H
 
+#include "fatal.h"
+#include "util.h"
+
 /* iterator support */
 
 template <class C>
@@ -213,7 +216,7 @@ Vector<E>::preAppend(int app_count)
 }
 
 template<class E>
-Vector<E>::Vector<E> (Vector const &rhs)
+Vector<E>::Vector<E> (Vector<E> const &rhs)
 {
     items = NULL;
     capacity = 0;
@@ -226,7 +229,7 @@ Vector<E>::Vector<E> (Vector const &rhs)
 
 template<class E>
 Vector<E> &
-Vector<E>::operator = (Vector const &old)
+Vector<E>::operator = (Vector<E> const &old)
 {
     clean();
     reserve (old.size());
@@ -292,14 +295,14 @@ template<class C>
 VectorIteratorBase<C>::VectorIteratorBase(size_t aPos, C &container) : pos(aPos), theVector(&container) {}
 
 template<class C>
-bool VectorIteratorBase<C>:: operator != (VectorIteratorBase const &rhs)
+bool VectorIteratorBase<C>:: operator != (VectorIteratorBase<C> const &rhs)
 {
     assert (theVector);
     return pos != rhs.pos;
 }
 
 template<class C>
-bool VectorIteratorBase<C>:: operator == (VectorIteratorBase const &rhs)
+bool VectorIteratorBase<C>:: operator == (VectorIteratorBase<C> const &rhs)
 {
     assert (theVector);
     return pos == rhs.pos;
@@ -336,7 +339,7 @@ VectorIteratorBase<C> VectorIteratorBase<C>:: operator ++(int)
 
 template<class C>
 VectorIteratorBase<C>&
-VectorIteratorBase<C>::operator =(VectorIteratorBase const &old)
+VectorIteratorBase<C>::operator =(VectorIteratorBase<C> const &old)
 {
     pos = old.pos;
     theVector = old.theVector;
@@ -345,7 +348,7 @@ VectorIteratorBase<C>::operator =(VectorIteratorBase const &old)
 
 template<class C>
 ssize_t
-VectorIteratorBase<C>::operator - (VectorIteratorBase const &rhs) const
+VectorIteratorBase<C>::operator - (VectorIteratorBase<C> const &rhs) const
 {
     assert(theVector == rhs.theVector);
     return pos - rhs.pos;
index 62da2773ab515768a179c0ee095eb8c8ab845142..85339a3935be7b5a80514f044f3dc169218af2e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Stack.h,v 1.15 2003/07/14 10:36:41 robertc Exp $
+ * $Id: Stack.h,v 1.16 2004/11/07 23:29:50 hno Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -44,8 +44,9 @@ template <class S = void *>
 
 class Stack : public Vector<S>
 {
-
 public:
+    using Vector<S>::count;
+    using Vector<S>::items;
     typedef typename Vector<S>::value_type value_type;
     typedef typename Vector<S>::pointer pointer;
     value_type pop()
@@ -53,9 +54,9 @@ public:
         if (!count)
             return value_type();
 
-        value_type result = items[--count];
+        value_type result = items[count];
 
-        items[count] = value_type();
+        this->items[count] = value_type();
 
         return result;
     }
diff --git a/include/fatal.h b/include/fatal.h
new file mode 100644 (file)
index 0000000..951053a
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef SQUID_FATAL_H
+#define SQUID_FATAL_H
+
+#include "config.h"
+
+SQUIDCEXTERN void fatal(const char *message);
+#if STDC_HEADERS
+SQUIDCEXTERN void
+fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1;
+#else
+SQUIDCEXTERN void fatalf();
+#endif
+SQUIDCEXTERN void fatal_dump(const char *message);
+
+#endif
index e048ec1f384d8ec8498ac546b24e54f0db03c3e8..2a659087d71ccadc474ad4b233fbb45206d89fa1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLBrowser.cc,v 1.2 2003/10/20 12:33:01 robertc Exp $
+ * $Id: ACLBrowser.cc,v 1.3 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -35,8 +35,8 @@
  */
 
 #include "squid.h"
-#include "ACLBrowser.h"
 #include "ACLChecklist.h"
+#include "ACLBrowser.h"
 #include "ACLRegexData.h"
 
 /* explicit template instantiation required for some systems */
index 08a69081f4194a9a4d1b5948f014281214c8c0be..098302b3473f56e3de272682e2c8158c408b4689 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLChecklist.cc,v 1.18 2004/10/18 12:12:54 hno Exp $
+ * $Id: ACLChecklist.cc,v 1.19 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -280,8 +280,7 @@ ACLChecklist::operator new (size_t size)
     ACLChecklist *result = cbdataAlloc(ACLChecklist);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
index 499a417862296581b46d64742ae6651176d0383c..550ddfac64be6c3af2a66a99ff24ec3e7832b9c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLDomainData.cc,v 1.6 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLDomainData.cc,v 1.7 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -69,6 +69,17 @@ splaystrcmp (T&l, T&r)
 /* general compare functions, these are used for tree search algorithms
  * so they return <0, 0 or >0 */
 
+/* compare a host and a domain */
+
+static int
+aclHostDomainCompare( char *const &a, char * const &b)
+{
+    const char *h = (const char *)a;
+    const char *d = (const char *)b;
+    return matchDomainName(h, d);
+}
+
+
 /* compare two domains */
 
 template<class T>
@@ -96,17 +107,6 @@ aclDomainCompare(T const &a, T const &b)
     return ret;
 }
 
-/* compare a host and a domain */
-
-static int
-aclHostDomainCompare( char *const &a, char * const &b)
-{
-    const char *h = (const char *)a;
-    const char *d = (const char *)b;
-    return matchDomainName(h, d);
-}
-
-
 bool
 ACLDomainData::match(char const *host)
 {
index 9c6d6adebf94949a4a531c643067e9ed986c0a0a..4ecc295c715d0a6c584a512d6dda87fe2be11723 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLReplyHeaderStrategy.h,v 1.5 2004/10/20 22:37:56 hno Exp $
+ * $Id: ACLReplyHeaderStrategy.h,v 1.6 2004/11/07 23:29:50 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -38,6 +38,8 @@
 #include "ACL.h"
 #include "ACLData.h"
 #include "ACLStrategy.h"
+#include "ACLChecklist.h"
+#include "HttpReply.h"
 
 template <http_hdr_type header>
 
index 1d5ab3666d9bb371209e17a18c9e0a6b69fa9764..7538ed742400e8375d31fe8e0d554831ae049232 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLRequestHeaderStrategy.h,v 1.7 2003/08/10 09:53:49 robertc Exp $
+ * $Id: ACLRequestHeaderStrategy.h,v 1.8 2004/11/07 23:29:50 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -39,6 +39,7 @@
 #include "ACLData.h"
 #include "ACLStrategy.h"
 #include "HttpRequest.h"
+#include "ACLChecklist.h"
 
 template <http_hdr_type header>
 
index 3dcd0a947de63652a5154149d56545d6cc4e1f3c..948579e4c55f9e80f636f37ac965b82fcaf5ac78 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: clientStream.cc,v 1.8 2003/04/06 08:23:10 robertc Exp $
+ * $Id: clientStream.cc,v 1.9 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 87    Client-side Stream routines.
  * AUTHOR: Robert Collins
@@ -134,8 +134,7 @@ clientStreamInit(dlink_list * list, CSR * func, CSD * rdetach, CSS * readstatus,
 {
     clientStreamNode *temp = clientStreamNew(func, NULL, rdetach, readstatus,
                              readdata);
-    dlinkAdd(temp, &temp->node, list);
-    cbdataReference(temp);
+    dlinkAdd(cbdataReference(temp), &temp->node, list);
     temp->head = list;
     clientStreamInsertHead(list, NULL, callback, cdetach, NULL, callbackdata);
     temp = (clientStreamNode *)list->tail->data;
@@ -164,9 +163,7 @@ clientStreamInsertHead(dlink_list * list, CSR * func, CSCB * callback,
     if (list->head->next)
         temp->readBuffer = ((clientStreamNode *)list->head->next->data)->readBuffer;
 
-    dlinkAddAfter(temp, &temp->node, list->head, list);
-
-    cbdataReference(temp);
+    dlinkAddAfter(cbdataReference(temp), &temp->node, list->head, list);
 }
 
 /*
index 2b883d416722bd12c91eeac125fee588a91e82aa..1e7db26d0b6a426ee222e9362aa6cad1b42ad64a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.39 2004/10/20 22:48:52 hno Exp $
+ * $Id: client_side_request.cc,v 1.40 2004/11/07 23:29:50 hno Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -93,8 +93,7 @@ ClientRequestContext::operator new (size_t size)
     ClientRequestContext *result = cbdataAlloc(ClientRequestContext);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
@@ -146,8 +145,7 @@ ClientHttpRequest::operator new (size_t size)
     ClientHttpRequest *result = cbdataAlloc(ClientHttpRequest);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
index c5b8c510c50be730c911345f3bac99b1019ddeb3..9ced197ee508aff19b0abd64b23bcc30967981ad 100644 (file)
@@ -111,8 +111,7 @@ AUFSFile::operator new (size_t)
     AUFSFile *result = cbdataAlloc(AUFSFile);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
index 810de5c8648d2af95056448b0e2b0f330b873ae8..5d09f8fd06a2810de2a3b50aea8bf693e4e9a3dd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_diskd.cc,v 1.39 2003/09/06 12:47:36 robertc Exp $
+ * $Id: store_io_diskd.cc,v 1.40 2004/11/07 23:29:51 hno Exp $
  *
  * DEBUG: section 79    Squid-side DISKD I/O functions.
  * AUTHOR: Duane Wessels
@@ -233,11 +233,10 @@ DiskdFile::operator new (size_t)
 {
     CBDATA_INIT_TYPE(DiskdFile);
     DiskdFile *result = cbdataAlloc(DiskdFile);
+    debug (79,3)("diskdFile with base %p allocating\n", result);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    debug (79,3)("diskdFile with base %p allocating\n", result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
index 947fad102942a32c29c48d33a9a5e6de204e51ae..cc80047c67231d5d2cb528cdd7b82ffdacdc251a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: StoreFSufs.h,v 1.1 2003/07/22 15:23:14 robertc Exp $
+ * $Id: StoreFSufs.h,v 1.2 2004/11/07 23:29:51 hno Exp $
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -36,7 +36,7 @@
 
 #include "squid.h"
 
-class IOModule;
+#include "fs/ufs/IOModule.h"
 
 template <class TheSwapDir>
 
index 67afbe3d181924a70f69e52520325ee11aff1c23..c400e828e08f6ffd5d53d2cdb06446287fd3be41 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_ufs.cc,v 1.25 2004/11/07 14:03:18 hno Exp $
+ * $Id: store_io_ufs.cc,v 1.26 2004/11/07 23:29:51 hno Exp $
  *
  * DEBUG: section 79    Storage Manager UFS Interface
  * AUTHOR: Duane Wessels
@@ -103,8 +103,7 @@ UFSFile::operator new (size_t)
     UFSFile *result = cbdataAlloc(UFSFile);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void
index bfb15660a653227d6b31147ccaf329479a1146be..3c1016e8acd4eda39f9b935dd7c2b09019bc1a5e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.238 2004/10/20 22:41:05 hno Exp $
+ * $Id: squid.h,v 1.239 2004/11/07 23:29:50 hno Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -46,6 +46,7 @@
 #else
 #define assert(EX)  ((EX)?((void)0):xassert("EX", __FILE__, __LINE__))
 #endif
+extern void xassert(const char *, const char *, int);
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
index e56fc483ce60d052e03a59065ffc1758586ce228..9781aba748da790c4e1dd8ef06c38e68a1729dec 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.135 2004/08/30 05:12:31 robertc Exp $
+ * $Id: store_client.cc,v 1.136 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 90    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -322,14 +322,14 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
      * everything we got before the abort condition occurred.
      */
     /* Warning: doCopy may indirectly free itself in callbacks,
-     * hence the cbdata reference to keep it active for the duration of
+     * hence the lock to keep it active for the duration of
      * this function
      */
-    cbdataReference(sc);
+    cbdataInternalLock(sc);
     assert (sc->flags.store_copying == 0);
     sc->doCopy(e);
     assert (sc->flags.store_copying == 0);
-    cbdataReferenceDone(sc);
+    cbdataInternalUnlock(sc);
 }
 
 void
index ecf496397c1067217b79ee7527c993b42dc760b3..4b8ab0882c3009660d37ee3a3a56a72e45b90354 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.494 2004/11/06 22:20:48 hno Exp $
+ * $Id: structs.h,v 1.495 2004/11/07 23:29:50 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -911,7 +911,6 @@ public:
 /* bah. remove this when HttpHeaderEntry is moved
  * out
  */
-extern void xassert(const char *, const char *, int);
 MEMPROXY_CLASS_INLINE(HttpHeaderEntry)
 
 /* http surogate control header field */
index 7010005ec35e4614b729b82861d5728940673db5..a72677c4a3611563130459161af79c538d173089 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ufscommon.cc,v 1.11 2003/08/04 22:14:42 robertc Exp $
+ * $Id: ufscommon.cc,v 1.12 2004/11/07 23:29:50 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Robert Collins
@@ -52,8 +52,7 @@ RebuildState::operator new (size_t size)
     RebuildState *result = cbdataAlloc(RebuildState);
     /* Mark result as being owned - we want the refcounter to do the delete
      * call */
-    cbdataReference(result);
-    return result;
+    return cbdataReference(result);
 }
 
 void