]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed numerous compiler warnings found by IRIX MIPS compiler.
authorhno <>
Sat, 24 Feb 2001 03:59:50 +0000 (03:59 +0000)
committerhno <>
Sat, 24 Feb 2001 03:59:50 +0000 (03:59 +0000)
15 files changed:
src/HttpStatusLine.cc
src/acl.cc
src/cache_cf.cc
src/cache_manager.cc
src/client.cc
src/client_db.cc
src/client_side.cc
src/comm_select.cc
src/fqdncache.cc
src/ipcache.cc
src/protos.h
src/snmp_core.cc
src/store_dir.cc
src/unlinkd.cc
src/urn.cc

index 5edd54cdacc3f52f030de7b83b6ef52c1ed5b409..0eb91da5082430c4cf702ebb5f89e3279b31beea 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpStatusLine.cc,v 1.22 2001/01/12 00:37:14 wessels Exp $
+ * $Id: HttpStatusLine.cc,v 1.23 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 57    HTTP Status-line
  * AUTHOR: Alex Rousskov
@@ -95,7 +95,7 @@ httpStatusLineParse(HttpStatusLine * sline, const char *start, const char *end)
     }
     if (!(start = strchr(start, ' ')))
        return 0;
-    sline->status = atoi(++start);
+    sline->status = (http_status)atoi(++start);
     /* we ignore 'reason-phrase' */
     return 1;                  /* success */
 }
index 3607d685609c393263b1babf579855f9092f037b..b978e98bb3e88ab5bd935a599a170e8a34cbe885 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.248 2001/02/18 11:16:51 hno Exp $
+ * $Id: acl.cc,v 1.249 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -866,7 +866,7 @@ because no authentication schemes are fully configured.\n", A->cfgline);
 }
 
 /* does name lookup, returns page_id */
-int
+err_type
 aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name)
 {
     acl_deny_info_list *A = NULL;
@@ -874,7 +874,7 @@ aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name)
 
     A = *head;
     if (NULL == *head)         /* empty list */
-       return -1;
+       return ERR_NONE;
     while (A) {
        L = A->acl_list;
        if (NULL == L)          /* empty list should never happen, but in case */
@@ -886,7 +886,7 @@ aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name)
        }
        A = A->next;
     }
-    return -1;
+    return ERR_NONE;
 }
 
 /* does name lookup, returns if it is a proxy_auth acl */
@@ -1701,16 +1701,16 @@ aclMatchAclList(const acl_list * list, aclCheck_t * checklist)
 int
 aclCheckFast(const acl_access * A, aclCheck_t * checklist)
 {
-    int allow = 0;
+    allow_t allow = ACCESS_DENIED;
     debug(28, 5) ("aclCheckFast: list: %p\n", A);
     while (A) {
        allow = A->allow;
        if (aclMatchAclList(A->acl_list, checklist))
-           return allow;
+           return allow == ACCESS_ALLOWED;
        A = A->next;
     }
-    debug(28, 5) ("aclCheckFast: no matches, returning: %d\n", !allow);
-    return !allow;
+    debug(28, 5) ("aclCheckFast: no matches, returning: %d\n", allow == ACCESS_DENIED);
+    return allow == ACCESS_DENIED;
 }
 
 static void
@@ -1813,8 +1813,8 @@ aclCheck(aclCheck_t * checklist)
        if (A->next)
            cbdataLock(A->next);
     }
-    debug(28, 3) ("aclCheck: NO match found, returning %d\n", !allow);
-    aclCheckCallback(checklist, !allow);
+    debug(28, 3) ("aclCheck: NO match found, returning %d\n", allow != ACCESS_DENIED ? ACCESS_DENIED : ACCESS_ALLOWED);
+    aclCheckCallback(checklist, allow != ACCESS_DENIED ? ACCESS_DENIED : ACCESS_ALLOWED);
 }
 
 void
index 4fc7176d3df684721c9a5fd401a47d959e972b3c..ae23fc855e6fa06cf0c73683e57a981f26be3ced 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.376 2001/02/21 00:02:34 hno Exp $
+ * $Id: cache_cf.cc,v 1.377 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1210,7 +1210,6 @@ static void
 dump_peer(StoreEntry * entry, const char *name, peer * p)
 {
     domain_ping *d;
-    acl_access *a;
     domain_type *t;
     LOCAL_ARRAY(char, xname, 128);
     while (p != NULL) {
@@ -1227,7 +1226,7 @@ dump_peer(StoreEntry * entry, const char *name, peer * p)
                d->do_ping ? null_string : "!",
                d->domain);
        }
