diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2021-03-18 12:37:52 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-03-18 12:37:55 +0000 |
commit | eefe721eadf78a5f68c38ea9ca0272c7be06e0c0 (patch) | |
tree | b075dbafc64ff850a17786341a673a75c752925b /libctf/swap.h | |
parent | b9a964318a73b9a8540c5c85ab7f3bea3d9d8db5 (diff) | |
download | binutils-eefe721eadf78a5f68c38ea9ca0272c7be06e0c0.zip binutils-eefe721eadf78a5f68c38ea9ca0272c7be06e0c0.tar.gz binutils-eefe721eadf78a5f68c38ea9ca0272c7be06e0c0.tar.bz2 |
libctf: fix GNU style for do {} while
It's formatted like this:
do
{
...
}
while (...);
Not like this:
do
{
...
} while (...);
or this:
do {
...
} while (...);
We used both in various places in libctf. Fixing it necessitated some
light reindentation.
libctf/ChangeLog
2021-03-18 Nick Alcock <nick.alcock@oracle.com>
* ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
* ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
(ctf_dedup_rwalk_one_output_mapping): Likewise.
* ctf-dump.c (ctf_dump_format_type): Likewise.
* ctf-lookup.c (ctf_symbol_next): Likewise.
* swap.h (swap_thing): Likewise.
Diffstat (limited to 'libctf/swap.h')
-rw-r--r-- | libctf/swap.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libctf/swap.h b/libctf/swap.h index d7cc993..4d0b48c 100644 --- a/libctf/swap.h +++ b/libctf/swap.h @@ -73,18 +73,20 @@ bswap_64 (uint64_t v) /* Swap the endianness of something. */ #define swap_thing(x) \ - do { \ - _Static_assert (sizeof (x) == 1 || (sizeof (x) % 2 == 0 \ - && sizeof (x) <= 8), \ - "Invalid size, update endianness code"); \ - switch (sizeof (x)) { \ - case 2: x = bswap_16 (x); break; \ - case 4: x = bswap_32 (x); break; \ - case 8: x = bswap_64 (x); break; \ - case 1: /* Nothing needs doing */ \ - break; \ + do \ + { \ + _Static_assert (sizeof (x) == 1 || (sizeof (x) % 2 == 0 \ + && sizeof (x) <= 8), \ + "Invalid size, update endianness code"); \ + switch (sizeof (x)) { \ + case 2: x = bswap_16 (x); break; \ + case 4: x = bswap_32 (x); break; \ + case 8: x = bswap_64 (x); break; \ + case 1: /* Nothing needs doing */ \ + break; \ + } \ } \ - } while (0); + while (0); #endif /* !defined(_CTF_SWAP_H) */ |