From: Mike Frysinger Date: Wed, 5 Jan 2011 17:13:36 +0000 (+0000) Subject: sim: tweak load buffer type to avoid signed warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc25892bf4b18282d58c4d8a3e85705142ba7ec0;p=binutils-gdb.git sim: tweak load buffer type to avoid signed warnings 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 --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index f4779ade3e4..ea0ce2070b0 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2011-01-05 Mike Frysinger + + * sim-load.c (sim_load_file): Change buffer type to unsigned char *. + 2011-01-05 Joel Brobecker * run.1: Copyright year update. diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c index ee794cef05a..698d1c172a8 100644 --- a/sim/common/sim-load.c +++ b/sim/common/sim-load.c @@ -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);