Makefiles: Flatten and sort file lists
[deliverable/binutils-gdb.git] / gdb / minidebug.c
index 8610a150807ccb13ba337b36189250a670d235fc..43232945b9df963dce8aa2bb4c598159e458abc2 100644 (file)
@@ -1,6 +1,6 @@
 /* Read MiniDebugInfo data from an objfile.
 
-   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +22,7 @@
 #include "symfile.h"
 #include "objfiles.h"
 #include "gdbcore.h"
+#include <algorithm>
 
 #ifdef HAVE_LIBLZMA
 
@@ -76,7 +77,7 @@ struct gdb_lzma_stream
 static void *
 lzma_open (struct bfd *nbfd, void *open_closure)
 {
-  asection *section = open_closure;
+  asection *section = (asection *) open_closure;
   bfd_size_type size, offset;
   lzma_stream_flags options;
   gdb_byte footer[LZMA_STREAM_HEADER_SIZE];
@@ -133,7 +134,7 @@ static file_ptr
 lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
            file_ptr offset)
 {
-  struct gdb_lzma_stream *lstream = stream;
+  struct gdb_lzma_stream *lstream = (struct gdb_lzma_stream *) stream;
   bfd_size_type chunk_size;
   lzma_index_iter iter;
   gdb_byte *compressed, *uncompressed;
@@ -201,7 +202,7 @@ lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
                               + iter.block.uncompressed_size);
        }
 
-      chunk_size = min (nbytes, lstream->data_end - offset);
+      chunk_size = std::min (nbytes, (file_ptr) lstream->data_end - offset);
       memcpy (buf, lstream->data + offset - lstream->data_start, chunk_size);
       buf = (gdb_byte *) buf + chunk_size;
       offset += chunk_size;
@@ -220,7 +221,7 @@ static int
 lzma_close (struct bfd *nbfd,
            void *stream)
 {
-  struct gdb_lzma_stream *lstream = stream;
+  struct gdb_lzma_stream *lstream = (struct gdb_lzma_stream *) stream;
 
   lzma_index_end (lstream->index, &gdb_lzma_allocator);
   xfree (lstream->data);
@@ -239,7 +240,7 @@ lzma_stat (struct bfd *abfd,
           void *stream,
           struct stat *sb)
 {
-  struct gdb_lzma_stream *lstream = stream;
+  struct gdb_lzma_stream *lstream = (struct gdb_lzma_stream *) stream;
 
   memset (sb, 0, sizeof (struct stat));
   sb->st_size = lzma_index_uncompressed_size (lstream->index);
This page took 0.029173 seconds and 4 git commands to generate.