diff --git a/src/GameState.cpp b/src/GameState.cpp index 11365834ea..0daead14cf 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -1551,6 +1551,8 @@ bool GameState::ShowW1() const case ALLOW_W1_EVERYWHERE: return true; default: ASSERT(0); } + // it should never hit here. + return false; } @@ -2424,7 +2426,7 @@ public: LuaHelpers::CreateTableFromArray( vHP, L ); return 1; } - static int GetEnabledPlayers(T* p, lua_State *L ) + static int GetEnabledPlayers(T* , lua_State *L ) { vector vEP; FOREACH_EnabledPlayer( pn ) @@ -2438,7 +2440,7 @@ public: LuaHelpers::Push( L, pStyle ); return 1; } - static int IsAnyHumanPlayerUsingMemoryCard( T* p, lua_State *L ) + static int IsAnyHumanPlayerUsingMemoryCard( T* , lua_State *L ) { bool bUsingMemoryCard = false; FOREACH_HumanPlayer( pn ) @@ -2449,7 +2451,11 @@ public: lua_pushboolean(L, bUsingMemoryCard ); return 1; } - static int GetNumStagesForCurrentSongAndStepsOrCourse( T* p, lua_State *L ) { lua_pushnumber(L, GAMESTATE->GetNumStagesForCurrentSongAndStepsOrCourse() ); return 1; } + static int GetNumStagesForCurrentSongAndStepsOrCourse( T* , lua_State *L ) + { + lua_pushnumber(L, GAMESTATE->GetNumStagesForCurrentSongAndStepsOrCourse() ); + return 1; + } static int GetNumStagesLeft( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check(L, 1); diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 9c56d5af6b..6b154fb0fc 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -580,8 +580,10 @@ const RString& ProfileManager::GetProfileDir( ProfileSlot slot ) const case ProfileSlot_Machine: return MACHINE_PROFILE_DIR; default: - ASSERT(0); + break; } + // it should never hit here. + FAIL_M("Invalid profile slot chosen: unable to get the directory!"); } RString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const @@ -596,6 +598,8 @@ RString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const default: ASSERT(0); } + // it should never hit here. + return RString(); } const Profile* ProfileManager::GetProfile( ProfileSlot slot ) const @@ -610,6 +614,8 @@ const Profile* ProfileManager::GetProfile( ProfileSlot slot ) const default: ASSERT(0); } + // it should never hit here. + return NULL; } // @@ -822,7 +828,7 @@ public: static int IsPersistentProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsPersistentProfile(Enum::Check(L, 1)) ); return 1; } static int GetProfile( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check(L, 1); Profile* pP = p->GetProfile(pn); ASSERT(pP != NULL); pP->PushSelf(L); return 1; } static int GetMachineProfile( T* p, lua_State *L ) { p->GetMachineProfile()->PushSelf(L); return 1; } - static int SaveMachineProfile( T* p, lua_State *L ) { p->SaveMachineProfile(); return 0; } + static int SaveMachineProfile( T* p, lua_State * ) { p->SaveMachineProfile(); return 0; } static int GetLocalProfile( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfile(SArg(1)); @@ -842,7 +848,7 @@ public: static int LastLoadWasTamperedOrCorrupt( T* p, lua_State *L ) { lua_pushboolean(L, p->LastLoadWasTamperedOrCorrupt(Enum::Check(L, 1)) ); return 1; } static int GetPlayerName( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check(L, 1); lua_pushstring(L, p->GetPlayerName(pn)); return 1; } - static int LocalProfileIDToDir( T* p, lua_State *L ) + static int LocalProfileIDToDir( T* , lua_State *L ) { RString dir = USER_PROFILES_DIR + SArg(1) + "/"; lua_pushstring( L, dir ); diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index 1f387e7c29..351e8bedb3 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -185,7 +185,7 @@ static LocalizedString D3D_NOT_INSTALLED ( "RageDisplay_D3D", "DirectX 8.1 or gr const RString D3D_URL = "http://www.microsoft.com/downloads/details.aspx?FamilyID=a19bed22-0b25-4e5d-a584-6389d8a3dad0&displaylang=en"; static LocalizedString HARDWARE_ACCELERATION_NOT_AVAILABLE ( "RageDisplay_D3D", "Your system is reporting that Direct3D hardware acceleration is not available. Please obtain an updated driver from your video card manufacturer." ); -RString RageDisplay_D3D::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) +RString RageDisplay_D3D::Init( const VideoModeParams &p, bool /* bAllowUnacceleratedRenderer */ ) { GraphicsWindow::Initialize( true ); @@ -661,7 +661,7 @@ RageSurface* RageDisplay_D3D::CreateScreenshot() } RageSurface *surface = CreateSurfaceFromPixfmt( PixelFormat_RGBA8, lr.pBits, desc.Width, desc.Height, lr.Pitch); - ASSERT( surface ); + ASSERT( surface != NULL ); // We need to make a copy, since lr.pBits will go away when we call UnlockRect(). RageSurface *SurfaceCopy = @@ -1406,7 +1406,7 @@ void RageDisplay_D3D::UpdateTexture( ASSERT( texpixfmt != NUM_PixelFormat ); RageSurface *Texture = CreateSurfaceFromPixfmt(PixelFormat(texpixfmt), lr.pBits, width, height, lr.Pitch); - ASSERT( Texture ); + ASSERT( Texture != NULL ); RageSurfaceUtils::Blit( img, Texture, width, height ); delete Texture; diff --git a/src/RageSound.cpp b/src/RageSound.cpp index f53ce1c0a5..462be50b15 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -53,7 +53,7 @@ RageSound::RageSound(): m_iStoppedSourceFrame(0), m_bPlaying(false), m_bDeleteWhenFinished(false), m_sError("") { - ASSERT( SOUNDMAN ); + ASSERT( SOUNDMAN != NULL ); } RageSound::~RageSound() @@ -65,7 +65,7 @@ RageSound::RageSound( const RageSound &cpy ): RageSoundBase( cpy ), m_Mutex( "RageSound" ) { - ASSERT(SOUNDMAN); + ASSERT(SOUNDMAN != NULL); m_pSource = NULL; @@ -266,7 +266,7 @@ int RageSound::GetDataToPlay( float *pBuffer, int iFrames, int64_t &iStreamFrame // LockMut(m_Mutex); ASSERT_M( m_bPlaying, ssprintf("%p", this) ); - ASSERT( m_pSource ); + ASSERT( m_pSource != NULL ); iFramesStored = 0; iStreamFrame = m_iStreamFrame; diff --git a/src/RageSoundReader.h b/src/RageSoundReader.h index ccb99351cd..635f4fefc0 100644 --- a/src/RageSoundReader.h +++ b/src/RageSoundReader.h @@ -14,7 +14,7 @@ public: virtual RageSoundReader *Copy() const = 0; virtual int GetSampleRate() const = 0; virtual unsigned GetNumChannels() const = 0; - virtual bool SetProperty( const RString &sProperty, float fValue ) { return false; } + virtual bool SetProperty( const RString & /* sProperty */, float /* fValue */ ) { return false; } virtual RageSoundReader *GetSource() { return NULL; } /* Return values for Read(). */ diff --git a/src/RageSoundReader_Extend.cpp b/src/RageSoundReader_Extend.cpp index 38beacfa35..c5e5e87f1c 100644 --- a/src/RageSoundReader_Extend.cpp +++ b/src/RageSoundReader_Extend.cpp @@ -15,7 +15,7 @@ RageSoundReader_Extend::RageSoundReader_Extend( RageSoundReader *pSource ): RageSoundReader_Filter( pSource ) { - ASSERT_M(pSource, "The music file was not found! Was it deleted or moved while the game was on?"); + ASSERT_M(pSource != NULL, "The music file was not found! Was it deleted or moved while the game was on?"); m_iPositionFrames = pSource->GetNextSourceFrame(); m_StopMode = M_STOP; diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index c0a2253dd1..ff7e659bf1 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -47,7 +47,7 @@ int RageSoundReader_Preload::GetTotalFrames() const bool RageSoundReader_Preload::Open( RageSoundReader *pSource ) { - ASSERT( pSource ); + ASSERT( pSource != NULL ); m_iSampleRate = pSource->GetSampleRate(); m_iChannels = pSource->GetNumChannels(); m_fRate = pSource->GetStreamToSourceRatio(); diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index 9721dd6cc7..ecc176c108 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -667,7 +667,7 @@ int RageSoundReader_Resample_Good::Read( float *pBuf, int iFrames ) { int iFramesNeeded = m_apResamplers[0]->NumInputsForOutputSamples(iFrames); float *pTmpBuf = (float *) alloca( iFramesNeeded * sizeof(float) * iChannels ); - ASSERT( pTmpBuf ); + ASSERT( pTmpBuf != NULL ); int iFramesIn = m_pSource->Read( pTmpBuf, iFramesNeeded ); if( iFramesIn < 0 ) return iFramesIn; diff --git a/src/RageSoundReader_Vorbisfile.cpp b/src/RageSoundReader_Vorbisfile.cpp index 3f040f4e31..6b60ab34bc 100644 --- a/src/RageSoundReader_Vorbisfile.cpp +++ b/src/RageSoundReader_Vorbisfile.cpp @@ -261,7 +261,7 @@ int RageSoundReader_Vorbisfile::Read( float *buf, int iFrames ) int RageSoundReader_Vorbisfile::GetSampleRate() const { - ASSERT(vf); + ASSERT(vf != NULL); vorbis_info *vi = ov_info(vf, -1); ASSERT(vi != NULL); @@ -271,7 +271,7 @@ int RageSoundReader_Vorbisfile::GetSampleRate() const int RageSoundReader_Vorbisfile::GetNextSourceFrame() const { - ASSERT(vf); + ASSERT(vf != NULL); int iFrame = (int)ov_pcm_tell( vf ); return iFrame; diff --git a/src/RageTimer.cpp b/src/RageTimer.cpp index 8b15b3341b..3c480dc7af 100644 --- a/src/RageTimer.cpp +++ b/src/RageTimer.cpp @@ -32,7 +32,7 @@ const RageTimer RageZeroTimer(0,0); static uint64_t g_iStartTime = ArchHooks::GetMicrosecondsSinceStart( true ); -static uint64_t GetTime( bool bAccurate ) +static uint64_t GetTime( bool /* bAccurate */ ) { return ArchHooks::GetMicrosecondsSinceStart( true ); diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h index fee3d0d97d..2027870be6 100644 --- a/src/ScreenGameplay.h +++ b/src/ScreenGameplay.h @@ -172,7 +172,7 @@ public: bool IsPaused() const { return m_bPaused; } protected: - virtual void UpdateStageStats( MultiPlayer mp ) {}; // overridden for multiplayer + virtual void UpdateStageStats( MultiPlayer /* mp */ ) {}; // overridden for multiplayer virtual bool UseSongBackgroundAndForeground() const { return true; } diff --git a/src/XmlFile.cpp b/src/XmlFile.cpp index 7e99ecb41e..1cb67627d8 100644 --- a/src/XmlFile.cpp +++ b/src/XmlFile.cpp @@ -137,7 +137,7 @@ XNode *XNode::AppendChild( XNode *node ) } // detach node and delete object -bool XNode::RemoveChild( XNode *node, bool bDelete ) +bool XNode::RemoveChild( XNode *node, bool /* bDelete */ ) { XNodes::iterator it = find( m_childs.begin(), m_childs.end(), node ); if( it == m_childs.end() ) diff --git a/src/archutils/Win32/MessageWindow.h b/src/archutils/Win32/MessageWindow.h index 50da20d92e..093adebfe9 100644 --- a/src/archutils/Win32/MessageWindow.h +++ b/src/archutils/Win32/MessageWindow.h @@ -17,7 +17,7 @@ public: HWND GetHwnd() { return m_hWnd; } protected: - virtual bool HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return false; } + virtual bool HandleMessage( UINT /* msg */, WPARAM /* wParam */, LPARAM /* lParam */ ) { return false; } void StopRunning(); private: diff --git a/src/archutils/Win32/arch_setup.cpp b/src/archutils/Win32/arch_setup.cpp index b2182733be..7175e9a66c 100644 --- a/src/archutils/Win32/arch_setup.cpp +++ b/src/archutils/Win32/arch_setup.cpp @@ -7,7 +7,7 @@ #if defined(WINDOWS) int main( int argc, char* argv[] ); -int __stdcall WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, char *pCmdLine, int nCmdShow ) +int __stdcall WinMain( HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, char * /* pCmdLine */, int /* nCmdShow */ ) { char **argv; int argc = GetWin32CmdLine( argv );