mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #109 from lioncash/file-io-clarifications
Eliminate the magic constants in the switch statement in WII_IPC_HLE_Device_FileIO.cpp's Seek function.
This commit is contained in:
commit
70b3749d4b
@ -162,7 +162,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
|
||||
switch (Mode)
|
||||
{
|
||||
case 0:
|
||||
case WII_SEEK_SET:
|
||||
{
|
||||
if ((SeekPosition >=0) && (SeekPosition <= fileSize))
|
||||
{
|
||||
@ -171,7 +171,8 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
|
||||
case WII_SEEK_CUR:
|
||||
{
|
||||
s32 wantedPos = SeekPosition+m_SeekPos;
|
||||
if (wantedPos >=0 && wantedPos <= fileSize)
|
||||
@ -181,9 +182,10 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
||||
case WII_SEEK_END:
|
||||
{
|
||||
s32 wantedPos = fileSize+m_SeekPos;
|
||||
s32 wantedPos = SeekPosition+fileSize;
|
||||
if (wantedPos >=0 && wantedPos <= fileSize)
|
||||
{
|
||||
m_SeekPos = wantedPos;
|
||||
@ -191,6 +193,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
PanicAlert("CWII_IPC_HLE_Device_FileIO Unsupported seek mode %i", Mode);
|
||||
|
@ -35,6 +35,13 @@ private:
|
||||
ISFS_OPEN_RW = (ISFS_OPEN_READ | ISFS_OPEN_WRITE)
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
WII_SEEK_SET = 0,
|
||||
WII_SEEK_CUR = 1,
|
||||
WII_SEEK_END = 2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ISFS_FUNCNULL = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user