* alpha-tdep.h (struct gdbarch_tdep): Add return_in_memory.
[binutils-gdb.git] / gprof / gmon_io.c
index 6261d46b12c78fc8f59e8ec00592fa1aae3d7d96..e56ab7a369581819f24631488d6168a0b025ba2f 100644 (file)
@@ -1,6 +1,7 @@
 /* gmon_io.c - Input and output from/to gmon.out files.
 
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -16,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 \f
 #include "gprof.h"
 #include "search_list.h"
@@ -255,6 +256,9 @@ gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
       *cnt = cnt64;
       break;
 #endif
+
+    default:
+      return 1;
     }
   return 0;
 }
@@ -378,15 +382,16 @@ gmon_out_read (const char *filename)
       {
        bfd_vma low_pc;
        bfd_vma high_pc;
-       int ncnt;
+       unsigned int ncnt;
       };
-      int i, samp_bytes, header_size = 0;
+      unsigned int i;
+      int samp_bytes, header_size = 0;
       unsigned long count;
       bfd_vma from_pc, self_pc;
       static struct hdr h;
       UNIT raw_bin_count;
       struct hdr tmp;
-      int version;
+      unsigned int version;
 
       /* Information from a gmon.out file is in two parts: an array of
         sampling hits within pc ranges, and the arcs.  */
@@ -419,7 +424,7 @@ gmon_out_read (const char *filename)
 
       if (version == GMONVERSION)
        {
-         int profrate;
+         unsigned int profrate;
 
          /* 4.4BSD format header.  */
           if (gmon_io_read_32 (ifp, &profrate))
@@ -427,7 +432,7 @@ gmon_out_read (const char *filename)
 
          if (!s_highpc)
            hz = profrate;
-         else if (hz != profrate)
+         else if (hz != (int) profrate)
            {
              fprintf (stderr,
                       _("%s: profiling rate incompatible with first gmon file\n"),
@@ -630,7 +635,7 @@ gmon_out_write (const char *filename)
   else if (file_format == FF_BSD || file_format == FF_BSD44)
     {
       UNIT raw_bin_count;
-      int i, hdrsize;
+      unsigned int i, hdrsize;
       unsigned padsize;
       char pad[3*4];
       Arc *arc;