]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Tidy up some DNS_RDATASET_FIXED conditional compilation
authorTony Finch <fanf@isc.org>
Mon, 11 Apr 2022 11:34:47 +0000 (12:34 +0100)
committerTony Finch <fanf@isc.org>
Tue, 3 May 2022 09:30:28 +0000 (09:30 +0000)
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

index a7e817dbe5f6b3dba0fdee5fe115e69e367cbb1d..cf0e46be9d756401d832d43f66a9ba1dce5fa0ef 100644 (file)
@@ -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;