This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] xtensa typedef enums when defining them
- From: tbsaunde+binutils at tbsaunde dot org
- To: binutils at sourceware dot org
- Cc: Trevor Saunders <tbsaunde+binutils at tbsaunde dot org>
- Date: Thu, 26 May 2016 08:42:43 -0400
- Subject: [PATCH] xtensa typedef enums when defining them
- Authentication-results: sourceware.org; auth=none
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Hi,
I think this is the more typical way to do this. Its also slightly shorter and
less repeditive.
built and regtested xtensa-linux, ok?
Trev
gas/ChangeLog:
2016-05-26 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/xtensa-relax.h: Move typedefs of enums to the enums
definition.
---
gas/config/xtensa-relax.h | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/gas/config/xtensa-relax.h b/gas/config/xtensa-relax.h
index 0bad423..6458579 100644
--- a/gas/config/xtensa-relax.h
+++ b/gas/config/xtensa-relax.h
@@ -91,10 +91,7 @@ struct req_or_option_list
/* Operand types and constraints on operands: */
-typedef enum op_type OpType;
-typedef enum cmp_op CmpOp;
-
-enum op_type
+typedef enum op_type
{
OP_CONSTANT,
OP_OPERAND,
@@ -107,13 +104,13 @@ enum op_type
OP_LITERAL,
OP_FREEREG,
OP_LABEL
-};
+} OpType;
-enum cmp_op
+typedef enum cmp_op
{
OP_EQUAL,
OP_NOTEQUAL,
-};
+} CmpOp;
struct precondition
{
@@ -143,14 +140,13 @@ struct build_op
};
typedef struct build_instr BuildInstr;
-typedef enum instr_type InstrType;
-enum instr_type
+typedef enum instr_type
{
INSTR_INSTR,
INSTR_LITERAL_DEF,
INSTR_LABEL_DEF
-};
+} InstrType;
struct build_instr
{
--
2.8.1