]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fixup the missing clang-format bits
authorOndřej Surý <ondrej@sury.org>
Sun, 16 Feb 2020 16:34:24 +0000 (17:34 +0100)
committerOndřej Surý <ondrej@sury.org>
Sun, 16 Feb 2020 16:34:24 +0000 (17:34 +0100)
bin/dig/dig.c
lib/dns/message.c
lib/dns/name.c
lib/isc/include/isc/list.h
lib/isccc/include/isccc/util.h

index bbe2fdfea594053941f3a7a91f21ed95fbd689f4..c447aab77f8f756c87d7b072cbb6efb388c022d2 100644 (file)
 #include <dig/dig.h>
 #include <pk11/site.h>
 
-#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
index 9c632adae3742c1251c7ffe9f7fe1151532e3f95..4e4d692a479f5c8563adb6ba549bf25a8fec96f3 100644 (file)
@@ -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;        \
                }                            \
index 73280d06b49ec540fc4e48caa897176a2a3a9985..831b534fb1df3bba92146d06df19f08787b7d5c7 100644 (file)
@@ -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);     \
        }
index cc38680b44175073da99da860aca930685bf80ad..e686c9ba991fb6d36d3d8582606bb362d4a931f7 100644 (file)
 
 #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);                    \
 
 #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);                    \
 
 #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;                 \
                }                                                       \
 
 #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);    \
 
 #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);   \
 
 #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;            \
 
 #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;            \
index f59e9b20b1df8ef2e70a5c99515ce2f4cdbb0da0..f74c1604239e7b86ae4253f5077b799c6839f9fe 100644 (file)
 #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)
        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)
 
                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);         \
                }                            \