]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Many small warning fixes, const and missing prototypes
authorhno <>
Thu, 18 Oct 2001 01:43:39 +0000 (01:43 +0000)
committerhno <>
Thu, 18 Oct 2001 01:43:39 +0000 (01:43 +0000)
12 files changed:
src/acl.cc
src/asn.cc
src/auth/basic/auth_basic.cc
src/auth/digest/auth_digest.cc
src/cache_cf.cc
src/cbdata.cc
src/cf_gen.cc
src/cf_gen_defines
src/ipc.cc
src/protos.h
src/repl/heap/store_repl_heap.cc
src/structs.h

index fb09281e672c6bb7b4e02f1d289021ac494ed53c..9abf15dc7430c71c66c0fede87f086a283c9e429 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.263 2001/10/17 12:41:49 hno Exp $
+ * $Id: acl.cc,v 1.264 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -348,10 +348,12 @@ aclParseProtoList(void *curlist)
     intlist **Tail;
     intlist *q = NULL;
     char *t = NULL;
+    protocol_t protocol;
     for (Tail = curlist; *Tail; Tail = &((*Tail)->next));
     while ((t = strtokFile())) {
+       protocol = urlParseProtocol(t);
        q = memAllocate(MEM_INTLIST);
-       q->i = (int) urlParseProtocol(t);
+       q->i = (int) protocol;
        *(Tail) = q;
        Tail = &q->next;
     }
index d6919f8e00ee58f3baa95e5db4757ffa0c349d14..0ac9f2b1670bc623ba442759b059144e43c55f46 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.73 2001/10/17 12:41:49 hno Exp $
+ * $Id: asn.cc,v 1.74 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -148,11 +148,12 @@ asnAclInitialize(acl * acls)
 
 /* initialize the radix tree structure */
 
+extern int max_keylen;         /* yuck.. this is in lib/radix.c */
+
 CBDATA_TYPE(ASState);
 void
 asnInit(void)
 {
-    extern int max_keylen;
     static int inited = 0;
     max_keylen = 40;
     CBDATA_INIT_TYPE(ASState);
index 00ef4b55329b86acf55e5108a3c9e4cad8b77dda..e4d4d4c37fee341f9edca9b831ccf85f63c8d3f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth_basic.cc,v 1.12 2001/10/17 12:41:50 hno Exp $
+ * $Id: auth_basic.cc,v 1.13 2001/10/17 19:43:40 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -361,7 +361,7 @@ authenticateBasicUsername(auth_user_t * auth_user)
 }
 
 static basic_data *
-authBasicDataNew()
+authBasicDataNew(void)
 {
     basic_data *temp;
     temp = memPoolAlloc(basic_data_pool);
index 73cb0dd8742c8a4f66f4323941eac85f5003971b..f3a8661d7a390a7442819110b4a5d42f924e36cc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_digest.cc,v 1.8 2001/10/17 17:09:08 hno Exp $
+ * $Id: auth_digest.cc,v 1.9 2001/10/17 19:43:41 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Robert Collins
@@ -96,11 +96,11 @@ CBDATA_TYPE(authenticateStateData);
 
 static void authenticateDigestNonceCacheCleanup(void *data);
 static digest_nonce_h *authenticateDigestNonceFindNonce(const char *nonceb64);
-static digest_nonce_h *authenticateDigestNonceNew();
+static digest_nonce_h *authenticateDigestNonceNew(void);
 static void authenticateDigestNonceDelete(digest_nonce_h * nonce);
-static void authenticateDigestNonceSetup();
-static void authenticateDigestNonceShutdown();
-static void authenticateDigestNonceReconfigure();
+static void authenticateDigestNonceSetup(void);
+static void authenticateDigestNonceShutdown(void);
+static void authenticateDigestNonceReconfigure(void);
 static const char *authenticateDigestNonceNonceb64(digest_nonce_h * nonce);
 static int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
 static int authDigestNonceIsStale(digest_nonce_h * nonce);
@@ -125,7 +125,7 @@ authDigestNonceEncode(digest_nonce_h * nonce)
 }
 
 static digest_nonce_h *
-authenticateDigestNonceNew()
+authenticateDigestNonceNew(void)
 {
     digest_nonce_h *newnonce = memPoolAlloc(digest_nonce_pool);
     digest_nonce_h *temp;
@@ -210,7 +210,7 @@ authenticateDigestNonceDelete(digest_nonce_h * nonce)
 }
 
 static void
-authenticateDigestNonceSetup()
+authenticateDigestNonceSetup(void)
 {
     if (!digest_nonce_pool)
        digest_nonce_pool = memPoolCreate("Digest Scheme nonce's", sizeof(digest_nonce_h));
@@ -222,7 +222,7 @@ authenticateDigestNonceSetup()
 }
 
 static void
