diff mbox

[3/9] alpha-dis: remove unused global; declare others to be static

Message ID 1337629910-30302-6-git-send-email-jim@meyering.net
State New
Headers show

Commit Message

Jim Meyering May 21, 2012, 7:51 p.m. UTC
From: Jim Meyering <meyering@redhat.com>

alpha_num_operands: Remove both declarations of this unused global.
alpha_opcodes: Declare static to limit scope. Remove duplicate decl.
alpha_num_opcodes: Likewise.
alpha_operands: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 alpha-dis.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)
diff mbox

Patch

diff --git a/alpha-dis.c b/alpha-dis.c
index ae331b3..f39b56d 100644
--- a/alpha-dis.c
+++ b/alpha-dis.c
@@ -53,12 +53,6 @@  struct alpha_opcode
   unsigned char operands[4];
 };

-/* The table itself is sorted by major opcode number, and is otherwise
-   in the order in which the disassembler should consider
-   instructions.  */
-extern const struct alpha_opcode alpha_opcodes[];
-extern const unsigned alpha_num_opcodes;
-
 /* Values defined for the flags field of a struct alpha_opcode.  */

 /* CPU Availability */
@@ -134,12 +128,6 @@  struct alpha_operand
   int (*extract) (unsigned instruction, int *invalid);
 };

-/* Elements in the table are retrieved by indexing with values from
-   the operands field of the alpha_opcodes table.  */
-
-extern const struct alpha_operand alpha_operands[];
-extern const unsigned alpha_num_operands;
-
 /* Values defined for the flags field of a struct alpha_operand.  */

 /* Mask for selecting the type for typecheck purposes */
@@ -292,8 +280,10 @@  static int extract_ev6hwjhint (unsigned, int *);

 
 /* The operands table  */
+/* Elements are retrieved by indexing with values from
+   the operands field of the alpha_opcodes table.  */

-const struct alpha_operand alpha_operands[] =
+static const struct alpha_operand alpha_operands[] =
 {
   /* The fields are bits, shift, insert, extract, flags */
   /* The zero index is used to indicate end-of-list */
@@ -424,8 +414,6 @@  const struct alpha_operand alpha_operands[] =
     insert_ev6hwjhint, extract_ev6hwjhint }
 };

-const unsigned alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operands);
-
 /* The RB field when it is the same as the RA field in the same insn.
    This operand is marked fake.  The insertion function just copies
    the RA field into the RB field, and the extraction function just
@@ -662,6 +650,9 @@  extract_ev6hwjhint(unsigned insn, int *invalid ATTRIBUTE_UNUSED)
 #define ARG_EV6HWMEM		{ RA, EV6HWDISP, PRB }
 
 /* The opcode table.
+   The table itself is sorted by major opcode number, and is otherwise
+   in the order in which the disassembler should consider
+   instructions.

    The format of the opcode table is:

@@ -706,7 +697,7 @@  extract_ev6hwjhint(unsigned insn, int *invalid ATTRIBUTE_UNUSED)
 		that were not assigned to a particular extension.
 */

-const struct alpha_opcode alpha_opcodes[] = {
+static const struct alpha_opcode alpha_opcodes[] = {
   { "halt",		SPCD(0x00,0x0000), BASE, ARG_NONE },
   { "draina",		SPCD(0x00,0x0002), BASE, ARG_NONE },
   { "bpt",		SPCD(0x00,0x0080), BASE, ARG_NONE },
@@ -1732,7 +1723,8 @@  const struct alpha_opcode alpha_opcodes[] = {
   { "bgt",		BRA(0x3F), BASE, ARG_BRA },
 };

-const unsigned alpha_num_opcodes = sizeof(alpha_opcodes)/sizeof(*alpha_opcodes);
+static const unsigned alpha_num_opcodes =
+  sizeof(alpha_opcodes)/sizeof(*alpha_opcodes);

 /* OSF register names.  */