opcodes: constify & localize z80 opcodes

Message ID 20210627055905.15674-1-vapier@gentoo.org
State New
Headers show
Series
  • opcodes: constify & localize z80 opcodes
Related show

Commit Message

Andrea Corallo via Binutils June 27, 2021, 5:59 a.m.
These aren't used outside of this module, and are never modified.
Mark it static to avoid bad exported variable name issues.
---
 opcodes/z80-dis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.31.1

Comments

Andrea Corallo via Binutils July 1, 2021, 10:09 a.m. | #1
Hi Mike,

> These aren't used outside of this module, and are never modified.

> Mark it static to avoid bad exported variable name issues.


Approved - please apply - with a ChangeLog entry.

Cheers
   Nick

Patch

diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c
index 9b9f941276d7..0e7a312ff898 100644
--- a/opcodes/z80-dis.c
+++ b/opcodes/z80-dis.c
@@ -414,7 +414,7 @@  dump (struct buffer *buf, disassemble_info * info, const char *txt)
 }
 
 /* Table to disassemble machine codes with prefix 0xED.  */
-struct tab_elt opc_ed[] =
+static const struct tab_elt opc_ed[] =
 {
   { 0x30, 0xFF, prt, "mul d,e", INSS_Z80N },
   { 0x31, 0xFF, prt, "add hl,a", INSS_Z80N },
@@ -525,7 +525,7 @@  static int
 pref_ed (struct buffer *buf, disassemble_info *info,
          const char *txt ATTRIBUTE_UNUSED)
 {
-  struct tab_elt *p;
+  const struct tab_elt *p;
 
   if (fetch_data (buf, info, 1))
     {