Core: Get rid of C-style struct typedefs

This commit is contained in:
Lioncash 2014-08-09 21:58:08 -04:00
parent a899d2b5dd
commit 11f730fd1e
4 changed files with 25 additions and 23 deletions

View File

@ -38,14 +38,15 @@ static u32 state_checksum(u32 *buf, int len)
return checksum; return checksum;
} }
typedef struct { struct StateFlags
{
u32 checksum; u32 checksum;
u8 flags; u8 flags;
u8 type; u8 type;
u8 discstate; u8 discstate;
u8 returnto; u8 returnto;
u32 unknown[6]; u32 unknown[6];
} StateFlags; };
bool CBoot::Boot_WiiWAD(const std::string& _pFilename) bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
{ {

View File

@ -184,7 +184,8 @@
#define EXP_6 6 // 0x000c #define EXP_6 6 // 0x000c
#define EXP_INT 7 // 0x000e external int (message from cpu) #define EXP_INT 7 // 0x000e external int (message from cpu)
typedef struct { struct DSP_Regs
{
u16 ar[4]; u16 ar[4];
u16 ix[4]; u16 ix[4];
u16 wr[4]; u16 wr[4];
@ -215,7 +216,7 @@ typedef struct {
u16 h; u16 h;
}; };
} ac[2]; } ac[2];
} DSP_Regs; };
// All the state of the DSP should be in this struct. Any DSP state that is not filled on init // All the state of the DSP should be in this struct. Any DSP state that is not filled on init
// should be moved here. // should be moved here.

View File

@ -44,7 +44,7 @@
#define SHT_DYNSYM 11 #define SHT_DYNSYM 11
typedef struct struct ELF_Header
{ {
unsigned char ID[4]; unsigned char ID[4];
unsigned char clazz; unsigned char clazz;
@ -64,9 +64,9 @@ typedef struct
unsigned short e_shentsize; unsigned short e_shentsize;
unsigned short e_shnum; unsigned short e_shnum;
unsigned short e_shtrndx; unsigned short e_shtrndx;
} ELF_Header; };
typedef struct struct Program_Header
{ {
unsigned int type; unsigned int type;
unsigned int offset; unsigned int offset;
@ -76,9 +76,9 @@ typedef struct
unsigned int memsz; unsigned int memsz;
unsigned int flags; unsigned int flags;
unsigned int align; unsigned int align;
} Program_Header; };
typedef struct struct Section_Header
{ {
unsigned int name; unsigned int name;
unsigned int type; unsigned int type;
@ -90,9 +90,9 @@ typedef struct
unsigned int info; unsigned int info;
unsigned int addralign; unsigned int addralign;
unsigned int entsize; unsigned int entsize;
} Section_Header; };
typedef struct struct Symbol_Header
{ {
unsigned int name; unsigned int name;
unsigned int value; unsigned int value;
@ -100,13 +100,13 @@ typedef struct
unsigned char info; unsigned char info;
unsigned char other; unsigned char other;
unsigned short shndx; unsigned short shndx;
} Symbol_Header; };
typedef struct struct Rela_Header
{ {
unsigned int offset; unsigned int offset;
unsigned int info; unsigned int info;
signed int addend; signed int addend;
} Rela_Header; };
const char ELFID[4] = {0x7F, 'E', 'L', 'F'}; const char ELFID[4] = {0x7F, 'E', 'L', 'F'};

View File

@ -46,7 +46,7 @@ private:
}; };
/* Device descriptor */ /* Device descriptor */
typedef struct struct WiiHIDDeviceDescriptor
{ {
u8 bLength; u8 bLength;
u8 bDescriptorType; u8 bDescriptorType;
@ -63,9 +63,9 @@ private:
u8 iSerialNumber; u8 iSerialNumber;
u8 bNumConfigurations; u8 bNumConfigurations;
u8 pad[2]; u8 pad[2];
} WiiHIDDeviceDescriptor; };
typedef struct struct WiiHIDConfigDescriptor
{ {
u8 bLength; u8 bLength;
u8 bDescriptorType; u8 bDescriptorType;
@ -76,9 +76,9 @@ private:
u8 bmAttributes; u8 bmAttributes;
u8 MaxPower; u8 MaxPower;
u8 pad[3]; u8 pad[3];
} WiiHIDConfigDescriptor; };
typedef struct struct WiiHIDInterfaceDescriptor
{ {
u8 bLength; u8 bLength;
u8 bDescriptorType; u8 bDescriptorType;
@ -90,9 +90,9 @@ private:
u8 bInterfaceProtocol; u8 bInterfaceProtocol;
u8 iInterface; u8 iInterface;
u8 pad[3]; u8 pad[3];
} WiiHIDInterfaceDescriptor; };
typedef struct struct WiiHIDEndpointDescriptor
{ {
u8 bLength; u8 bLength;
u8 bDescriptorType; u8 bDescriptorType;
@ -103,7 +103,7 @@ private:
u8 bRefresh; u8 bRefresh;
u8 bSynchAddress; u8 bSynchAddress;
u8 pad[1]; u8 pad[1];
} WiiHIDEndpointDescriptor; };
u32 deviceCommandAddress; u32 deviceCommandAddress;
void FillOutDevices(u32 BufferOut, u32 BufferOutSize); void FillOutDevices(u32 BufferOut, u32 BufferOutSize);