diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 76348d0701..00cd3b22f1 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1151,7 +1151,7 @@ bool Actor::TweenState::operator==( const TweenState &other ) const COMPARE( fSkewX ); COMPARE( crop ); COMPARE( fade ); - for( unsigned i=0; i= 0 && c <= 0xFFFFFF); /* Fast path: */ - if( c < (int) ARRAYSIZE(m_iCharToGlyphCache) && m_iCharToGlyphCache[c] ) + if( c < (int) ARRAYLEN(m_iCharToGlyphCache) && m_iCharToGlyphCache[c] ) return *m_iCharToGlyphCache[c]; /* Try the regular character. */ @@ -767,7 +767,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) ZERO( m_iCharToGlyphCache ); map::iterator it; for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it ) - if( it->first < (int) ARRAYSIZE(m_iCharToGlyphCache) ) + if( it->first < (int) ARRAYLEN(m_iCharToGlyphCache) ) m_iCharToGlyphCache[it->first] = it->second; } } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index fa490f9c3c..3975965421 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2644,7 +2644,7 @@ static Style g_Styles[] = }, }; -#define NUM_STYLES ARRAYSIZE(g_Styles) +#define NUM_STYLES ARRAYLEN(g_Styles) void GameManager::GetStylesForGame( const Game *pGame, vector& aStylesAddTo, bool editor ) const { diff --git a/stepmania/src/GraphDisplay.cpp b/stepmania/src/GraphDisplay.cpp index 26218a91f7..cc78f27635 100644 --- a/stepmania/src/GraphDisplay.cpp +++ b/stepmania/src/GraphDisplay.cpp @@ -130,7 +130,7 @@ public: Actor::SetTextureRenderStates(); DISPLAY->SetTextureModeModulate(); - DISPLAY->DrawQuadStrip( m_Slices, ARRAYSIZE(m_Slices) ); + DISPLAY->DrawQuadStrip( m_Slices, ARRAYLEN(m_Slices) ); } RageSpriteVertex m_Slices[2*VALUE_RESOLUTION]; @@ -192,7 +192,7 @@ void GraphDisplay::LoadFromStageStats( const StageStats &ss, const PlayerStageSt m_Values.resize( VALUE_RESOLUTION ); pss.GetLifeRecord( &m_Values[0], VALUE_RESOLUTION, ss.GetTotalPossibleStepsSeconds() ); - for( unsigned i=0; iLock(); - if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) ) + if( size_t(g_iNumStackCounts) < ARRAYLEN(g_iStackCounts) ) { g_iStackCounts[g_iNumStackCounts] = lua_gettop(L); } @@ -221,7 +221,7 @@ void LuaManager::Release( Lua *&p ) ASSERT( p == L ); ASSERT( g_iNumStackCounts != 0 ); --g_iNumStackCounts; - if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) ) + if( size_t(g_iNumStackCounts) < ARRAYLEN(g_iStackCounts) ) { ASSERT( g_iStackCounts[g_iNumStackCounts] == lua_gettop(L) ); } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index dff975c542..c39f2a39ac 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -43,7 +43,7 @@ static const SortOrder g_SongSortOrders[] = SORT_ARTIST, SORT_GENRE, }; -const vector SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAYSIZE(g_SongSortOrders) ); +const vector SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAYLEN(g_SongSortOrders) ); static SortOrder ForceAppropriateSort( PlayMode pm, SortOrder so ) { diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index e94d55a151..7a9f7fe14b 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -1816,7 +1816,7 @@ const ValidRow g_ValidRows[] = void NoteDataUtil::RemoveStretch( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex ) { vector vpValidRowsToCheck; - for( unsigned i=0; i -#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; } +#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } void PlayerOptions::Init() { diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 0e7d286fe7..73a4a634fa 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -710,7 +710,7 @@ static bool PathUsesSlowFlush( const RString &sPath ) "Save/" }; - for( unsigned i = 0; i < ARRAYSIZE(FlushPaths); ++i ) + for( unsigned i = 0; i < ARRAYLEN(FlushPaths); ++i ) if( !strncmp( sPath, FlushPaths[i], strlen(FlushPaths[i]) ) ) return true; return false; diff --git a/stepmania/src/RageSoundReader_Chain.cpp b/stepmania/src/RageSoundReader_Chain.cpp index 7d41ea4c1c..1a61cd05b7 100644 --- a/stepmania/src/RageSoundReader_Chain.cpp +++ b/stepmania/src/RageSoundReader_Chain.cpp @@ -275,7 +275,7 @@ int RageSoundReader_Chain::ReadBlock( int16_t *pBuffer, int iFrames ) { ActiveSound &s = m_apActiveSounds[i]; SoundReader *pSound = s.pSound; - int iSamples = min( iFramesToRead * pSound->GetNumChannels(), ARRAYSIZE(Buffer) ); + int iSamples = min( iFramesToRead * pSound->GetNumChannels(), ARRAYLEN(Buffer) ); int iBytesRead = pSound->Read( (char *) Buffer, iSamples*sizeof(int16_t) ); if( iBytesRead == -1 || iBytesRead == 0 ) { diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 5d1e73e93a..38f7586fe9 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1244,7 +1244,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) const float fSpeeds[] = { 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f, 8.0f }; int iSpeed = 0; - for( unsigned i = 0; i < ARRAYSIZE(fSpeeds); ++i ) + for( unsigned i = 0; i < ARRAYLEN(fSpeeds); ++i ) { if( fSpeeds[i] == fScrollSpeed ) { @@ -1257,7 +1257,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) --iSpeed; else if( EditB == EDIT_BUTTON_SCROLL_SPEED_UP ) ++iSpeed; - iSpeed = clamp( iSpeed, 0, (int) ARRAYSIZE(fSpeeds)-1 ); + iSpeed = clamp( iSpeed, 0, (int) ARRAYLEN(fSpeeds)-1 ); if( fSpeeds[iSpeed] != fScrollSpeed ) { @@ -3668,7 +3668,7 @@ void ScreenEdit::DoHelp() { g_EditHelp.rows.clear(); - for( unsigned i=0; im_CurStageStats.m_player[p].GetGrade(); - if( g < (int) ARRAYSIZE(ScoreBonuses) ) + if( g < (int) ARRAYLEN(ScoreBonuses) ) { STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g]; STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g]; diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 75c27c4422..64ff3db5f3 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -57,7 +57,7 @@ const char NAME_CHARS[] = { ' ',' ',' ',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' }; -#define NUM_NAME_CHARS (ARRAYSIZE(NAME_CHARS)) +#define NUM_NAME_CHARS (ARRAYLEN(NAME_CHARS)) #define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 72ba3d4a5c..00e1def6ed 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -609,7 +609,7 @@ bool CheckVideoDefaultSettings() VideoCardDefaults defaults; - for( unsigned i=0; i', "gt", } }; - for( unsigned i = 0; i < ARRAYSIZE(EntityTable); ++i ) + for( unsigned i = 0; i < ARRAYLEN(EntityTable); ++i ) { const Entity &ent = EntityTable[i]; g_mapEntitiesToChars[ent.pEntity] = RString(1, ent.c);