aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-04-19 13:35:48 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-04-19 13:35:48 +0000
commit7e4db2548b0addbad6ccc104885dd3adbbe9b0c9 (patch)
tree301c539a6114bc3f6362a775b0c829b0425fd691 /bfd/libbfd.c
parent512e5f946970e66f44261bf4364804d73acb7f6d (diff)
downloadgdb-7e4db2548b0addbad6ccc104885dd3adbbe9b0c9.zip
gdb-7e4db2548b0addbad6ccc104885dd3adbbe9b0c9.tar.gz
gdb-7e4db2548b0addbad6ccc104885dd3adbbe9b0c9.tar.bz2
* libbfd.c: bfd_put*: Remove casts to bfd_vma.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r--bfd/libbfd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index aa5e6af..61cdeef 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -405,6 +405,14 @@ DESCRIPTION
around in macros--for example libaout.h defines GET_WORD to
either bfd_get_32 or bfd_get_64.
+ In the put routines, val must be a bfd_vma. If we are on a
+ system without prototypes, the caller is responsible for making
+ sure that is true, with a cast if necessary. We don't cast
+ them in the macro definitions because that would prevent lint
+ or gcc -Wall from detecting sins such as passing a pointer.
+ To detect calling these with less than a bfd_vma, use gcc
+ -Wconversion on a host with 64 bit bfd_vma's.
+
.#define bfd_put_8(abfd, val, ptr) \
. (*((unsigned char *)ptr) = (unsigned char)val)
.#define bfd_put_signed_8(abfd, val, ptr) (*((char *)(ptr)) = (char)(val))
@@ -412,21 +420,21 @@ DESCRIPTION
. (*((unsigned char *)(ptr)))
.#define bfd_get_signed_8(abfd, ptr) (((*(char *)(ptr) ^ 0x80) & 0xff) - 0x80)
.#define bfd_put_16(abfd, val, ptr) \
-. BFD_SEND(abfd, bfd_putx16, ((bfd_vma)(val),(ptr)))
+. BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
.#define bfd_put_signed_16 bfd_put_16
.#define bfd_get_16(abfd, ptr) \
. BFD_SEND(abfd, bfd_getx16, (ptr))
.#define bfd_get_signed_16(abfd, ptr) \
. BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
.#define bfd_put_32(abfd, val, ptr) \
-. BFD_SEND(abfd, bfd_putx32, ((bfd_vma)(val),(ptr)))
+. BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
.#define bfd_put_signed_32 bfd_put_32
.#define bfd_get_32(abfd, ptr) \
. BFD_SEND(abfd, bfd_getx32, (ptr))
.#define bfd_get_signed_32(abfd, ptr) \
. BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
.#define bfd_put_64(abfd, val, ptr) \
-. BFD_SEND(abfd, bfd_putx64, ((bfd_vma)(val), (ptr)))
+. BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
.#define bfd_put_signed_64 bfd_put_64
.#define bfd_get_64(abfd, ptr) \
. BFD_SEND(abfd, bfd_getx64, (ptr))