public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/7] sim: ppc: constify spreg table
@ 2022-11-09 20:01 Mike Frysinger
  2022-11-09 20:01 ` [PATCH 2/7] sim: ppc: pull default switch return out Mike Frysinger
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Mike Frysinger @ 2022-11-09 20:01 UTC (permalink / raw)
  To: gdb-patches

This internal table is only ever read, so constify it.
---
 sim/ppc/dgen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/ppc/dgen.c b/sim/ppc/dgen.c
index caafe07a6aab..0f9b02f91084 100644
--- a/sim/ppc/dgen.c
+++ b/sim/ppc/dgen.c
@@ -196,14 +196,14 @@ gen_spreg_c(spreg_table *table, lf *file)
 
   lf_printf(file, "\n");
   lf_printf(file, "typedef struct _spreg_info {\n");
-  lf_printf(file, "  char *name;\n");
+  lf_printf(file, "  const char *name;\n");
   lf_printf(file, "  int is_valid;\n");
   lf_printf(file, "  int length;\n");
   lf_printf(file, "  int is_readonly;\n");
   lf_printf(file, "  int index;\n");
   lf_printf(file, "} spreg_info;\n");
   lf_printf(file, "\n");
-  lf_printf(file, "static spreg_info spr_info[nr_of_sprs+1] = {\n");
+  lf_printf(file, "static const spreg_info spr_info[nr_of_sprs+1] = {\n");
   entry = table->sprs;
   for (spreg_nr = 0; spreg_nr < nr_of_sprs+1; spreg_nr++) {
     if (entry == NULL || spreg_nr < entry->spreg_nr)
-- 
2.38.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-20  1:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 20:01 [PATCH 1/7] sim: ppc: constify spreg table Mike Frysinger
2022-11-09 20:01 ` [PATCH 2/7] sim: ppc: pull default switch return out Mike Frysinger
2022-11-09 20:01 ` [PATCH 3/7] sim: ppc: collapse is_valid switch table more Mike Frysinger
2022-11-09 20:01 ` [PATCH 4/7] sim: ppc: collapse is_readonly & length switch tables heavily Mike Frysinger
2022-11-09 20:01 ` [PATCH 5/7] sim: ppc: drop support for dgen -L option Mike Frysinger
2022-11-09 20:01 ` [PATCH 6/7] sim: ppc: change spreg switch table generation to compile-time Mike Frysinger
2022-11-09 20:01 ` [PATCH 7/7] sim: ppc: move spreg.[ch] files to the source tree Mike Frysinger
2022-12-20  1:50   ` [PATCH 1/2] " Mike Frysinger
2022-12-20  1:50     ` [PATCH 2/2] sim: ppc: drop old dgen.c generator Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).