From 7f4a4ec07c922055a7d7855c79576504258d3198 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Fri, 8 Apr 2022 16:47:02 +0100 Subject: [PATCH 1/2] Ditch a couple of unused `#define`s These were added by mistake in CHANGES 2349 and were not removed when the mistake was corrected. --- lib/dns/include/dns/rdataslab.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/dns/include/dns/rdataslab.h b/lib/dns/include/dns/rdataslab.h index 7364b8d644..10a8525a1f 100644 --- a/lib/dns/include/dns/rdataslab.h +++ b/lib/dns/include/dns/rdataslab.h @@ -53,12 +53,6 @@ ISC_LANG_BEGINDECLS #define DNS_RDATASLAB_EXACT 0x2 #define DNS_RDATASLAB_OFFLINE 0x01 /* RRSIG is for offline DNSKEY */ -#define DNS_RDATASLAB_WARNMASK \ - 0x0E /*%< RRSIG(DNSKEY) expired \ - * warnings number mask. */ -#define DNS_RDATASLAB_WARNSHIFT \ - 1 /*%< How many bits to shift to find \ - * remaining expired warning number. */ /*** *** Functions From 8c26cd915b6a9d66761f3dc7d290e38ab9351ebd Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Mon, 11 Apr 2022 12:34:47 +0100 Subject: [PATCH 2/2] Tidy up some DNS_RDATASET_FIXED conditional compilation Add a #if to make it clear that struct xrdata->order is only used in DNS_RDATASET_FIXED mode. Re-order some variable declarations to merge two #if blocks into one. --- lib/dns/rdataslab.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index a7e817dbe5..cf0e46be9d 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -70,7 +70,9 @@ struct xrdata { dns_rdata_t rdata; +#if DNS_RDATASET_FIXED unsigned int order; +#endif /* if DNS_RDATASET_FIXED */ }; /*% Note: the "const void *" are just to make qsort happy. */ @@ -122,18 +124,16 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx, static unsigned char removed; struct xrdata *x; unsigned char *rawbuf; -#if DNS_RDATASET_FIXED - unsigned char *offsetbase; -#endif /* if DNS_RDATASET_FIXED */ unsigned int buflen; isc_result_t result; unsigned int nitems; unsigned int nalloc; + unsigned int length; unsigned int i; #if DNS_RDATASET_FIXED + unsigned char *offsetbase; unsigned int *offsettable; #endif /* if DNS_RDATASET_FIXED */ - unsigned int length; buflen = reservelen + 2;