diff options
author | Alan Modra <amodra@gmail.com> | 2004-03-15 13:17:38 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-03-15 13:17:38 +0000 |
commit | 471ca1e1e41c0cc47cd2045f112bf020b498c84b (patch) | |
tree | 69c2523235df3a00a3030fa4f3b3bf90a8ca4d0d /bfd/bfd-in2.h | |
parent | 3c342aed9abdd2f4426714b704d3bcbaaac5cb76 (diff) | |
download | binutils-gdb-471ca1e1e41c0cc47cd2045f112bf020b498c84b.tar.gz |
* bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
(bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
(bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
(bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
(bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
* libbfd.c: Likewise in function definitions.
(bfd_put_8): Mask with 0xff rather than casting to char.
(bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
(H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
(H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
* libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
(H_GET_64, H_GET_32, H_GET_16): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
* archive.c (do_slurp_coff_armap): Update swap prototype.
* coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
(tic54x_getl_signed_32): Likewise.
(tic54x_putl32): Likewise. Mask with 0xff rather than casting to char.
* mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
* pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
(bfd_getp_signed_32, bfd_putp32): Likewise.
* targets.c (struct bfd_target): Use void* in place of bfd_byte* for
bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
bfd_h_getx_signed_16, bfd_h_putx16.
* aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
* hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 142 |
1 files changed, 57 insertions, 85 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 74bbccdac48..ee5a8fd8266 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -525,29 +525,29 @@ extern bfd_boolean bfd_record_phdr /* Byte swapping routines. */ -bfd_vma bfd_getb64 (const unsigned char *); -bfd_vma bfd_getl64 (const unsigned char *); -bfd_signed_vma bfd_getb_signed_64 (const unsigned char *); -bfd_signed_vma bfd_getl_signed_64 (const unsigned char *); -bfd_vma bfd_getb32 (const unsigned char *); -bfd_vma bfd_getl32 (const unsigned char *); -bfd_signed_vma bfd_getb_signed_32 (const unsigned char *); -bfd_signed_vma bfd_getl_signed_32 (const unsigned char *); -bfd_vma bfd_getb16 (const unsigned char *); -bfd_vma bfd_getl16 (const unsigned char *); -bfd_signed_vma bfd_getb_signed_16 (const unsigned char *); -bfd_signed_vma bfd_getl_signed_16 (const unsigned char *); -void bfd_putb64 (bfd_vma, unsigned char *); -void bfd_putl64 (bfd_vma, unsigned char *); -void bfd_putb32 (bfd_vma, unsigned char *); -void bfd_putl32 (bfd_vma, unsigned char *); -void bfd_putb16 (bfd_vma, unsigned char *); -void bfd_putl16 (bfd_vma, unsigned char *); +bfd_vma bfd_getb64 (const void *); +bfd_vma bfd_getl64 (const void *); +bfd_signed_vma bfd_getb_signed_64 (const void *); +bfd_signed_vma bfd_getl_signed_64 (const void *); +bfd_vma bfd_getb32 (const void *); +bfd_vma bfd_getl32 (const void *); +bfd_signed_vma bfd_getb_signed_32 (const void *); +bfd_signed_vma bfd_getl_signed_32 (const void *); +bfd_vma bfd_getb16 (const void *); +bfd_vma bfd_getl16 (const void *); +bfd_signed_vma bfd_getb_signed_16 (const void *); +bfd_signed_vma bfd_getl_signed_16 (const void *); +void bfd_putb64 (bfd_vma, void *); +void bfd_putl64 (bfd_vma, void *); +void bfd_putb32 (bfd_vma, void *); +void bfd_putl32 (bfd_vma, void *); +void bfd_putb16 (bfd_vma, void *); +void bfd_putl16 (bfd_vma, void *); /* Byte swapping routines which take size and endiannes as arguments. */ -bfd_vma bfd_get_bits (bfd_byte *, int, bfd_boolean); -void bfd_put_bits (bfd_vma, bfd_byte *, int, bfd_boolean); +bfd_vma bfd_get_bits (const void *, int, bfd_boolean); +void bfd_put_bits (bfd_vma, void *, int, bfd_boolean); /* Externally visible ECOFF routines. */ @@ -873,7 +873,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Byte swapping macros for user section data. */ #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) + ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ @@ -961,52 +961,24 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) -/* Refinements on the above, which should eventually go away. Save - cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ - -#define H_PUT_64(abfd, val, where) \ - bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_32(abfd, val, where) \ - bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_16(abfd, val, where) \ - bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_8 bfd_h_put_8 - -#define H_PUT_S64(abfd, val, where) \ - bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S32(abfd, val, where) \ - bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S16(abfd, val, where) \ - bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S8 bfd_h_put_signed_8 - -#define H_GET_64(abfd, where) \ - bfd_h_get_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_32(abfd, where) \ - bfd_h_get_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_16(abfd, where) \ - bfd_h_get_16 ((abfd), (bfd_byte *) (where)) - -#define H_GET_8 bfd_h_get_8 - -#define H_GET_S64(abfd, where) \ - bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S32(abfd, where) \ - bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S16(abfd, where) \ - bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S8 bfd_h_get_signed_8 +/* Aliases for the above, which should eventually go away. */ + +#define H_PUT_64 bfd_h_put_64 +#define H_PUT_32 bfd_h_put_32 +#define H_PUT_16 bfd_h_put_16 +#define H_PUT_8 bfd_h_put_8 +#define H_PUT_S64 bfd_h_put_signed_64 +#define H_PUT_S32 bfd_h_put_signed_32 +#define H_PUT_S16 bfd_h_put_signed_16 +#define H_PUT_S8 bfd_h_put_signed_8 +#define H_GET_64 bfd_h_get_64 +#define H_GET_32 bfd_h_get_32 +#define H_GET_16 bfd_h_get_16 +#define H_GET_8 bfd_h_get_8 +#define H_GET_S64 bfd_h_get_signed_64 +#define H_GET_S32 bfd_h_get_signed_32 +#define H_GET_S16 bfd_h_get_signed_16 +#define H_GET_S8 bfd_h_get_signed_8 /* Extracted from bfdio.c. */ @@ -4128,26 +4100,26 @@ typedef struct bfd_target /* Entries for byte swapping for data. These are different from the other entry points, since they don't take a BFD asthe first argument. Certain other handlers could do the same. */ - bfd_vma (*bfd_getx64) (const bfd_byte *); - bfd_signed_vma (*bfd_getx_signed_64) (const bfd_byte *); - void (*bfd_putx64) (bfd_vma, bfd_byte *); - bfd_vma (*bfd_getx32) (const bfd_byte *); - bfd_signed_vma (*bfd_getx_signed_32) (const bfd_byte *); - void (*bfd_putx32) (bfd_vma, bfd_byte *); - bfd_vma (*bfd_getx16) (const bfd_byte *); - bfd_signed_vma (*bfd_getx_signed_16) (const bfd_byte *); - void (*bfd_putx16) (bfd_vma, bfd_byte *); + bfd_vma (*bfd_getx64) (const void *); + bfd_signed_vma (*bfd_getx_signed_64) (const void *); + void (*bfd_putx64) (bfd_vma, void *); + bfd_vma (*bfd_getx32) (const void *); + bfd_signed_vma (*bfd_getx_signed_32) (const void *); + void (*bfd_putx32) (bfd_vma, void *); + bfd_vma (*bfd_getx16) (const void *); + bfd_signed_vma (*bfd_getx_signed_16) (const void *); + void (*bfd_putx16) (bfd_vma, void *); /* Byte swapping for the headers. */ - bfd_vma (*bfd_h_getx64) (const bfd_byte *); - bfd_signed_vma (*bfd_h_getx_signed_64) (const bfd_byte *); - void (*bfd_h_putx64) (bfd_vma, bfd_byte *); - bfd_vma (*bfd_h_getx32) (const bfd_byte *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const bfd_byte *); - void (*bfd_h_putx32) (bfd_vma, bfd_byte *); - bfd_vma (*bfd_h_getx16) (const bfd_byte *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const bfd_byte *); - void (*bfd_h_putx16) (bfd_vma, bfd_byte *); + bfd_vma (*bfd_h_getx64) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_64) (const void *); + void (*bfd_h_putx64) (bfd_vma, void *); + bfd_vma (*bfd_h_getx32) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); + void (*bfd_h_putx32) (bfd_vma, void *); + bfd_vma (*bfd_h_getx16) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); + void (*bfd_h_putx16) (bfd_vma, void *); /* Format dependent routines: these are vectors of entry points within the target vector structure, one for each format to check. */ |