diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-03-25 11:03:27 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-03-25 11:03:27 +0000 |
commit | 212c5244ec13e693d6fb68834be9adc4f02974e0 (patch) | |
tree | c20e4d409c5af8cbdcca26090a45ed91ec922007 /libctf/ctf-open.c | |
parent | bc62419e91f4ab6e78d8a33c789b8495e652d5c7 (diff) | |
download | binutils-212c5244ec13e693d6fb68834be9adc4f02974e0.zip binutils-212c5244ec13e693d6fb68834be9adc4f02974e0.tar.gz binutils-212c5244ec13e693d6fb68834be9adc4f02974e0.tar.bz2 |
libctf: prefixed kinds: reduce repetition, fix info/kind confusion
The LCTF_ macros are fairly poorly named to start with, but the number of
times we had to repeat LCTF_IS_PREFIXED_KIND (LCTF_INFO_UNPREFIXED_KIND...)
was ridiculous, and half the time we forgot the latter part and ended up
testing a full info word against a kind (which is unlikely to work).
Replace with a new LCTF_IS_PREFIXED_INFO that does the right thing.
Diffstat (limited to 'libctf/ctf-open.c')
-rw-r--r-- | libctf/ctf-open.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c index 8796479..e7a252f 100644 --- a/libctf/ctf-open.c +++ b/libctf/ctf-open.c @@ -108,7 +108,7 @@ get_prefixed_kind_v4 (const ctf_type_t *tp) { /* Resolve away as many prefixes as exist. */ - while (LCTF_IS_PREFIXED_KIND (tp->ctt_info)) + while (LCTF_IS_PREFIXED_INFO (tp->ctt_info)) tp++; return CTF_INFO_KIND (tp->ctt_info); @@ -133,11 +133,11 @@ get_prefixed_vlen_v4 (const ctf_type_t *tp) /* Resolve away non-BIG prefixes (which have no affect on vlen). */ - while (LCTF_IS_PREFIXED_KIND (tp->ctt_info) + while (LCTF_IS_PREFIXED_INFO (tp->ctt_info) && CTF_INFO_KIND (tp->ctt_info) != CTF_K_BIG) tp++; - if (!LCTF_IS_PREFIXED_KIND (CTF_INFO_KIND (tp->ctt_info))) + if (!LCTF_IS_PREFIXED_INFO (tp->ctt_info)) return (CTF_INFO_VLEN (tp->ctt_info)); suffix = tp + 1; @@ -229,7 +229,7 @@ get_ctt_size_v4 (const ctf_dict_t *fp _libctf_unused_, const ctf_type_t *tp, if (incrementp) *incrementp = 0; - while (LCTF_IS_PREFIXED_KIND (tp->ctt_info)) + while (LCTF_IS_PREFIXED_INFO (tp->ctt_info)) { if (CTF_INFO_KIND (tp->ctt_info) == CTF_K_BIG) size = ((ssize_t) tp->ctt_size) << 32; @@ -851,7 +851,7 @@ init_static_types_names_internal (ctf_dict_t *fp, ctf_header_t *cth, int is_btf, /* Prefixed type: pull off the prefixes (for most purposes). (We already know the prefixes cannot overflow.) */ - while (LCTF_IS_PREFIXED_KIND (LCTF_INFO_UNPREFIXED_KIND (fp, suffix->ctt_info))) + while (LCTF_IS_PREFIXED_INFO (suffix->ctt_info)) { if (is_btf) return ECTF_CORRUPT; |