2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Fixup the missing clang-format bits

This commit is contained in:
Ondřej Surý 2020-02-16 17:34:24 +01:00
parent cbb127eb43
commit 3832e3ecc9
5 changed files with 50 additions and 56 deletions

View File

@ -44,10 +44,11 @@
#define ADD_STRING(b, s) \ #define ADD_STRING(b, s) \
{ \ { \
if (strlen(s) >= isc_buffer_availablelength(b)) \ if (strlen(s) >= isc_buffer_availablelength(b)) { \
return ((ISC_R_NOSPACE)); \ return ((((ISC_R_NOSPACE)))); \
else \ } else { \
isc_buffer_putstr(b, s); \ isc_buffer_putstr(b, s); \
} \
} }
#define DIG_MAX_ADDRESSES 20 #define DIG_MAX_ADDRESSES 20

View File

@ -938,10 +938,9 @@ getrdata(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
#define DO_ERROR(r) \ #define DO_ERROR(r) \
do { \ do { \
if (best_effort) \ if (best_effort) { \
seen_problem = true; \ seen_problem = true; \
else \ } else { \
{ \
result = r; \ result = r; \
goto cleanup; \ goto cleanup; \
} \ } \

View File

@ -99,10 +99,9 @@ static unsigned char maptolower[] = {
var = (default_offsets); var = (default_offsets);
#define SETUP_OFFSETS(name, var, default_offsets) \ #define SETUP_OFFSETS(name, var, default_offsets) \
if ((name)->offsets != NULL) \ if ((name)->offsets != NULL) { \
var = (name)->offsets; \ var = (name)->offsets; \
else \ } else { \
{ \
var = (default_offsets); \ var = (default_offsets); \
set_offsets(name, var, NULL); \ set_offsets(name, var, NULL); \
} }

View File

@ -48,10 +48,11 @@
#define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \ #define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \
do { \ do { \
if ((list).head != NULL) \ if ((list).head != NULL) { \
(list).head->link.prev = (elt); \ (list).head->link.prev = (elt); \
else \ } else { \
(list).tail = (elt); \ (list).tail = (elt); \
} \
(elt)->link.prev = NULL; \ (elt)->link.prev = NULL; \
(elt)->link.next = (list).head; \ (elt)->link.next = (list).head; \
(list).head = (elt); \ (list).head = (elt); \
@ -68,10 +69,11 @@
#define __ISC_LIST_APPENDUNSAFE(list, elt, link) \ #define __ISC_LIST_APPENDUNSAFE(list, elt, link) \
do { \ do { \
if ((list).tail != NULL) \ if ((list).tail != NULL) { \
(list).tail->link.next = (elt); \ (list).tail->link.next = (elt); \
else \ } else { \
(list).head = (elt); \ (list).head = (elt); \
} \
(elt)->link.prev = (list).tail; \ (elt)->link.prev = (list).tail; \
(elt)->link.next = NULL; \ (elt)->link.next = NULL; \
(list).tail = (elt); \ (list).tail = (elt); \
@ -88,17 +90,15 @@
#define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \ #define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \
do { \ do { \
if ((elt)->link.next != NULL) \ if ((elt)->link.next != NULL) { \
(elt)->link.next->link.prev = (elt)->link.prev; \ (elt)->link.next->link.prev = (elt)->link.prev; \
else \ } else { \
{ \
ISC_INSIST((list).tail == (elt)); \ ISC_INSIST((list).tail == (elt)); \
(list).tail = (elt)->link.prev; \ (list).tail = (elt)->link.prev; \
} \ } \
if ((elt)->link.prev != NULL) \ if ((elt)->link.prev != NULL) { \
(elt)->link.prev->link.next = (elt)->link.next; \ (elt)->link.prev->link.next = (elt)->link.next; \
else \ } else { \
{ \
ISC_INSIST((list).head == (elt)); \ ISC_INSIST((list).head == (elt)); \
(list).head = (elt)->link.next; \ (list).head = (elt)->link.next; \
} \ } \
@ -124,10 +124,9 @@
#define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \ #define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \
do { \ do { \
if ((before)->link.prev == NULL) \ if ((before)->link.prev == NULL) { \
ISC_LIST_PREPEND(list, elt, link); \ ISC_LIST_PREPEND(list, elt, link); \
else \ } else { \
{ \
(elt)->link.prev = (before)->link.prev; \ (elt)->link.prev = (before)->link.prev; \
(before)->link.prev = (elt); \ (before)->link.prev = (elt); \
(elt)->link.prev->link.next = (elt); \ (elt)->link.prev->link.next = (elt); \
@ -144,10 +143,9 @@
#define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \ #define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \
do { \ do { \
if ((after)->link.next == NULL) \ if ((after)->link.next == NULL) { \
ISC_LIST_APPEND(list, elt, link); \ ISC_LIST_APPEND(list, elt, link); \
else \ } else { \
{ \
(elt)->link.next = (after)->link.next; \ (elt)->link.next = (after)->link.next; \
(after)->link.next = (elt); \ (after)->link.next = (elt); \
(elt)->link.next->link.prev = (elt); \ (elt)->link.next->link.prev = (elt); \
@ -164,10 +162,9 @@
#define ISC_LIST_APPENDLIST(list1, list2, link) \ #define ISC_LIST_APPENDLIST(list1, list2, link) \
do { \ do { \
if (ISC_LIST_EMPTY(list1)) \ if (ISC_LIST_EMPTY(list1)) { \
(list1) = (list2); \ (list1) = (list2); \
else if (!ISC_LIST_EMPTY(list2)) \ } else if (!ISC_LIST_EMPTY(list2)) { \
{ \
(list1).tail->link.next = (list2).head; \ (list1).tail->link.next = (list2).head; \
(list2).head->link.prev = (list1).tail; \ (list2).head->link.prev = (list1).tail; \
(list1).tail = (list2).tail; \ (list1).tail = (list2).tail; \
@ -178,10 +175,9 @@
#define ISC_LIST_PREPENDLIST(list1, list2, link) \ #define ISC_LIST_PREPENDLIST(list1, list2, link) \
do { \ do { \
if (ISC_LIST_EMPTY(list1)) \ if (ISC_LIST_EMPTY(list1)) { \
(list1) = (list2); \ (list1) = (list2); \
else if (!ISC_LIST_EMPTY(list2)) \ } else if (!ISC_LIST_EMPTY(list2)) { \
{ \
(list2).tail->link.next = (list1).head; \ (list2).tail->link.next = (list1).head; \
(list1).head->link.prev = (list2).tail; \ (list1).head->link.prev = (list2).tail; \
(list1).head = (list2).head; \ (list1).head = (list2).head; \

View File

@ -83,10 +83,9 @@
#define GETC16(v, w, d) \ #define GETC16(v, w, d) \
do { \ do { \
GET8(v, w); \ GET8(v, w); \
if (v == 0) \ if (v == 0) { \
d = ISCCC_TRUE; \ d = ISCCC_TRUE; \
else \ } else { \
{ \
d = ISCCC_FALSE; \ d = ISCCC_FALSE; \
if (v == 255) \ if (v == 255) \
GET16(v, w); \ GET16(v, w); \
@ -96,8 +95,9 @@
#define GETC32(v, w) \ #define GETC32(v, w) \
do { \ do { \
GET24(v, w); \ GET24(v, w); \
if (v == 0xffffffu) \ if (v == 0xffffffu) { \
GET32(v, w); \ GET32(v, w); \
} \
} while (0) } while (0)
#define GET_OFFSET(v, w) GET32(v, w) #define GET_OFFSET(v, w) GET32(v, w)
@ -112,11 +112,12 @@
do { \ do { \
GET8(v, w); \ GET8(v, w); \
if (v > 127) { \ if (v > 127) { \
if (v < 255) \ if (v < 255) { \
v = ((v & 0x7f) << 16) | ISCCC_RDATATYPE_SIG; \ v = ((v & 0x7f) << 16) | ISCCC_RDATATYPE_SIG; \
else \ } else { \
GET32(v, w); \ GET32(v, w); \
} \ } \
} \
} while (0) } while (0)
#define PUT8(v, w) \ #define PUT8(v, w) \
@ -164,10 +165,9 @@
#define PUTC16(v, w) \ #define PUTC16(v, w) \
do { \ do { \
if (v > 0 && v < 255) \ if (v > 0 && v < 255) { \
PUT8(v, w); \ PUT8(v, w); \
else \ } else { \
{ \
PUT8(255, w); \ PUT8(255, w); \
PUT16(v, w); \ PUT16(v, w); \
} \ } \
@ -175,10 +175,9 @@
#define PUTC32(v, w) \ #define PUTC32(v, w) \
do { \ do { \
if (v < 0xffffffU) \ if (v < 0xffffffU) { \
PUT24(v, w); \ PUT24(v, w); \
else \ } else { \
{ \
PUT24(0xffffffU, w); \ PUT24(0xffffffU, w); \
PUT32(v, w); \ PUT32(v, w); \
} \ } \