-authenticateDigestNonceShutdown()
+authenticateDigestNonceShutdown(void)
 {
     /* 
      * We empty the cache of any nonces left in there.
@@ -245,7 +245,7 @@ authenticateDigestNonceShutdown()
 }
 
 static void
-authenticateDigestNonceReconfigure()
+authenticateDigestNonceReconfigure(void)
 {
 }
 
@@ -445,20 +445,20 @@ authDigestUserFindUsername(const char *username)
 }
 
 static digest_user_h *
-authDigestUserNew()
+authDigestUserNew(void)
 {
     return memPoolAlloc(digest_user_pool);
 }
 
 static void
-authDigestUserSetup()
+authDigestUserSetup(void)
 {
     if (!digest_user_pool)
        digest_user_pool = memPoolCreate("Digest Scheme User Data", sizeof(digest_user_h));
 }
 
 static void
-authDigestUserShutdown()
+authDigestUserShutdown(void)
 {
     /*
      * Future work: the auth framework could flush it's cache 
@@ -518,7 +518,7 @@ authDigestAURequestFree(auth_user_request_t * auth_user_request)
 }
 
 static digest_request_h *
-authDigestRequestNew()
+authDigestRequestNew(void)
 {
     digest_request_h *tmp;
     tmp = memPoolAlloc(digest_request_pool);
@@ -527,14 +527,14 @@ authDigestRequestNew()
 }
 
 static void
-authDigestRequestSetup()
+authDigestRequestSetup(void)
 {
     if (!digest_request_pool)
        digest_request_pool = memPoolCreate("Digest Scheme Request Data", sizeof(digest_request_h));
 }
 
 static void
-authDigestRequestShutdown()
+authDigestRequestShutdown(void)
 {
     /* No requests should be in progress when we get here */
     if (digest_request_pool) {
@@ -614,12 +614,12 @@ authSchemeSetup_digest(authscheme_entry_t * authscheme)
 }
 
 static int
-authenticateDigestActive()
+authenticateDigestActive(void)
 {
     return (authdigest_initialised == 1) ? 1 : 0;
 }
 static int
-authDigestConfigured()
+authDigestConfigured(void)
 {
     if ((digestConfig != NULL) && (digestConfig->authenticate != NULL) &&
        (digestConfig->authenticateChildren != 0) &&
index e2390538923afaa4f3fe7ea3f99c552a4574b789..f31fa8358f133d193f9722b93f897459149843b6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.392 2001/10/17 13:43:06 hno Exp $
+ * $Id: cache_cf.cc,v 1.393 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -2136,7 +2136,7 @@ parse_uri_whitespace(int *var)
 static void
 dump_uri_whitespace(StoreEntry * entry, const char *name, int var)
 {
-    char *s;
+    const char *s;
     if (var == URI_WHITESPACE_ALLOW)
        s = "allow";
     else if (var == URI_WHITESPACE_ENCODE)
index f89ef4e5fbd4df836b5ab772059ddcc20cea8152..dd993d6722a3d14c579c85c5fa85849310b4a68a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cbdata.cc,v 1.41 2001/04/09 21:55:50 hno Exp $
+ * $Id: cbdata.cc,v 1.42 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: section 45    Callback Data Registry
  * ORIGINAL AUTHOR: Duane Wessels
@@ -95,7 +95,7 @@ int cbdata_types = 0;
 #define OFFSET_OF(type, member) ((int)(char *)&((type *)0L)->member)
 
 void
-cbdataInitType(cbdata_type type, char *name, int size, FREE * free_func)
+cbdataInitType(cbdata_type type, const char *name, int size, FREE * free_func)
 {
     char *label;
     if (type >= cbdata_types) {
@@ -114,7 +114,7 @@ cbdataInitType(cbdata_type type, char *name, int size, FREE * free_func)
 }
 
 cbdata_type
-cbdataAddType(cbdata_type type, char *name, int size, FREE * free_func)
+cbdataAddType(cbdata_type type, const char *name, int size, FREE * free_func)
 {
     if (type)
        return type;
index fa38d2a6a69f62e46fd811fcf89f4cdfc66d30d1..3c04bdedc6ab6850465da7a1fb7362fedbfa8350 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cf_gen.cc,v 1.42 2001/08/23 13:20:46 robertc Exp $
+ * $Id: cf_gen.cc,v 1.43 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: none          Generate squid.conf.default and cf_parser.h
  * AUTHOR: Max Okumoto
@@ -116,7 +116,7 @@ static void gen_conf(Entry *, FILE *);
 static void gen_default_if_none(Entry *, FILE *);
 
 static void
-lineAdd(Line ** L, char *str)
+lineAdd(Line ** L, const char *str)
 {
     while (*L)
        L = &(*L)->next;
@@ -129,8 +129,8 @@ main(int argc, char *argv[])
 {
     FILE *fp;
     char *input_filename = argv[1];
-    char *output_filename = _PATH_PARSER;
-    char *conf_filename = _PATH_SQUID_CONF;
+    const char *output_filename = _PATH_PARSER;
+    const char *conf_filename = _PATH_SQUID_CONF;
     int linenum = 0;
     Entry *entries = NULL;
     Entry *curr = NULL;
index 0dd50f30d656a584ea5218fb57b0caede90b8150..ca53e08fd646b0417b7c3ac0c96b684ed8347896 100755 (executable)
@@ -3,7 +3,7 @@ BEGIN {
        print "/* Generated automatically from cf.data.pre"
        print " * DO NOT EDIT"
        print "*/"
-       print "struct { char *name; char *enable; int defined;} defines[] = {"
+       print "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 5be079ca8f159190bd6e57e4e1ee1fcd2e4ca13e..80a3a85788cfc2d8fd450f85970a2760c2d21238 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipc.cc,v 1.24 2001/09/27 21:59:22 hno Exp $
+ * $Id: ipc.cc,v 1.25 2001/10/17 19:43:39 hno Exp $
  *
  * DEBUG: section 54    Interprocess Communication
  * AUTHOR: Duane Wessels
@@ -56,7 +56,7 @@ ipcCloseAllFD(int prfd, int pwfd, int crfd, int cwfd)
 }
 
 int
-ipcCreate(int type, const char *prog, char *const args[], const char *name, int *rfd, int *wfd)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, int *rfd, int *wfd)
 {
     pid_t pid;
     struct sockaddr_in CS;
index c8e08886cbd77924e0152e134560fee4c53ff72b..cabe09ce56704610c844f48c915c1a19730032d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.416 2001/10/17 12:41:49 hno Exp $
+ * $Id: protos.h,v 1.417 2001/10/17 19:43:39 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -118,8 +118,8 @@ extern void cbdataUnlock(const void *p);
 /* Note: Allocations is done using the cbdataAlloc macro */
 extern void *cbdataInternalFree(void *p);
 extern int cbdataValid(const void *p);
-extern void cbdataInitType(cbdata_type type, char *label, int size, FREE * free_func);
-extern cbdata_type cbdataAddType(cbdata_type type, char *label, int size, FREE * free_func);
+extern void cbdataInitType(cbdata_type type, const char *label, int size, FREE * free_func);
+extern cbdata_type cbdataAddType(cbdata_type type, const char *label, int size, FREE * free_func);
 extern int cbdataLocked(const void *p);
 
 extern void clientdbInit(void);
@@ -1192,7 +1192,7 @@ extern void stringAppend(String * s, const char *buf, int len);
  */
 extern int ipcCreate(int type,
     const char *prog,
-    char *const args[],
+    const char *const args[],
     const char *name,
     int *rfd,
     int *wfd);
index 9c02798b16b2d0f975972255a2db964c7ee17152..bf8f9e6b8b40dacd8bea3a156b4c2ea89e2fe2b5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_heap.cc,v 1.7 2001/03/14 22:28:44 wessels Exp $
+ * $Id: store_repl_heap.cc,v 1.8 2001/10/17 19:43:41 hno Exp $
  *
  * DEBUG: section ?     HEAP based removal policies
  * AUTHOR: Henrik Nordstrom
@@ -255,7 +255,7 @@ createRemovalPolicy_heap(wordlist * args)
 {
     RemovalPolicy *policy;
     HeapPolicyData *heap_data;
-    char *keytype;
+    const char *keytype;
     /* Allocate the needed structures */
     policy = cbdataAlloc(RemovalPolicy);
     heap_data = xcalloc(1, sizeof(*heap_data));
index d2d214475e738aeb3905a656f9374c6c8e75d6b2..bd93a5086bf9908202c073646cfa948104c84b88 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.403 2001/10/10 15:17:42 adrian Exp $
+ * $Id: structs.h,v 1.404 2001/10/17 19:43:39 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1435,7 +1435,7 @@ struct _RemovalPolicyNode {
 };
 
 struct _RemovalPolicy {
-    char *_type;
+    const char *_type;
     void *_data;
     void (*Free) (RemovalPolicy * policy);
     void (*Add) (RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node);
@@ -2153,7 +2153,7 @@ struct _Logfile {
 };
 
 struct cache_dir_option {
-    char *name;
+    const char *name;
     void (*parse) (SwapDir * sd, const char *option, const char *value, int reconfiguring);
     void (*dump) (StoreEntry * e, const char *option, SwapDir * sd);
 };