pcsx2/common: fix tons of warning spamming on clang

* Don't use parameter name to avoid unused parameter
* Set a default for various case
This commit is contained in:
Gregory Hainaut 2014-07-05 00:06:26 +02:00
parent e6e7c95e94
commit c5d2343f51
13 changed files with 50 additions and 36 deletions

View File

@ -129,32 +129,32 @@ struct IConsoleWriter
// //
struct NullConsoleWriter struct NullConsoleWriter
{ {
void WriteRaw( const wxString& fmt ) {} void WriteRaw( const wxString& ) {}
void DoWriteLn( const wxString& fmt ) {} void DoWriteLn( const wxString& ) {}
void DoSetColor( ConsoleColors color ) {} void DoSetColor( ConsoleColors ) {}
void DoWriteFromStdout( const wxString& fmt ) {} void DoWriteFromStdout( const wxString& ) {}
void Newline() {} void Newline() {}
void SetTitle( const wxString& title ) {} void SetTitle( const wxString& ) {}
ConsoleColors GetColor() const { return Color_Current; } ConsoleColors GetColor() const { return Color_Current; }
const NullConsoleWriter& SetColor( ConsoleColors color ) const { return *this; } const NullConsoleWriter& SetColor( ConsoleColors ) const { return *this; }
const NullConsoleWriter& ClearColor() const { return *this; } const NullConsoleWriter& ClearColor() const { return *this; }
const NullConsoleWriter& SetIndent( int tabcount=1 ) const { return *this; } const NullConsoleWriter& SetIndent( int =1 ) const { return *this; }
NullConsoleWriter Indent( int tabcount=1 ) const { return NullConsoleWriter(); } NullConsoleWriter Indent( int =1 ) const { return NullConsoleWriter(); }
bool FormatV( const char* fmt, va_list args ) const { return false; } bool FormatV( const char* , va_list ) const { return false; }
bool WriteLn( ConsoleColors color, const char* fmt, ... ) const { return false; } bool WriteLn( ConsoleColors , const char* , ... ) const { return false; }
bool WriteLn( const char* fmt, ... ) const { return false; } bool WriteLn( const char* , ... ) const { return false; }
bool Error( const char* fmt, ... ) const { return false; } bool Error( const char* , ... ) const { return false; }
bool Warning( const char* fmt, ... ) const { return false; } bool Warning( const char* , ... ) const { return false; }
bool FormatV( const wxChar* fmt, va_list args ) const { return false; } bool FormatV( const wxChar* , va_list ) const { return false; }
bool WriteLn( ConsoleColors color, const wxChar* fmt, ... ) const { return false; } bool WriteLn( ConsoleColors , const wxChar* , ... ) const { return false; }
bool WriteLn( const wxChar* fmt, ... ) const { return false; } bool WriteLn( const wxChar* , ... ) const { return false; }
bool Error( const wxChar* fmt, ... ) const { return false; } bool Error( const wxChar* , ... ) const { return false; }
bool Warning( const wxChar* fmt, ... ) const { return false; } bool Warning( const wxChar* , ... ) const { return false; }
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------

View File

@ -52,12 +52,12 @@ public:
OnPageFaultEvent( evtinfo, handled ); OnPageFaultEvent( evtinfo, handled );
} }
virtual void DispatchEvent( const PageFaultInfo& evtinfo ) virtual void DispatchEvent( const PageFaultInfo& )
{ {
pxFailRel( "Don't call me, damnit. Use DispatchException instead." ); pxFailRel( "Don't call me, damnit. Use DispatchException instead." );
} }
virtual void OnPageFaultEvent( const PageFaultInfo& evtinfo, bool& handled ) {} virtual void OnPageFaultEvent( const PageFaultInfo& , bool& ) {}
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------

View File

@ -44,7 +44,7 @@ namespace Threading
void SetThread( pxThread& thr ) { m_thread = &thr; } void SetThread( pxThread& thr ) { m_thread = &thr; }
void SetThread( pxThread* thr ) { m_thread = thr; } void SetThread( pxThread* thr ) { m_thread = thr; }
void DispatchEvent( const int& params ) void DispatchEvent( const int& )
{ {
OnThreadCleanup(); OnThreadCleanup();
} }

View File

@ -92,8 +92,8 @@ public:
// Gets a pointer to the element directly after the last element in the array. // Gets a pointer to the element directly after the last element in the array.
// This is equivalent to doing GetPtr(GetLength()), except that this call *avoids* // This is equivalent to doing GetPtr(GetLength()), except that this call *avoids*
// the out-of-bounds assertion check that typically occurs when you do that. :) // the out-of-bounds assertion check that typically occurs when you do that. :)
T* GetPtrEnd( uint idx=0 ) { return &m_ptr[m_size]; } T* GetPtrEnd() { return &m_ptr[m_size]; }
const T* GetPtrEnd( uint idx=0 ) const { return &m_ptr[m_size]; } const T* GetPtrEnd() const { return &m_ptr[m_size]; }
// Gets an element of this memory allocation much as if it were an array. // Gets an element of this memory allocation much as if it were an array.
// DevBuilds : Generates assertion if the index is invalid. // DevBuilds : Generates assertion if the index is invalid.

