From 66850bf5531ba9b3fe0c17da396cd841e51cf4d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Jan 2015 13:58:12 -0500 Subject: [PATCH 1/3] isolated, nameless union in struct OPCODE, named union OPCODE There were no other members of struct `tagOPCODE` besides one nameless union, so, to fix some nameless union compiler warnings, I deleted struct tagOPCODE and named the nameless union, union tagOPCODE. Since "OpCode.h" is #include'd 9 times across the RSP source, technically this commit fixes 9 warning messages, even though it's really just 1 warning. --- Source/RSP/OpCode.h | 74 +++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/Source/RSP/OpCode.h b/Source/RSP/OpCode.h index 8f26092af..1511a4359 100644 --- a/Source/RSP/OpCode.h +++ b/Source/RSP/OpCode.h @@ -29,49 +29,45 @@ #include "Types.h" -typedef struct tagOPCODE { - union { +typedef union tagOPCODE { + unsigned long Hex; + unsigned char Ascii[4]; - unsigned long Hex; - unsigned char Ascii[4]; - - struct { - unsigned offset : 16; - unsigned rt : 5; - unsigned rs : 5; - unsigned op : 6; - }; + struct { + unsigned offset : 16; + unsigned rt : 5; + unsigned rs : 5; + unsigned op : 6; + }; - struct { - unsigned immediate : 16; - unsigned : 5; - unsigned base : 5; - unsigned : 6; - }; - - struct { - unsigned target : 26; - unsigned : 6; - }; - - struct { - unsigned funct : 6; - unsigned sa : 5; - unsigned rd : 5; - unsigned : 5; - unsigned : 5; - unsigned : 6; - }; + struct { + unsigned immediate : 16; + unsigned : 5; + unsigned base : 5; + unsigned : 6; + }; - struct { - signed voffset : 7; - unsigned del : 4; - unsigned : 5; - unsigned dest : 5; - unsigned : 5; - unsigned : 6; - }; + struct { + unsigned target : 26; + unsigned : 6; + }; + struct { + unsigned funct : 6; + unsigned sa : 5; + unsigned rd : 5; + unsigned : 5; + unsigned : 5; + unsigned : 6; + }; + + struct { + signed voffset : 7; + unsigned del : 4; + unsigned : 5; + unsigned dest : 5; + unsigned : 5; + unsigned : 6; }; } OPCODE; From 22f13e173933fede727af7e08481952f4b8f345c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Jan 2015 14:07:48 -0500 Subject: [PATCH 2/3] offset operates w/ base; immediate operates w/ rs (fixes nothing) --- Source/RSP/OpCode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/RSP/OpCode.h b/Source/RSP/OpCode.h index 1511a4359..74ad55a60 100644 --- a/Source/RSP/OpCode.h +++ b/Source/RSP/OpCode.h @@ -34,14 +34,14 @@ typedef union tagOPCODE { unsigned char Ascii[4]; struct { - unsigned offset : 16; + unsigned immediate : 16; unsigned rt : 5; unsigned rs : 5; unsigned op : 6; }; struct { - unsigned immediate : 16; + unsigned offset : 16; unsigned : 5; unsigned base : 5; unsigned : 6; From 5877daf7b393bbef12315215b28d1a3dbc8be9b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Jan 2015 14:22:18 -0500 Subject: [PATCH 3/3] isolated, nameless union in struct SHUFFLE, named union SHUFFLE --- Source/RSP/X86.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index aa4311164..ee324dae6 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -246,16 +246,14 @@ void SseMoveUnalignedRegToN64Mem ( int sseReg, int AddrReg ); void SseMoveRegToReg ( int Dest, int Source ); void SseXorRegToReg ( int Dest, int Source ); -typedef struct { - union { - struct { - unsigned Reg0 : 2; - unsigned Reg1 : 2; - unsigned Reg2 : 2; - unsigned Reg3 : 2; - }; - unsigned UB:8; +typedef union { + struct { + unsigned Reg0 : 2; + unsigned Reg1 : 2; + unsigned Reg2 : 2; + unsigned Reg3 : 2; }; + unsigned UB:8; } SHUFFLE; void SseShuffleReg ( int Dest, int Source, BYTE Immed );