]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1244: Squid-3.0 compilation problems with gcc-4.0
authorserassio <>
Sun, 1 May 2005 01:32:00 +0000 (01:32 +0000)
committerserassio <>
Sun, 1 May 2005 01:32:00 +0000 (01:32 +0000)
Partial forward port of 2.5 patches from bug#1211

15 files changed:
helpers/basic_auth/LDAP/squid_ldap_auth.c
helpers/ntlm_auth/SMB/libntlmssp.c
helpers/ntlm_auth/SMB/ntlm.h
helpers/ntlm_auth/SMB/smbval/smblib-priv.h
helpers/ntlm_auth/winbind/wb_ntlm_auth.c
helpers/ntlm_auth/winbind/wbntlm.h
include/Array.h
lib/GNUregex.c
lib/cppunit-1.10.0/include/cppunit/extensions/TestFixtureFactory.h
src/ACLChecklist.h
src/ACLReplyMIMEType.h
src/ACLRequestMIMEType.h
src/ESIParser.h
src/cf_gen_defines
src/main.cc

index 3573d497002156dcd3eafbdfb815d4d5a3f6d133..263a97021c06e8624323ed3ec4879b5cb5607753 100644 (file)
@@ -316,7 +316,7 @@ open_ldap_connection(const char *ldapServer, int port)
 static int
 validUsername(const char *user)
 {
-    const unsigned char *p = user;
+    const unsigned char *p = (const unsigned char *)user;
 
     /* Leading whitespace? */
     if (isspace(p[0]))
index 2c597036e1255c68b66d9b43baf591f0c4665ef1..30c88bf7c23eb6e35491ddc49a8d71d9386e35af 100644 (file)
@@ -72,8 +72,8 @@ int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName, char *PassWord,
 
 
 #define ENCODED_PASS_LEN 24
-static char challenge[NONCE_LEN];
-static char lmencoded_empty_pass[ENCODED_PASS_LEN],
+static unsigned char challenge[NONCE_LEN];
+static unsigned char lmencoded_empty_pass[ENCODED_PASS_LEN],
        ntencoded_empty_pass[ENCODED_PASS_LEN];
 SMB_Handle_Type handle = NULL;
 
@@ -139,8 +139,8 @@ init_challenge(char *domain, char *domain_controller)
        return 3;
     }
     memcpy(challenge, handle->Encrypt_Key, NONCE_LEN);
-               SMBencrypt("",challenge,lmencoded_empty_pass);
-               SMBNTencrypt("",challenge,ntencoded_empty_pass);
+               SMBencrypt((unsigned char *)"",challenge,lmencoded_empty_pass);
+               SMBNTencrypt((unsigned char *)"",challenge,ntencoded_empty_pass);
     return 0;
 }
 
index e3d123f7fbfae6a8c0bbbdecf55e5f985d6faeb5..5a2128a82b14ff33aa9375dc43b64070b24485b7 100644 (file)
@@ -50,7 +50,7 @@
 #ifdef DEBUG
 #include <stdio.h>
 #include <unistd.h>
