]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: tweak load buffer type to avoid signed warnings
authorMike Frysinger <vapier@gentoo.org>
Wed, 5 Jan 2011 17:13:36 +0000 (17:13 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 5 Jan 2011 17:13:36 +0000 (17:13 +0000)
The sim_load_file func creates a buffer with arbitrary data in it (reads
it via the bfd).  It then passes it on to a sim_write_fn which expects a
unsigned char buffer.  Since sim_load_file itself doesn't care about the
contents, tweak the type to avoid signed mismatch warnings from gcc:

common/sim-load.c: In function ‘sim_load_file’:
common/sim-load.c:143: warning: pointer targets in passing argument 3 of ‘do_write’ differ in signedness
common/sim-load.c:143: note: expected ‘const unsigned char *’ but argument is of type ‘char *’

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/common/ChangeLog
sim/common/sim-load.c

index f4779ade3e42381dea14366093db52d79f30ba66..ea0ce2070b014bc74f76688e350a4ce96f205fb7 100644 (file)
@@ -1,3 +1,7 @@
+2011-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-load.c (sim_load_file): Change buffer type to unsigned char *.
+
 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
 
        * run.1: Copyright year update.
index ee794cef05af3b350bd0d9a560aa652ed45d1d9e..698d1c172a86f9111eb6b948bab62e859d229f9c 100644 (file)
@@ -111,7 +111,7 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
          size = bfd_get_section_size (s);
          if (size > 0)
            {
-             char *buffer;
+             unsigned char *buffer;
              bfd_vma lma;
 
              buffer = malloc (size);