From: Mike Frysinger Date: Sun, 27 Jun 2021 02:55:53 +0000 (-0400) Subject: sim: cgen: constify trace strings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ded82565c6d432c6dcfc6a867bad479633426a62;p=binutils-gdb.git sim: cgen: constify trace strings Shouldn't be any functional changes here. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index b0c3cb17d06..06f092478d9 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,12 @@ +2021-06-27 Mike Frysinger + + * 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 * cgen-mem.h (DECLARE_GETMEM_EXTERN): New macro. diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 206720ca139..65927400ae3 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 6e860de7840..fcf50e98078 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) \