Skip to content

Commit

Permalink
rem: dev: Drop single-use RETERR macro
Browse files Browse the repository at this point in the history
If the RETERR define is only used once in a file, just drop the macro.

Merge branch 'matthijs-remove-single-use-define-reterr' into 'main'

See merge request isc-projects/bind9!9871
  • Loading branch information
matje committed Dec 10, 2024
2 parents 8460716 + b6d0314 commit f6ff4ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
16 changes: 6 additions & 10 deletions bin/named/zoneconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ typedef enum {
allow_update_forwarding
} acl_type_t;

#define RETERR(x) \
do { \
isc_result_t _r = (x); \
if (_r != ISC_R_SUCCESS) \
return ((_r)); \
} while (0)

#define CHECK(x) \
do { \
result = (x); \
Expand Down Expand Up @@ -577,9 +570,12 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
isc_region_t region;

/* Create the DB beforehand */
RETERR(dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
dns_dbtype_stub, dns_zone_getclass(zone), 0, NULL,
&db));
result = dns_db_create(mctx, dbtype, dns_zone_getorigin(zone),
dns_dbtype_stub, dns_zone_getclass(zone), 0,
NULL, &db);
if (result != ISC_R_SUCCESS) {
return result;
}

dns_rdataset_init(&rdataset);

Expand Down
12 changes: 4 additions & 8 deletions lib/dns/nsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@

#include <dst/dst.h>

#define RETERR(x) \
do { \
result = (x); \
if (result != ISC_R_SUCCESS) \
goto failure; \
} while (0)

void
dns_nsec_setbit(unsigned char *array, unsigned int type, unsigned int bit) {
unsigned int shift, mask;
Expand Down Expand Up @@ -189,7 +182,10 @@ dns_nsec_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
dns_rdataset_init(&rdataset);
dns_rdata_init(&rdata);

RETERR(dns_nsec_buildrdata(db, version, node, target, data, &rdata));
result = dns_nsec_buildrdata(db, version, node, target, data, &rdata);
if (result != ISC_R_SUCCESS) {
goto failure;
}

dns_rdatalist_init(&rdatalist);
rdatalist.rdclass = dns_db_class(db);
Expand Down

0 comments on commit f6ff4ff

Please sign in to comment.