OSDN Git Service

sim: constify save_data()
authorvapier <vapier>
Sat, 10 Apr 2010 17:00:58 +0000 (17:00 +0000)
committervapier <vapier>
Sat, 10 Apr 2010 17:00:58 +0000 (17:00 +0000)
The local save_data() function takes a pointer to a buffer and only uses it as
the source to the memcpy() function.  Since it is given const strings, GCC
likes to spit out warnings:
common/sim-trace.c: In function 'trace_prefix':
common/sim-trace.c:697: warning: passing argument 5 of 'save_data' discards
qualifiers from pointer target type

So I've committed this as obvious.

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

index f360dee..a40dbf8 100644 (file)
@@ -1,5 +1,9 @@
 2010-04-10  Mike Frysinger  <vapier@gentoo.org>
 
+       * sim-trace.c (save_data): Add const markings to "buf" argument.
+
+2010-04-10  Mike Frysinger  <vapier@gentoo.org>
+
        * sim-options.c (standard_option_handler): Add const markings to
        local "type" var.
 
index 478cbfa..358a01d 100644 (file)
@@ -513,7 +513,7 @@ save_data (SIM_DESC sd,
           TRACE_DATA *data,
           data_fmt fmt,
           long size,
-          void *buf)
+          const void *buf)
 {
   int i = TRACE_INPUT_IDX (data);
   if (i == sizeof (TRACE_INPUT_FMT (data)))