Commit 41aad56b authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

avoid calling variables 'result' if they are not of type isc_result_t

parent 71181f3e
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.24 2000/03/16 23:13:02 gson Exp $ */
/* $Id: tsig_250.c,v 1.25 2000/03/20 22:44:33 gson Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
......@@ -270,7 +270,7 @@ compare_any_tsig(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t r2;
dns_name_t name1;
dns_name_t name2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -283,9 +283,9 @@ compare_any_tsig(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_name_init(&name2, NULL);
dns_name_fromregion(&name1, &r1);
dns_name_fromregion(&name2, &r2);
result = dns_name_rdatacompare(&name1, &name2);
if (result != 0)
return (result);
order = dns_name_rdatacompare(&name1, &name2);
if (order != 0)
return (order);
isc_region_consume(&r1, name_length(&name1));
isc_region_consume(&r2, name_length(&name2));
return (compare_region(&r1, &r2));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: minfo_14.c,v 1.20 2000/03/16 02:00:37 brister Exp $ */
/* $Id: minfo_14.c,v 1.21 2000/03/20 22:44:33 gson Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
......@@ -144,7 +144,7 @@ compare_minfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
isc_region_t region2;
dns_name_t name1;
dns_name_t name2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -159,9 +159,9 @@ compare_minfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_fromregion(&name1, &region1);
dns_name_fromregion(&name2, &region2);
result = dns_name_rdatacompare(&name1, &name2);
if (result != 0)
return (result);
order = dns_name_rdatacompare(&name1, &name2);
if (order != 0)
return (order);
isc_region_consume(&region1, name_length(&name1));
isc_region_consume(&region2, name_length(&name2));
......@@ -172,8 +172,8 @@ compare_minfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_fromregion(&name1, &region1);
dns_name_fromregion(&name2, &region2);
result = dns_name_rdatacompare(&name1, &name2);
return (result);
order = dns_name_rdatacompare(&name1, &name2);
return (order);
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mx_15.c,v 1.25 2000/03/17 02:19:55 explorer Exp $ */
/* $Id: mx_15.c,v 1.26 2000/03/20 22:44:34 gson Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
......@@ -132,15 +132,15 @@ compare_mx(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_t name2;
isc_region_t region1;
isc_region_t region2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 15);
result = memcmp(rdata1->data, rdata2->data, 2);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(rdata1->data, rdata2->data, 2);
if (order != 0)
return (order < 0 ? -1 : 1);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.c,v 1.21 2000/03/16 02:23:17 brister Exp $ */
/* $Id: nxt_30.c,v 1.22 2000/03/20 22:44:34 gson Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
......@@ -183,7 +183,7 @@ compare_nxt(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t r2;
dns_name_t name1;
dns_name_t name2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -195,9 +195,9 @@ compare_nxt(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_rdata_toregion(rdata2, &r2);
dns_name_fromregion(&name1, &r1);
dns_name_fromregion(&name2, &r2);
result = dns_name_rdatacompare(&name1, &name2);
if (result != 0)
return (result);
order = dns_name_rdatacompare(&name1, &name2);
if (order != 0)
return (order);
return (compare_region(&r1, &r2));
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rp_17.c,v 1.15 2000/03/17 01:22:15 explorer Exp $ */
/* $Id: rp_17.c,v 1.16 2000/03/20 22:44:34 gson Exp $ */
/* RFC 1183 */
......@@ -144,7 +144,7 @@ compare_rp(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
isc_region_t region2;
dns_name_t name1;
dns_name_t name2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -159,9 +159,9 @@ compare_rp(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_fromregion(&name1, &region1);
dns_name_fromregion(&name2, &region2);
result = dns_name_rdatacompare(&name1, &name2);
if (result != 0)
return (result);
order = dns_name_rdatacompare(&name1, &name2);
if (order != 0)
return (order);
isc_region_consume(&region1, name_length(&name1));
isc_region_consume(&region2, name_length(&name2));
......@@ -172,8 +172,7 @@ compare_rp(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_fromregion(&name1, &region1);
dns_name_fromregion(&name2, &region2);
result = dns_name_rdatacompare(&name1, &name2);
return (result);
return (dns_name_rdatacompare(&name1, &name2));
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rt_21.c,v 1.16 2000/03/16 23:51:09 brister Exp $ */
/* $Id: rt_21.c,v 1.17 2000/03/20 22:44:34 gson Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
......@@ -143,15 +143,15 @@ compare_rt(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_t name2;
isc_region_t region1;
isc_region_t region2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 21);
result = memcmp(rdata1->data, rdata2->data, 2);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(rdata1->data, rdata2->data, 2);
if (order != 0)
return (order < 0 ? -1 : 1);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tkey_249.c,v 1.22 2000/03/20 18:40:28 gson Exp $ */
/* $Id: tkey_249.c,v 1.23 2000/03/20 22:44:35 gson Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
......@@ -275,7 +275,7 @@ compare_tkey(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t r2;
dns_name_t name1;
dns_name_t name2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -288,8 +288,8 @@ compare_tkey(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_name_init(&name2, NULL);
dns_name_fromregion(&name1, &r1);
dns_name_fromregion(&name2, &r2);
if ((result = dns_name_rdatacompare(&name1, &name2)) != 0)
return (result);
if ((order = dns_name_rdatacompare(&name1, &name2)) != 0)
return (order);
isc_region_consume(&r1, name_length(&name1));
isc_region_consume(&r2, name_length(&name2));
return (compare_region(&r1, &r2));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: a_1.c,v 1.4 2000/03/17 00:01:18 brister Exp $ */
/* $Id: a_1.c,v 1.5 2000/03/20 22:44:35 gson Exp $ */
/* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */
......@@ -123,18 +123,18 @@ towire_hs_a(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
static inline int
compare_hs_a(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
{
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->type);
REQUIRE(rdata1->type == 1);
REQUIRE(rdata1->rdclass == 4);
result = memcmp(rdata1->data, rdata2->data, 4);
if (result != 0)
result = (result < 0) ? -1 : 1;
order = memcmp(rdata1->data, rdata2->data, 4);
if (order != 0)
order = (order < 0) ? -1 : 1;
return (result);
return (order);
}
static inline isc_result_t
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: a6_38.c,v 1.21 2000/03/19 03:15:49 brister Exp $ */
/* $Id: a6_38.c,v 1.22 2000/03/20 22:44:35 gson Exp $ */
/* draft-ietf-ipngwg-dns-lookups-03.txt */
......@@ -208,7 +208,7 @@ towire_in_a6(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
static inline int
compare_in_a6(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
int result;
int order;
unsigned char prefixlen1, prefixlen2;
unsigned char octets;
dns_name_t name1;
......@@ -237,16 +237,16 @@ compare_in_a6(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
octets = 16 - prefixlen1 / 8;
if (octets > 0) {
result = memcmp(region1.base, region2.base, octets);
if (result < 0)
order = memcmp(region1.base, region2.base, octets);
if (order < 0)
return (-1);
else if (result > 0)
else if (order > 0)
return (1);
/*
* Address suffixes are equal.
*/
if (prefixlen1 == 0)
return (result);
return (order);
isc_region_consume(&region1, octets);
isc_region_consume(&region2, octets);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: kx_36.c,v 1.18 2000/03/17 02:17:39 explorer Exp $ */
/* $Id: kx_36.c,v 1.19 2000/03/20 22:44:35 gson Exp $ */
/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */
......@@ -134,16 +134,16 @@ compare_in_kx(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
dns_name_t name2;
isc_region_t region1;
isc_region_t region2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 36);
REQUIRE(rdata1->rdclass == 1);
result = memcmp(rdata1->data, rdata2->data, 2);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(rdata1->data, rdata2->data, 2);
if (order != 0)
return (order < 0 ? -1 : 1);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: naptr_35.c,v 1.17 2000/03/17 02:47:01 bwelling Exp $ */
/* $Id: naptr_35.c,v 1.18 2000/03/20 22:44:36 gson Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
......@@ -196,7 +196,7 @@ compare_in_naptr(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_name_t name2;
isc_region_t region1;
isc_region_t region2;
int result, len;
int order, len;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -207,33 +207,33 @@ compare_in_naptr(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_rdata_toregion(rdata2, &region2);
/* order, preference */
result = memcmp(region1.base, region2.base, 4);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(region1.base, region2.base, 4);
if (order != 0)
return (order < 0 ? -1 : 1);
isc_region_consume(&region1, 4);
isc_region_consume(&region2, 4);
/* flags */
len = ISC_MIN(region1.base[0], region2.base[0]);
result = memcmp(region1.base, region2.base, len + 1);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(region1.base, region2.base, len + 1);
if (order != 0)
return (order < 0 ? -1 : 1);
isc_region_consume(&region1, region1.base[0] + 1);
isc_region_consume(&region2, region2.base[0] + 1);
/* service */
len = ISC_MIN(region1.base[0], region2.base[0]);
result = memcmp(region1.base, region2.base, len + 1);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(region1.base, region2.base, len + 1);
if (order != 0)
return (order < 0 ? -1 : 1);
isc_region_consume(&region1, region1.base[0] + 1);
isc_region_consume(&region2, region2.base[0] + 1);
/* regexp */
len = ISC_MIN(region1.base[0], region2.base[0]);
result = memcmp(region1.base, region2.base, len + 1);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(region1.base, region2.base, len + 1);
if (order != 0)
return (order < 0 ? -1 : 1);
isc_region_consume(&region1, region1.base[0] + 1);
isc_region_consume(&region2, region2.base[0] + 1);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: srv_33.c,v 1.15 2000/03/17 21:03:33 bwelling Exp $ */
/* $Id: srv_33.c,v 1.16 2000/03/20 22:44:36 gson Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
......@@ -160,7 +160,7 @@ compare_in_srv(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
dns_name_t name2;
isc_region_t region1;
isc_region_t region2;
int result;
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
......@@ -168,9 +168,9 @@ compare_in_srv(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
REQUIRE(rdata1->rdclass == 1);
/* priority, weight, port */
result = memcmp(rdata1->data, rdata2->data, 6);
if (result != 0)
return (result < 0 ? -1 : 1);
order = memcmp(rdata1->data, rdata2->data, 6);
if (order != 0)
return (order < 0 ? -1 : 1);
/* target */
dns_name_init(&name1, NULL);
......
Markdown is supported
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