From 80b782f356f0692c11b4e52e8dd46ec41704e5a2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 26 Feb 2003 23:52:30 +0000 Subject: [PATCH] 1447. [bug] We were casting (unsigned int) to and from (void *). rdataset->private4 is now rdataset->privateuint4 to reflect a type change. developer: marka reviewer: explorer --- CHANGES | 4 ++++ lib/dns/include/dns/rdataset.h | 4 ++-- lib/dns/ncache.c | 14 +++++++------- lib/dns/rbtdb.c | 14 +++++++------- lib/dns/rdatalist.c | 4 ++-- lib/dns/rdataset.c | 8 ++++---- lib/dns/rdataslab.c | 14 +++++++------- 7 files changed, 33 insertions(+), 29 deletions(-) diff --git a/CHANGES b/CHANGES index d5df12da25..91e5f61f20 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1447. [bug] We were casting (unsigned int) to and from (void *). + rdataset->private4 is now rdataset->privateuint4 + to reflect a type change. + 1446. [func] Implemented undocumented alternate transfer sources from BIND 8. See use-alt-transfer-source, alt-transfer-source-v4 and alt-transfer-source-v6. diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index 710e3c8318..3ca396f42e 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.h,v 1.46 2003/01/18 03:18:31 marka Exp $ */ +/* $Id: rdataset.h,v 1.47 2003/02/26 23:52:30 marka Exp $ */ #ifndef DNS_RDATASET_H #define DNS_RDATASET_H 1 @@ -104,7 +104,7 @@ struct dns_rdataset { void * private1; void * private2; void * private3; - void * private4; + unsigned int privateuint4; void * private5; }; diff --git a/lib/dns/ncache.c b/lib/dns/ncache.c index d9e3221c81..67a029fbe6 100644 --- a/lib/dns/ncache.c +++ b/lib/dns/ncache.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ncache.c,v 1.31 2003/01/18 03:18:30 marka Exp $ */ +/* $Id: ncache.c,v 1.32 2003/02/26 23:52:29 marka Exp $ */ #include @@ -398,12 +398,12 @@ rdataset_first(dns_rdataset_t *rdataset) { } raw += 2; /* - * The private4 field is the number of rdata beyond the cursor + * The privateuint4 field is the number of rdata beyond the cursor * position, so we decrement the total count by one before storing * it. */ count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; rdataset->private5 = raw; return (ISC_R_SUCCESS); @@ -415,11 +415,11 @@ rdataset_next(dns_rdataset_t *rdataset) { unsigned int length; unsigned char *raw; - count = (unsigned int)rdataset->private4; + count = rdataset->privateuint4; if (count == 0) return (ISC_R_NOMORE); count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; raw = rdataset->private5; length = raw[0] * 256 + raw[1]; raw += length + 2; @@ -448,7 +448,7 @@ rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) { /* * Reset iterator state. */ - target->private4 = NULL; + target->privateuint4 = 0; target->private5 = NULL; } @@ -543,7 +543,7 @@ dns_ncache_getrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name, /* * Reset iterator state. */ - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; return (ISC_R_SUCCESS); } diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 9120f1c296..b10ccb5017 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.184 2003/01/18 03:18:30 marka Exp $ */ +/* $Id: rbtdb.c,v 1.185 2003/02/26 23:52:29 marka Exp $ */ /* * Principal Author: Bob Halley @@ -1320,7 +1320,7 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, /* * Reset iterator state. */ - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; } @@ -4622,12 +4622,12 @@ rdataset_first(dns_rdataset_t *rdataset) { } raw += 2; /* - * The private4 field is the number of rdata beyond the cursor + * The privateuint4 field is the number of rdata beyond the cursor * position, so we decrement the total count by one before storing * it. */ count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; rdataset->private5 = raw; return (ISC_R_SUCCESS); @@ -4639,11 +4639,11 @@ rdataset_next(dns_rdataset_t *rdataset) { unsigned int length; unsigned char *raw; - count = (unsigned int)rdataset->private4; + count = rdataset->privateuint4; if (count == 0) return (ISC_R_NOMORE); count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; raw = rdataset->private5; length = raw[0] * 256 + raw[1]; raw += length + 2; @@ -4677,7 +4677,7 @@ rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) { /* * Reset iterator state. */ - target->private4 = NULL; + target->privateuint4 = 0; target->private5 = NULL; } diff --git a/lib/dns/rdatalist.c b/lib/dns/rdatalist.c index f8b84dcae5..2fd0c9041b 100644 --- a/lib/dns/rdatalist.c +++ b/lib/dns/rdatalist.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdatalist.c,v 1.25 2001/01/09 21:51:21 bwelling Exp $ */ +/* $Id: rdatalist.c,v 1.26 2003/02/26 23:52:29 marka Exp $ */ #include @@ -74,7 +74,7 @@ dns_rdatalist_tordataset(dns_rdatalist_t *rdatalist, rdataset->private1 = rdatalist; rdataset->private2 = NULL; rdataset->private3 = NULL; - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; return (ISC_R_SUCCESS); diff --git a/lib/dns/rdataset.c b/lib/dns/rdataset.c index 7f0069617b..20dde2baf1 100644 --- a/lib/dns/rdataset.c +++ b/lib/dns/rdataset.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.c,v 1.66 2002/12/05 04:36:26 marka Exp $ */ +/* $Id: rdataset.c,v 1.67 2003/02/26 23:52:29 marka Exp $ */ #include @@ -52,7 +52,7 @@ dns_rdataset_init(dns_rdataset_t *rdataset) { rdataset->private1 = NULL; rdataset->private2 = NULL; rdataset->private3 = NULL; - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; } @@ -77,7 +77,7 @@ dns_rdataset_invalidate(dns_rdataset_t *rdataset) { rdataset->private1 = NULL; rdataset->private2 = NULL; rdataset->private3 = NULL; - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; } @@ -103,7 +103,7 @@ dns_rdataset_disassociate(dns_rdataset_t *rdataset) { rdataset->private1 = NULL; rdataset->private2 = NULL; rdataset->private3 = NULL; - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; } diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 42de1891c2..0d520f9ff5 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataslab.c,v 1.32 2002/11/12 23:24:45 explorer Exp $ */ +/* $Id: rdataslab.c,v 1.33 2003/02/26 23:52:29 marka Exp $ */ #include @@ -169,12 +169,12 @@ rdataset_first(dns_rdataset_t *rdataset) { } raw += 2; /* - * The private4 field is the number of rdata beyond the cursor + * The privateuint4 field is the number of rdata beyond the cursor * position, so we decrement the total count by one before storing * it. */ count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; rdataset->private5 = raw; return (ISC_R_SUCCESS); @@ -186,11 +186,11 @@ rdataset_next(dns_rdataset_t *rdataset) { unsigned int length; unsigned char *raw; - count = (unsigned int)rdataset->private4; + count = rdataset->privateuint4; if (count == 0) return (ISC_R_NOMORE); count--; - rdataset->private4 = (void *)count; + rdataset->privateuint4 = count; raw = rdataset->private5; length = raw[0] * 256 + raw[1]; raw += length + 2; @@ -219,7 +219,7 @@ rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) { /* * Reset iterator state. */ - target->private4 = NULL; + target->privateuint4 = 0; target->private5 = NULL; } @@ -264,7 +264,7 @@ dns_rdataslab_tordataset(unsigned char *slab, unsigned int reservelen, /* * Reset iterator state. */ - rdataset->private4 = NULL; + rdataset->privateuint4 = 0; rdataset->private5 = NULL; }