2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Remove redundant parentheses from the return statement

This commit is contained in:
Ondřej Surý
2024-11-19 10:38:03 +01:00
parent 3873b0c279
commit 0258850f20
437 changed files with 10832 additions and 10856 deletions

View File

@@ -131,7 +131,7 @@ static int
compare_rdata(const void *p1, const void *p2) {
const struct xrdata *x1 = p1;
const struct xrdata *x2 = p2;
return (dns_rdata_compare(&x1->rdata, &x2->rdata));
return dns_rdata_compare(&x1->rdata, &x2->rdata);
}
#if DNS_RDATASET_FIXED
@@ -197,7 +197,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
*/
if (nitems == 0) {
if (rdataset->type != 0) {
return (ISC_R_FAILURE);
return ISC_R_FAILURE;
}
rawbuf = isc_mem_get(mctx, buflen);
region->base = rawbuf;
@@ -205,15 +205,15 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
rawbuf += reservelen;
*rawbuf++ = 0;
*rawbuf = 0;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
if (maxrrperset > 0 && nitems > maxrrperset) {
return (DNS_R_TOOMANYRECORDS);
return DNS_R_TOOMANYRECORDS;
}
if (nitems > 0xffff) {
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
/*
@@ -389,7 +389,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
free_rdatas:
isc_mem_cput(mctx, x, nalloc, sizeof(struct xrdata));
return (result);
return result;
}
unsigned int
@@ -411,7 +411,7 @@ dns_rdataslab_size(unsigned char *slab, unsigned int reservelen) {
#endif /* if DNS_RDATASET_FIXED */
}
return ((unsigned int)(current - slab));
return (unsigned int)(current - slab);
}
unsigned int
@@ -435,7 +435,7 @@ dns_rdataslab_rdatasize(unsigned char *slab, unsigned int reservelen) {
#endif /* if DNS_RDATASET_FIXED */
}
return (rdatalen);
return rdatalen;
}
unsigned int
@@ -445,7 +445,7 @@ dns_rdataslab_count(unsigned char *slab, unsigned int reservelen) {
unsigned char *current = slab + reservelen;
uint16_t count = get_uint16(current);
return (count);
return count;
}
/*
@@ -505,14 +505,14 @@ rdata_in_slab(unsigned char *slab, unsigned int reservelen,
int n = dns_rdata_compare(&trdata, rdata);
if (n == 0) {
return (true);
return true;
}
if (n > 0) { /* In DNSSEC order. */
break;
}
dns_rdata_reset(&trdata);
}
return (false);
return false;
}
isc_result_t
@@ -560,7 +560,7 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
INSIST(ocount > 0 && ncount > 0);
if (maxrrperset > 0 && ocount + ncount > maxrrperset) {
return (DNS_R_TOOMANYRECORDS);
return DNS_R_TOOMANYRECORDS;
}
#if DNS_RDATASET_FIXED
@@ -621,11 +621,11 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
if (((flags & DNS_RDATASLAB_EXACT) != 0) && (tcount != ncount + ocount))
{
return (DNS_R_NOTEXACT);
return DNS_R_NOTEXACT;
}
if (!added_something && (flags & DNS_RDATASLAB_FORCE) == 0) {
return (DNS_R_UNCHANGED);
return DNS_R_UNCHANGED;
}
/*
@@ -636,11 +636,11 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
* We have a singleton type, but there's more than one
* RR in the rdataset.
*/
return (DNS_R_SINGLETON);
return DNS_R_SINGLETON;
}
if (tcount > 0xffff) {
return (ISC_R_NOSPACE);
return ISC_R_NOSPACE;
}
/*
@@ -778,7 +778,7 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
*tslabp = tstart;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
isc_result_t
@@ -860,21 +860,21 @@ dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
* check only works as rdataslabs do not contain duplicates.
*/
if (((flags & DNS_RDATASLAB_EXACT) != 0) && (rcount != scount)) {
return (DNS_R_NOTEXACT);
return DNS_R_NOTEXACT;
}
/*
* Don't continue if the new rdataslab would be empty.
*/
if (tcount == 0) {
return (DNS_R_NXRRSET);
return DNS_R_NXRRSET;
}
/*
* If nothing is going to change, we can stop.
*/
if (rcount == 0) {
return (DNS_R_UNCHANGED);
return DNS_R_UNCHANGED;
}
/*
@@ -948,7 +948,7 @@ dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
*tslabp = tstart;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
bool
@@ -965,7 +965,7 @@ dns_rdataslab_equal(unsigned char *slab1, unsigned char *slab2,
count2 = get_uint16(current2);
if (count1 != count2) {
return (false);
return false;
}
#if DNS_RDATASET_FIXED
@@ -985,13 +985,13 @@ dns_rdataslab_equal(unsigned char *slab1, unsigned char *slab2,
if (length1 != length2 ||
memcmp(current1, current2, length1) != 0)
{
return (false);
return false;
}
current1 += length1;
current2 += length1;
}
return (true);
return true;
}
bool
@@ -1010,7 +1010,7 @@ dns_rdataslab_equalx(unsigned char *slab1, unsigned char *slab2,
count2 = get_uint16(current2);
if (count1 != count2) {
return (false);
return false;
}
#if DNS_RDATASET_FIXED
@@ -1022,23 +1022,23 @@ dns_rdataslab_equalx(unsigned char *slab1, unsigned char *slab2,
rdata_from_slab(&current1, rdclass, type, &rdata1);
rdata_from_slab(&current2, rdclass, type, &rdata2);
if (dns_rdata_compare(&rdata1, &rdata2) != 0) {
return (false);
return false;
}
dns_rdata_reset(&rdata1);
dns_rdata_reset(&rdata2);
}
return (true);
return true;
}
dns_slabheader_t *
dns_slabheader_fromrdataset(const dns_rdataset_t *rdataset) {
dns_slabheader_t *header = (dns_slabheader_t *)rdataset->slab.raw;
return (header - 1);
return header - 1;
}
void *
dns_slabheader_raw(dns_slabheader_t *header) {
return (header + 1);
return header + 1;
}
void
@@ -1101,7 +1101,7 @@ dns_slabheader_new(dns_db_t *db, dns_dbnode_t *node) {
.link = ISC_LINK_INITIALIZER,
};
dns_slabheader_reset(h, db, node);
return (h);
return h;
}
void
@@ -1185,7 +1185,7 @@ rdataset_first(dns_rdataset_t *rdataset) {
if (count == 0) {
rdataset->slab.iter_pos = NULL;
rdataset->slab.iter_count = 0;
return (ISC_R_NOMORE);
return ISC_R_NOMORE;
}
if ((rdataset->attributes & DNS_RDATASETATTR_LOADORDER) == 0) {
@@ -1204,7 +1204,7 @@ rdataset_first(dns_rdataset_t *rdataset) {
rdataset->slab.iter_pos = raw + DNS_RDATASET_LENGTH;
rdataset->slab.iter_count = count - 1;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@@ -1212,7 +1212,7 @@ rdataset_next(dns_rdataset_t *rdataset) {
uint16_t count = rdataset->slab.iter_count;
if (count == 0) {
rdataset->slab.iter_pos = NULL;
return (ISC_R_NOMORE);
return ISC_R_NOMORE;
}
rdataset->slab.iter_count = count - 1;
@@ -1230,7 +1230,7 @@ rdataset_next(dns_rdataset_t *rdataset) {
rdataset->slab.iter_pos = raw + DNS_RDATASET_ORDER +
DNS_RDATASET_LENGTH;
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void
@@ -1297,7 +1297,7 @@ rdataset_count(dns_rdataset_t *rdataset) {
raw = rdataset->slab.raw;
count = get_uint16(raw);
return (count);
return count;
}
static isc_result_t
@@ -1353,7 +1353,7 @@ rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
dns_name_clone(&noqname->name, name);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static isc_result_t
@@ -1406,7 +1406,7 @@ rdataset_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
dns_name_clone(&closest->name, name);
return (ISC_R_SUCCESS);
return ISC_R_SUCCESS;
}
static void