View File

@ -143,7 +143,7 @@ public:
return false; return false;
} }
virtual void ApplyPrefix( FastFormatAscii& ascii ) const {} virtual void ApplyPrefix( FastFormatAscii& ) const {}
virtual void DoWrite( const char* fmt ) const=0; virtual void DoWrite( const char* fmt ) const=0;
}; };

View File

@ -91,7 +91,7 @@ struct pxAlignmentType
return Apply().Border( dir, padding ); return Apply().Border( dir, padding );
} }
wxSizerFlags Proportion( int prop ) const wxSizerFlags Proportion() const
{ {
return Apply().Proportion( intval ); return Apply().Proportion( intval );
} }
@ -127,7 +127,7 @@ struct pxStretchType
return Apply().Border( dir, padding ); return Apply().Border( dir, padding );
} }
wxSizerFlags Proportion( int prop ) const wxSizerFlags Proportion() const
{ {
return Apply().Proportion( intval ); return Apply().Proportion( intval );
} }
@ -438,7 +438,7 @@ public:
// NOTE: Enabling system menu on dialogs usually doesn't work, and might cause // NOTE: Enabling system menu on dialogs usually doesn't work, and might cause
// other unwanted behavior, such as a missing close button. // other unwanted behavior, such as a missing close button.
pxDialogCreationFlags SystemMenu( bool enable=true ) const pxDialogCreationFlags SystemMenu( bool =true ) const
{ {
return pxDialogCreationFlags(*this).SetSystemMenu( false ); return pxDialogCreationFlags(*this).SetSystemMenu( false );
} }
@ -648,7 +648,7 @@ public:
protected: protected:
// line may be empty // line may be empty
virtual void OnOutputLine(const wxString& line) { } virtual void OnOutputLine(const wxString&) { }
// called at the start of every new line (except the very first one) // called at the start of every new line (except the very first one)
virtual void OnNewLine() { } virtual void OnNewLine() { }

View File

@ -648,6 +648,7 @@ struct Gif_Unit {
} }
void PrintPathInfo(GIF_PATH path) { void PrintPathInfo(GIF_PATH path) {
(void)path; // avoid silly warning
GUNIT_LOG("Gif Path %d - [hasData = %d][state = %d]", path, GUNIT_LOG("Gif Path %d - [hasData = %d][state = %d]", path,
gifPath[path].hasDataRemaining(), gifPath[path].state); gifPath[path].hasDataRemaining(), gifPath[path].state);
} }

View File

@ -177,6 +177,7 @@ mem32_t __fastcall _hwRead32(u32 mem)
} }
} }
break; break;
default: break;
} }
//Hack for Transformers and Test Drive Unlimited to simulate filling the VIF FIFO //Hack for Transformers and Test Drive Unlimited to simulate filling the VIF FIFO
//It actually stalls VIF a few QW before the end of the transfer, so we need to pretend its all gone //It actually stalls VIF a few QW before the end of the transfer, so we need to pretend its all gone
@ -302,6 +303,7 @@ static void _hwRead64(u32 mem, mem64_t* result )
} }
} }
return; return;
default: break;
} }
*result = _hwRead32<page,false>( mem ); *result = _hwRead32<page,false>( mem );

View File

@ -425,6 +425,8 @@ void __fastcall _hwWrite128(u32 mem, const mem128_t* srcval)
} }
return; return;
default: break;
} }
// All upper bits of all non-FIFO 128-bit HW writes are almost certainly disregarded. --air // All upper bits of all non-FIFO 128-bit HW writes are almost certainly disregarded. --air

View File

