gdb/
[binutils-gdb.git] / bfd / bfdio.c
index 88a87382d3e8c5b4335c5bee0b4f640de516c158..e428b165b2f03c29b7df36a68ba50a324f6caf54 100644 (file)
@@ -1,7 +1,7 @@
 /* Low-level I/O routines for BFDs.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -187,7 +187,7 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
       struct bfd_in_memory *bim;
       bfd_size_type get;
 
-      bim = abfd->iostream;
+      bim = (struct bfd_in_memory *) abfd->iostream;
       get = size;
       if (abfd->where + get > bim->size)
        {
@@ -219,7 +219,7 @@ bfd_bwrite (const void *ptr, bfd_size_type size, bfd *abfd)
 
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     {
-      struct bfd_in_memory *bim = abfd->iostream;
+      struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
 
       size = (size_t) size;
       if (abfd->where + size > bim->size)
@@ -232,7 +232,8 @@ bfd_bwrite (const void *ptr, bfd_size_type size, bfd *abfd)
          newsize = (bim->size + 127) & ~(bfd_size_type) 127;
          if (newsize > oldsize)
            {
-             bim->buffer = bfd_realloc_or_free (bim->buffer, newsize);
+             bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer,
+                                                              newsize);
              if (bim->buffer == NULL)
                {
                  bim->size = 0;
@@ -338,7 +339,7 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
     {
       struct bfd_in_memory *bim;
 
-      bim = abfd->iostream;
+      bim = (struct bfd_in_memory *) abfd->iostream;
 
       if (direction == SEEK_SET)
        abfd->where = position;
@@ -358,7 +359,8 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
              newsize = (bim->size + 127) & ~(bfd_size_type) 127;
              if (newsize > oldsize)
                {
-                 bim->buffer = bfd_realloc_or_free (bim->buffer, newsize);
+                 bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer,
+                                                                  newsize);
                  if (bim->buffer == NULL)
                    {
                      bim->size = 0;