diff --git a/bin/dig/dig.c b/bin/dig/dig.c index bbe2fdfea5..c447aab77f 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -42,12 +42,13 @@ #include #include -#define ADD_STRING(b, s) \ - { \ - if (strlen(s) >= isc_buffer_availablelength(b)) \ - return ((ISC_R_NOSPACE)); \ - else \ - isc_buffer_putstr(b, s); \ +#define ADD_STRING(b, s) \ + { \ + if (strlen(s) >= isc_buffer_availablelength(b)) { \ + return ((((ISC_R_NOSPACE)))); \ + } else { \ + isc_buffer_putstr(b, s); \ + } \ } #define DIG_MAX_ADDRESSES 20 diff --git a/lib/dns/message.c b/lib/dns/message.c index 9c632adae3..4e4d692a47 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -938,10 +938,9 @@ getrdata(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, #define DO_ERROR(r) \ do { \ - if (best_effort) \ + if (best_effort) { \ seen_problem = true; \ - else \ - { \ + } else { \ result = r; \ goto cleanup; \ } \ diff --git a/lib/dns/name.c b/lib/dns/name.c index 73280d06b4..831b534fb1 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -99,10 +99,9 @@ static unsigned char maptolower[] = { var = (default_offsets); #define SETUP_OFFSETS(name, var, default_offsets) \ - if ((name)->offsets != NULL) \ + if ((name)->offsets != NULL) { \ var = (name)->offsets; \ - else \ - { \ + } else { \ var = (default_offsets); \ set_offsets(name, var, NULL); \ } diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h index cc38680b44..e686c9ba99 100644 --- a/lib/isc/include/isc/list.h +++ b/lib/isc/include/isc/list.h @@ -48,10 +48,11 @@ #define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \ do { \ - if ((list).head != NULL) \ + if ((list).head != NULL) { \ (list).head->link.prev = (elt); \ - else \ + } else { \ (list).tail = (elt); \ + } \ (elt)->link.prev = NULL; \ (elt)->link.next = (list).head; \ (list).head = (elt); \ @@ -68,10 +69,11 @@ #define __ISC_LIST_APPENDUNSAFE(list, elt, link) \ do { \ - if ((list).tail != NULL) \ + if ((list).tail != NULL) { \ (list).tail->link.next = (elt); \ - else \ + } else { \ (list).head = (elt); \ + } \ (elt)->link.prev = (list).tail; \ (elt)->link.next = NULL; \ (list).tail = (elt); \ @@ -88,17 +90,15 @@ #define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \ do { \ - if ((elt)->link.next != NULL) \ + if ((elt)->link.next != NULL) { \ (elt)->link.next->link.prev = (elt)->link.prev; \ - else \ - { \ + } else { \ ISC_INSIST((list).tail == (elt)); \ (list).tail = (elt)->link.prev; \ } \ - if ((elt)->link.prev != NULL) \ + if ((elt)->link.prev != NULL) { \ (elt)->link.prev->link.next = (elt)->link.next; \ - else \ - { \ + } else { \ ISC_INSIST((list).head == (elt)); \ (list).head = (elt)->link.next; \ } \ @@ -124,10 +124,9 @@ #define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \ do { \ - if ((before)->link.prev == NULL) \ + if ((before)->link.prev == NULL) { \ ISC_LIST_PREPEND(list, elt, link); \ - else \ - { \ + } else { \ (elt)->link.prev = (before)->link.prev; \ (before)->link.prev = (elt); \ (elt)->link.prev->link.next = (elt); \ @@ -144,10 +143,9 @@ #define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \ do { \ - if ((after)->link.next == NULL) \ + if ((after)->link.next == NULL) { \ ISC_LIST_APPEND(list, elt, link); \ - else \ - { \ + } else { \ (elt)->link.next = (after)->link.next; \ (after)->link.next = (elt); \ (elt)->link.next->link.prev = (elt); \ @@ -164,10 +162,9 @@ #define ISC_LIST_APPENDLIST(list1, list2, link) \ do { \ - if (ISC_LIST_EMPTY(list1)) \ + if (ISC_LIST_EMPTY(list1)) { \ (list1) = (list2); \ - else if (!ISC_LIST_EMPTY(list2)) \ - { \ + } else if (!ISC_LIST_EMPTY(list2)) { \ (list1).tail->link.next = (list2).head; \ (list2).head->link.prev = (list1).tail; \ (list1).tail = (list2).tail; \ @@ -178,10 +175,9 @@ #define ISC_LIST_PREPENDLIST(list1, list2, link) \ do { \ - if (ISC_LIST_EMPTY(list1)) \ + if (ISC_LIST_EMPTY(list1)) { \ (list1) = (list2); \ - else if (!ISC_LIST_EMPTY(list2)) \ - { \ + } else if (!ISC_LIST_EMPTY(list2)) { \ (list2).tail->link.next = (list1).head; \ (list1).head->link.prev = (list2).tail; \ (list1).head = (list2).head; \ diff --git a/lib/isccc/include/isccc/util.h b/lib/isccc/include/isccc/util.h index f59e9b20b1..f74c160423 100644 --- a/lib/isccc/include/isccc/util.h +++ b/lib/isccc/include/isccc/util.h @@ -83,21 +83,21 @@ #define GETC16(v, w, d) \ do { \ GET8(v, w); \ - if (v == 0) \ + if (v == 0) { \ d = ISCCC_TRUE; \ - else \ - { \ + } else { \ d = ISCCC_FALSE; \ if (v == 255) \ GET16(v, w); \ } \ } while (0) -#define GETC32(v, w) \ - do { \ - GET24(v, w); \ - if (v == 0xffffffu) \ - GET32(v, w); \ +#define GETC32(v, w) \ + do { \ + GET24(v, w); \ + if (v == 0xffffffu) { \ + GET32(v, w); \ + } \ } while (0) #define GET_OFFSET(v, w) GET32(v, w) @@ -112,10 +112,11 @@ do { \ GET8(v, w); \ if (v > 127) { \ - if (v < 255) \ + if (v < 255) { \ v = ((v & 0x7f) << 16) | ISCCC_RDATATYPE_SIG; \ - else \ + } else { \ GET32(v, w); \ + } \ } \ } while (0) @@ -162,23 +163,21 @@ w += 8; \ } while (0) -#define PUTC16(v, w) \ - do { \ - if (v > 0 && v < 255) \ - PUT8(v, w); \ - else \ - { \ - PUT8(255, w); \ - PUT16(v, w); \ - } \ +#define PUTC16(v, w) \ + do { \ + if (v > 0 && v < 255) { \ + PUT8(v, w); \ + } else { \ + PUT8(255, w); \ + PUT16(v, w); \ + } \ } while (0) #define PUTC32(v, w) \ do { \ - if (v < 0xffffffU) \ + if (v < 0xffffffU) { \ PUT24(v, w); \ - else \ - { \ + } else { \ PUT24(0xffffffU, w); \ PUT32(v, w); \ } \