diff --git a/src/EnumHelper.h b/src/EnumHelper.h index 6de115163a..6f34ac2194 100644 --- a/src/EnumHelper.h +++ b/src/EnumHelper.h @@ -80,7 +80,7 @@ const RString &EnumToString( int iVal, int iMax, const char **szNameArray, std:: #define XToString(X) \ const RString& X##ToString(X x); \ -COMPILE_ASSERT( NUM_##X == ARRAYLEN(X##Names) ); \ +static_assert( NUM_##X == ARRAYLEN(X##Names) ); \ const RString& X##ToString( X x ) \ { \ static std::unique_ptr as_##X##Name[NUM_##X+2]; \ @@ -186,7 +186,7 @@ namespace LuaHelpers \ * @author Chris Danford, Glenn Maynard (c) 2004-2006 * @section LICENSE * All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -196,7 +196,7 @@ namespace LuaHelpers \ * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF diff --git a/src/Game.cpp b/src/Game.cpp index a4783f2dc9..b2e318cca3 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -32,7 +32,7 @@ static const Game::PerButtonInfo g_CommonButtonInfo[] = const Game::PerButtonInfo *Game::GetPerButtonInfo( GameButton gb ) const { - COMPILE_ASSERT( GAME_BUTTON_NEXT == ARRAYLEN(g_CommonButtonInfo) ); + static_assert( GAME_BUTTON_NEXT == ARRAYLEN(g_CommonButtonInfo) ); if( gb < GAME_BUTTON_NEXT ) return &g_CommonButtonInfo[gb]; else @@ -44,7 +44,7 @@ TapNoteScore Game::GetMapJudgmentTo( TapNoteScore tns ) const switch(tns) { case TNS_W1: return m_mapW1To; - case TNS_W2: return m_mapW2To; + case TNS_W2: return m_mapW2To; case TNS_W3: return m_mapW3To; case TNS_W4: return m_mapW4To; case TNS_W5: return m_mapW5To; @@ -55,7 +55,7 @@ TapNoteScore Game::GetMapJudgmentTo( TapNoteScore tns ) const // lua start #include "LuaBinding.h" -/** @brief Allow Lua to have access to the Game. */ +/** @brief Allow Lua to have access to the Game. */ class LunaGame: public Luna { public: @@ -79,7 +79,7 @@ LUA_REGISTER_CLASS( Game ) /* * (c) 2001-2002 Chris Danford * All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -89,7 +89,7 @@ LUA_REGISTER_CLASS( Game ) * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index c1f50715be..208bbfecab 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -1214,7 +1214,7 @@ static const InputScheme::GameButtonInfo g_CommonGameButtonInfo[] = const InputScheme::GameButtonInfo *InputScheme::GetGameButtonInfo( GameButton gb ) const { - COMPILE_ASSERT( GAME_BUTTON_NEXT == ARRAYLEN(g_CommonGameButtonInfo) ); + static_assert( GAME_BUTTON_NEXT == ARRAYLEN(g_CommonGameButtonInfo) ); if( gb < GAME_BUTTON_NEXT ) return &g_CommonGameButtonInfo[gb]; else diff --git a/src/LifeMeterTime.cpp b/src/LifeMeterTime.cpp index 706aa59fa5..ece496c179 100644 --- a/src/LifeMeterTime.cpp +++ b/src/LifeMeterTime.cpp @@ -37,7 +37,7 @@ static const float g_fTimeMeterSecondsChangeInit[] = -4.0f, // SE_LetGo -0.0f, // SE_Missed }; -COMPILE_ASSERT( ARRAYLEN(g_fTimeMeterSecondsChangeInit) == NUM_ScoreEvent ); +static_assert( ARRAYLEN(g_fTimeMeterSecondsChangeInit) == NUM_ScoreEvent ); static void TimeMeterSecondsChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { diff --git a/src/arch/MovieTexture/MovieTexture_Generic.cpp b/src/arch/MovieTexture/MovieTexture_Generic.cpp index 23ffad787c..93526d72bb 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -493,7 +493,7 @@ static EffectMode EffectModes[] = { EffectMode_YUYV422, }; -COMPILE_ASSERT( ARRAYLEN(EffectModes) == NUM_PixelFormatYCbCr ); +static_assert( ARRAYLEN(EffectModes) == NUM_PixelFormatYCbCr ); EffectMode MovieTexture_Generic::GetEffectMode( MovieDecoderPixelFormatYCbCr fmt ) { diff --git a/src/global.h b/src/global.h index acad921f2b..287dc3291b 100644 --- a/src/global.h +++ b/src/global.h @@ -112,11 +112,6 @@ void ShowWarningOrTrace( const char *file, int line, const char *message, bool b #define SM_UNIQUE_NAME2(x,line) SM_UNIQUE_NAME3(x, line) #define SM_UNIQUE_NAME(x) SM_UNIQUE_NAME2(x, __LINE__) -template struct CompileAssert; -template <> struct CompileAssert { }; -template struct CompileAssertDecl { }; -#define COMPILE_ASSERT(COND) typedef CompileAssertDecl< sizeof(CompileAssert) > CompileAssertInst - #include "StdString.h" /** @brief Use RStrings throughout the program. */ typedef StdString::CStdString RString;