]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
lint
authorwessels <>
Tue, 3 Feb 1998 11:21:10 +0000 (11:21 +0000)
committerwessels <>
Tue, 3 Feb 1998 11:21:10 +0000 (11:21 +0000)
21 files changed:
src/access_log.cc
src/acl.cc
src/asn.cc
src/client_side.cc
src/defines.h
src/fqdncache.cc
src/ftp.cc
src/http.cc
src/icmp.cc
src/icp_v2.cc
src/ipcache.cc
src/net_db.cc
src/peer_select.cc
src/pinger.cc
src/protos.h
src/recv-announce.cc
src/snmp_agent.cc
src/stat.cc
src/store_rebuild.cc
src/store_swapmeta.cc
src/url.cc

index d38f14f4ccb2a5a51b3da1069fa021aba9546ba3..409728bb11e7dce75579ded3776a773bc3480c3f 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: access_log.cc,v 1.19 1998/02/02 21:14:54 wessels Exp $
+ * $Id: access_log.cc,v 1.20 1998/02/03 04:21:10 wessels Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -198,7 +198,6 @@ accessLogOpen(const char *fname)
     LogfileStatus = LOG_ENABLE;
 }
 
-#define SKIP_BASIC_SZ 6
 void
 accessLogLog(AccessLogEntry * al)
 {
index 8db7571eb8a6d1407d1f3c6fa1d422e4a25b5664..34d24aa5e7cc51ac3ea51f6d74ce6b0ac7eed14a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.131 1998/02/02 21:59:43 wessels Exp $
+ * $Id: acl.cc,v 1.132 1998/02/03 04:21:11 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -1081,7 +1081,6 @@ aclMatchIdent(wordlist * data, const char *ident)
     return 0;
 }
 