-static char *__foo;
+static const char *__foo;
 extern char debug_enabled;
 #define debug(X...) if (debug_enabled) { \
                     fprintf(stderr,"ntlm-auth[%ld](%s:%d): ", (long)getpid(), \
index 8da4c703fd35f4e885297ad7a76905e2bbb29334..5ed7649891b816ba354984d2eff19c371d4f9441 100644 (file)
@@ -497,7 +497,7 @@ typedef enum {
 /* The following two arrays need to be in step!              */
 /* We must make it possible for callers to specify these ... */
 
-
+#if 0
 extern char *SMB_Prots[];
 
 /*
@@ -532,6 +532,8 @@ extern int SMB_Types[];
  * SMB_P_NT1,
  * -1};
  */
+#endif
+
 typedef struct SMB_Status {
 
     union {
index 5c47b65eb5a4d6a0fb07920dad72cd41110cb7e0..2d38ac6c078e418f4dd5c55524d12a07c1b6d6a3 100644 (file)
@@ -138,7 +138,7 @@ init_random()
 }
 
 static unsigned char challenge[CHALLENGE_LEN + 1];
-static char *
+static unsigned char *
 build_challenge(void)
 {
     size_t gotchars;
index 7edccbcbacc8abfdcb25ebbf2ae76c8cc44369d4..3f28afa8cc3f684c281b3d64245953c2dd9a2d7a 100644 (file)
@@ -37,7 +37,7 @@
 
 /* Debugging stuff */
 extern char *myname;
-static char *__foo;
+static const char *__foo;
 extern pid_t mypid;
 extern char debug_enabled;
 
index 0c8a944034f876fcd258e41b81af4e5e984f4383..9b8e01c229aefebceaf53adddfc23fc4968f0c95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Array.h,v 1.20 2005/01/03 16:08:24 robertc Exp $
+ * $Id: Array.h,v 1.21 2005/04/30 19:32:01 serassio Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -217,7 +217,7 @@ Vector<E>::preAppend(int app_count)
 }
 
 template<class E>
-Vector<E>::Vector<E> (Vector<E> const &rhs)
+Vector<E>::Vector (Vector<E> const &rhs)
 {
     items = NULL;
     capacity = 0;
index f6a53e2e10bf2b94cfc2f9f07c31c3c152692e42..27a2b2ea1a6065ec3a752670dd375f0609512715 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: GNUregex.c,v 1.20 2005/01/06 10:55:34 serassio Exp $
+ * $Id: GNUregex.c,v 1.21 2005/04/30 19:32:01 serassio Exp $
  */
 
 /* Extended regular expression matching and search library,
@@ -3524,7 +3524,7 @@ re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop)
                    /* Compare that many; failure if mismatch, else move
                     * past them.  */
                    if (translate
-                       ? bcmp_translate(d, d2, mcnt, translate)
+                       ? bcmp_translate((unsigned char *)d, (unsigned char *)d2, mcnt, translate)
                        : memcmp(d, d2, mcnt))
                        goto fail;
                    d += mcnt, d2 += mcnt;
index 1e3e803143aa56f6de909bd3324e64b574b85feb..3cfa8e53c99e51bd8ecfb2fe596a60bb4f7677d4 100644 (file)
@@ -18,6 +18,7 @@ class TestFixtureFactory
 public:
   //! Creates a new TestFixture instance.
   virtual TestFixture *makeFixture() =0;
+  virtual ~TestFixtureFactory() {}
 };
 
 
index 763bc85e0343e0ba298d39899b200f1b4dcb478b..7583fdbfb408bed5851c331ec049071740dbc7e3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLChecklist.h,v 1.20 2005/04/18 21:52:41 hno Exp $
+ * $Id: ACLChecklist.h,v 1.21 2005/04/30 19:32:01 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -64,6 +64,7 @@ public:
 
     public:
         virtual void checkForAsync(ACLChecklist *) const = 0;
+        virtual ~AsyncState() {}
 
     protected:
         void changeState (ACLChecklist *, AsyncState *) const;
@@ -75,6 +76,7 @@ class NullState : public AsyncState
     public:
         static NullState *Instance();
         virtual void checkForAsync(ACLChecklist *) const;
+        virtual ~NullState() {}
 
     private:
         static NullState _instance;
index e731aec12200e99bddfa8886a06a228c0da6dd76..9116fe546c7d7f5bfb4359979ee4ff752e539a91 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLReplyMIMEType.h,v 1.6 2004/12/20 16:30:32 robertc Exp $
+ * $Id: ACLReplyMIMEType.h,v 1.7 2005/04/30 19:32:01 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -51,6 +51,8 @@ private:
 };
 
 /* partial specialisation */
+
+template <>
 int
 ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>::match (ACLData<char const *> * &data, ACLChecklist *checklist)
 {
index 14002993b911962eab5db8f14f989a2d9a3058ed..fb16f72ef6bf076fe4680ec01607d503cb443231 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLRequestMIMEType.h,v 1.2 2003/02/21 22:50:04 robertc Exp $
+ * $Id: ACLRequestMIMEType.h,v 1.3 2005/04/30 19:32:01 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -50,6 +50,8 @@ private:
 };
 
 /* partial specialisation */
+
+template <>
 int
 ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>::match (ACLData<char const *> * &data, ACLChecklist *checklist)
 {
index 9ee17a95a5e56ccd88930dcbfe1d48dafd824ad2..d76c179388cd17b380bbc17f5b96212528301839 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ESIParser.h,v 1.3 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESIParser.h,v 1.4 2005/04/30 19:32:01 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -41,7 +41,9 @@ public:
     virtual void end(const char *el) = 0;
     virtual void parserDefault (const char *s, int len) =0;
     virtual void parserComment (const char *s) = 0;
-};
+    virtual ~ESIParserClient() {}}
+
+;
 
 class ESIParser : public RefCountable
 {
index 5c96cf9b9d792b2cce6ab4e433d1530f61facaca..c5b7ee25d2c1eca365cd4e28966fa3f749bfd69a 100755 (executable)
@@ -3,7 +3,7 @@ BEGIN {
        print "/* Generated automatically from cf.data.pre"
        print " * DO NOT EDIT"
        print "*/"
-       print "struct { const char *name; const char *enable; int defined;} defines[] = {"
+       print "static struct { const char *name; const char *enable; int defined;} defines[] = {"
        define["DELAY_POOLS"]="--enable-delay-pools"
        define["HTTP_VIOLATIONS"]="--enable-http-violations"
        define["SQUID_SNMP"]="--enable-snmp"
index f90a5bcdf0fc388ccfb6fea601bc1aa1fe6e1498..ec7b75e9fac1670e5be215aaf4bfe4098fe27feb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.409 2005/04/23 12:28:11 serassio Exp $
+ * $Id: main.cc,v 1.410 2005/04/30 19:32:01 serassio Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -1272,7 +1272,7 @@ mainStartScript(const char *prog)
 
     if ((cpid = fork()) == 0) {
         /* child */
-        execl(script, squid_start_script, NULL);
+        execl(script, squid_start_script, (char *)NULL);
         _exit(-1);
     } else {
         do {