Some code clean up. I am terrible at coding styles...

This commit is contained in:
Matthew Parlane 2012-03-18 21:50:07 +13:00
parent 6fe495e1aa
commit 8479d5bdf7
1 changed files with 21 additions and 12 deletions

View File

@ -85,7 +85,8 @@ void Init()
_dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init"); _dbg_assert_msg_(WII_IPC_HLE, g_DeviceMap.empty(), "DeviceMap isnt empty on init");
u32 i; u32 i;
for(i=0; i<IPC_MAX_FDS; i++){ for (i=0; i<IPC_MAX_FDS; i++)
{
g_FdMap[i] = NULL; g_FdMap[i] = NULL;
} }
@ -121,7 +122,8 @@ void Reset(bool _bHard)
{ {
u32 i; u32 i;
for (i=0; i<IPC_MAX_FDS; i++){ for (i=0; i<IPC_MAX_FDS; i++)
{
if (g_FdMap[i] != NULL && !g_FdMap[i]->IsHardware()) if (g_FdMap[i] != NULL && !g_FdMap[i]->IsHardware())
{ {
// close all files and delete their resources // close all files and delete their resources
@ -185,7 +187,8 @@ void SDIO_EventNotify()
int getFreeDeviceId() int getFreeDeviceId()
{ {
u32 i; u32 i;
for(i=0; i<IPC_MAX_FDS; i++){ for (i=0; i<IPC_MAX_FDS; i++)
{
if (g_FdMap[i] == NULL) if (g_FdMap[i] == NULL)
{ {
return i; return i;
@ -248,10 +251,12 @@ void DoState(PointerWrap &p)
if (p.GetMode() == PointerWrap::MODE_READ) if (p.GetMode() == PointerWrap::MODE_READ)
{ {
u32 i; u32 i;
for (i=0; i<IPC_MAX_FDS; i++){ for (i=0; i<IPC_MAX_FDS; i++)
{
u32 exists; u32 exists;
p.Do(exists); p.Do(exists);
if (exists){ if (exists)
{
u32 isHw; u32 isHw;
p.Do(isHw); p.Do(isHw);
if (isHw) if (isHw)
@ -283,10 +288,12 @@ void DoState(PointerWrap &p)
else else
{ {
u32 i; u32 i;
for (i=0; i<IPC_MAX_FDS; i++){ for (i=0; i<IPC_MAX_FDS; i++)
{
u32 exists = g_FdMap[i] ? 1 : 0; u32 exists = g_FdMap[i] ? 1 : 0;
p.Do(exists); p.Do(exists);
if (exists){ if (exists)
{
u32 isHw = g_FdMap[i]->IsHardware() ? 1 : 0; u32 isHw = g_FdMap[i]->IsHardware() ? 1 : 0;
p.Do(isHw); p.Do(isHw);
if (isHw) if (isHw)
@ -553,8 +560,10 @@ void Update()
void UpdateDevices() void UpdateDevices()
{ {
// Check if a hardware device must be updated // Check if a hardware device must be updated
for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != g_DeviceMap.end(); ++itr) { for (TDeviceMap::const_iterator itr = g_DeviceMap.begin(); itr != g_DeviceMap.end(); ++itr)
if (itr->second->IsOpened() && itr->second->Update()) { {
if (itr->second->IsOpened() && itr->second->Update())
{
break; break;
} }
} }