pcsx2: add various default case statement

Note: add a note on some case note handled properly not sure how to fix them.
Actually there are potentially invalid case.
This commit is contained in:
Gregory Hainaut 2014-07-12 12:47:35 +02:00
parent f401f817ed
commit a1ac59a48a
9 changed files with 26 additions and 7 deletions

View File

@ -30,8 +30,9 @@ const wxChar* EnumToString( SSE_RoundMode sse )
case SSEround_NegInf: return L"NegativeInfinity"; case SSEround_NegInf: return L"NegativeInfinity";
case SSEround_PosInf: return L"PositiveInfinity"; case SSEround_PosInf: return L"PositiveInfinity";
case SSEround_Chop: return L"Chop"; case SSEround_Chop: return L"Chop";
default: return L"Invalid";
} }
return L"Invalid"; return L"Invalid";
} }

View File

@ -211,6 +211,8 @@ void DisassemblyManager::analyze(u32 address, u32 size = 1024)
address = info.address+info.size; address = info.address+info.size;
} }
break; break;
default:
break;
} }
} }
@ -986,6 +988,8 @@ void DisassemblyData::createLines()
pos += 4; pos += 4;
} }
break; break;
default:
break;
} }
size_t len = strlen(buffer); size_t len = strlen(buffer);

View File

@ -32,7 +32,7 @@ struct DisassemblyLineInfo
u32 totalSize; u32 totalSize;
}; };
enum LineType { LINE_UP, LINE_DOWN, LINE_RIGHT }; enum LineType { LINE_UP, LINE_DOWN };
struct BranchLine struct BranchLine
{ {

View File

@ -291,6 +291,8 @@ namespace MIPSAnalyst
case BRANCH: case BRANCH:
info.branchTarget = info.opcodeAddress + 4 + ((signed short)(op&0xFFFF)<<2); info.branchTarget = info.opcodeAddress + 4 + ((signed short)(op&0xFFFF)<<2);
break; break;
case NONE:
return false;
} }
return true; return true;

View File

@ -264,9 +264,6 @@ namespace ioman {
void close() void close()
{ {
if (type == FILE_FREE)
return;
switch (type) switch (type)
{ {
case FILE_FILE: case FILE_FILE:
@ -277,6 +274,8 @@ namespace ioman {
dir->close(); dir->close();
dir = NULL; dir = NULL;
break; break;
case FILE_FREE:
return;
} }
type = FILE_FREE; type = FILE_FREE;

View File

@ -93,6 +93,9 @@ void SysThreadBase::Suspend( bool isBlocking )
switch( m_ExecMode ) switch( m_ExecMode )
{ {
// FIXME what to do for this case
// case ExecMode_NoThreadYet:
// Check again -- status could have changed since above. // Check again -- status could have changed since above.
case ExecMode_Closed: return; case ExecMode_Closed: return;
@ -109,6 +112,9 @@ void SysThreadBase::Suspend( bool isBlocking )
case ExecMode_Opened: case ExecMode_Opened:
m_ExecMode = ExecMode_Closing; m_ExecMode = ExecMode_Closing;
break; break;
case ExecMode_Closing:
break;
} }
pxAssertDev( m_ExecMode == ExecMode_Closing, "ExecMode should be nothing other than Closing..." ); pxAssertDev( m_ExecMode == ExecMode_Closing, "ExecMode should be nothing other than Closing..." );
@ -214,6 +220,10 @@ void SysThreadBase::Resume()
if( (m_ExecMode != ExecMode_Closed) && (m_ExecMode != ExecMode_Paused) ) return; if( (m_ExecMode != ExecMode_Closed) && (m_ExecMode != ExecMode_Paused) ) return;
if( !GetCorePlugins().AreLoaded() ) return; if( !GetCorePlugins().AreLoaded() ) return;
break; break;
case ExecMode_Paused:
case ExecMode_Closed:
break;
} }
pxAssertDev( (m_ExecMode == ExecMode_Closed) || (m_ExecMode == ExecMode_Paused), pxAssertDev( (m_ExecMode == ExecMode_Closed) || (m_ExecMode == ExecMode_Paused),

View File

@ -132,6 +132,9 @@ void Pcsx2App::DispatchEvent( CoreThreadStatus evt )
{ {
switch( evt ) switch( evt )
{ {
// FIXME what to do for this case
// case CoreThread_Indeterminate:
case CoreThread_Started: case CoreThread_Started:
case CoreThread_Reset: case CoreThread_Reset:
case CoreThread_Stopped: case CoreThread_Stopped:

View File

@ -182,6 +182,7 @@ namespace Implementations
case AspectRatio_Stretch: art = AspectRatio_4_3; arts = L"AspectRatio_4_3"; break; case AspectRatio_Stretch: art = AspectRatio_4_3; arts = L"AspectRatio_4_3"; break;
case AspectRatio_4_3: art = AspectRatio_16_9; arts = L"AspectRatio_16:9"; break; case AspectRatio_4_3: art = AspectRatio_16_9; arts = L"AspectRatio_16:9"; break;
case AspectRatio_16_9: art = AspectRatio_Stretch; arts = L"AspectRatio_Stretch";break; case AspectRatio_16_9: art = AspectRatio_Stretch; arts = L"AspectRatio_Stretch";break;
default: break;
} }
Console.WriteLn(L"(GSwindow) Aspect ratio: %s.", arts.c_str()); Console.WriteLn(L"(GSwindow) Aspect ratio: %s.", arts.c_str());

View File

@ -244,8 +244,7 @@ GameDatabaseListView& GameDatabaseListView::SortBy( GameDataColumnId column )
case GdbCol_Compat: std::sort(begin, end, GLSort_byCompat(isDescending)); break; case GdbCol_Compat: std::sort(begin, end, GLSort_byCompat(isDescending)); break;
case GdbCol_Patches: std::sort(begin, end, GLSort_byPatches(isDescending)); break; case GdbCol_Patches: std::sort(begin, end, GLSort_byPatches(isDescending)); break;
// do not use jNO_DEFAULT here -- keeps release builds from crashing (it'll just default: break; // for GdbCol_Count
// ignore the sort request!)
} }
//m_GamesInView.( ); //m_GamesInView.( );