diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index d07827f9f2..84186ca96a 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1139,7 +1139,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) ARRAY_SIZE(m_iCharToGlyphCache) && m_iCharToGlyphCache[c] ) + if( c < (int) ARRAYSIZE(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) ARRAY_SIZE(m_iCharToGlyphCache) ) + if( it->first < (int) ARRAYSIZE(m_iCharToGlyphCache) ) m_iCharToGlyphCache[it->first] = it->second; } } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 8461cc0226..7a1217efaf 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2636,7 +2636,7 @@ static Style g_Styles[] = }, }; -#define NUM_STYLES ARRAY_SIZE(g_Styles) +#define NUM_STYLES ARRAYSIZE(g_Styles) GameManager::GameManager() diff --git a/stepmania/src/GraphDisplay.cpp b/stepmania/src/GraphDisplay.cpp index b6e8ded580..26218a91f7 100644 --- a/stepmania/src/GraphDisplay.cpp +++ b/stepmania/src/GraphDisplay.cpp @@ -130,7 +130,7 @@ public: Actor::SetTextureRenderStates(); DISPLAY->SetTextureModeModulate(); - DISPLAY->DrawQuadStrip( m_Slices, ARRAY_SIZE(m_Slices) ); + DISPLAY->DrawQuadStrip( m_Slices, ARRAYSIZE(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) < ARRAY_SIZE(g_iStackCounts) ) + if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) ) { g_iStackCounts[g_iNumStackCounts] = lua_gettop(L); } @@ -211,7 +211,7 @@ void LuaManager::Release( Lua *&p ) ASSERT( p == L ); ASSERT( g_iNumStackCounts != 0 ); --g_iNumStackCounts; - if( size_t(g_iNumStackCounts) < ARRAY_SIZE(g_iStackCounts) ) + if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) ) { ASSERT( g_iStackCounts[g_iNumStackCounts] == lua_gettop(L) ); } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index abed273c74..f25aec74ee 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -45,7 +45,7 @@ static const SortOrder g_SongSortOrders[] = SORT_ARTIST, SORT_GENRE, }; -const vector SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAY_SIZE(g_SongSortOrders) ); +const vector SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAYSIZE(g_SongSortOrders) ); MusicWheel::MusicWheel() { diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index ad94a17c51..678a6c7f53 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -1823,7 +1823,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 < ARRAY_SIZE(arr); ++Z ) arr[Z]=1.0f; } +#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; } void PlayerOptions::Init() { diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 6c6cdc2bd1..b4bbe0666b 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -702,7 +702,7 @@ static bool PathUsesSlowFlush( const RString &sPath ) "Save/" }; - for( unsigned i = 0; i < ARRAY_SIZE(FlushPaths); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(FlushPaths); ++i ) if( !strncmp( sPath, FlushPaths[i], strlen(FlushPaths[i]) ) ) return true; return false; diff --git a/stepmania/src/RageMath.cpp b/stepmania/src/RageMath.cpp index 32a3baeff2..0196a18f07 100644 --- a/stepmania/src/RageMath.cpp +++ b/stepmania/src/RageMath.cpp @@ -600,9 +600,9 @@ float RageFastSin( float x ) if( !bInited ) { bInited = true; - for( unsigned i=0; i=0 && fRemainder<=1 ); - float fValue[ARRAY_SIZE(iSampleIndex)]; - for( unsigned i=0; i= int(ARRAY_SIZE(table)) ) // PI <= iSample < 2*PI + if( iSample >= int(ARRAYSIZE(table)) ) // PI <= iSample < 2*PI { // sin(x) == -sin(PI+x) - iSample -= ARRAY_SIZE(table); - DEBUG_ASSERT( iSample>=0 && iSample=0 && iSampleGetNumChannels(), ARRAY_SIZE(Buffer) ); + int iSamples = min( iFramesToRead * pSound->GetNumChannels(), ARRAYSIZE(Buffer) ); int iBytesRead = pSound->Read( (char *) Buffer, iSamples*sizeof(int16_t) ); if( iBytesRead == -1 || iBytesRead == 0 ) { diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 0b98ea5961..457cd2ca09 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -504,7 +504,7 @@ static const LanguageInfo g_langs[] = void GetLanguageInfos( vector &vAddTo ) { - for( unsigned i=0; i &vAddTo ) const LanguageInfo *GetLanguageInfo( const RString &sIsoCode ) { - for( unsigned i=0; i. */ diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index a1a3fde187..9f57ae3338 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1211,7 +1211,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 < ARRAY_SIZE(fSpeeds); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(fSpeeds); ++i ) { if( fSpeeds[i] == fScrollSpeed ) { @@ -1224,7 +1224,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) --iSpeed; else if( EditB == EDIT_BUTTON_SCROLL_SPEED_UP ) ++iSpeed; - iSpeed = clamp( iSpeed, 0, (int) ARRAY_SIZE(fSpeeds)-1 ); + iSpeed = clamp( iSpeed, 0, (int) ARRAYSIZE(fSpeeds)-1 ); if( fSpeeds[iSpeed] != fScrollSpeed ) { @@ -3608,7 +3608,7 @@ void ScreenEdit::DoHelp() { g_EditHelp.rows.clear(); - for( unsigned i=0; im_CurStageStats.m_player[p].GetGrade(); - if( g < (int) ARRAY_SIZE(ScoreBonuses) ) + if( g < (int) ARRAYSIZE(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 b732cb3838..59a46e82b2 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 (ARRAY_SIZE(NAME_CHARS)) +#define NUM_NAME_CHARS (ARRAYSIZE(NAME_CHARS)) #define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY) diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 168601b956..e4a0697631 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -295,7 +295,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption ) { const PrefsManager::MusicWheelUsesSections mapping[] = { PrefsManager::NEVER, PrefsManager::ALWAYS, PrefsManager::ABC_ONLY }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } /* Background options */ @@ -303,19 +303,19 @@ static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption ) static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void BGBrightnessNoZero( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void BGBrightnessOrStatic( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 0.5f,0.25f,0.5f,0.75f }; - MoveMap( sel, PREFSMAN->m_fBGBrightness, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, PREFSMAN->m_fBGBrightness, ToSel, mapping, ARRAYSIZE(mapping) ); if( ToSel && !PREFSMAN->m_bSongBackgrounds ) sel = 0; @@ -326,57 +326,57 @@ static void BGBrightnessOrStatic( int &sel, bool ToSel, const ConfOption *pConfO static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 5,10,15,20 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } /* Input options */ static void MusicWheelSwitchSpeed( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 5, 10, 15, 25 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } /* Gameplay options */ static void AllowW1( int &sel, bool ToSel, const ConfOption *pConfOption ) { const PrefsManager::AllowW1 mapping[] = { PrefsManager::ALLOW_W1_NEVER, PrefsManager::ALLOW_W1_COURSES_ONLY, PrefsManager::ALLOW_W1_EVERYWHERE }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption ) { const CoinMode mapping[] = { COIN_MODE_HOME, COIN_MODE_PAY, COIN_MODE_FREE }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption ) { const CoinMode mapping[] = { COIN_MODE_PAY, COIN_MODE_FREE }; - MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) ); } static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void PremiumM( int &sel, bool ToSel, const ConfOption *pConfOption ) { const Premium mapping[] = { PREMIUM_NONE, PREMIUM_DOUBLE, PREMIUM_JOINT }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 1,2,3,4,5 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 1,2,3,4,5,6 }; - MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAYSIZE(mapping) ); if( ToSel && PREFSMAN->m_bEventMode ) sel = 5; @@ -389,13 +389,13 @@ static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pCo static void TimingWindowScale( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f }; - MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAYSIZE(mapping) ); } static int GetLifeDifficulty() @@ -411,13 +411,13 @@ LuaFunction( GetLifeDifficulty, GetLifeDifficulty() ); static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption ) { const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void GetRankingName( int &sel, bool ToSel, const ConfOption *pConfOption ) { const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption ) @@ -494,37 +494,37 @@ static void DisplayResolutionM( int &sel, bool ToSel, const ConfOption *pConfOpt static void DisplayColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 16,32 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void MaxTextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 256,512,1024,2048 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void TextureColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 16,32 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void MovieColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { 16,32 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption ) { const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void DisplayAspectRatio( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 3/4.f,1,4/3.0f,16/10.0f,16/9.f, 8/3.f }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } /* Simpler DisplayAspectRatio setting, which only offers "on" and "off". "On" can be 16:9 @@ -535,7 +535,7 @@ static void WideScreen16_10( int &sel, bool ToSel, const ConfOption *pConfOption ASSERT_M( pPref != NULL, pConfOption->name ); const float mapping[] = { 4/3.0f, 16/10.0f }; - MoveMap( sel, *pPref, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, *pPref, ToSel, mapping, ARRAYSIZE(mapping) ); } static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption ) @@ -544,7 +544,7 @@ static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption ASSERT_M( pPref != NULL, pConfOption->name ); const float mapping[] = { 4/3.0f, 16/9.0f }; - MoveMap( sel, *pPref, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, *pPref, ToSel, mapping, ARRAYSIZE(mapping) ); } /* Sound options */ @@ -552,7 +552,7 @@ static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption ) { const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOption ) @@ -561,7 +561,7 @@ static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOp for( int i = 0; i < 41; ++i ) mapping[i] = SCALE( i, 0.0f, 40.0f, -0.1f, +0.1f ); - MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); + MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) ); } static vector g_ConfOptions; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index ed4b39b331..5b2501df52 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 < ARRAY_SIZE(EntityTable); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(EntityTable); ++i ) { const Entity &ent = EntityTable[i]; g_mapEntitiesToChars[ent.pEntity] = RString(1, ent.c); diff --git a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp index fa1c2e8265..f3712ce35a 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp @@ -50,7 +50,7 @@ static const DeviceButton g_keys[] = static DeviceButton GetRandomKeyboardKey() { - int index = RandomInt( ARRAY_SIZE(g_keys) ); + int index = RandomInt( ARRAYSIZE(g_keys) ); return g_keys[index]; } diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp index c592832e68..27cc553dd3 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp @@ -55,7 +55,7 @@ void InputHandler_Win32_Pump::HandleInput( int iDevice, int iEvent ) InputDevice id = InputDevice( DEVICE_PUMP1 + iDevice ); - for( int iButton = 0; iButton < ARRAY_SIZE(bits); ++iButton ) + for( int iButton = 0; iButton < ARRAYSIZE(bits); ++iButton ) { DeviceInput di( id, enum_add2(JOY_BUTTON_1, iButton) ); diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 98b8d305ff..ea94cef5ec 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -63,7 +63,7 @@ void RageSound_Generic_Software::Mix( int16_t *buf, int frames, int64_t frameno, static RageSoundMixBuffer mix; - for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i ) { /* s.snd can not safely be accessed from here. */ sound &s = sounds[i]; @@ -174,7 +174,7 @@ void RageSound_Generic_Software::DecodeThread() LockMut( m_Mutex ); // LOG->Trace("begin mix"); - for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i ) { /* The volume can change while the sound is playing; update it. */ /* XXX: We can't access snd when in STOPPING; it doesn't exist anymore. */ @@ -195,7 +195,7 @@ void RageSound_Generic_Software::DecodeThread() * causing major CPU bursts when the stream starts or underruns. (Filling 32k * takes more CPU than filling 4k frames, and may cause a gameplay skip.) */ - for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i ) { if( sounds[i].state != sound::PLAYING ) continue; @@ -245,7 +245,7 @@ int RageSound_Generic_Software::GetDataForSound( sound &s ) ASSERT( psize[0] > 0 ); sound_block *b = p[0]; - int size = ARRAY_SIZE(b->buf)/channels; + int size = ARRAYSIZE(b->buf)/channels; bool eof = !s.snd->GetDataToPlay( b->buf, size, b->position, b->frames_in_buffer ); b->p = b->buf; @@ -263,7 +263,7 @@ void RageSound_Generic_Software::Update(float delta) /* We must not lock here, since the decoder thread might hold the lock for a * while at a time. This is threadsafe, because once a sound is in STOPPING, * this is the only place it'll be changed (to STOPPED). */ - for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i ) { switch( sounds[i].state ) { @@ -316,10 +316,10 @@ void RageSound_Generic_Software::StartMixing( RageSoundBase *snd ) m_SoundListMutex.Lock(); unsigned i; - for( i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( i = 0; i < ARRAYSIZE(sounds); ++i ) if( sounds[i].state == sound::AVAILABLE ) break; - if( i == ARRAY_SIZE(sounds) ) + if( i == ARRAYSIZE(sounds) ) { m_SoundListMutex.Unlock(); return; @@ -381,10 +381,10 @@ void RageSound_Generic_Software::StopMixing( RageSoundBase *snd ) /* Find the sound. */ unsigned i; - for( i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( i = 0; i < ARRAYSIZE(sounds); ++i ) if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd ) break; - if( i == ARRAY_SIZE(sounds) ) + if( i == ARRAYSIZE(sounds) ) { LOG->Trace( "not stopping a sound because it's not playing" ); return; @@ -416,14 +416,14 @@ bool RageSound_Generic_Software::PauseMixing( RageSoundBase *snd, bool bStop ) /* Find the sound. */ unsigned i; - for( i = 0; i < ARRAY_SIZE(sounds); ++i ) + for( i = 0; i < ARRAYSIZE(sounds); ++i ) if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd ) break; /* A sound can be paused in PLAYING or STOPPING. (STOPPING means the sound * has been decoded to the end, and we're waiting for that data to finish, so * externally it looks and acts like PLAYING.) */ - if( i == ARRAY_SIZE(sounds) || + if( i == ARRAYSIZE(sounds) || (sounds[i].state != sound::PLAYING && sounds[i].state != sound::STOPPING) ) { LOG->Trace( "not pausing a sound because it's not playing" ); diff --git a/stepmania/src/archutils/Win32/CrashHandlerChild.cpp b/stepmania/src/archutils/Win32/CrashHandlerChild.cpp index e3cab7d255..be215a439d 100644 --- a/stepmania/src/archutils/Win32/CrashHandlerChild.cpp +++ b/stepmania/src/archutils/Win32/CrashHandlerChild.cpp @@ -117,7 +117,7 @@ namespace VDDebugInfo pctx->sRawBlock = RString(); pctx->pRVAHeap = NULL; - GetVDIPath( pctx->sFilename, ARRAY_SIZE(pctx->sFilename) ); + GetVDIPath( pctx->sFilename, ARRAYSIZE(pctx->sFilename) ); pctx->sError = RString(); HANDLE h = CreateFile( pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); diff --git a/stepmania/src/archutils/Win32/DialogUtil.cpp b/stepmania/src/archutils/Win32/DialogUtil.cpp index 54f4f2f7e5..d15373478b 100644 --- a/stepmania/src/archutils/Win32/DialogUtil.cpp +++ b/stepmania/src/archutils/Win32/DialogUtil.cpp @@ -62,7 +62,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg ) RString sGroup; { - ::GetWindowText( hdlg, szTemp, ARRAY_SIZE(szTemp) ); + ::GetWindowText( hdlg, szTemp, ARRAYSIZE(szTemp) ); RString s = szTemp; sGroup = "Dialog-"+s; s = THEME->GetString( sGroup, s ); @@ -71,7 +71,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg ) for( HWND hwndChild = ::GetTopWindow(hdlg); hwndChild != NULL; hwndChild = ::GetNextWindow(hwndChild,GW_HWNDNEXT) ) { - ::GetWindowText( hwndChild, szTemp, ARRAY_SIZE(szTemp) ); + ::GetWindowText( hwndChild, szTemp, ARRAYSIZE(szTemp) ); RString s = szTemp; if( s.empty() ) continue; diff --git a/stepmania/src/crypto/CryptRSA.cpp b/stepmania/src/crypto/CryptRSA.cpp index a0e72f5b4f..af33c112fa 100644 --- a/stepmania/src/crypto/CryptRSA.cpp +++ b/stepmania/src/crypto/CryptRSA.cpp @@ -122,7 +122,7 @@ static Bignum rsa_privkey_op(Bignum input, const RSAKey *key) SHA512_State ss; unsigned char digest512[64]; - unsigned digestused = ARRAY_SIZE(digest512); + unsigned digestused = ARRAYSIZE(digest512); int hashseq = 0; /* @@ -158,7 +158,7 @@ static Bignum rsa_privkey_op(Bignum input, const RSAKey *key) * Conceptually the following few lines are equivalent to * byte = random_byte(); */ - if (digestused >= ARRAY_SIZE(digest512)) { + if (digestused >= ARRAYSIZE(digest512)) { unsigned char seqbuf[4]; PUT_32BIT(seqbuf, hashseq); SHA512_Init(&ss);