@ -42,9 +42,9 @@ public:
virtual void close() = 0; virtual void close() = 0;
virtual int lseek(s32 offset, s32 whence) { return -IOP_EIO; } virtual int lseek(s32 , s32 ) { return -IOP_EIO; }
virtual int read(void *buf, u32 count) { return -IOP_EIO; } virtual int read(void *, u32 ) { return -IOP_EIO; }
virtual int write(void *buf, u32 count) { return -IOP_EIO; } virtual int write(void *, u32 ) { return -IOP_EIO; }
}; };
class IOManDir { class IOManDir {

View File

@ -262,6 +262,7 @@ static mem8_t __fastcall _ext_memRead8 (u32 mem)
Console.WriteLn("DEV9 read8 %8.8lx: %2.2lx", mem & ~0xa4000000, retval); Console.WriteLn("DEV9 read8 %8.8lx: %2.2lx", mem & ~0xa4000000, retval);
return retval; return retval;
} }
default: break;
} }
MEM_LOG("Unknown Memory Read8 from address %8.8x", mem); MEM_LOG("Unknown Memory Read8 from address %8.8x", mem);
@ -291,6 +292,8 @@ static mem16_t __fastcall _ext_memRead16(u32 mem)
case 8: // spu2 case 8: // spu2
return SPU2read(mem); return SPU2read(mem);
default: break;
} }
MEM_LOG("Unknown Memory read16 from address %8.8x", mem); MEM_LOG("Unknown Memory read16 from address %8.8x", mem);
cpuTlbMissR(mem, cpuRegs.branch); cpuTlbMissR(mem, cpuRegs.branch);
@ -310,6 +313,7 @@ static mem32_t __fastcall _ext_memRead32(u32 mem)
Console.WriteLn("DEV9 read32 %8.8lx: %8.8lx", mem & ~0xa4000000, retval); Console.WriteLn("DEV9 read32 %8.8lx: %8.8lx", mem & ~0xa4000000, retval);
return retval; return retval;
} }
default: break;
} }
MEM_LOG("Unknown Memory read32 from address %8.8x (Status=%8.8x)", mem, cpuRegs.CP0.n.Status.val); MEM_LOG("Unknown Memory read32 from address %8.8x (Status=%8.8x)", mem, cpuRegs.CP0.n.Status.val);
@ -324,6 +328,7 @@ static void __fastcall _ext_memRead64(u32 mem, mem64_t *out)
{ {
case 6: // gsm case 6: // gsm
*out = gsRead64(mem); return; *out = gsRead64(mem); return;
default: break;
} }
MEM_LOG("Unknown Memory read64 from address %8.8x", mem); MEM_LOG("Unknown Memory read64 from address %8.8x", mem);
@ -340,6 +345,7 @@ static void __fastcall _ext_memRead128(u32 mem, mem128_t *out)
case 6: // gsm case 6: // gsm
CopyQWC(out,PS2GS_BASE(mem)); CopyQWC(out,PS2GS_BASE(mem));
return; return;
default: break;
} }
MEM_LOG("Unknown Memory read128 from address %8.8x", mem); MEM_LOG("Unknown Memory read128 from address %8.8x", mem);
@ -358,6 +364,7 @@ static void __fastcall _ext_memWrite8 (u32 mem, mem8_t value)
DEV9write8(mem & ~0xa4000000, value); DEV9write8(mem & ~0xa4000000, value);
Console.WriteLn("DEV9 write8 %8.8lx: %2.2lx", mem & ~0xa4000000, value); Console.WriteLn("DEV9 write8 %8.8lx: %2.2lx", mem & ~0xa4000000, value);
return; return;
default: break;
} }
MEM_LOG("Unknown Memory write8 to address %x with data %2.2x", mem, value); MEM_LOG("Unknown Memory write8 to address %x with data %2.2x", mem, value);
@ -379,6 +386,7 @@ static void __fastcall _ext_memWrite16(u32 mem, mem16_t value)
return; return;
case 8: // spu2 case 8: // spu2
SPU2write(mem, value); return; SPU2write(mem, value); return;
default: break;
} }
MEM_LOG("Unknown Memory write16 to address %x with data %4.4x", mem, value); MEM_LOG("Unknown Memory write16 to address %x with data %4.4x", mem, value);
cpuTlbMissW(mem, cpuRegs.branch); cpuTlbMissW(mem, cpuRegs.branch);
@ -394,6 +402,7 @@ static void __fastcall _ext_memWrite32(u32 mem, mem32_t value)
DEV9write32(mem & ~0xa4000000, value); DEV9write32(mem & ~0xa4000000, value);
Console.WriteLn("DEV9 write32 %8.8lx: %8.8lx", mem & ~0xa4000000, value); Console.WriteLn("DEV9 write32 %8.8lx: %8.8lx", mem & ~0xa4000000, value);
return; return;
default: break;
} }
MEM_LOG("Unknown Memory write32 to address %x with data %8.8x", mem, value); MEM_LOG("Unknown Memory write32 to address %x with data %8.8x", mem, value);
cpuTlbMissW(mem, cpuRegs.branch); cpuTlbMissW(mem, cpuRegs.branch);

View File

@ -236,7 +236,7 @@ public:
IEventListener_SysState() {} IEventListener_SysState() {}
virtual ~IEventListener_SysState() throw() {} virtual ~IEventListener_SysState() throw() {}
virtual void DispatchEvent( const SysStateUnlockedParams& status ) virtual void DispatchEvent( const SysStateUnlockedParams& )
{ {
SysStateAction_OnUnlocked(); SysStateAction_OnUnlocked();
} }

View File

@ -177,10 +177,10 @@ public:
void Step(); void Step();
void Execute(u32 cycles); void Execute(u32 cycles);
void Clear(u32 addr, u32 size) {} void Clear(u32 , u32 ) {}
uint GetCacheReserve() const { return 0; } uint GetCacheReserve() const { return 0; }
void SetCacheReserve( uint reserveInMegs ) const {} void SetCacheReserve( uint ) const {}
}; };
class InterpVU1 : public BaseVUmicroCPU class InterpVU1 : public BaseVUmicroCPU
@ -198,11 +198,11 @@ public:
void Step(); void Step();
void Execute(u32 cycles); void Execute(u32 cycles);
void Clear(u32 addr, u32 size) {} void Clear(u32 , u32 ) {}
void ResumeXGkick() {} void ResumeXGkick() {}
uint GetCacheReserve() const { return 0; } uint GetCacheReserve() const { return 0; }
void SetCacheReserve( uint reserveInMegs ) const {} void SetCacheReserve( uint ) const {}
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------