Message ID | 20220815072629.12865-17-milica.lazarevic@syrmia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Convert nanoMIPS disassembler from C++ to C | expand |
On 15/08/2022 09.26, Milica Lazarevic wrote: > Change enums to typedef enums to keep naming clear > > Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com> > --- > disas/nanomips.cpp | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp > index a8cd878809..9406805367 100644 > --- a/disas/nanomips.cpp > +++ b/disas/nanomips.cpp > @@ -43,16 +43,16 @@ typedef uint64_t img_address; > typedef bool(*conditional_function)(uint64 instruction); > typedef const char *(*disassembly_function)(uint64 instruction); > > -enum TABLE_ENTRY_TYPE { > +typedef enum { > instruction, > call_instruction, > branch_instruction, > return_instruction, > reserved_block, > pool, > -}; > +} TABLE_ENTRY_TYPE; > > -enum TABLE_ATTRIBUTE_TYPE { > +typedef enum { > MIPS64_ = 0x00000001, > XNP_ = 0x00000002, > XMMS_ = 0x00000004, > @@ -70,7 +70,7 @@ enum TABLE_ATTRIBUTE_TYPE { > TLB_ = 0x00004000, > MVH_ = 0x00008000, > ALL_ATTRIBUTES = 0xffffffffull, > -}; > +} TABLE_ATTRIBUTE_TYPE; Reviewed-by: Thomas Huth <thuth@redhat.com>
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp index a8cd878809..9406805367 100644 --- a/disas/nanomips.cpp +++ b/disas/nanomips.cpp @@ -43,16 +43,16 @@ typedef uint64_t img_address; typedef bool(*conditional_function)(uint64 instruction); typedef const char *(*disassembly_function)(uint64 instruction); -enum TABLE_ENTRY_TYPE { +typedef enum { instruction, call_instruction, branch_instruction, return_instruction, reserved_block, pool, -}; +} TABLE_ENTRY_TYPE; -enum TABLE_ATTRIBUTE_TYPE { +typedef enum { MIPS64_ = 0x00000001, XNP_ = 0x00000002, XMMS_ = 0x00000004, @@ -70,7 +70,7 @@ enum TABLE_ATTRIBUTE_TYPE { TLB_ = 0x00004000, MVH_ = 0x00008000, ALL_ATTRIBUTES = 0xffffffffull, -}; +} TABLE_ATTRIBUTE_TYPE; struct Pool { TABLE_ENTRY_TYPE type;
Change enums to typedef enums to keep naming clear Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com> --- disas/nanomips.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)