diff options
author | Alan Modra <amodra@gmail.com> | 2003-06-29 10:06:40 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-06-29 10:06:40 +0000 |
commit | c58b95236ce4c9345c4fa76e7ef16762e5229380 (patch) | |
tree | 332a115744ba45143797b861b78058e6f42fb995 /bfd/bfdwin.c | |
parent | 58611256d83c4bd2c27a88982d8449c99fdd154f (diff) | |
download | gdb-c58b95236ce4c9345c4fa76e7ef16762e5229380.zip gdb-c58b95236ce4c9345c4fa76e7ef16762e5229380.tar.gz gdb-c58b95236ce4c9345c4fa76e7ef16762e5229380.tar.bz2 |
Convert to C90 and a few tweaks.
Diffstat (limited to 'bfd/bfdwin.c')
-rw-r--r-- | bfd/bfdwin.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/bfd/bfdwin.c b/bfd/bfdwin.c index 442a8a4..00d1a14 100644 --- a/bfd/bfdwin.c +++ b/bfd/bfdwin.c @@ -52,7 +52,7 @@ INTERNAL_DEFINITION .struct _bfd_window_internal { . struct _bfd_window_internal *next; -. PTR data; +. void *data; . bfd_size_type size; . int refcount : 31; {* should be enough... *} . unsigned mapped : 1; {* 1 = mmap, 0 = malloc *} @@ -60,8 +60,7 @@ INTERNAL_DEFINITION */ void -bfd_init_window (windowp) - bfd_window *windowp; +bfd_init_window (bfd_window *windowp) { windowp->data = 0; windowp->i = 0; @@ -69,8 +68,7 @@ bfd_init_window (windowp) } void -bfd_free_window (windowp) - bfd_window *windowp; +bfd_free_window (bfd_window *windowp) { bfd_window_internal *i = windowp->i; windowp->i = 0; @@ -108,12 +106,11 @@ bfd_free_window (windowp) static int ok_to_map = 1; bfd_boolean -bfd_get_file_window (abfd, offset, size, windowp, writable) - bfd *abfd; - file_ptr offset; - bfd_size_type size; - bfd_window *windowp; - bfd_boolean writable; +bfd_get_file_window (bfd *abfd, + file_ptr offset, + bfd_size_type size, + bfd_window *windowp, + bfd_boolean writable) { static size_t pagesize; bfd_window_internal *i = windowp->i; @@ -133,8 +130,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) if (i == 0) { - i = ((bfd_window_internal *) - bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); + i = bfd_zmalloc (sizeof (bfd_window_internal)); windowp->i = i; if (i == 0) return FALSE; @@ -180,7 +176,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) ? MAP_FILE | MAP_PRIVATE : MAP_FILE | MAP_SHARED), fd, file_offset); - if (i->data == (PTR) -1) + if (i->data == (void *) -1) { /* An error happened. Report it, or try using malloc, or something. */ @@ -195,7 +191,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n", (long) real_size, i->data, (long) offset2); i->size = real_size; - windowp->data = (PTR) ((bfd_byte *) i->data + offset2); + windowp->data = (bfd_byte *) i->data + offset2; windowp->size = size; i->mapped = 1; return TRUE; @@ -222,7 +218,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable) if (debug_windows) fprintf (stderr, "\n\t%s(%6ld)", i->data ? "realloc" : " malloc", (long) size_to_alloc); - i->data = (PTR) bfd_realloc (i->data, size_to_alloc); + i->data = bfd_realloc (i->data, size_to_alloc); if (debug_windows) fprintf (stderr, "\t-> %p\n", i->data); i->refcount = 1; |