From: hno <> Date: Sat, 24 Feb 2001 03:59:50 +0000 (+0000) Subject: Fixed numerous compiler warnings found by IRIX MIPS compiler. X-Git-Tag: SQUID_3_0_PRE1~1587 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1810dde69178df29d58b670feed64b0dd6ec1f8a;p=thirdparty%2Fsquid.git Fixed numerous compiler warnings found by IRIX MIPS compiler. --- diff --git a/src/HttpStatusLine.cc b/src/HttpStatusLine.cc index 5edd54cdac..0eb91da508 100644 --- a/src/HttpStatusLine.cc +++ b/src/HttpStatusLine.cc @@ -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 */ } diff --git a/src/acl.cc b/src/acl.cc index 3607d68560..b978e98bb3 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -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 diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 4fc7176d3d..ae23fc855e 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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); } diff --git a/src/cache_manager.cc b/src/cache_manager.cc index f1db631d5a..a185fce444 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -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; diff --git a/src/client.cc b/src/client.cc index 32da7c48de..a044ca154b 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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) { diff --git a/src/client_db.cc b/src/client_db.cc index 7f36133fc9..1c4762aed1 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -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]; } diff --git a/src/client_side.cc b/src/client_side.cc index cd22b90b1f..c32fd39353 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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; diff --git a/src/comm_select.cc b/src/comm_select.cc index 9780cd123c..fcb426840d 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -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); diff --git a/src/fqdncache.cc b/src/fqdncache.cc index dac4e3295e..bfa646d6ed 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -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) diff --git a/src/ipcache.cc b/src/ipcache.cc index 9285c13b8f..b7cd66ed9d 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -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 diff --git a/src/protos.h b/src/protos.h index 56c6b3d7cc..117f8d584b 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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))) diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 226559c567..654f356689 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -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++; } diff --git a/src/store_dir.cc b/src/store_dir.cc index 80f58d9eba..adbd479393 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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) { diff --git a/src/unlinkd.cc b/src/unlinkd.cc index 9637c334bb..11c3719ddc 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -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 diff --git a/src/urn.cc b/src/urn.cc index c8117eca00..cee72c10d7 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -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;