]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: cgen: constify trace strings
authorMike Frysinger <vapier@gentoo.org>
Sun, 27 Jun 2021 02:55:53 +0000 (22:55 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 27 Jun 2021 14:45:51 +0000 (10:45 -0400)
Shouldn't be any functional changes here.

sim/common/ChangeLog
sim/common/cgen-trace.c
sim/common/cgen-trace.h

index b0c3cb17d060121089566e6ed9a2c03042057b1e..06f092478d91f8bfeb1e42639a6434037615425e 100644 (file)
@@ -1,3 +1,12 @@
+2021-06-27  Mike Frysinger  <vapier@gentoo.org>
+
+       * cgen-trace.c (cgen_trace_extract): Make name & fmt const.
+       (cgen_trace_result): Make name const.
+       (cgen_trace_printf): Make fmt const.
+       * cgen-trace.h (cgen_trace_extract): Make 3rd arg const.
+       (cgen_trace_result): Make 2nd arg const.
+       (cgen_trace_printf): Likewise.
+
 2021-06-27  Mike Frysinger  <vapier@gentoo.org>
 
        * cgen-mem.h (DECLARE_GETMEM_EXTERN): New macro.
index 206720ca13957d3ee7a44bfec261160928c7a885..65927400ae3a5e4e85cab7bc8557992237c33a07 100644 (file)
@@ -185,11 +185,11 @@ cgen_trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode,
 }
 
 void
-cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
+cgen_trace_extract (SIM_CPU *cpu, IADDR pc, const char *name, ...)
 {
   va_list args;
   int printed_one_p = 0;
-  char *fmt;
+  const char *fmt;
 
   va_start (args, name);
 
@@ -199,7 +199,7 @@ cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
   do {
     int type,ival;
 
-    fmt = va_arg (args, char *);
+    fmt = va_arg (args, const char *);
 
     if (fmt)
       {
@@ -224,7 +224,7 @@ cgen_trace_extract (SIM_CPU *cpu, IADDR pc, char *name, ...)
 }
 
 void
-cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...)
+cgen_trace_result (SIM_CPU *cpu, const char *name, int type, ...)
 {
   va_list args;
 
@@ -270,7 +270,7 @@ cgen_trace_result (SIM_CPU *cpu, char *name, int type, ...)
    This is only for tracing semantic code.  */
 
 void
-cgen_trace_printf (SIM_CPU *cpu, char *fmt, ...)
+cgen_trace_printf (SIM_CPU *cpu, const char *fmt, ...)
 {
   va_list args;
 
index 6e860de78400eb8a3d45c83203d32a86c7c98e8e..fcf50e98078c130afc94813d45b16a59315eb501 100644 (file)
@@ -24,9 +24,9 @@ void cgen_trace_insn_init (SIM_CPU *, int);
 void cgen_trace_insn_fini (SIM_CPU *, const struct argbuf *, int);
 void cgen_trace_insn (SIM_CPU *, const struct cgen_insn *,
                      const struct argbuf *, IADDR);
-void cgen_trace_extract (SIM_CPU *, IADDR, char *, ...);
-void cgen_trace_result (SIM_CPU *, char *, int, ...);
-void cgen_trace_printf (SIM_CPU *, char *fmt, ...);
+void cgen_trace_extract (SIM_CPU *, IADDR, const char *, ...);
+void cgen_trace_result (SIM_CPU *, const char *, int, ...);
+void cgen_trace_printf (SIM_CPU *, const char *fmt, ...);
 
 /* Trace instruction results.  */
 #define CGEN_TRACE_RESULT_P(cpu, abuf) \