summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-11-20 02:09:56 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-11-20 02:09:56 +0000
commit1dcdda88894990e91dd2fadf966a9aafe8333447 (patch)
tree9546528b3aec1355bdbf4d598c275800928377f3 /bfd
parente67d01d8a631ddf16b590e0c13074401311a8e2f (diff)
downloadgdb-1dcdda88894990e91dd2fadf966a9aafe8333447.tar.gz
* bfd-in.h (struct stat): Don't typedef.
* bfdio.c (bfd_get_size): Return a file_ptr. * cisco-core.c (cisco_core_file_validate): Use bfd_size_type for nread. * mmo.c (mmo_scan): Use file_ptr for curpos. * trad-core.c (trad_unix_core): Don't cast statbuf.st_size to unsigned long. * bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/bfd-in.h3
-rw-r--r--bfd/bfd-in2.h5
-rw-r--r--bfd/bfdio.c4
-rw-r--r--bfd/cisco-core.c2
-rw-r--r--bfd/mmo.c2
-rw-r--r--bfd/trad-core.c16
7 files changed, 27 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bbd545991e9..382e2173670 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,15 @@
2006-11-20 Alan Modra <amodra@bigpond.net.au>
+ * bfd-in.h (struct stat): Don't typedef.
+ * bfdio.c (bfd_get_size): Return a file_ptr.
+ * cisco-core.c (cisco_core_file_validate): Use bfd_size_type for nread.
+ * mmo.c (mmo_scan): Use file_ptr for curpos.
+ * trad-core.c (trad_unix_core): Don't cast statbuf.st_size to
+ unsigned long.
+ * bfd-in2.h: Regenerate.
+
+2006-11-20 Alan Modra <amodra@bigpond.net.au>
+
PR 3532
* bfd-in.h (struct bfd_hash_table): Reorganize. Add "frozen".
* hash.c (bfd_hash_table_init_n): Init frozen.
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 35ce3965292..342c6c1c29f 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -350,7 +350,8 @@ typedef struct bfd_section *sec_ptr;
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
/ bfd_octets_per_byte (bfd))
-typedef struct stat stat_type;
+/* Forward define. */
+struct stat;
typedef enum bfd_print_symbol
{
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 80eb8a272be..480b2d7221f 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -357,7 +357,8 @@ typedef struct bfd_section *sec_ptr;
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
/ bfd_octets_per_byte (bfd))
-typedef struct stat stat_type;
+/* Forward define. */
+struct stat;
typedef enum bfd_print_symbol
{
@@ -1110,7 +1111,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section
/* Extracted from bfdio.c. */
long bfd_get_mtime (bfd *abfd);
-long bfd_get_size (bfd *abfd);
+file_ptr bfd_get_size (bfd *abfd);
/* Extracted from bfdwin.c. */
/* Extracted from section.c. */
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index 22ea886b5cb..0aa82a9d2e2 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -401,7 +401,7 @@ FUNCTION
bfd_get_size
SYNOPSIS
- long bfd_get_size (bfd *abfd);
+ file_ptr bfd_get_size (bfd *abfd);
DESCRIPTION
Return the file size (as read from file system) for the file
@@ -429,7 +429,7 @@ DESCRIPTION
size reasonable?".
*/
-long
+file_ptr
bfd_get_size (bfd *abfd)
{
struct stat buf;
diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c
index 7d63118aef6..7cf623e284a 100644
--- a/bfd/cisco-core.c
+++ b/bfd/cisco-core.c
@@ -88,7 +88,7 @@ cisco_core_file_validate (abfd, crash_info_loc)
char buf[4];
unsigned int crashinfo_offset;
crashinfo_external crashinfo;
- int nread;
+ bfd_size_type nread;
unsigned int magic;
unsigned int version;
unsigned int rambase;
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 077e3a8b8a0..731bb10dd61 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1917,7 +1917,7 @@ mmo_scan (bfd *abfd)
/* This must be the last 32-bit word in an mmo file.
Let's find out. */
struct stat statbuf;
- long curpos = bfd_tell (abfd);
+ file_ptr curpos = bfd_tell (abfd);
if (bfd_stat (abfd, &statbuf) < 0)
goto error_return;
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index 2b309c0b084..c3884fb62b8 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -114,24 +114,24 @@ trad_unix_core_file_p (abfd)
if (bfd_stat (abfd, &statbuf) < 0)
return 0;
- if ((unsigned long) (NBPG * (UPAGES + u.u_dsize
+ if ((ufile_ptr) NBPG * (UPAGES + u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- - u.u_tsize
+ - u.u_tsize
#endif
- + u.u_ssize))
- > (unsigned long) statbuf.st_size)
+ + u.u_ssize)
+ > (ufile_ptr) statbuf.st_size)
{
bfd_set_error (bfd_error_wrong_format);
return 0;
}
#ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE
- if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
+ if (((ufile_ptr) NBPG * (UPAGES + u.u_dsize + u.u_ssize)
#ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED
/* Some systems write the file too big. */
- + TRAD_CORE_EXTRA_SIZE_ALLOWED
+ + TRAD_CORE_EXTRA_SIZE_ALLOWED
#endif
- )
- < (unsigned long) statbuf.st_size)
+ )
+ < (ufile_ptr) statbuf.st_size)
{
/* The file is too big. Maybe it's not a core file
or we otherwise have bad values for u_dsize and u_ssize). */