Commit 19c5c23e authored by Mark Andrews's avatar Mark Andrews
Browse files

fix compiler warning: While loop condition is always non-zero.

nxt_30.c enforce type range to 1..127. DNS_R_RANGE otherwise.
parent cebd4498
......@@ -1174,13 +1174,13 @@ uniqify_name_list(dns_diff_t *list) {
p = ISC_LIST_HEAD(list->tuples);
while (p != NULL) {
while (1) {
do {
q = ISC_LIST_NEXT(p, link);
if (q == NULL || ! dns_name_equal(&p->name, &q->name))
break;
ISC_LIST_UNLINK(list->tuples, q, link);
dns_difftuple_free(&q);
}
} while (1);
p = ISC_LIST_NEXT(p, link);
}
failure:
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rbt.c,v 1.67 1999/11/03 00:17:11 tale Exp $ */
/* $Id: rbt.c,v 1.68 1999/11/03 01:06:57 marka Exp $ */
/* Principal Authors: DCL */
......@@ -321,7 +321,7 @@ chain_name(dns_rbtnodechain_t *chain, dns_name_t *name,
static inline dns_result_t
move_chain_to_last(dns_rbtnodechain_t *chain, dns_rbtnode_t *node) {
while (1) {
do {
/*
* Go as far right and then down as much as possible,
* as long as the rightmost node has a down pointer.
......@@ -337,7 +337,7 @@ move_chain_to_last(dns_rbtnodechain_t *chain, dns_rbtnode_t *node) {
ADD_ANCESTOR(chain, NULL);
ADD_LEVEL(chain, node);
node = DOWN(node);
}
} while (1);
chain->end = node;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.c,v 1.17 1999/10/08 21:26:42 tale Exp $ */
/* $Id: nxt_30.c,v 1.18 1999/11/03 01:06:59 marka Exp $ */
/* RFC 2065 */
......@@ -50,25 +50,27 @@ fromtext_nxt(dns_rdataclass_t rdclass, dns_rdatatype_t type,
RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target));
memset(bm, 0, sizeof bm);
while (1) {
do {
RETERR(gettoken(lexer, &token, isc_tokentype_string,
ISC_TRUE));
if (token.type != isc_tokentype_string)
break;
n = strtol(token.value.as_pointer, &e, 10);
if (n < 0 || n > 65535)
return (DNS_R_RANGE);
covered = (dns_rdatatype_t)n;
if (*e == 0)
(void) NULL;
else if (dns_rdatatype_fromtext(&covered,
if (e != token.value.as_pointer && *e == '\0') {
covered = (dns_rdatatype_t)n;
} else if (dns_rdatatype_fromtext(&covered,
&token.value.as_textregion) == DNS_R_UNKNOWN)
return (DNS_R_UNKNOWN);
/*
* NXT is only specified for types 1..127.
*/
if (covered < 1 || covered > 127)
return (DNS_R_RANGE);
if (first || covered > maxcovered)
maxcovered = covered;
first = ISC_FALSE;
bm[covered/8] |= (0x80>>(covered%8));
}
} while (1);
isc_lex_ungettoken(lexer, &token);
if (first)
return (DNS_R_SUCCESS);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: txt_16.c,v 1.16 1999/09/15 23:03:33 explorer Exp $ */
/* $Id: txt_16.c,v 1.17 1999/11/03 01:06:59 marka Exp $ */
#ifndef RDATA_GENERIC_TXT_16_C
#define RDATA_GENERIC_TXT_16_C
......@@ -33,14 +33,14 @@ fromtext_txt(dns_rdataclass_t rdclass, dns_rdatatype_t type,
origin = origin; /*unused*/
downcase = downcase; /*unused*/
while (1) {
do {
RETERR(gettoken(lexer, &token, isc_tokentype_qstring,
ISC_TRUE));
if (token.type != isc_tokentype_qstring &&
token.type != isc_tokentype_string)
break;
RETERR(txt_fromtext(&token.value.as_textregion, target));
}
} while (1);
/* Let upper layer handle eol/eof. */
isc_lex_ungettoken(lexer, &token);
return (DNS_R_SUCCESS);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: wks_11.c,v 1.17 1999/09/15 23:03:37 explorer Exp $ */
/* $Id: wks_11.c,v 1.18 1999/11/03 01:07:00 marka Exp $ */
#ifndef RDATA_IN_1_WKS_11_C
#define RDATA_IN_1_WKS_11_C
......@@ -83,7 +83,7 @@ fromtext_in_wks(dns_rdataclass_t rdclass, dns_rdatatype_t type,
RETERR(uint8_tobuffer(proto, target));
memset(bm, 0, sizeof bm);
while (1) {
do {
RETERR(gettoken(lexer, &token, isc_tokentype_string,
ISC_TRUE));
if (token.type != isc_tokentype_string)
......@@ -101,7 +101,7 @@ fromtext_in_wks(dns_rdataclass_t rdclass, dns_rdatatype_t type,
if (port > maxport)
maxport = port;
bm[port/8] |= (0x80>>(port%8));
}
} while (1);
isc_lex_ungettoken(lexer, &token);
n = (maxport + 8) / 8;
return (mem_tobuffer(target, bm, n));
......
......@@ -191,7 +191,7 @@ A_SURRENDER_CTX *surrenderContext;
/* Fill in the random block and try generating as long as the
the generate operation returns BE_NEED_RANDOM.
*/
while (1) {
do {
if ((status = B_AlgorithmGenerateRandomBytes
(randomAlgorithm,
(unsigned char *)generateAlgaChoice->randomBlock.z.context,
......@@ -211,6 +211,6 @@ A_SURRENDER_CTX *surrenderContext;
else
/* Success, so return */
return (0);
}
} while (1);
}
......@@ -40,7 +40,7 @@ unsigned int k;
/* Begin calc.
*/
while (1) {
do {
if (BigSign (v3, k) == 0)
break;
BigPdiv (q, r, u3, v3, k, k);
......@@ -57,7 +57,7 @@ unsigned int k;
BigCopy (v1, t1, k);
BigCopy (v2, t2, k);
BigCopy (v3, t3, k);
}
} while (1);
if (BigSign (u1, k) == -1)
/* make positive */
......
......@@ -70,7 +70,7 @@ unsigned int n;
/* now we are guaranteed that a is not too small */
BigInc (a, n + 2);
while (1) {
do {
BigPmpy (p, a, t1, n + 2);
/* makes comparison to 2**u easier */
BigDec (p, 2 * (n + 2));
......@@ -81,7 +81,7 @@ unsigned int n;
/* a was too big, reduce and try again */
BigDec (a, n + 2);
}
} while (1);
T_memset ((POINTER)p, 0, sizeof (p));
T_memset ((POINTER)q, 0, sizeof (q));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: log.c,v 1.11 1999/10/31 19:09:23 halley Exp $ */
/* $Id: log.c,v 1.12 1999/11/03 01:07:02 marka Exp $ */
/* Principal Authors: DCL */
......@@ -868,7 +868,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
* XXX duplicate filtering (do not write multiple times to same source
* via various channels)
*/
while (1) {
do {
/*
* If the channel list end was reached and a match was made,
* everything is finished.
......@@ -1143,7 +1143,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
}
}
} while (1);
isc_mutex_unlock(&lctx->lock);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment