From ac36e134d96fa71a2f5c141058e06b57bcc72136 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Thu, 18 Feb 2021 17:03:28 +0000 Subject: libctf: reimplement many _iter iterators in terms of _next Ever since the generator-style _next iterators were introduced, there have been separate implementations of the functional-style _iter iterators that do the same thing as _next. This is annoying and adds more dependencies on the internal guts of the file format. Rip them all out and replace them with the corresponding _next iterators. Only ctf_archive_raw_iter and ctf_label_iter survive, the former because there is no access to the raw binary data of archives via any _next iterator, and the latter because ctf_label_next hasn't been implemented (because labels are currently not used for anything). Tested by reverting the change (already applied) that reimplemented ctf_member_iter in terms of ctf_member_next, then verifying that the _iter and _next iterators produced the same results for every iterable entity within a large type archive. libctf/ChangeLog 2021-03-02 Nick Alcock * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope. (ctf_enum_iter): Reimplement in terms of ctf_enum_next. (ctf_type_iter): Reimplement in terms of ctf_type_next. (ctf_type_iter_all): Likewise. (ctf_variable_iter): Reimplement in terms of ctf_variable_next. * ctf-archive.c (ctf_archive_iter_internal): Remove. (ctf_archive_iter): Reimplement in terms of ctf_archive_next. --- libctf/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libctf/ChangeLog') diff --git a/libctf/ChangeLog b/libctf/ChangeLog index db44cae..c639fdd 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,15 @@ 2021-03-02 Nick Alcock + * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope. + (ctf_enum_iter): Reimplement in terms of ctf_enum_next. + (ctf_type_iter): Reimplement in terms of ctf_type_next. + (ctf_type_iter_all): Likewise. + (ctf_variable_iter): Reimplement in terms of ctf_variable_next. + * ctf-archive.c (ctf_archive_iter_internal): Remove. + (ctf_archive_iter): Reimplement in terms of ctf_archive_next. + +2021-03-02 Nick Alcock + * ctf-archive.c (ctf_archive_next): Set the name of parents in single-member archives. -- cgit v1.1