-#define SKIP_BASIC_SZ 6
 static int
 aclMatchProxyAuth(struct _acl_proxy_auth *p, aclCheck_t * checklist)
 {
@@ -1784,7 +1783,7 @@ aclReadProxyAuth(struct _acl_proxy_auth *p)
                passwd = strtok(NULL, "\n");
                debug(28, 5) ("aclReadProxyAuth: adding new passwords to hash table\n");
                while (user != NULL) {
-                   if (strlen(user) > 1 && passwd && strlen(passwd) > 1) {
+                   if ((int)strlen(user) > 1 && passwd && (int) strlen(passwd) > 1) {
                        debug(28, 6) ("aclReadProxyAuth: adding %s, %s to hash table\n", user, passwd);
                        hash_insert(p->hash, xstrdup(user), (void *) xstrdup(passwd));
                    }
index 4461d06ec13520436dbaba82e453f9ad13810fe3..2844992024db21aad24f996652766f146c3cd24b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asn.cc,v 1.16 1998/02/02 21:16:17 wessels Exp $
+ * $Id: asn.cc,v 1.17 1998/02/03 04:21:11 wessels Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -344,10 +344,8 @@ destroyRadixNode(struct radix_node *rn, void *w)
 static void
 destroyRadixNodeInfo(as_info * e_info)
 {
-    intlist *first, *prev;
+    intlist *prev = NULL;
     intlist *data = e_info->as_number;
-    first = data;
-    prev = NULL;
     while (data) {
        prev = data;
        data = data->next;
index 7d576d1cf157c2cfadda3d5953451ec67eec55d6..c8ad526fd068fed22aa439eb25882b1d3cac6469 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.202 1998/02/02 21:16:19 wessels Exp $
+ * $Id: client_side.cc,v 1.203 1998/02/03 04:21:12 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -495,7 +495,7 @@ clientPurgeRequest(clientHttpRequest * http)
        http->http_code = HTTP_OK;
     }
     msg = httpReplyHeader(1.0, http->http_code, NULL, 0, 0, -1);
-    if (strlen(msg) < 8190)
+    if ((int)strlen(msg) < 8190)
        strcat(msg, "\r\n");
     comm_write(fd, xstrdup(msg), strlen(msg), clientWriteComplete, http, xfree);
 }
@@ -1004,7 +1004,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
        comm_close(fd);
     } else if (entry->store_status == STORE_ABORTED) {
        comm_close(fd);
-    } else if ((done = clientCheckTransferDone(http)) || size == 0) {
+    } else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) {
        debug(12, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd);
        /* We're finished case */
        if (http->entry->mem_obj->reply->content_length < 0 || !done ||
index 68bbeed2e69e09d6868ae6106101a75d2e6430d8..23063686a271f89a7ad9ade63d247e6dd4040253 100644 (file)
 #define STORE_ENTRY_WITHOUT_MEMOBJ     0
 #define STORE_SWAP_BUF         DISK_PAGE_SIZE
 #define VM_WINDOW_SZ           DISK_PAGE_SIZE
+
+#define SKIP_BASIC_SZ ((size_t) 6)
index d8184ee9427ec80433f12010f7625a220c7a0d7a..0f9927901e181c72ec398c82b917ba953df8c785 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.78 1998/01/12 04:30:37 wessels Exp $
+ * $Id: fqdncache.cc,v 1.79 1998/02/03 04:21:13 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -928,7 +928,7 @@ var_fqdn_entry(struct variable *vp, oid * name, int *length, int exact, int
     i = 0;
     while (fq != NULL) {
        newname[vp->namelen] = i + 1;
-       result = compare(name, *length, newname, (int) vp->namelen + 1);
+       result = snmpCompare(name, *length, newname, (int) vp->namelen + 1);
        if ((exact && (result == 0)) || (!exact && (result < 0))) {
            debug(49, 5) ("snmp var_fqdn_entry: yup, a match.\n");
            break;
index fb91659a613b04172b20265e5b21268e9e41020a..01d604100082eaf27150563168c883127159bcbb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.189 1998/02/02 21:16:25 wessels Exp $
+ * $Id: ftp.cc,v 1.190 1998/02/03 04:21:14 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -548,7 +548,7 @@ ftpHtmlifyListEntry(char *line, FtpStateData * ftpState)
     size_t width = Config.Ftp.list_width;
     ftpListParts *parts;
     int flags = ftpState->flags;
-    if (strlen(line) > 1024) {
+    if ((int)strlen(line) > 1024) {
        snprintf(html, 8192, "%s\n", line);
        return html;
     }
@@ -1487,7 +1487,7 @@ ftpReadPasv(FtpStateData * ftpState)
        ftpSendPort(ftpState);
        return;
     }
-    if (strlen(buf) > 1024) {
+    if ((int)strlen(buf) > 1024) {
        debug(9, 1) ("ftpReadPasv: Avoiding potential buffer overflow\n");
        ftpSendPort(ftpState);
        return;
@@ -1909,7 +1909,7 @@ ftpUrlWith2f(const request_t * request)
     if (request->port != urlDefaultPort(request->protocol))
        snprintf(portbuf, 32, ":%d", request->port);
     loginbuf[0] = '\0';
-    if (strlen(request->login) > 0) {
+    if ((int)strlen(request->login) > 0) {
        strcpy(loginbuf, request->login);
        if ((t = strchr(loginbuf, ':')))
            *t = '\0';
index c95492e9d1a54dbf3ce76bfdd22255b7c9975d76..d5450fab236e2463bbec828e0889be95726664d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.234 1998/01/12 04:30:39 wessels Exp $
+ * $Id: http.cc,v 1.235 1998/02/03 04:21:15 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -826,13 +826,13 @@ httpBuildRequestHeader(request_t * request,
                EBIT_SET(cc_flags, CCC_MAXAGE);
        } else if (strncasecmp(xbuf, "Via:", 4) == 0) {
            for (s = xbuf + 4; *s && isspace(*s); s++);
-           if (strlen(viabuf) + strlen(s) < 4000)
+           if ((int)strlen(viabuf) + (int)strlen(s) < 4000)
                strcat(viabuf, s);
            strcat(viabuf, ", ");
            continue;
        } else if (strncasecmp(xbuf, "X-Forwarded-For:", 16) == 0) {
            for (s = xbuf + 16; *s && isspace(*s); s++);
-           if (strlen(fwdbuf) + strlen(s) < 4000)
+           if ((int)strlen(fwdbuf) + (int)strlen(s) < 4000)
                strcat(fwdbuf, s);
            strcat(fwdbuf, ", ");
            continue;
index c4edfca1c1bf841b1e724e03abe41b93709b1019..74cb82483e18201bb0379f1ac481ad8d3e6c3446 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.54 1998/01/31 05:31:58 wessels Exp $
+ * $Id: icmp.cc,v 1.55 1998/02/03 04:21:16 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -130,7 +130,7 @@ icmpSend(int fd, void *data)
 {
     icmpQueueData *queue = data;
     int x;
-    while ((queue = IcmpQueueHead)) {
+    while ((queue = IcmpQueueHead) != NULL) {
        x = send(icmp_sock,
            queue->msg,
            queue->len,
@@ -258,7 +258,7 @@ icmpClose(void)
     debug(29, 0) ("Closing Pinger socket on FD %d\n", icmp_sock);
     comm_close(icmp_sock);
     icmp_sock = -1;
-    while ((queue = IcmpQueueHead)) {
+    while ((queue = IcmpQueueHead) != NULL) {
        IcmpQueueHead = queue->next;
        if (queue->free_func)
            queue->free_func(queue->msg);
index 487509d58cb6716da669fb1a4994795d764e7295..f18a2070cdefd84483919a1279918b51494c19d8 100644 (file)
@@ -137,7 +137,6 @@ icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len)
     const cache_key *key;
     request_t *icp_request = NULL;
     int allow = 0;
-    int pkt_len;
     aclCheck_t checklist;
     icp_common_t *reply;
     int src_rtt = 0;
@@ -183,7 +182,6 @@ icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len)
        entry = storeGet(key);
        debug(12, 5) ("icpHandleIcpV2: OPCODE %s\n", icp_opcode_str[header.opcode]);
        if (icpCheckUdpHit(entry, icp_request)) {
-           pkt_len = sizeof(icp_common_t) + strlen(url) + 1 + 2 + entry->object_len;
            reply = icpCreateMessage(ICP_HIT, flags, url, header.reqnum, src_rtt);
            icpUdpSend(fd, &from, reply, LOG_UDP_HIT, icp_request->protocol);
            break;
index ca8b24ef923d2e6a53178a172d924e80af8e2cf6..fae8139d6afbbcf31fbd165192d5ddec17be74ca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.153 1998/01/06 05:15:41 wessels Exp $
+ * $Id: ipcache.cc,v 1.154 1998/02/03 04:21:17 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -1087,7 +1087,7 @@ var_ipcache_entry(struct variable *vp, oid * name, int *length, int exact, int *
 
     for (m = lru_list.head; m; m = m->next, cnt++) {
        newname[vp->namelen] = cnt;
-       result = compare(name, *length, newname, (int) vp->namelen + 1);
+       result = snmpCompare(name, *length, newname, (int) vp->namelen + 1);
        if ((exact && (result == 0)) || (!exact && (result < 0))) {
            debug(49, 5) ("snmp var_ipcache_entry: yup, a match.\n");
            break;
index a30f0fc91a655f4b43f7727b8dd11c5f6ac3414b..5e2caeaa3e7e4d61dbd8f0767b235b3a4675615c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.60 1998/01/12 04:30:06 wessels Exp $
+ * $Id: net_db.cc,v 1.61 1998/02/03 04:21:18 wessels Exp $
  *
  * DEBUG: section 37    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -125,7 +125,7 @@ static void
 netdbRelease(netdbEntry * n)
 {
     net_db_name *x;
-    net_db_name *next;
+    net_db_name *next = NULL;
     for (x = n->hosts; x; x = next) {
        next = x->next;
        netdbHashUnlink(x->name);
@@ -347,7 +347,7 @@ netdbSaveState(void *foo)
        return;
     }
     next = (netdbEntry *) hash_first(addr_table);
-    while ((n = next)) {
+    while ((n = next) != NULL) {
        next = (netdbEntry *) hash_next(addr_table);
        if (n->pings_recv == 0)
            continue;
@@ -519,7 +519,7 @@ netdbFreeMemory(void)
     }
     for (j = 0; j < i; j++) {
        n = *(L1 + j);
-       while ((x = n->hosts)) {
+       while ((x = n->hosts) != NULL) {
            n->hosts = x->next;
            safe_free(x);
        }
@@ -701,7 +701,7 @@ var_netdb_entry(struct variable *vp, oid * name, int *length, int exact, int *va
     n = (netdbEntry *) hash_first(addr_table);
     while (n != NULL) {
        newname[vp->namelen] = cnt++;
-       result = compare(name, *length, newname, (int) vp->namelen + 1);
+       result = snmpCompare(name, *length, newname, (int) vp->namelen + 1);
        if ((exact && (result == 0)) || (!exact && (result < 0))) {
            debug(49, 5) ("snmp var_netdb_entry: yup, a match.\n");
            break;
index cf1b832e9189341bac25254fdd5cd13bb8353f0c..77f6473c2f10a9c7fa7e510cb92332731eeb5415 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.36 1998/01/31 05:32:03 wessels Exp $
+ * $Id: peer_select.cc,v 1.37 1998/02/03 04:21:19 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -328,12 +328,12 @@ peerSelectFoo(ps_state * psstate)
        debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], request->host);
        hierarchyNote(&request->hier, code, &psstate->icp, request->host);
        peerSelectCallback(psstate, NULL);
-    } else if ((p = psstate->closest_parent_miss)) {
+    } else if ((p = psstate->closest_parent_miss) != NULL) {
        code = CLOSEST_PARENT_MISS;
        debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
        hierarchyNote(&request->hier, code, &psstate->icp, p->host);
        peerSelectCallback(psstate, p);
-    } else if ((p = psstate->first_parent_miss)) {
+    } else if ((p = psstate->first_parent_miss) != NULL) {
        code = FIRST_PARENT_MISS;
        debug(44, 3) ("peerSelect: %s/%s\n", hier_strings[code], p->host);
        hierarchyNote(&request->hier, code, &psstate->icp, p->host);
index f234a5c59f4fabd93237a5269d4e24963967eb6c..bd618b254b41648553ed41ca68653578b87b9a95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: pinger.cc,v 1.29 1998/01/31 05:32:03 wessels Exp $
+ * $Id: pinger.cc,v 1.30 1998/02/03 04:21:19 wessels Exp $
  *
  * DEBUG: section 42    ICMP Pinger program
  * AUTHOR: Duane Wessels
@@ -135,7 +135,6 @@ pingerSendEcho(struct in_addr to, int opcode, char *payload, int len)
     struct icmphdr *icmp = NULL;
     icmpEchoData *echo;
     int icmp_pktsize = sizeof(struct icmphdr);
-    int x;
     struct sockaddr_in S;
     memset(pkt, '\0', MAX_PKT_SZ);
     icmp = (struct icmphdr *) (void *) pkt;
@@ -143,7 +142,7 @@ pingerSendEcho(struct in_addr to, int opcode, char *payload, int len)
     icmp->icmp_code = 0;
     icmp->icmp_cksum = 0;
     icmp->icmp_id = icmp_ident;
-    icmp->icmp_seq = icmp_pkts_sent++;
+    icmp->icmp_seq = (u_short) icmp_pkts_sent++;
     echo = (icmpEchoData *) (icmp + 1);
     echo->opcode = (unsigned char) opcode;
     echo->tv = current_time;
@@ -158,7 +157,7 @@ pingerSendEcho(struct in_addr to, int opcode, char *payload, int len)
     S.sin_family = AF_INET;
     S.sin_addr = to;
     S.sin_port = 0;
-    x = sendto(icmp_sock,
+    sendto(icmp_sock,
        pkt,
        icmp_pktsize,
        0,
index 3fa15e1e1f83fecb3f5802e43ee108d4bd281b5b..d8fdc600e015d843a45e28422bb763ddacd836a6 100644 (file)
@@ -247,6 +247,7 @@ extern int create_view(char **);
 extern int create_user(char **);
 extern int create_community(char **);
 extern void tokenize(char *, char **, int);
+extern int snmpCompare(oid * name1, int len1, oid * name2, int len2);
 #endif /* SQUID_SNMP */
 
 extern void AppendUdp(icpUdpData *);
@@ -516,8 +517,8 @@ extern void storeConvertFile(const cache_key * key,
     time_t timestamp,
     time_t lastref,
     time_t lastmod,
-    u_num32 refcount,
-    u_num32 flags,
+    u_short refcount,
+    u_short flags,
     int clean);
 extern int storeGetNextFile(int *sfileno, int *size);
 extern StoreEntry * storeAddDiskRestore(const cache_key * key,
index b37733ac82b55bf35858c32254ea07b1b202fc55..0a43ac1387c41e1372cde1a5053f7c70d799a7ba 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: recv-announce.cc,v 1.16 1998/02/02 21:16:28 wessels Exp $
+ * $Id: recv-announce.cc,v 1.17 1998/02/03 04:21:20 wessels Exp $
  *
  * DEBUG: section 0     Announcement Server
  * AUTHOR: Harvest Derived
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
     dup(1);
 
 
-    while (1) {
+    for(;;) {
        memset(buf, '\0', RECV_BUF_SIZE);
        memset(&R, '\0', len = sizeof(R));
 
index e6b65696bcc88c269adf83789160bb573d398e1e..44519d64d54df84584ccc8a094ec377129497697 100644 (file)
@@ -40,7 +40,6 @@ void snmp_input();
 void snmp_trap();
 int create_identical();
 int parse_var_op_list();
-void setVariable();
 
 struct pbuf *definitelyGetBuf();
 int get_community();
@@ -66,16 +65,16 @@ u_long _agentSize;
 
 
 /* fwd: */
-static int check_auth();
-static int bulk_var_op_list();
-static int goodValue();
+static int check_auth(struct snmp_session *, u_char *, int, u_char *, int, usecEntry **);
+static int bulk_var_op_list(u_char *, int, u_char *, int, int, int, long *);
+static int goodValue(u_char, int, u_char, int);
+static void setVariable(u_char *, u_char, int, u_char *, int);
 /* from usec.c: */
 extern void increment_stat();
 extern void create_report();
 extern void md5Digest();
 extern int parse_parameters();
 
-
 int
 init_agent_auth(void)
 {
@@ -124,13 +123,12 @@ init_agent_auth(void)
 }
 
 int
-snmp_agent_parse(sn_data, length, out_sn_data, out_length, sourceip, ireqid)
-     u_char *sn_data;
-     int length;
-     u_char *out_sn_data;
-     int *out_length;
-     u_long sourceip;          /* possibly for authentication */
-     long *ireqid;
+snmp_agent_parse(u_char *sn_data,
+     int length,
+     u_char *out_sn_data,
+     int *out_length,
+     u_long sourceip,          /* possibly for authentication */
+     long *ireqid)
 {
     u_char msgtype, type;
     long zero = 0;
@@ -171,7 +169,7 @@ snmp_agent_parse(sn_data, length, out_sn_data, out_length, sourceip, ireqid)
        }
        if (ret < 0) {
            increment_stat(-ret);
-           if ((sn_data = asn_parse_header(sn_data, &length, &msgtype))
+           if ((sn_data = asn_parse_header(sn_data, &length, &msgtype)) != NULL
                && asn_parse_int(sn_data, &length, &type, &reqid, sizeof(reqid))) {
                if (msgtype == REPORT_MSG)
                    return 0;
@@ -309,7 +307,7 @@ snmp_agent_parse(sn_data, length, out_sn_data, out_length, sourceip, ireqid)
 
     if (errstat == SNMP_ERR_NOSUCHNAME) {
        /* see if we have forwarding turned on */
-       if (Config.Snmp.localPort > 0) {
+       if (Config.Snmp.localPort != 0) {
            *ireqid = reqid;
            return 2;
        }
@@ -421,14 +419,13 @@ snmp_agent_parse(sn_data, length, out_sn_data, out_length, sourceip, ireqid)
  * If any error occurs, an error code is returned.
  */
 int
-parse_var_op_list(sn_data, length, out_sn_data, out_length, index, msgtype, action)
-     u_char *sn_data;
-     int length;
-     u_char *out_sn_data;
-     int out_length;
-     long *index;
-     int msgtype;
-     int action;
+parse_var_op_list(u_char *sn_data,
+     int length,
+     u_char *out_sn_data,
+     int out_length,
+     long *index,
+     int msgtype,
+     int action)
 {
     u_char type;
     oid var_name[MAX_NAME_LEN];
@@ -609,11 +606,11 @@ parse_var_op_list(sn_data, length, out_sn_data, out_length, index, msgtype, acti
  * Returns 1 upon success and 0 upon failure.
  */
 int
-create_identical(snmp_in, snmp_out, snmp_length, errstat, errindex)
-     u_char *snmp_in;
-     u_char *snmp_out;
-     int snmp_length;
-     long errstat, errindex;
+create_identical(u_char *snmp_in,
+     u_char *snmp_out,
+     int snmp_length,
+     long errstat,
+     long errindex)
 {
     u_char *sn_data;
     u_char type;
@@ -657,13 +654,12 @@ create_identical(snmp_in, snmp_out, snmp_length, errstat, errindex)
 }
 
 static int
-check_auth(session, sn_data, length, pp, plen, ueret)
-     struct snmp_session *session;
-     u_char *sn_data;
-     int length;
-     u_char *pp;
-     int plen;
-     usecEntry **ueret;
+check_auth(struct snmp_session *session,
+     u_char *sn_data,
+     int length,
+     u_char *pp,
+     int plen,
+     usecEntry **ueret)
 {
     usecEntry *ue;
     Parameters params;
@@ -709,7 +705,7 @@ check_auth(session, sn_data, length, pp, plen, ueret)
 
 
     /* verify that the requested qoS is supported by the userName */
-    if ((params.qoS & USEC_QOS_AUTHPRIV) > ue->qoS)
+    if ((u_char) (params.qoS & USEC_QOS_AUTHPRIV) > ue->qoS)
        return -USEC_STAT_UNSUPPORTED_QOS;
 
     xmemcpy(session->authKey, ue->authKey, 16);
@@ -747,14 +743,13 @@ check_auth(session, sn_data, length, pp, plen, ueret)
 }
 
 int
-get_community(sessionid)
-     u_char *sessionid;
+get_community(char *sessionid)
 {
     communityEntry *cp;
     debug(49, 5) ("get_community: %s\n", sessionid);
     for (cp = Config.Snmp.communities; cp; cp = cp->next) {
        debug(49, 5) ("get_community: %s\n", cp->name);
-       if (!strcmp(cp->name, (char *) sessionid))
+       if (!strcmp(cp->name, sessionid))
            break;
     }
 
@@ -772,9 +767,7 @@ get_community(sessionid)
 }
 
 static int
-goodValue(inType, inLen, actualType, actualLen)
-     u_char inType, actualType;
-     int inLen, actualLen;
+goodValue(u_char inType, int inLen, u_char actualType, int actualLen)
 {
     if (inLen > actualLen)
        return FALSE;
@@ -782,13 +775,12 @@ goodValue(inType, inLen, actualType, actualLen)
 }
 
 
-void
-setVariable(var_val, var_val_type, var_val_len, statP, statLen)
-     u_char *var_val;
-     u_char var_val_type;
-     int var_val_len;
-     u_char *statP;
-     int statLen;
+static void
+setVariable(u_char *var_val,
+     u_char var_val_type,
+     int var_val_len,
+     u_char *statP,
+     int statLen)
 {
     int buffersize = 1000;
 
@@ -817,14 +809,13 @@ struct repeater {
 
 
 static int
-bulk_var_op_list(sn_data, length, out_sn_data, out_length, non_repeaters, max_repetitions, index)
-     u_char *sn_data;
-     int length;
-     u_char *out_sn_data;
-     int out_length;
-     int non_repeaters;
-     int max_repetitions;
-     long *index;
+bulk_var_op_list(u_char *sn_data,
+     int length,
+     u_char *out_sn_data,
+     int out_length,
+     int non_repeaters,
+     int max_repetitions,
+     long *index)
 {
     u_char type;
     oid var_name[MAX_NAME_LEN];
index 81b56bbbf5985903ba12bad7155c595602dbe34d..f710a264f7064bbbeb30f70130b1cf51867bf346 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.189 1998/02/03 01:17:07 wessels Exp $
+ * $Id: stat.cc,v 1.190 1998/02/03 04:21:24 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -267,7 +267,7 @@ statObjects(StoreEntry * sentry, int vm_or_not)
     int i;
     struct _store_client *sc;
     next = (StoreEntry *) hash_first(store_table);
-    while (entry = next) {
+    while ((entry = next) != NULL) {
        next = (StoreEntry *) hash_next(store_table);
        mem = entry->mem_obj;
        if (vm_or_not && mem == NULL)
index b235051607873740504bd8a79d1eb87b4d24b581..72cdfaed3fea0369653096e3288ceaabef85ab93 100644 (file)
@@ -2,14 +2,16 @@
 
 #define STORE_META_BUFSZ 4096
 
+struct _rebuild_dir {
+    int dirn;
+    FILE *log;
+    int speed;
+    int clean;
+    struct _rebuild_dir *next;
+};
+
 struct storeRebuildState {
-    struct _rebuild_dir {
-        int dirn;
-        FILE *log;
-        int speed;
-        int clean;
-        struct _rebuild_dir *next;
-    }           *rebuild_dir;
+    struct _rebuild_dir *rebuild_dir;
     int objcount;               /* # objects successfully reloaded */
     int expcount;               /* # objects expired */
     int linecount;              /* # lines parsed from cache logfile */
@@ -192,8 +194,8 @@ storeConvertFile(const cache_key * key,
     time_t timestamp,
     time_t lastref,
     time_t lastmod,
-    u_num32 refcount,
-    u_num32 flags,
+    u_short refcount,
+    u_short flags,
     int clean)
 {
     int fd_r, fd_w;
@@ -287,11 +289,11 @@ storeGetNextFile(int *sfileno, int *size)
            debug(20, 3) ("storeGetNextFile: empty dir.\n");
 #endif
        in_dir = 0;
-       if ((curlvl2 = (curlvl2 + 1) % Config.cacheSwap.swapDirs[dirn].l2))
+       if ((curlvl2 = (curlvl2 + 1) % Config.cacheSwap.swapDirs[dirn].l2) != 0)
            continue;
-       if ((curlvl1 = (curlvl1 + 1) % Config.cacheSwap.swapDirs[dirn].l1))
+       if ((curlvl1 = (curlvl1 + 1) % Config.cacheSwap.swapDirs[dirn].l1) != 0)
            continue;
-       if ((dirn = (dirn + 1) % Config.cacheSwap.n_configured))
+       if ((dirn = (dirn + 1) % Config.cacheSwap.n_configured) != 0)
            continue;
        else
            done = 1;
@@ -510,8 +512,8 @@ storeDoConvertFromLog(void *data)
            timestamp,
            lastref,
            lastmod,
-           (u_num32) scan6,    /* refcount */
-           (u_num32) scan7,    /* flags */
+           (u_short) scan6,    /* refcount */
+           (u_short) scan7,    /* flags */
            d->clean);
 #if 0
        storeDirSwapLog(e);
index dd687fbf5714077197cec9271259260c9f34a3cd..8d30e649f65ffce76ca44ab041d82c6d16a67069 100644 (file)
@@ -7,7 +7,6 @@ int
 storeBuildMetaData(StoreEntry * e, char *swap_buf_c)
 {
     MemObject *mem;
-    int keylength;
     int a = STORE_META_TLD_START;
     char *meta_buf;
     mem = e->mem_obj;
@@ -18,14 +17,10 @@ storeBuildMetaData(StoreEntry * e, char *swap_buf_c)
        meta_buf = mem->swapout.meta_buf = xmalloc(1024);
     /* construct header */
     /* add Length(int)-Type(char)-Data encoded info  */
-    if (squid_key_size < 0)
-       keylength = strlen(e->key);
-    else
-       keylength = squid_key_size;
     meta_buf[0] = META_OK;
     xmemcpy(&meta_buf[1], &a, sizeof(int));
     mem->swapout.meta_len = STORE_META_TLD_START;
-    addSwapHdr(STORE_META_KEY, keylength, (void *) e->key,
+    addSwapHdr(STORE_META_KEY, squid_key_size, (void *) e->key,
        mem->swapout.meta_buf, &mem->swapout.meta_len);
     addSwapHdr(STORE_META_STD, STORE_HDR_METASIZE, (void *) &e->timestamp,
        mem->swapout.meta_buf, &mem->swapout.meta_len);
index 46160eca47e981e6a0cd13b7fcbc98ddec62fa99..dee6201845ffbe9b0407d4c3615e405e8da8463a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.74 1998/01/12 04:30:16 wessels Exp $
+ * $Id: url.cc,v 1.75 1998/02/03 04:21:26 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -347,7 +347,7 @@ urlCanonicalClean(const request_t * request)
            if (request->port != urlDefaultPort(request->protocol))
                snprintf(portbuf, 32, ":%d", request->port);
            loginbuf[0] = '\0';
-           if (strlen(request->login) > 0) {
+           if ((int) strlen(request->login) > 0) {
                strcpy(loginbuf, request->login);
                if ((t = strchr(loginbuf, ':')))
                    *t = '\0';