aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-dedup.c
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-03-18 12:37:52 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-03-18 12:37:55 +0000
commiteefe721eadf78a5f68c38ea9ca0272c7be06e0c0 (patch)
treeb075dbafc64ff850a17786341a673a75c752925b /libctf/ctf-dedup.c
parentb9a964318a73b9a8540c5c85ab7f3bea3d9d8db5 (diff)
downloadgdb-eefe721eadf78a5f68c38ea9ca0272c7be06e0c0.zip
gdb-eefe721eadf78a5f68c38ea9ca0272c7be06e0c0.tar.gz
gdb-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/ctf-dedup.c')
-rw-r--r--libctf/ctf-dedup.c67
1 files changed, 35 insertions, 32 deletions
diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c
index ef8507a..9f5ba90 100644
--- a/libctf/ctf-dedup.c
+++ b/libctf/ctf-dedup.c
@@ -589,7 +589,8 @@ ctf_dedup_rhash_type (ctf_dict_t *fp, ctf_dict_t *input, ctf_dict_t **inputs,
goto oom; \
if (ctf_dynset_cinsert (citers, hval) < 0) \
goto oom; \
- } while (0)
+ } \
+ while (0)
/* If this is a named struct or union or a forward to one, and this is a child
traversal, treat this type as if it were a forward -- do not recurse to
@@ -2029,42 +2030,44 @@ ctf_dedup_rwalk_one_output_mapping (ctf_dict_t *output,
times, which is worse. */
#define CTF_TYPE_WALK(type, errlabel, errmsg) \
- do { \
- void *type_id; \
- const char *hashval; \
- int cited_type_input_num = input_num; \
+ do \
+ { \
+ void *type_id; \
+ const char *hashval; \
+ int cited_type_input_num = input_num; \
\
- if ((fp->ctf_flags & LCTF_CHILD) && (LCTF_TYPE_ISPARENT (fp, type))) \
- cited_type_input_num = parents[input_num]; \
+ if ((fp->ctf_flags & LCTF_CHILD) && (LCTF_TYPE_ISPARENT (fp, type))) \
+ cited_type_input_num = parents[input_num]; \
\
- type_id = CTF_DEDUP_GID (output, cited_type_input_num, type); \
+ type_id = CTF_DEDUP_GID (output, cited_type_input_num, type); \
\
- if (type == 0) \
- { \
- ctf_dprintf ("Walking: unimplemented type\n"); \
- break; \
- } \
+ if (type == 0) \
+ { \
+ ctf_dprintf ("Walking: unimplemented type\n"); \
+ break; \
+ } \
\
- ctf_dprintf ("Looking up ID %i/%lx in type hashes\n", \
- cited_type_input_num, type); \
- hashval = ctf_dynhash_lookup (d->cd_type_hashes, type_id); \
- if (!ctf_assert (output, hashval)) \
- { \
- whaterr = N_("error looking up ID in type hashes"); \
- goto errlabel; \
- } \
- ctf_dprintf ("ID %i/%lx has hash %s\n", cited_type_input_num, type, \
- hashval); \
+ ctf_dprintf ("Looking up ID %i/%lx in type hashes\n", \
+ cited_type_input_num, type); \
+ hashval = ctf_dynhash_lookup (d->cd_type_hashes, type_id); \
+ if (!ctf_assert (output, hashval)) \
+ { \
+ whaterr = N_("error looking up ID in type hashes"); \
+ goto errlabel; \
+ } \
+ ctf_dprintf ("ID %i/%lx has hash %s\n", cited_type_input_num, type, \
+ hashval); \
\
- ret = ctf_dedup_rwalk_output_mapping (output, inputs, ninputs, parents, \
- already_visited, hashval, \
- visit_fun, arg, depth); \
- if (ret < 0) \
- { \
- whaterr = errmsg; \
- goto errlabel; \
- } \
- } while (0)
+ ret = ctf_dedup_rwalk_output_mapping (output, inputs, ninputs, parents, \
+ already_visited, hashval, \
+ visit_fun, arg, depth); \
+ if (ret < 0) \
+ { \
+ whaterr = errmsg; \
+ goto errlabel; \
+ } \
+ } \
+ while (0)
switch (ctf_type_kind_unsliced (fp, type))
{