int sw,sc;
ULONG l;
- if (len == 0) return;
+ if (len == 0U) return;
l=(c->Nl+(len<<3))&0xffffffffL;
/* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
int ew,ec;
c->num+=(int)len;
- if ((sc+len) < 4) /* ugly, add char's to a word */
+ if ((sc+len) < 4U) /* ugly, add char's to a word */
{
l= p[sw];
p_c2l_p(data,l,sc,len);
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static const char rcsid[] = "$Id: inet_addr.c,v 1.2.2.1 2004/03/09 09:17:26 marka Exp $";
+static const char rcsid[] = "$Id: inet_addr.c,v 1.2.2.2 2004/03/17 00:40:10 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
- if (pp >= parts + 3 || val > 0xff)
+ if (pp >= parts + 3 || val > 0xffU)
return (0);
*pp++ = val;
c = *++cp;
break;
case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
+ if (val > 0xffffffU)
return (0);
val |= parts[0] << 24;
break;
case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
+ if (val > 0xffffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16);
break;
case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
+ if (val > 0xffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
break;
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.2 2004/03/09 09:17:27 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.3 2004/03/17 00:40:10 marka Exp $";
#endif
#include "port_before.h"
if (bits == -1)
len = 4;
else
- for (len = 1, b = 1 ; b < 4; b++)
+ for (len = 1, b = 1 ; b < 4U; b++)
if (*(src + b))
len = b + 1;
if (len > bytes)
bytes = len;
b = decoct(src, bytes, dst, size);
- if (b == 0)
+ if (b == 0U)
goto emsgsize;
dst += b;
size -= b;
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.2.2.2 2004/03/09 09:17:27 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.2.2.3 2004/03/17 00:40:11 marka Exp $";
#endif
#include "port_before.h"
if (tmp > 255)
goto enoent;
} while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (size-- == 0)
+ if (size-- == 0U)
goto emsgsize;
*dst++ = (u_char) tmp;
if (ch == '\0' || ch == '/')
goto enoent;
/* Extend address to four octets. */
- while (size-- > 0)
+ while (size-- > 0U)
*dst++ = 0;
*pbits = bits;
{
u_long addr;
- if (net < 128)
+ if (net < 128U)
addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
+ else if (net < 65536U)
addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
else if (net < 16777216L)
addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_pton.c,v 1.4.2.2 2004/03/09 09:17:27 marka Exp $";
+static const char rcsid[] = "$Id: inet_net_pton.c,v 1.4.2.3 2004/03/17 00:40:11 marka Exp $";
#endif
#include "port_before.h"
&& isascii((unsigned char)(src[1]))
&& isxdigit((unsigned char)(src[1]))) {
/* Hexadecimal: Eat nybble string. */
- if (size <= 0)
+ if (size <= 0U)
goto emsgsize;
dirty = 0;
src++; /* skip x or X. */
else
tmp = (tmp << 4) | n;
if (++dirty == 2) {
- if (size-- <= 0)
+ if (size-- <= 0U)
goto emsgsize;
*dst++ = (u_char) tmp;
dirty = 0;
}
}
if (dirty) { /* Odd trailing nybble? */
- if (size-- <= 0)
+ if (size-- <= 0U)
goto emsgsize;
*dst++ = (u_char) (tmp << 4);
}
goto enoent;
} while ((ch = *src++) != '\0' &&
isascii(ch) && isdigit(ch));
- if (size-- <= 0)
+ if (size-- <= 0U)
goto emsgsize;
*dst++ = (u_char) tmp;
if (ch == '\0' || ch == '/')
}
/* Extend network to cover the actual mask. */
while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0)
+ if (size-- <= 0U)
goto emsgsize;
*dst++ = '\0';
}
base = 16, cp++;
while ((c = *cp) != 0) {
if (isdigit((unsigned char)c)) {
- if (base == 8 && (c == '8' || c == '9'))
+ if (base == 8U && (c == '8' || c == '9'))
return (INADDR_NONE);
val = (val * base) + (c - '0');
cp++;
digit = 1;
continue;
}
- if (base == 16 && isxdigit((unsigned char)c)) {
+ if (base == 16U && isxdigit((unsigned char)c)) {
val = (val << 4) +
(c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
cp++;
if (!digit)
return (INADDR_NONE);
if (*cp == '.') {
- if (pp >= parts + 4 || val > 0xff)
+ if (pp >= parts + 4 || val > 0xffU)
return (INADDR_NONE);
*pp++ = val, cp++;
goto again;
return (INADDR_NONE);
*pp++ = val;
n = pp - parts;
- if (n > 4)
+ if (n > 4U)
return (INADDR_NONE);
for (val = 0, i = 0; i < n; i++) {
val <<= 8;
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns.c,v 1.1.2.1 2004/03/09 09:17:28 marka Exp $";
+static const char rcsid[] = "$Id: dns.c,v 1.1.2.2 2004/03/17 00:40:11 marka Exp $";
#endif
/*
dns_res_set(this, res, free);
}
- if ((dns->res->options & RES_INIT) == 0 &&
+ if ((dns->res->options & RES_INIT) == 0U &&
res_ninit(dns->res) < 0)
return (NULL);
/* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.8 2004/03/09 09:17:28 marka Exp $";
+static const char rcsid[] = "$Id: dns_ho.c,v 1.5.2.9 2004/03/17 00:40:11 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/* Imports. */
q2->qtype = T_PTR;
q2->answer = q2->qbuf.buf;
q2->anslen = sizeof(q2->qbuf);
- if ((pvt->res->options & RES_NO_NIBBLE2) != 0)
+ if ((pvt->res->options & RES_NO_NIBBLE2) != 0U)
q2->action = RESTGT_IGNORE;
else
q2->action = RESTGT_AFTERFAILURE;
if (!pvt->res && !ho_res_get(this))
return (-1);
- if (((pvt->res->options & RES_INIT) == 0) &&
+ if (((pvt->res->options & RES_INIT) == 0U) &&
res_ninit(pvt->res) == -1)
return (-1);
return (0);
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_nw.c,v 1.3.2.5 2004/03/09 09:17:28 marka Exp $";
+static const char rcsid[] = "$Id: dns_nw.c,v 1.3.2.6 2004/03/17 00:40:12 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/* Imports. */
if (!pvt->res && !nw_res_get(this))
return (-1);
- if (((pvt->res->options & RES_INIT) == 0) &&
+ if (((pvt->res->options & RES_INIT) == 0U) &&
res_ninit(pvt->res) == -1)
return (-1);
return (0);
*/
/*
- * $Id: dns_p.h,v 1.1.2.1 2004/03/09 09:17:28 marka Exp $
+ * $Id: dns_p.h,v 1.1.2.2 2004/03/17 00:40:12 marka Exp $
*/
#ifndef _DNS_P_H_INCLUDED
#define _DNS_P_H_INCLUDED
-#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0 || \
+#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \
(ok)(nm) != 0)
#define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok)
#define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok)
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: gen.c,v 1.3.2.1 2004/03/09 09:17:28 marka Exp $";
+static const char rcsid[] = "$Id: gen.c,v 1.3.2.2 2004/03/17 00:40:12 marka Exp $";
#endif
/*
gen_res_set(this, res, free);
}
- if (((irs->res->options & RES_INIT) == 0) && res_ninit(irs->res) < 0)
+ if (((irs->res->options & RES_INIT) == 0U) && res_ninit(irs->res) < 0)
return (NULL);
return (irs->res);
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: irpmarshall.c,v 1.3.2.1 2004/03/09 09:17:32 marka Exp $";
+static const char rcsid[] = "$Id: irpmarshall.c,v 1.3.2.2 2004/03/17 00:40:12 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#if 0
/* gr_name field */
name = NULL;
- if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0) {
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
goto error;
}
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: irs_data.c,v 1.3.2.3 2004/03/09 09:17:32 marka Exp $";
+static const char rcsid[] = "$Id: irs_data.c,v 1.3.2.4 2004/03/17 00:40:13 marka Exp $";
#endif
#include "port_before.h"
return (NULL);
}
- if ((net_data->res->options & RES_INIT) == 0 &&
+ if ((net_data->res->options & RES_INIT) == 0U &&
res_ninit(net_data->res) == -1) {
(*net_data->irs->close)(net_data->irs);
memput(net_data, sizeof (struct net_data));
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: lcl.c,v 1.1.2.1 2004/03/09 09:17:32 marka Exp $";
+static const char rcsid[] = "$Id: lcl.c,v 1.1.2.2 2004/03/17 00:40:13 marka Exp $";
#endif
/* Imports */
lcl_res_set(this, res, free);
}
- if ((lcl->res->options & RES_INIT) == 0 &&
+ if ((lcl->res->options & RES_INIT) == 0U &&
res_ninit(lcl->res) < 0)
return (NULL);
/* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: lcl_ho.c,v 1.1.2.1 2004/03/09 09:17:32 marka Exp $";
+static const char rcsid[] = "$Id: lcl_ho.c,v 1.1.2.2 2004/03/17 00:40:13 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/* Imports. */
if (!pvt->res && !ho_res_get(this))
return (-1);
- if (((pvt->res->options & RES_INIT) == 0) &&
+ if (((pvt->res->options & RES_INIT) == 0U) &&
res_ninit(pvt->res) == -1)
return (-1);
return (0);
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: lcl_nw.c,v 1.1.2.1 2004/03/09 09:17:33 marka Exp $";
+static const char rcsid[] = "$Id: lcl_nw.c,v 1.1.2.2 2004/03/17 00:40:13 marka Exp $";
/* from getgrent.c 8.2 (Berkeley) 3/21/94"; */
/* from BSDI Id: getgrent.c,v 2.8 1996/05/28 18:15:14 bostic Exp $ */
#endif /* LIBC_SCCS and not lint */
if (!pvt->res && !nw_res_get(this))
return (-1);
- if (((pvt->res->options & RES_INIT) == 0) &&
+ if (((pvt->res->options & RES_INIT) == 0U) &&
res_ninit(pvt->res) == -1)
return (-1);
return (0);
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: base64.c,v 1.1.2.1 2004/03/09 09:17:34 marka Exp $";
+static const char rcsid[] = "$Id: base64.c,v 1.1.2.2 2004/03/17 00:40:13 marka Exp $";
#endif /* not lint */
#include "port_before.h"
u_char output[4];
size_t i;
- while (2 < srclength) {
+ while (2U < srclength) {
input[0] = *src++;
input[1] = *src++;
input[2] = *src++;
}
/* Now we worry about padding. */
- if (0 != srclength) {
+ if (0U != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
for (i = 0; i < srclength; i++)
return (-1);
target[datalength++] = Base64[output[0]];
target[datalength++] = Base64[output[1]];
- if (srclength == 1)
+ if (srclength == 1U)
target[datalength++] = Pad64;
else
target[datalength++] = Base64[output[2]];
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: ctl_clnt.c,v 1.4.2.2 2004/03/09 09:17:34 marka Exp $";
+static const char rcsid[] = "$Id: ctl_clnt.c,v 1.4.2.3 2004/03/17 00:40:14 marka Exp $";
#endif /* not lint */
/*
(*tran->donefunc)(ctx, tran->uap, ctx->inbuf.text,
(done ? 0 : CTL_MORE));
ctx->inbuf.used -= ((eos - ctx->inbuf.text) + 1);
- if (ctx->inbuf.used == 0)
+ if (ctx->inbuf.used == 0U)
ctl_bufput(&ctx->inbuf);
else
memmove(ctx->inbuf.text, eos + 1, ctx->inbuf.used);
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: ctl_p.c,v 1.1.2.1 2004/03/09 09:17:34 marka Exp $";
+static const char rcsid[] = "$Id: ctl_p.c,v 1.1.2.2 2004/03/17 00:40:14 marka Exp $";
#endif /* not lint */
/*
ctl_bufget(struct ctl_buf *buf, ctl_logfunc logger) {
static const char me[] = "ctl_bufget";
- REQUIRE(!allocated_p(*buf) && buf->used == 0);
+ REQUIRE(!allocated_p(*buf) && buf->used == 0U);
buf->text = memget(MAX_LINELEN);
if (!allocated_p(*buf)) {
(*logger)(ctl_error, "%s: getmem: %s", me, strerror(errno));
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: ctl_srvr.c,v 1.3.2.2 2004/03/09 09:17:35 marka Exp $";
+static const char rcsid[] = "$Id: ctl_srvr.c,v 1.3.2.3 2004/03/17 00:40:14 marka Exp $";
#endif /* not lint */
/*
ctl_docommand(sess);
}
sess->inbuf.used -= ((eos - sess->inbuf.text) + 1);
- if (sess->inbuf.used == 0)
+ if (sess->inbuf.used == 0U)
ctl_bufput(&sess->inbuf);
else
memmove(sess->inbuf.text, eos + 1, sess->inbuf.used);
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_streams.c,v 1.2.2.1 2004/03/09 09:17:35 marka Exp $";
+static const char rcsid[] = "$Id: ev_streams.c,v 1.2.2.2 2004/03/17 00:40:14 marka Exp $";
#endif
#include "port_before.h"
/* Pull off or truncate lead iovec(s). */
static void
consume(evStream *str, size_t bytes) {
- while (bytes > 0) {
+ while (bytes > 0U) {
if (bytes < (size_t)str->iovCur->iov_len) {
str->iovCur->iov_len -= bytes;
str->iovCur->iov_base = (void *)
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_timers.c,v 1.2.2.2 2004/03/09 09:17:35 marka Exp $";
+static const char rcsid[] = "$Id: ev_timers.c,v 1.2.2.3 2004/03/17 00:40:15 marka Exp $";
#endif
/* Import. */
(long)due.tv_sec, due.tv_nsec,
(long)inter.tv_sec, inter.tv_nsec);
- if (due.tv_sec < 0 || due.tv_nsec < 0)
+ if (due.tv_sec < 0 || due.tv_nsec > BILLION)
EV_ERR(EINVAL);
- if (inter.tv_sec < 0 || inter.tv_nsec < 0)
+ if (inter.tv_sec < 0 || inter.tv_nsec > BILLION)
EV_ERR(EINVAL);
/* due={0,0} is a magic cookie meaning "now." */
evTimer *timer = id.opaque;
int result=0;
+ UNUSED(value);
+
if (heap_element(ctx->timers, timer->index) != timer)
EV_ERR(ENOENT);
if (heap_element(ctx->timers, timer->index) != timer)
EV_ERR(ENOENT);
- if (due.tv_sec < 0 || due.tv_nsec < 0)
+ if (due.tv_sec < 0 || due.tv_nsec > BILLION)
EV_ERR(EINVAL);
- if (inter.tv_sec < 0 || inter.tv_nsec < 0)
+ if (inter.tv_sec < 0 || inter.tv_nsec > BILLION)
EV_ERR(EINVAL);
old_due = timer->due;
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: memcluster.c,v 1.3.2.2 2004/03/16 12:35:31 marka Exp $";
+static const char rcsid[] = "$Id: memcluster.c,v 1.3.2.3 2004/03/17 00:40:15 marka Exp $";
#endif /* not lint */
#include "port_before.h"
free(mem);
#endif
- INSIST(stats[max_size].gets != 0);
+ INSIST(stats[max_size].gets != 0U);
stats[max_size].gets--;
return;
}
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_print.c,v 1.3.2.3 2004/03/16 12:35:32 marka Exp $";
+static const char rcsid[] = "$Id: ns_print.c,v 1.3.2.4 2004/03/17 00:40:15 marka Exp $";
#endif
/* Import. */
addlen(x, &buf, &buflen);
len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
T(addstr(tmp, len, &buf, &buflen));
- if (rdlen == 0)
+ if (rdlen == 0U)
return (buf - obuf);
T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));