[PATCH 06/13] sim: cgen: constify trace strings
Mike Frysinger
vapier@gentoo.org
Sun Jun 27 03:30:44 GMT 2021
Shouldn't be any functional changes here.
---
sim/common/cgen-trace.c | 10 +++++-----
sim/common/cgen-trace.h | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c
index 206720ca1395..65927400ae3a 100644
--- a/sim/common/cgen-trace.c
+++ b/sim/common/cgen-trace.c
@@ -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;
diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h
index 6e860de78400..fcf50e98078c 100644
--- a/sim/common/cgen-trace.h
+++ b/sim/common/cgen-trace.h
@@ -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) \
--
2.31.1
More information about the Gdb-patches
mailing list