mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-12 15:23:06 -05:00
silence compiler
This commit is contained in:
parent
59d86dbcc8
commit
699bd87fc0
15 changed files with 74 additions and 74 deletions
|
|
@ -63,7 +63,7 @@ isc_gethexstring(unsigned char *buf, size_t len, int count, FILE *fp,
|
|||
goto formerr;
|
||||
x = (x<<4) | (s - hex);
|
||||
if (++n == 2) {
|
||||
if (len > 0) {
|
||||
if (len > 0U) {
|
||||
*buf++ = x;
|
||||
len--;
|
||||
} else
|
||||
|
|
@ -86,11 +86,11 @@ isc_puthexstring(FILE *fp, const unsigned char *buf, size_t buflen,
|
|||
{
|
||||
size_t i = 0;
|
||||
|
||||
if (len1 < 4)
|
||||
if (len1 < 4U)
|
||||
len1 = 4;
|
||||
if (len2 < 4)
|
||||
if (len2 < 4U)
|
||||
len2 = 4;
|
||||
while (buflen > 0) {
|
||||
while (buflen > 0U) {
|
||||
fputc(hex[(buf[0]>>4)&0xf], fp);
|
||||
fputc(hex[buf[0]&0xf], fp);
|
||||
i += 2;
|
||||
|
|
@ -106,7 +106,7 @@ isc_puthexstring(FILE *fp, const unsigned char *buf, size_t buflen,
|
|||
|
||||
void
|
||||
isc_tohex(const unsigned char *buf, size_t buflen, char *t) {
|
||||
while (buflen > 0) {
|
||||
while (buflen > 0U) {
|
||||
*t++ = hex[(buf[0]>>4)&0xf];
|
||||
*t++ = hex[buf[0]&0xf];
|
||||
buf++;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
|
||||
#if !defined(LINT) && !defined(CODECENTER)
|
||||
static const char rcsid[] = "$Id: memcluster.c,v 1.3.2.1 2004/03/09 09:17:36 marka Exp $";
|
||||
static const char rcsid[] = "$Id: memcluster.c,v 1.3.2.2 2004/03/16 12:35:31 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -124,11 +124,11 @@ meminit(size_t init_max_size, size_t target_size) {
|
|||
errno = EEXIST;
|
||||
return (-1);
|
||||
}
|
||||
if (init_max_size == 0)
|
||||
if (init_max_size == 0U)
|
||||
max_size = DEF_MAX_SIZE;
|
||||
else
|
||||
max_size = init_max_size;
|
||||
if (target_size == 0)
|
||||
if (target_size == 0U)
|
||||
mem_target = DEF_MEM_TARGET;
|
||||
else
|
||||
mem_target = target_size;
|
||||
|
|
@ -180,7 +180,7 @@ __memget_record(size_t size, const char *file, int line) {
|
|||
if (freelists == NULL)
|
||||
if (meminit(0, 0) == -1)
|
||||
return (NULL);
|
||||
if (size == 0) {
|
||||
if (size == 0U) {
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
|
|||
|
||||
REQUIRE(freelists != NULL);
|
||||
|
||||
if (size == 0) {
|
||||
if (size == 0U) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
|
@ -433,7 +433,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
|
|||
* max. size (max_size) ends up getting recorded as a call to
|
||||
* max_size.
|
||||
*/
|
||||
INSIST(stats[size].gets != 0);
|
||||
INSIST(stats[size].gets != 0U);
|
||||
stats[size].gets--;
|
||||
stats[new_size].freefrags++;
|
||||
}
|
||||
|
|
@ -469,12 +469,12 @@ memstats(FILE *out) {
|
|||
for (i = 1; i <= max_size; i++) {
|
||||
const struct stats *s = &stats[i];
|
||||
|
||||
if (s->totalgets == 0 && s->gets == 0)
|
||||
if (s->totalgets == 0U && s->gets == 0U)
|
||||
continue;
|
||||
fprintf(out, "%s%5d: %11lu gets, %11lu rem",
|
||||
(i == max_size) ? ">=" : " ",
|
||||
i, s->totalgets, s->gets);
|
||||
if (s->blocks != 0)
|
||||
if (s->blocks != 0U)
|
||||
fprintf(out, " (%lu bl, %lu ff)",
|
||||
s->blocks, s->freefrags);
|
||||
fputc('\n', out);
|
||||
|
|
@ -501,7 +501,7 @@ memactive(void) {
|
|||
if (stats == NULL)
|
||||
return (0);
|
||||
for (i = 1; i <= max_size; i++)
|
||||
if (stats[i].gets != 0)
|
||||
if (stats[i].gets != 0U)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_date.c,v 1.3.2.1 2004/03/09 09:17:37 marka Exp $";
|
||||
static const char rcsid[] = "$Id: ns_date.c,v 1.3.2.2 2004/03/16 12:35:32 marka Exp $";
|
||||
#endif
|
||||
|
||||
/* Import. */
|
||||
|
|
@ -57,7 +57,7 @@ ns_datetosecs(const char *cp, int *errp) {
|
|||
static const int days_per_month[12] =
|
||||
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
if (strlen(cp) != 14) {
|
||||
if (strlen(cp) != 14U) {
|
||||
*errp = 1;
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_print.c,v 1.3.2.2 2004/03/09 09:17:37 marka Exp $";
|
||||
static const char rcsid[] = "$Id: ns_print.c,v 1.3.2.3 2004/03/16 12:35:32 marka Exp $";
|
||||
#endif
|
||||
|
||||
/* Import. */
|
||||
|
|
@ -341,7 +341,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
u_int order, preference;
|
||||
char t[50];
|
||||
|
||||
if (rdlen < 2*NS_INT16SZ)
|
||||
if (rdlen < 2U*NS_INT16SZ)
|
||||
goto formerr;
|
||||
|
||||
/* Order, Precedence. */
|
||||
|
|
@ -382,7 +382,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
u_int priority, weight, port;
|
||||
char t[50];
|
||||
|
||||
if (rdlen < NS_INT16SZ*3)
|
||||
if (rdlen < 3U*NS_INT16SZ)
|
||||
goto formerr;
|
||||
|
||||
/* Priority, Weight, Port. */
|
||||
|
|
@ -411,7 +411,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
case ns_t_wks: {
|
||||
int n, lcnt;
|
||||
|
||||
if (rdlen < NS_INT32SZ + 1)
|
||||
if (rdlen < 1U + NS_INT32SZ)
|
||||
goto formerr;
|
||||
|
||||
/* Address. */
|
||||
|
|
@ -455,7 +455,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
const char *leader;
|
||||
int n;
|
||||
|
||||
if (rdlen < NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
|
||||
if (rdlen < 0U + NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
|
||||
goto formerr;
|
||||
|
||||
/* Key flags, Protocol, Algorithm. */
|
||||
|
|
@ -498,7 +498,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
u_long t;
|
||||
int n;
|
||||
|
||||
if (rdlen < 22)
|
||||
if (rdlen < 22U)
|
||||
goto formerr;
|
||||
|
||||
/* Type covered, Algorithm, Label count, Original TTL. */
|
||||
|
|
@ -662,7 +662,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
|
|||
int pbyte, pbit;
|
||||
|
||||
/* prefix length */
|
||||
if (rdlen == 0) goto formerr;
|
||||
if (rdlen == 0U) goto formerr;
|
||||
len = SPRINTF((tmp, "%d ", *rdata));
|
||||
T(addstr(tmp, len, &buf, &buflen));
|
||||
pbit = *rdata;
|
||||
|
|
@ -829,7 +829,7 @@ addname(const u_char *msg, size_t msglen,
|
|||
newlen = prune_origin(*buf, origin);
|
||||
if (**buf == '\0') {
|
||||
goto root;
|
||||
} else if (newlen == 0) {
|
||||
} else if (newlen == 0U) {
|
||||
/* Use "@" instead of name. */
|
||||
if (newlen + 2 > *buflen)
|
||||
goto enospc; /* No room for "@\0". */
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.2.3 2004/03/09 09:17:37 marka Exp $";
|
||||
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.2.4 2004/03/16 12:35:33 marka Exp $";
|
||||
#endif
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -56,7 +56,7 @@ ns_samedomain(const char *a, const char *b) {
|
|||
lb = strlen(b);
|
||||
|
||||
/* Ignore a trailing label separator (i.e. an unescaped dot) in 'a'. */
|
||||
if (la != 0 && a[la - 1] == '.') {
|
||||
if (la != 0U && a[la - 1] == '.') {
|
||||
escaped = 0;
|
||||
/* Note this loop doesn't get executed if la==1. */
|
||||
for (i = la - 2; i >= 0; i--)
|
||||
|
|
@ -72,7 +72,7 @@ ns_samedomain(const char *a, const char *b) {
|
|||
}
|
||||
|
||||
/* Ignore a trailing label separator (i.e. an unescaped dot) in 'b'. */
|
||||
if (lb != 0 && b[lb - 1] == '.') {
|
||||
if (lb != 0U && b[lb - 1] == '.') {
|
||||
escaped = 0;
|
||||
/* note this loop doesn't get executed if lb==1 */
|
||||
for (i = lb - 2; i >= 0; i--)
|
||||
|
|
@ -88,7 +88,7 @@ ns_samedomain(const char *a, const char *b) {
|
|||
}
|
||||
|
||||
/* lb == 0 means 'b' is the root domain, so 'a' must be in 'b'. */
|
||||
if (lb == 0)
|
||||
if (lb == 0U)
|
||||
return (1);
|
||||
|
||||
/* 'b' longer than 'a' means 'a' can't be in 'b'. */
|
||||
|
|
@ -171,9 +171,9 @@ ns_makecanon(const char *src, char *dst, size_t dstsize) {
|
|||
return (-1);
|
||||
}
|
||||
strcpy(dst, src);
|
||||
while (n >= 1 && dst[n - 1] == '.') /* Ends in "." */
|
||||
if (n >= 2 && dst[n - 2] == '\\' && /* Ends in "\." */
|
||||
(n < 3 || dst[n - 3] != '\\')) /* But not "\\." */
|
||||
while (n >= 1U && dst[n - 1] == '.') /* Ends in "." */
|
||||
if (n >= 2U && dst[n - 2] == '\\' && /* Ends in "\." */
|
||||
(n < 3U || dst[n - 3] != '\\')) /* But not "\\." */
|
||||
break;
|
||||
else
|
||||
dst[--n] = '\0';
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char rcsid[] = "$Id: res_data.c,v 1.1.2.1 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_data.c,v 1.1.2.2 2004/03/16 12:35:33 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -133,7 +133,7 @@ fp_query(const u_char *msg, FILE *file) {
|
|||
|
||||
void
|
||||
fp_nquery(const u_char *msg, int len, FILE *file) {
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1)
|
||||
return;
|
||||
|
||||
res_pquery(&_res, msg, len, file);
|
||||
|
|
@ -149,7 +149,7 @@ res_mkquery(int op, /* opcode of query */
|
|||
u_char *buf, /* buffer to put query */
|
||||
int buflen) /* size of buffer */
|
||||
{
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ res_mkquery(int op, /* opcode of query */
|
|||
|
||||
int
|
||||
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ res_query(const char *name, /* domain name */
|
|||
u_char *answer, /* buffer to put answer */
|
||||
int anslen) /* size of answer buffer */
|
||||
{
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ res_isourserver(const struct sockaddr_in *inp) {
|
|||
|
||||
int
|
||||
res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
/* errno should have been set by res_init() in this case. */
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ int
|
|||
res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
|
||||
u_char *ans, int anssiz)
|
||||
{
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
/* errno should have been set by res_init() in this case. */
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ res_close(void) {
|
|||
|
||||
int
|
||||
res_update(ns_updrec *rrecp_in) {
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ res_search(const char *name, /* domain name */
|
|||
u_char *answer, /* buffer to put answer */
|
||||
int anslen) /* size of answer */
|
||||
{
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ res_querydomain(const char *name,
|
|||
u_char *answer, /* buffer to put answer */
|
||||
int anslen) /* size of answer */
|
||||
{
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
|
||||
RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
|
||||
return (-1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
|
||||
static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.6 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.7 2004/03/16 12:35:34 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -137,7 +137,7 @@ fp_resstat(const res_state statp, FILE *file) {
|
|||
u_long mask;
|
||||
|
||||
fprintf(file, ";; res options:");
|
||||
for (mask = 1; mask != 0; mask <<= 1)
|
||||
for (mask = 1; mask != 0U; mask <<= 1)
|
||||
if (statp->options & mask)
|
||||
fprintf(file, " %s", p_option(mask));
|
||||
putc('\n', file);
|
||||
|
|
@ -672,7 +672,7 @@ p_sockun(union res_sockaddr_union u, char *buf, size_t size) {
|
|||
sprintf(ret, "[af%d]", u.sin.sin_family);
|
||||
break;
|
||||
}
|
||||
if (size > 0) {
|
||||
if (size > 0U) {
|
||||
strncpy(buf, ret, size - 1);
|
||||
buf[size - 1] = '0';
|
||||
}
|
||||
|
|
@ -1128,7 +1128,7 @@ res_nametoclass(const char *buf, int *successp) {
|
|||
goto done;
|
||||
errno = 0;
|
||||
result = strtoul(buf + 5, &endptr, 10);
|
||||
if (errno == 0 && *endptr == '\0' && result <= 0xffff)
|
||||
if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
|
||||
success = 1;
|
||||
done:
|
||||
if (successp)
|
||||
|
|
@ -1151,7 +1151,7 @@ res_nametotype(const char *buf, int *successp) {
|
|||
goto done;
|
||||
errno = 0;
|
||||
result = strtoul(buf + 4, &endptr, 10);
|
||||
if (errno == 0 && *endptr == '\0' && result <= 0xffff)
|
||||
if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
|
||||
success = 1;
|
||||
done:
|
||||
if (successp)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#if !defined(lint) && !defined(SABER)
|
||||
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.2.2.4 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.2.2.5 2004/03/16 12:35:34 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
|
@ -90,7 +90,7 @@ static void res_dprintf(const char *, ...) ISC_FORMAT_PRINTF(1, 2);
|
|||
|
||||
#define DPRINTF(x) do {\
|
||||
int save_errno = errno; \
|
||||
if ((statp->options & RES_DEBUG) != 0) res_dprintf x; \
|
||||
if ((statp->options & RES_DEBUG) != 0U) res_dprintf x; \
|
||||
errno = save_errno; \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
|
||||
static const char rcsid[] = "$Id: res_init.c,v 1.9.2.6 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_init.c,v 1.9.2.7 2004/03/16 12:35:35 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -170,7 +170,7 @@ __res_vinit(res_state statp, int preinit) {
|
|||
statp->id = res_randomid();
|
||||
}
|
||||
|
||||
if ((statp->options & RES_INIT) != 0)
|
||||
if ((statp->options & RES_INIT) != 0U)
|
||||
res_ndestroy(statp);
|
||||
|
||||
memset(u, 0, sizeof(u));
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
|
||||
static const char rcsid[] = "$Id: res_mkquery.c,v 1.1.2.3 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_mkquery.c,v 1.1.2.4 2004/03/16 12:35:35 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -125,7 +125,7 @@ res_nmkquery(res_state statp,
|
|||
hp = (HEADER *) buf;
|
||||
hp->id = htons(++statp->id);
|
||||
hp->opcode = op;
|
||||
hp->rd = (statp->options & RES_RECURSE) != 0;
|
||||
hp->rd = (statp->options & RES_RECURSE) != 0U;
|
||||
hp->rcode = NOERROR;
|
||||
cp = buf + HFIXEDSZ;
|
||||
ep = buf + buflen;
|
||||
|
|
@ -219,7 +219,7 @@ res_nopt(res_state statp,
|
|||
u_int16_t flags = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
if ((statp->options & RES_DEBUG) != 0)
|
||||
if ((statp->options & RES_DEBUG) != 0U)
|
||||
printf(";; res_nopt()\n");
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#if !defined(lint) && !defined(SABER)
|
||||
static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.2 2004/03/09 09:17:49 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.3 2004/03/16 12:35:36 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -380,7 +380,7 @@ res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) {
|
|||
}
|
||||
break;
|
||||
case T_TXT:
|
||||
while (1) {
|
||||
for (;;) {
|
||||
if ((n = getstr_str(buf2, sizeof buf2,
|
||||
&startp, endp)) < 0) {
|
||||
if (cp != (sp2 + INT16SZ))
|
||||
|
|
@ -582,7 +582,7 @@ res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) {
|
|||
ShrinkBuffer(n);
|
||||
maxtype = 0;
|
||||
memset(data, 0, sizeof data);
|
||||
while (1) {
|
||||
for (;;) {
|
||||
if (!getword_str(buf2, sizeof buf2, &startp,
|
||||
endp))
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
|
||||
static const char rcsid[] = "$Id: res_query.c,v 1.2.2.4 2004/03/09 09:17:50 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_query.c,v 1.2.2.5 2004/03/16 12:35:36 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "port_before.h"
|
||||
|
|
@ -133,7 +133,7 @@ again:
|
|||
buf, sizeof(buf));
|
||||
#ifdef RES_USE_EDNS0
|
||||
if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
|
||||
(statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0)
|
||||
(statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U)
|
||||
n = res_nopt(statp, n, buf, sizeof(buf), anslen);
|
||||
#endif
|
||||
if (n <= 0) {
|
||||
|
|
@ -148,7 +148,7 @@ again:
|
|||
if (n < 0) {
|
||||
#ifdef RES_USE_EDNS0
|
||||
/* if the query choked with EDNS0, retry without EDNS0 */
|
||||
if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0 &&
|
||||
if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
|
||||
((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
|
||||
statp->_flags |= RES_F_EDNS0ERR;
|
||||
if (statp->options & RES_DEBUG)
|
||||
|
|
@ -252,8 +252,8 @@ res_nsearch(res_state statp,
|
|||
* - there is at least one dot, there is no trailing dot,
|
||||
* and RES_DNSRCH is set.
|
||||
*/
|
||||
if ((!dots && (statp->options & RES_DEFNAMES) != 0) ||
|
||||
(dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) {
|
||||
if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
|
||||
(dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
|
||||
int done = 0;
|
||||
|
||||
for (domain = (const char * const *)statp->dnsrch;
|
||||
|
|
@ -311,7 +311,7 @@ res_nsearch(res_state statp,
|
|||
/* if we got here for some reason other than DNSRCH,
|
||||
* we only wanted one iteration of the loop, so stop.
|
||||
*/
|
||||
if ((statp->options & RES_DNSRCH) == 0)
|
||||
if ((statp->options & RES_DNSRCH) == 0U)
|
||||
done++;
|
||||
}
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ res_nsearch(res_state statp,
|
|||
* If the query has not already been tried as is then try it
|
||||
* unless RES_NOTLDQUERY is set and there were no dots.
|
||||
*/
|
||||
if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0) &&
|
||||
if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
|
||||
!(tried_as_is || root_on_list)) {
|
||||
ret = res_nquerydomain(statp, name, NULL, class, type,
|
||||
answer, anslen);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
|
||||
static const char rcsid[] = "$Id: res_send.c,v 1.5.2.3 2004/03/09 09:17:50 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_send.c,v 1.5.2.4 2004/03/16 12:35:37 marka Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
/*
|
||||
|
|
@ -352,8 +352,8 @@ res_nsend(res_state statp,
|
|||
* Some resolvers want to even out the load on their nameservers.
|
||||
* Note that RES_BLAST overrides RES_ROTATE.
|
||||
*/
|
||||
if ((statp->options & RES_ROTATE) != 0 &&
|
||||
(statp->options & RES_BLAST) == 0) {
|
||||
if ((statp->options & RES_ROTATE) != 0U &&
|
||||
(statp->options & RES_BLAST) == 0U) {
|
||||
union res_sockaddr_union inu;
|
||||
struct sockaddr_in ina;
|
||||
int lastns = statp->nscount - 1;
|
||||
|
|
@ -467,8 +467,8 @@ res_nsend(res_state statp,
|
|||
* or if we haven't been asked to keep a socket open,
|
||||
* close the socket.
|
||||
*/
|
||||
if ((v_circuit && (statp->options & RES_USEVC) == 0) ||
|
||||
(statp->options & RES_STAYOPEN) == 0) {
|
||||
if ((v_circuit && (statp->options & RES_USEVC) == 0U) ||
|
||||
(statp->options & RES_STAYOPEN) == 0U) {
|
||||
res_nclose(statp);
|
||||
}
|
||||
if (statp->rhook) {
|
||||
|
|
@ -902,7 +902,7 @@ send_dg(res_state statp,
|
|||
goto wait;
|
||||
}
|
||||
#ifdef RES_USE_EDNS0
|
||||
if (anhp->rcode == FORMERR && (statp->options & RES_USE_EDNS0) != 0) {
|
||||
if (anhp->rcode == FORMERR && (statp->options & RES_USE_EDNS0) != 0U) {
|
||||
/*
|
||||
* Do not retry if the server do not understand EDNS0.
|
||||
* The case has to be captured here, as FORMERR packet do not
|
||||
|
|
@ -970,7 +970,7 @@ Aerror(const res_state statp, FILE *file, const char *string, int error,
|
|||
|
||||
alen = alen;
|
||||
|
||||
if ((statp->options & RES_DEBUG) != 0) {
|
||||
if ((statp->options & RES_DEBUG) != 0U) {
|
||||
if (getnameinfo(address, alen, hbuf, sizeof(hbuf),
|
||||
sbuf, sizeof(sbuf), niflags)) {
|
||||
strncpy(hbuf, "?", sizeof(hbuf) - 1);
|
||||
|
|
@ -988,7 +988,7 @@ static void
|
|||
Perror(const res_state statp, FILE *file, const char *string, int error) {
|
||||
int save = errno;
|
||||
|
||||
if ((statp->options & RES_DEBUG) != 0)
|
||||
if ((statp->options & RES_DEBUG) != 0U)
|
||||
fprintf(file, "res_send: %s: %s\n",
|
||||
string, strerror(error));
|
||||
errno = save;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ retry:
|
|||
}
|
||||
|
||||
hp = (HEADER *) answer;
|
||||
if (hp->tc && !usingTCP && (statp->options & RES_IGNTC) == 0) {
|
||||
if (hp->tc && !usingTCP && (statp->options & RES_IGNTC) == 0U) {
|
||||
nstatp->options &= ~RES_IGNTC;
|
||||
usingTCP = 1;
|
||||
goto retry;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#if !defined(lint) && !defined(SABER)
|
||||
static const char rcsid[] = "$Id: res_update.c,v 1.6.2.5 2004/03/09 09:17:50 marka Exp $";
|
||||
static const char rcsid[] = "$Id: res_update.c,v 1.6.2.6 2004/03/16 12:35:37 marka Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
|
@ -83,7 +83,7 @@ static void res_dprintf(const char *, ...) ISC_FORMAT_PRINTF(1, 2);
|
|||
|
||||
#define DPRINTF(x) do {\
|
||||
int save_errno = errno; \
|
||||
if ((statp->options & RES_DEBUG) != 0) res_dprintf x; \
|
||||
if ((statp->options & RES_DEBUG) != 0U) res_dprintf x; \
|
||||
errno = save_errno; \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue