include/
[deliverable/binutils-gdb.git] / bfd / libbfd.c
index ec1864c68fae9dcf8eeb8238c4d23c4590c548ac..26ab40421329121b0899ac45cd84363b932cab7a 100644 (file)
@@ -1,6 +1,6 @@
 /* Assorted BFD support routines, only used internally.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004
+   2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -865,12 +865,12 @@ warn_deprecated (const char *what,
 
 bfd_vma
 read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
-                     char *buf,
+                     bfd_byte *buf,
                      unsigned int *bytes_read_ptr)
 {
   bfd_vma result;
   unsigned int num_read;
-  int shift;
+  unsigned int shift;
   unsigned char byte;
 
   result = 0;
@@ -878,7 +878,7 @@ read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
   num_read = 0;
   do
     {
-      byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+      byte = bfd_get_8 (abfd, buf);
       buf++;
       num_read++;
       result |= (((bfd_vma) byte & 0x7f) << shift);
@@ -893,12 +893,12 @@ read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
 
 bfd_signed_vma
 read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
-                   char *buf,
-                   unsigned int * bytes_read_ptr)
+                   bfd_byte *buf,
+                   unsigned int *bytes_read_ptr)
 {
   bfd_vma result;
-  unsigned shift;
-  int num_read;
+  unsigned int shift;
+  unsigned int num_read;
   unsigned char byte;
 
   result = 0;
@@ -906,14 +906,14 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
   num_read = 0;
   do
     {
-      byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+      byte = bfd_get_8 (abfd, buf);
       buf ++;
       num_read ++;
       result |= (((bfd_vma) byte & 0x7f) << shift);
       shift += 7;
     }
   while (byte & 0x80);
-  if ((shift < 8 * sizeof (result)) && (byte & 0x40))
+  if (shift < 8 * sizeof (result) && (byte & 0x40))
     result |= (((bfd_vma) -1) << shift);
   *bytes_read_ptr = num_read;
   return result;
This page took 0.031403 seconds and 4 git commands to generate.