]> sourceware.org Git - cgen.git/commitdiff
sid/sim: constify sim_machs storage
authorMike Frysinger <vapier@gentoo.org>
Mon, 28 Jun 2021 15:33:56 +0000 (11:33 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 14 Sep 2021 19:34:55 +0000 (15:34 -0400)
The array itself is read-only, so mark it const.

ChangeLog
sid.scm
sim.scm

index 74f5214d2018971dfcd74d0f3062ddad880bde67..1bc885cd6a2f1c08ab096f37b9bc14254b6d3c19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-09-14  Mike Frysinger  <vapier@gentoo.org>
+
+       * sid.scm (sim_machs): Mark array const.
+       * sim.scm (sim_machs): Likewise.
+
 2021-09-10  Mike Frysinger  <vapier@gentoo.org>
 
        * desc-cpu.scm: Include stdlib.h.
diff --git a/sid.scm b/sid.scm
index d6d6ed30a890d34dded8fb690b16c7cd6154e108..c34338371d82a5f8c83f8481f6d70c91080c989b 100644 (file)
--- a/sid.scm
+++ b/sid.scm
 
 (define (/gen-mach-data)
   (string-append
-   "const MACH *sim_machs[] =\n{\n"
+   "const MACH * const sim_machs[] =\n{\n"
    (string-map (lambda (mach)
                 (gen-obj-sanitize
                  mach
diff --git a/sim.scm b/sim.scm
index f965ef1fcb179bdb2083cf199c50e0f540d7c907..a153f8cee72081c5b459396bf0ca63f0b94be0ea 100644 (file)
--- a/sim.scm
+++ b/sim.scm
 
 (define (/gen-mach-data)
   (string-append
-   "const SIM_MACH *sim_machs[] =\n{\n"
+   "const SIM_MACH * const sim_machs[] =\n{\n"
    (string-map (lambda (mach)
                 (gen-obj-sanitize
                  mach
This page took 0.154568 seconds and 5 git commands to generate.