-       if ((a = p->access)) {
+       if (p->access) {
            snprintf(xname, 128, "cache_peer_access %s", p->host);
            dump_acl_access(entry, xname, p->access);
        }
index f1db631d5a5615859597e4d4233a0208b7ccbf6e..a185fce444b42fd8c1ea1ce2dc383d51f126d415 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.25 2001/01/12 00:37:15 wessels Exp $
+ * $Id: cache_manager.cc,v 1.26 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -49,8 +49,8 @@ typedef struct _action_table {
     char *desc;
     OBJH *handler;
     struct {
-       int pw_req:1;
-       int atomic:1;
+       unsigned int pw_req:1;
+       unsigned int atomic:1;
     } flags;
     struct _action_table *next;
 } action_table;
index 32da7c48deb13aaa127ba2ce9706f0561940a889..a044ca154baf6b2f4c69362b4584fe75d8254c00 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client.cc,v 1.92 2001/02/07 19:10:12 hno Exp $
+ * $Id: client.cc,v 1.93 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
@@ -89,7 +89,6 @@ main(int argc, char *argv[])
     int ping, pcount;
     int keep_alive = 0;
     int opt_noaccept = 0;
-    int opt_put = 0;
     int opt_verbose = 0;
     char *hostname, *localhost;
     char url[BUFSIZ], msg[BUFSIZ], buf[BUFSIZ];
@@ -194,8 +193,6 @@ main(int argc, char *argv[])
        xfree(t);
     }
     if (put_file) {
-       opt_put = 1;
-       /*method = xstrdup("PUT"); */
        put_fd = open(put_file, O_RDONLY);
        set_our_signal();
        if (put_fd < 0) {
index 7f36133fc9c4c373e6b46fc8bd1b02b0329cceb6..1c4762aed14bd418577967b0fc43ad85a4fe71b1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_db.cc,v 1.52 2001/01/12 00:37:15 wessels Exp $
+ * $Id: client_db.cc,v 1.53 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 0     Client Database
  * AUTHOR: Duane Wessels
@@ -290,7 +290,7 @@ snmp_meshCtblFn(variable_list * Var, snint * ErrP)
        break;
     case MESH_CTBL_HTHITS:
        aggr = 0;
-       for (l = 0; l < LOG_TYPE_MAX; l++) {
+       for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; l++) {
            if (isTcpHit(l))
                aggr += c->Http.result_hist[l];
        }
index cd22b90b1f71646a2ccc013839f99ae953fe4256..c32fd393536cf91d4c0a1ea49ae159e06fbf3585 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.528 2001/02/20 22:49:23 hno Exp $
+ * $Id: client_side.cc,v 1.529 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -215,7 +215,7 @@ void
 clientAccessCheckDone(int answer, void *data)
 {
     clientHttpRequest *http = data;
-    int page_id = -1;
+    err_type page_id;
     http_status status;
     ErrorState *err = NULL;
     char *proxy_auth_msg = NULL;
@@ -255,11 +255,11 @@ clientAccessCheckDone(int answer, void *data)
                /* WWW authorisation needed */
                status = HTTP_UNAUTHORIZED;
            }
-           if (page_id <= 0)
+           if (page_id == ERR_NONE)
                page_id = ERR_CACHE_ACCESS_DENIED;
        } else {
            status = HTTP_FORBIDDEN;
-           if (page_id <= 0)
+           if (page_id == ERR_NONE)
                page_id = ERR_ACCESS_DENIED;
        }
        err = errorCon(page_id, status);
@@ -288,8 +288,8 @@ clientRedirectDone(void *data, char *result)
     assert(http->redirect_state == REDIRECT_PENDING);
     http->redirect_state = REDIRECT_DONE;
     if (result) {
-       http_status status = atoi(result);
-       if (status == 301 || status == 302) {
+       http_status status = (http_status)atoi(result);
+       if (status == HTTP_MOVED_PERMANENTLY || status == HTTP_MOVED_TEMPORARILY) {
            char *t = result;
            if ((t = strchr(result, ':')) != NULL) {
                http->redirect.status = status;
index 9780cd123c5e787ecf01734f0a8b4bbe8aaab818..fcb426840dbe4392b25db038754c82381a1d6366 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select.cc,v 1.48 2001/01/12 00:37:16 wessels Exp $
+ * $Id: comm_select.cc,v 1.49 2001/02/23 20:59:50 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -63,7 +63,9 @@ static int comm_check_incoming_select_handlers(int nfds, int *fds);
 static void comm_select_dns_incoming(void);
 #endif
 
+#if !HAVE_POLL
 static struct timeval zero_tv;
+#endif
 static fd_set global_readfds;
 static fd_set global_writefds;
 static int nreadfds;
@@ -916,8 +918,10 @@ comm_select_dns_incoming(void)
 void
 comm_select_init(void)
 {
+#if !HAVE_POLL
     zero_tv.tv_sec = 0;
     zero_tv.tv_usec = 0;
+#endif
     cachemgrRegister("comm_incoming",
        "comm_incoming() stats",
        commIncomingStats, 0, 1);
index dac4e3295e8ec9fc8c1b6dd791bb3a918f37632d..bfa646d6ed331de2307c482f946adeec27796326 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.146 2001/01/12 00:37:17 wessels Exp $
+ * $Id: fqdncache.cc,v 1.147 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -276,7 +276,6 @@ fqdncacheParse(rfc1035_rr * answers, int nr)
 {
     static fqdncache_entry f;
     int k;
-    int j;
     int na = 0;
     memset(&f, '\0', sizeof(f));
     f.expires = squid_curtime;
@@ -295,7 +294,7 @@ fqdncacheParse(rfc1035_rr * answers, int nr)
     }
     debug(35, 3) ("fqdncacheParse: %d answers\n", nr);
     assert(answers);
-    for (j = 0, k = 0; k < nr; k++) {
+    for (k = 0; k < nr; k++) {
        if (answers[k].type != RFC1035_TYPE_PTR)
            continue;
        if (answers[k].class != RFC1035_CLASS_IN)
index 9285c13b8f1d630193eaffb3d01d27bfa3029d0b..b7cd66ed9d8b2b3149a99e60eb8585645946ce25 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.232 2001/01/12 00:37:18 wessels Exp $
+ * $Id: ipcache.cc,v 1.233 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -364,13 +364,12 @@ ipcacheHandleReply(void *data, char *reply)
 ipcacheHandleReply(void *data, rfc1035_rr * answers, int na)
 #endif
 {
-    int n;
     generic_cbdata *c = data;
     ipcache_entry *i = c->data;
     ipcache_entry *x = NULL;
     cbdataFree(c);
     c = NULL;
-    n = ++IpcacheStats.replies;
+    IpcacheStats.replies++;
     statHistCount(&statCounter.dns.svc_time,
        tvSubMsec(i->request_time, current_time));
 #if USE_DNSSERVERS
index 56c6b3d7cc7d861c0d722a9c4c10807be8f6d06b..117f8d584b502250d6fe60229a0c75da37bbf522 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.398 2001/02/10 16:40:40 hno Exp $
+ * $Id: protos.h,v 1.399 2001/02/23 20:59:51 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -59,7 +59,7 @@ extern void aclDestroyAcls(acl **);
 extern void aclParseAccessLine(struct _acl_access **);
 extern void aclParseAclLine(acl **);
 extern int aclIsProxyAuth(const char *name);
-extern int aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
+extern err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
 extern void aclParseDenyInfoLine(struct _acl_deny_info_list **);
 extern void aclDestroyDenyInfoList(struct _acl_deny_info_list **);
 extern void aclDestroyRegexList(struct _relist *data);
@@ -1150,7 +1150,7 @@ extern void htcpSocketClose(void);
 #endif
 
 /* String */
-#define strLen(s)     ((const int)(s).len)
+#define strLen(s)     ((/* const */ int)(s).len)
 #define strBuf(s)     ((const char*)(s).buf)
 #define strChr(s,ch)  ((const char*)strchr(strBuf(s), (ch)))
 #define strRChr(s,ch) ((const char*)strrchr(strBuf(s), (ch)))
index 226559c5674d884e23b22e4140e112f82e1a226e..654f356689fc10c8f50f85e6784e5689fde9229b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: snmp_core.cc,v 1.46 2001/01/12 00:37:21 wessels Exp $
+ * $Id: snmp_core.cc,v 1.47 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 49    SNMP support
  * AUTHOR: Glenn Chisholm
@@ -534,7 +534,6 @@ snmpConstructReponse(snmp_request_t * rq)
 {
     struct snmp_session Session;
     struct snmp_pdu *RespPDU;
-    int ret;
 
     debug(49, 5) ("snmpConstructReponse: Called.\n");
     RespPDU = snmpAgentResponse(rq->PDU);
@@ -543,7 +542,7 @@ snmpConstructReponse(snmp_request_t * rq)
        Session.Version = SNMP_VERSION_1;
        Session.community = rq->community;
        Session.community_len = strlen((char *) rq->community);
-       ret = snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen);
+       snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen);
        sendto(rq->sock, rq->outbuf, rq->outlen, 0, (struct sockaddr *) &rq->from, sizeof(rq->from));
        snmp_free_pdu(RespPDU);
        xfree(rq->outbuf);
@@ -646,7 +645,7 @@ static oid_ParseFn *
 snmpTreeGet(oid * Current, snint CurrentLen)
 {
     oid_ParseFn *Fn = NULL;
-    mib_tree_entry *mibTreeEntry = NULL, *lastEntry = NULL;
+    mib_tree_entry *mibTreeEntry = NULL;
     int count = 0;
 
     debug(49, 5) ("snmpTreeGet: Called\n");
@@ -658,7 +657,6 @@ snmpTreeGet(oid * Current, snint CurrentLen)
     if (Current[count] == mibTreeEntry->name[count]) {
        count++;
        while ((mibTreeEntry) && (count < CurrentLen) && (!mibTreeEntry->parsefunction)) {
-           lastEntry = mibTreeEntry;
            mibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry);
            count++;
        }
index 80f58d9eba6f6569ef08e202e9373a7b6c021c2a..adbd47939399a1312b867718928ee358181ad807 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.126 2001/02/10 16:40:40 hno Exp $
+ * $Id: store_dir.cc,v 1.127 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -367,7 +367,6 @@ storeDirWriteCleanLogs(int reopen)
     struct timeval start;
     double dt;
     SwapDir *sd;
-    RemovalPolicyWalker **walkers;
     int dirn;
     int notdone = 1;
     if (store_dirs_rebuilding) {
@@ -378,7 +377,6 @@ storeDirWriteCleanLogs(int reopen)
     debug(20, 1) ("storeDirWriteCleanLogs: Starting...\n");
     getCurrentTime();
     start = current_time;
-    walkers = xcalloc(Config.cacheSwap.n_configured, sizeof *walkers);
     for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
        sd = &Config.cacheSwap.swapDirs[dirn];
        if (sd->log.clean.start(sd) < 0) {
index 9637c334bbe602b2fcb1c3dc889baa7e19c998f2..11c3719ddc1feb199f92232f56a83d945339117c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: unlinkd.cc,v 1.42 2001/01/12 00:37:23 wessels Exp $
+ * $Id: unlinkd.cc,v 1.43 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 12    Unlink Daemon
  * AUTHOR: Duane Wessels
@@ -97,12 +97,11 @@ unlinkdUnlink(const char *path)
     if (queuelen >= UNLINKD_QUEUE_LIMIT) {
        struct timeval to;
        fd_set R;
-       int x;
        FD_ZERO(&R);
        FD_SET(unlinkd_rfd, &R);
        to.tv_sec = 0;
        to.tv_usec = 100000;
-       x = select(unlinkd_rfd + 1, &R, NULL, NULL, &to);
+       select(unlinkd_rfd + 1, &R, NULL, NULL, &to);
     }
     /*
      * If there is at least one outstanding unlink request, then
index c8117eca00091fa100f144808b54165d2dad5b98..cee72c10d7a99a1b93fd06852c5d3853a6fb9db3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: urn.cc,v 1.65 2001/02/07 19:04:09 hno Exp $
+ * $Id: urn.cc,v 1.66 2001/02/23 20:59:51 hno Exp $
  *
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -42,7 +42,7 @@ typedef struct {
     request_t *request;
     request_t *urlres_r;
     struct {
-       int force_menu:1;
+       unsigned int force_menu:1;
     } flags;
 } UrnState;