sim: constify sim_write source buffer
authorMike Frysinger <vapier@gentoo.org>
Tue, 13 Apr 2010 20:28:20 +0000 (20:28 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 13 Apr 2010 20:28:20 +0000 (20:28 +0000)
Most the sim write functions declare their source buffer const because
they only ever read from it.  The global sim_write() function does not
follow this convention though which causes some warnings when trying to
pass it const strings or buffers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
include/gdb/ChangeLog
include/gdb/remote-sim.h
sim/common/ChangeLog
sim/common/sim-hrw.c
sim/common/sim-utils.h

index 3b84cad1879c40fd019dc4a821e2afb2d745d60a..119264eb34c72ee60369b104026e523b8b93bc19 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-13  Mike Frysinger  <vapier@gentoo.org>
+
+       * remote-sim.h (sim_write): Add const to buf arg.
+
 2009-11-24  DJ Delorie  <dj@redhat.com>
 
        * sim-rx.h: New.
index cfb1c1141d655cb015358a8f3a5654a9f23ccc91..37f029ad7436f3425f6be378c31e69e6969a1f95 100644 (file)
@@ -175,7 +175,7 @@ int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
    memory. Store bytes starting at virtual address MEM. Result is
    number of bytes write, or zero if error.  */
 
-int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length));
+int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length));
 
 
 /* Fetch register REGNO storing its raw (target endian) value in the
index 71f4613ce9414e36b3bdc975d69eb03d9d937cbb..2a386d700a38861d08db7e30033cd9a09c2867cd 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-13  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-hrw.c (sim_write): Add const to buf arg.
+       * sim-utils.h (sim_write_fn): Likewise.
+
 2010-04-12  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New
index e76a1962da5b00510d71ecb88f0481092c910532..cedae87a7e9acf132757c69dc9e9701ed8e5f9d7 100644 (file)
@@ -32,7 +32,7 @@ sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
 }
 
 int
-sim_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
+sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
 {
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   return sim_core_write_buffer (sd, NULL, write_map,
index 75d2fb45026172b223169f521bf3928ea14f23ae..e3ff63afe7ee8beec8b8c0afcb2b47dc0df988e4 100644 (file)
@@ -63,7 +63,7 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
    This is still accommodated for backward compatibility reasons. */
 
 typedef int sim_write_fn PARAMS ((SIM_DESC sd, SIM_ADDR mem,
-                                     unsigned char *buf, int length));
+                                     const unsigned char *buf, int length));
 struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
                           host_callback *callback, char *prog,
                           struct bfd *prog_bfd, int verbose_p,
This page took 0.031296 seconds and 4 git commands to generate.