libctf: explicitly cast more size_t types used in printf()s
[external/binutils.git] / libctf / ChangeLog
1 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
2
3         * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
4         (ctf_dump_objts): Likewise.
5         (ctf_dump_funcs): Likewise.
6         (ctf_dump_member): Likewise.
7         (ctf_dump_str): Likewise.
8
9 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
10
11         * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
12         * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
13
14 2019-06-05  Nick Alcock  <nick.alcock@oracle.com>
15
16         * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
17         (ctf_arc_open_by_offset): Likewise.
18         * ctf-create.c (ctf_add_type): Likewise.
19
20 2019-06-04  Tom Tromey  <tromey@adacore.com>
21
22         * ctf-create.c (ctf_add_encoded, ctf_add_slice)
23         (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
24
25 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
26
27         * configure.ac: Check for O_CLOEXEC.
28         * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
29         * config.h.in: Regenerate.
30         * configure: Likewise.
31
32 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
33
34         * qsort_r.c: Rename to...
35         * ctf-qsort_r.c: ... this.
36         (_quicksort): Define to ctf_qsort_r.
37         * ctf-decls.h (qsort_r): Remove.
38         (ctf_qsort_r): Add.
39         (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
40         (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
41         * Makefile.am (libctf_a_LIBADD): Remove.
42         (libctf_a_SOURCES): New, add ctf-qsort_r.c.
43         * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
44         * ctf-create.c (ctf_update): Likewise.
45         * configure.ac: Check for BSD versus GNU qsort_r signature.
46         * Makefile.in: Regenerate.
47         * config.h.in: Likewise.
48         * configure: Likewise.
49
50 2019-06-03  Nick Alcock  <nick.alcock@oracle.com>
51
52         * ctf-dump.c (ctf_dump_funcs): Free in the right place.
53
54 2019-05-29  Nick Alcock  <nick.alcock@oracle.com>
55
56         * Makefile.am (ZLIB): New.
57         (ZLIBINC): Likewise.
58         (AM_CFLAGS): Use them.
59         (libctf_a_LIBADD): New, for LIBOBJS.
60         * configure.ac: Check for zlib, endian.h, and qsort_r.
61         * ctf-endian.h: New, providing htole64 and le64toh.
62         * swap.h: Code style fixes.
63         (bswap_identity_64): New.
64         * qsort_r.c: New, from gnulib (with one added #include).
65         * ctf-decls.h: New, providing a conditional qsort_r declaration,
66         and unconditional definitions of MIN and MAX.
67         * ctf-impl.h: Use it.  Do not use <sys/errno.h>.
68         (ctf_set_errno): Now returns unsigned long.
69         * ctf-util.c (ctf_set_errno): Adjust here too.
70         * ctf-archive.c: Use ctf-endian.h.
71         (ctf_arc_open_by_offset): Use memset, not bzero.  Drop cts_type,
72         cts_flags and cts_offset.
73         (ctf_arc_write): Drop debugging dependent on the size of off_t.
74         * ctf-create.c: Provide a definition of roundup if not defined.
75         (ctf_create): Drop cts_type, cts_flags and cts_offset.
76         (ctf_add_reftype): Do not check if type IDs are below zero.
77         (ctf_add_slice): Likewise.
78         (ctf_add_typedef): Likewise.
79         (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
80         when known error-free.  Drop CTF_ERR usage for functions returning
81         int.
82         (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
83         int.
84         (ctf_add_variable): Likewise.
85         (enumcmp): Likewise.
86         (enumadd): Likewise.
87         (membcmp): Likewise.
88         (ctf_add_type): Likewise.  Cast error-returning ssize_t's to size_t
89         when known error-free.
90         * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
91         returning int: use CTF_ERR for functions returning ctf_type_id.
92         (ctf_dump_label): Likewise.
93         (ctf_dump_objts): Likewise.
94         * ctf-labels.c (ctf_label_topmost): Likewise.
95         (ctf_label_iter): Likewise.
96         (ctf_label_info): Likewise.
97         * ctf-lookup.c (ctf_func_args): Likewise.
98         * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
99         (ctf_bufopen): Likewise.  Use zlib types as needed.
100         * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
101         returning int.
102         (ctf_enum_iter): Likewise.
103         (ctf_type_size): Likewise.
104         (ctf_type_align): Likewise.  Cast to size_t where appropriate.
105         (ctf_type_kind_unsliced): Likewise.
106         (ctf_type_kind): Likewise.
107         (ctf_type_encoding): Likewise.
108         (ctf_member_info): Likewise.
109         (ctf_array_info): Likewise.
110         (ctf_enum_value): Likewise.
111         (ctf_type_rvisit): Likewise.
112         * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
113         cts_offset.
114         (ctf_simple_open): Likewise.
115         (ctf_bfdopen_ctfsect): Likewise.  Set cts_size properly.
116         * Makefile.in: Regenerate.
117         * aclocal.m4: Likewise.
118         * config.h: Likewise.
119         * configure: Likewise.
120
121 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
122
123         * configure.in: Check for bfd_section_from_elf_index.
124         * configure: Regenerate.
125         * config.h.in [HAVE_BFD_ELF]: Likewise.
126         * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
127         abfd is potentially unused now.
128
129 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
130
131         * Makefile.am: New.
132         * Makefile.in: Regenerated.
133         * config.h.in: Likewise.
134         * aclocal.m4: Likewise.
135         * configure: Likewise.
136
137 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
138
139         * ctf-dump.c: New.
140
141 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
142
143         * ctf-labels.c: New.
144
145 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
146
147         * ctf-impl.h (_libctf_version): New declaration.
148         * ctf-subr.c (_libctf_version): Define it.
149         (ctf_version): New.
150
151 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
152
153         * ctf-create.c (enumcmp): New.
154         (enumadd): Likewise.
155         (membcmp): Likewise.
156         (membadd): Likewise.
157         (ctf_add_type): Likewise.
158
159 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
160
161         * ctf-lookup.c (isqualifier): New.
162         (ctf_lookup_by_name): Likewise.
163         (struct ctf_lookup_var_key): Likewise.
164         (ctf_lookup_var): Likewise.
165         (ctf_lookup_variable): Likewise.
166         (ctf_lookup_symbol_name): Likewise.
167         (ctf_lookup_by_symbol): Likewise.
168         (ctf_func_info): Likewise.
169         (ctf_func_args): Likewise.
170
171 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
172
173         * ctf-decl.c: New file.
174         * ctf-types.c: Likewise.
175         * ctf-impl.h: New declarations.
176
177 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
178
179         * ctf-open-bfd.c: New file.
180         * ctf-open.c (ctf_close): New.
181         * ctf-impl.h: Include bfd.h.
182         (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
183         (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
184         ctfi_bfd_close.
185         (ctf_bfdopen_ctfsect): New declaration.
186         (_CTF_SECTION): likewise.
187
188 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
189
190         * ctf-archive.c: New.
191         * ctf-impl.h (ctf_archive_internal): New type.
192         (ctf_arc_open_internal): New declaration.
193         (ctf_arc_bufopen): Likewise.
194         (ctf_arc_close_internal): Likewise.
195
196 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
197
198         * ctf-open.c: New file.
199         * swap.h: Likewise.
200
201 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
202
203         * ctf-create.c: New file.
204         * ctf-lookup.c: New file.
205
206 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
207
208         * ctf-impl.h: New definitions and declarations for type creation
209         and lookup.
210
211 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
212
213         * ctf-hash.c: New file.
214         * ctf-impl.h: New declarations.
215
216 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
217
218         * ctf-error.c: New file.
219
220 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
221
222         * ctf-util.c: New file.
223         * elf.h: Likewise.
224         * ctf-impl.h: Include it, and add declarations.
225
226 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
227
228         * ctf-impl.h: New file.
229         * ctf-subr.c: New file.
230
231 \f
232 Local Variables:
233 mode: change-log
234 left-margin: 8
235 fill-column: 76
236 version-control: never
237 End: