diff options
author | Alan Modra <amodra@gmail.com> | 2023-08-07 14:40:35 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-08-09 08:48:09 +0930 |
commit | 226f9f4fadb087875ef98a0a55d614236c6241b3 (patch) | |
tree | e6c63b104143dd86acf739d5633649582668224e /bfd/peicode.h | |
parent | feddea4b466ce4f2bb2301fd2d4bef56e8d09ccc (diff) | |
download | gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.zip gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.gz gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.bz2 |
Rename bfd_bread and bfd_bwrite
These were renamed from bfd_read and bfd_write back in 2001 when they
lost an unnecessary parameter. Rename them back, and get rid of a few
casts that are only needed without prototyped functions (K&R C).
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r-- | bfd/peicode.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index e2e2be6..2cd020e 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -1187,7 +1187,7 @@ pe_ILF_object_p (bfd * abfd) /* Upon entry the first six bytes of the ILF header have already been read. Now read the rest of the header. */ - if (bfd_bread (buffer, (bfd_size_type) 14, abfd) != 14) + if (bfd_read (buffer, 14, abfd) != 14) return NULL; ptr = buffer; @@ -1449,8 +1449,8 @@ pe_bfd_object_p (bfd * abfd) /* Detect if this a Microsoft Import Library Format element. */ /* First read the beginning of the header. */ - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_bread (buffer, (bfd_size_type) 6, abfd) != 6) + if (bfd_seek (abfd, 0, SEEK_SET) != 0 + || bfd_read (buffer, 6, abfd) != 6) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1462,9 +1462,8 @@ pe_bfd_object_p (bfd * abfd) && H_GET_16 (abfd, buffer + 4) == 0) return pe_ILF_object_p (abfd); - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd) - != sizeof (dos_hdr)) + if (bfd_seek (abfd, 0, SEEK_SET) != 0 + || bfd_read (&dos_hdr, sizeof (dos_hdr), abfd) != sizeof (dos_hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1489,8 +1488,7 @@ pe_bfd_object_p (bfd * abfd) offset = H_GET_32 (abfd, dos_hdr.e_lfanew); if (bfd_seek (abfd, offset, SEEK_SET) != 0 - || (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd) - != sizeof (image_hdr))) + || bfd_read (&image_hdr, sizeof (image_hdr), abfd) != sizeof (image_hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); |