remove or comment empty conditional branches

some empty conditional branches which contained a semicolon were
"fixed" by clang-format to contain nothing. add comments to prevent this.

(cherry picked from commit 735be3b816)
This commit is contained in:
Evan Hunt
2020-03-17 15:39:03 -07:00
parent fa320d03a2
commit beaca3e8db
2 changed files with 25 additions and 18 deletions
+2 -2
View File
@@ -1442,7 +1442,7 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
} else if (strcasecmp(arg, "maintain") == 0) {
allow = maint = true;
} else if (strcasecmp(arg, "off") == 0) {
;
/* Default */
} else {
INSIST(0);
ISC_UNREACHABLE();
@@ -1591,7 +1591,7 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setkeyopt(zone, DNS_ZONEKEY_NORESIGN,
true);
} else if (strcasecmp(arg, "maintain") == 0) {
;
/* Default */
} else {
INSIST(0);
ISC_UNREACHABLE();
+23 -16
View File
@@ -73,7 +73,7 @@ fromtext_in_wks(ARGS_FROMTEXT) {
isc_token_t token;
isc_region_t region;
struct in_addr addr;
char *e;
char *e = NULL;
long proto;
unsigned char bm[8*1024]; /* 64k bits */
long port;
@@ -115,10 +115,12 @@ fromtext_in_wks(ARGS_FROMTEXT) {
false));
isc_buffer_availableregion(target, &region);
if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1) {
CHECKTOK(DNS_R_BADDOTTEDQUAD);
if (region.length < 4)
}
if (region.length < 4) {
return (ISC_R_NOSPACE);
}
memmove(region.base, &addr, 4);
isc_buffer_add(target, 4);
@@ -129,18 +131,19 @@ fromtext_in_wks(ARGS_FROMTEXT) {
false));
proto = strtol(DNS_AS_STR(token), &e, 10);
if (*e == 0)
;
else if (!mygetprotobyname(DNS_AS_STR(token), &proto))
if (*e != '\0' && !mygetprotobyname(DNS_AS_STR(token), &proto)) {
CHECKTOK(DNS_R_UNKNOWNPROTO);
}
if (proto < 0 || proto > 0xff)
if (proto < 0 || proto > 0xff) {
CHECKTOK(ISC_R_RANGE);
}
if (proto == IPPROTO_TCP)
if (proto == IPPROTO_TCP) {
ps = "tcp";
else if (proto == IPPROTO_UDP)
} else if (proto == IPPROTO_UDP) {
ps = "udp";
}
CHECK(uint8_tobuffer(proto, target));
@@ -148,8 +151,9 @@ fromtext_in_wks(ARGS_FROMTEXT) {
do {
CHECK(isc_lex_getmastertoken(lexer, &token,
isc_tokentype_string, true));
if (token.type != isc_tokentype_string)
if (token.type != isc_tokentype_string) {
break;
}
/*
* Lowercase the service string as some getservbyname() are
@@ -161,15 +165,18 @@ fromtext_in_wks(ARGS_FROMTEXT) {
service[i] = tolower(service[i]&0xff);
port = strtol(DNS_AS_STR(token), &e, 10);
if (*e == 0)
;
else if (!mygetservbyname(service, ps, &port) &&
!mygetservbyname(DNS_AS_STR(token), ps, &port))
if (*e != 0 && !mygetservbyname(service, ps, &port) &&
!mygetservbyname(DNS_AS_STR(token), ps, &port))
{
CHECKTOK(DNS_R_UNKNOWNSERVICE);
if (port < 0 || port > 0xffff)
}
if (port < 0 || port > 0xffff) {
CHECKTOK(ISC_R_RANGE);
if (port > maxport)
}
if (port > maxport) {
maxport = port;
}
bm[port / 8] |= (0x80 >> (port % 8));
} while (1);