diff --git a/src/Actor.cpp b/src/Actor.cpp index 6dab81b3b2..0b37e4f973 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -175,7 +175,7 @@ Actor::~Actor() { StopTweening(); UnsubscribeAll(); - for(std::size_t i= 0; i < m_WrapperStates.size(); ++i) + for(size_t i= 0; i < m_WrapperStates.size(); ++i) { RageUtil::SafeDelete(m_WrapperStates[i]); } @@ -196,7 +196,7 @@ Actor::Actor( const Actor &cpy ): CPY( m_pLuaInstance ); m_WrapperStates.resize(cpy.m_WrapperStates.size()); - for(std::size_t i= 0; i < m_WrapperStates.size(); ++i) + for(size_t i= 0; i < m_WrapperStates.size(); ++i) { m_WrapperStates[i]= new ActorFrame(*dynamic_cast(cpy.m_WrapperStates[i])); } @@ -404,7 +404,7 @@ void Actor::Draw() { m_FakeParent->BeginDraw(); } - std::size_t wrapper_states_used= 0; + size_t wrapper_states_used= 0; RageColor last_diffuse; RageColor last_glow; bool use_last_diffuse= false; @@ -420,7 +420,7 @@ void Actor::Draw() // wrapper[3] is the outermost frame. wrapper[2] is inside wrapper[3]. // wrapper[1] is inside wrapper[2]. The actor is inside wrapper[1]. // -Kyz - for(std::size_t i= m_WrapperStates.size(); i > 0 && dont_abort_draw; --i) + for(size_t i= m_WrapperStates.size(); i > 0 && dont_abort_draw; --i) { Actor* state= m_WrapperStates[i-1]; if(!state->m_bVisible || state->m_fHibernateSecondsLeft > 0 || @@ -469,7 +469,7 @@ void Actor::Draw() } this->PostDraw(); } - for(std::size_t i= 0; i < wrapper_states_used; ++i) + for(size_t i= 0; i < wrapper_states_used; ++i) { Actor* state= m_WrapperStates[i]; if(abort_with_end_draw) @@ -886,7 +886,7 @@ void Actor::Update( float fDeltaTime ) fDeltaTime = -m_fHibernateSecondsLeft; m_fHibernateSecondsLeft = 0; } - for(std::size_t i= 0; i < m_WrapperStates.size(); ++i) + for(size_t i= 0; i < m_WrapperStates.size(); ++i) { m_WrapperStates[i]->Update(fDeltaTime); } @@ -984,14 +984,14 @@ void Actor::AddWrapperState() m_WrapperStates.push_back(wrapper); } -void Actor::RemoveWrapperState(std::size_t i) +void Actor::RemoveWrapperState(size_t i) { ASSERT(i < m_WrapperStates.size()); RageUtil::SafeDelete(m_WrapperStates[i]); m_WrapperStates.erase(m_WrapperStates.begin()+i); } -Actor* Actor::GetWrapperState(std::size_t i) +Actor* Actor::GetWrapperState(size_t i) { ASSERT(i < m_WrapperStates.size()); return m_WrapperStates[i]; @@ -1964,11 +1964,11 @@ public: p->GetWrapperState(p->GetNumWrapperStates()-1)->PushSelf(L); return 1; } - static std::size_t get_state_index(T* p, lua_State* L, int stack_index) + static size_t get_state_index(T* p, lua_State* L, int stack_index) { // Lua is one indexed. int i= IArg(stack_index)-1; - const std::size_t si= static_cast(i); + const size_t si= static_cast(i); if(i < 0 || si >= p->GetNumWrapperStates()) { luaL_error(L, "%d is not a valid wrapper state index.", i+1); @@ -1977,7 +1977,7 @@ public: } static int RemoveWrapperState(T* p, lua_State* L) { - std::size_t si= get_state_index(p, L, 1); + size_t si= get_state_index(p, L, 1); p->RemoveWrapperState(si); COMMON_RETURN_SELF; } @@ -1988,7 +1988,7 @@ public: } static int GetWrapperState(T* p, lua_State* L) { - std::size_t si= get_state_index(p, L, 1); + size_t si= get_state_index(p, L, 1); p->GetWrapperState(si)->PushSelf(L); return 1; } diff --git a/src/Actor.h b/src/Actor.h index c74dd0d864..bf927fe551 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -318,9 +318,9 @@ public: Actor* GetFakeParent() { return m_FakeParent; } void AddWrapperState(); - void RemoveWrapperState(std::size_t i); - Actor* GetWrapperState(std::size_t i); - std::size_t GetNumWrapperStates() const { return m_WrapperStates.size(); } + void RemoveWrapperState(size_t i); + Actor* GetWrapperState(size_t i); + size_t GetNumWrapperStates() const { return m_WrapperStates.size(); } /** * @brief Retrieve the Actor's x position. diff --git a/src/ActorMultiTexture.cpp b/src/ActorMultiTexture.cpp index e7b52090a0..ff9992232f 100644 --- a/src/ActorMultiTexture.cpp +++ b/src/ActorMultiTexture.cpp @@ -98,7 +98,7 @@ void ActorMultiTexture::DrawPrimitives() quadVerticies.bottom = +m_size.y/2.0f; DISPLAY->ClearAllTextures(); - for( std::size_t i = 0; i < m_aTextureUnits.size(); ++i ) + for( size_t i = 0; i < m_aTextureUnits.size(); ++i ) { TextureUnit tu = enum_add2(TextureUnit_1, i); DISPLAY->SetTexture( tu, m_aTextureUnits[i].m_pTexture->GetTexHandle() ); @@ -127,7 +127,7 @@ void ActorMultiTexture::DrawPrimitives() DISPLAY->DrawQuad( v ); - for( std::size_t i = 0; i < m_aTextureUnits.size(); ++i ) + for( size_t i = 0; i < m_aTextureUnits.size(); ++i ) DISPLAY->SetTexture( enum_add2(TextureUnit_1, i), 0 ); DISPLAY->SetEffectMode( EffectMode_Normal ); diff --git a/src/ActorMultiVertex.cpp b/src/ActorMultiVertex.cpp index f9584a9891..ced4caade8 100644 --- a/src/ActorMultiVertex.cpp +++ b/src/ActorMultiVertex.cpp @@ -69,7 +69,7 @@ ActorMultiVertex::ActorMultiVertex() _EffectMode = EffectMode_Normal; _TextureMode = TextureMode_Modulate; _splines.resize(num_vert_splines); - for(std::size_t i= 0; i < num_vert_splines; ++i) + for(size_t i= 0; i < num_vert_splines; ++i) { _splines[i].redimension(3); _splines[i].m_owned_by_actor= true; @@ -158,11 +158,11 @@ void ActorMultiVertex::UnloadTexture() } } -void ActorMultiVertex::SetNumVertices( std::size_t n ) +void ActorMultiVertex::SetNumVertices( size_t n ) { if( n == 0 ) { - for( std::size_t i = 0; i < AMV_Tweens.size(); ++i ) + for( size_t i = 0; i < AMV_Tweens.size(); ++i ) { AMV_Tweens[i].vertices.clear(); } @@ -171,7 +171,7 @@ void ActorMultiVertex::SetNumVertices( std::size_t n ) } else { - for( std::size_t i = 0; i < AMV_Tweens.size(); ++i ) + for( size_t i = 0; i < AMV_Tweens.size(); ++i ) { AMV_Tweens[i].vertices.resize( n ); } @@ -182,7 +182,7 @@ void ActorMultiVertex::SetNumVertices( std::size_t n ) void ActorMultiVertex::ResizeVertices(std::vector& vertices, int size) { - if (vertices.capacity() < static_cast(size)) + if (vertices.capacity() < static_cast(size)) { vertices.reserve(size); } @@ -191,7 +191,7 @@ void ActorMultiVertex::ResizeVertices(std::vector& vertices, i void ActorMultiVertex::AddVertex() { - for( std::size_t i = 0; i < AMV_Tweens.size(); ++i ) + for( size_t i = 0; i < AMV_Tweens.size(); ++i ) { AMV_Tweens[i].vertices.emplace_back( RageSpriteVertex() ); } @@ -203,7 +203,7 @@ void ActorMultiVertex::AddVertices( int Add ) { int size = AMV_DestTweenState().vertices.size(); size += Add; - for( std::size_t i = 0; i < AMV_Tweens.size(); ++i ) + for( size_t i = 0; i < AMV_Tweens.size(); ++i ) { ResizeVertices(AMV_Tweens[i].vertices, size); } @@ -246,7 +246,7 @@ void ActorMultiVertex::DrawPrimitives() if( m_pTempState->diffuse[0] != RageColor(1, 1, 1, 1) && m_pTempState->diffuse[0].a > 0 ) { - for( std::size_t i=0; i < TS.vertices.size(); i++ ) + for( size_t i=0; i < TS.vertices.size(); i++ ) { // RageVColor uses a std::uint8_t for each channel. 0-255. // RageColor uses a float. 0-1. @@ -279,7 +279,7 @@ void ActorMultiVertex::DrawPrimitives() if( m_pTempState->glow.a > 0 ) { - for( std::size_t i=0; i < TS.vertices.size(); i++ ) + for( size_t i=0; i < TS.vertices.size(); i++ ) { TS.vertices[i].c = m_pTempState->glow; } @@ -354,19 +354,19 @@ bool ActorMultiVertex::EarlyAbortDraw() const return false; } -void ActorMultiVertex::SetVertsFromSplinesInternal(std::size_t num_splines, std::size_t offset) +void ActorMultiVertex::SetVertsFromSplinesInternal(size_t num_splines, size_t offset) { std::vector& verts= AMV_DestTweenState().vertices; - std::size_t first= AMV_DestTweenState().FirstToDraw + offset; - std::size_t num_verts= AMV_DestTweenState().GetSafeNumToDraw(AMV_DestTweenState()._DrawMode, AMV_DestTweenState().NumToDraw) - offset; + size_t first= AMV_DestTweenState().FirstToDraw + offset; + size_t num_verts= AMV_DestTweenState().GetSafeNumToDraw(AMV_DestTweenState()._DrawMode, AMV_DestTweenState().NumToDraw) - offset; std::vector tper(num_splines, 0.0f); float num_parts= (static_cast(num_verts) / static_cast(num_splines)) - 1.0f; - for(std::size_t i= 0; i < num_splines; ++i) + for(size_t i= 0; i < num_splines; ++i) { tper[i]= _splines[i].get_max_t() / num_parts; } - for(std::size_t v= 0; v < num_verts; ++v) + for(size_t v= 0; v < num_verts; ++v) { std::vector pos; const int spi= v%num_splines; @@ -406,7 +406,7 @@ void ActorMultiVertex::SetVertsFromSplines() } } -CubicSplineN* ActorMultiVertex::GetSpline(std::size_t i) +CubicSplineN* ActorMultiVertex::GetSpline(size_t i) { ASSERT(i < num_vert_splines); return &(_splines[i]); @@ -414,7 +414,7 @@ CubicSplineN* ActorMultiVertex::GetSpline(std::size_t i) void ActorMultiVertex::SetState(int i) { - ASSERT(i >= 0 && static_cast(i) < _states.size()); + ASSERT(i >= 0 && static_cast(i) < _states.size()); _cur_state= i; _secs_into_state= 0.0f; } @@ -450,7 +450,7 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) { AMV_TweenState& dest= AMV_DestTweenState(); std::vector& verts= dest.vertices; - std::vector& qs= dest.quad_states; + std::vector& qs= dest.quad_states; if(!_use_animation_state || _states.empty() || dest._DrawMode == DrawMode_LineStrip || qs.empty()) { return; } @@ -467,16 +467,16 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) } if(state_changed) { - std::size_t first= dest.FirstToDraw; - std::size_t last= first+dest.GetSafeNumToDraw(dest._DrawMode, dest.NumToDraw); + size_t first= dest.FirstToDraw; + size_t last= first+dest.GetSafeNumToDraw(dest._DrawMode, dest.NumToDraw); switch(AMV_DestTweenState()._DrawMode) { case DrawMode_Quads: - for (std::size_t i = first; i < last; ++i) + for (size_t i = first; i < last; ++i) { - const std::size_t quad_id = (i - first) / 4; - const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); + const size_t quad_id = (i - first) / 4; + const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); const auto& rect = _states[state_id].rect; switch ((i - first) % 4) @@ -504,10 +504,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) } [[fallthrough]]; case DrawMode_QuadStrip: - for (std::size_t i = first; i < last; ++i) + for (size_t i = first; i < last; ++i) { - const std::size_t quad_id = (i - first) / 2; - const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); + const size_t quad_id = (i - first) / 2; + const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); const auto& rect = _states[state_id].rect; if ((i - first) % 2 == 0) @@ -524,10 +524,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) break; case DrawMode_Strip: case DrawMode_Fan: - for (std::size_t i = first; i < last; ++i) + for (size_t i = first; i < last; ++i) { - const std::size_t quad_id = (i - first); - const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); + const size_t quad_id = (i - first); + const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); const auto& rect = _states[state_id].rect; verts[i].t.x = rect.left; @@ -535,10 +535,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) } break; case DrawMode_Triangles: - for (std::size_t i = first; i < last; ++i) + for (size_t i = first; i < last; ++i) { - const std::size_t quad_id = (i - first) / 3; - const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); + const size_t quad_id = (i - first) / 3; + const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); const auto& rect = _states[state_id].rect; switch ((i - first) % 3) @@ -559,10 +559,10 @@ void ActorMultiVertex::UpdateAnimationState(bool force_update) } break; case DrawMode_SymmetricQuadStrip: - for (std::size_t i = first; i < last; ++i) + for (size_t i = first; i < last; ++i) { - const std::size_t quad_id = (i - first) / 3; - const std::size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); + const size_t quad_id = (i - first) / 3; + const size_t state_id = (_cur_state + qs[quad_id % qs.size()]) % _states.size(); const auto& rect = _states[state_id].rect; switch ((i - first) % 3) @@ -682,7 +682,7 @@ void ActorMultiVertex::AMV_TweenState::SetDrawState( DrawMode dm, int first, int void ActorMultiVertex::AMV_TweenState::MakeWeightedAverage(AMV_TweenState& average_out, const AMV_TweenState& ts1, const AMV_TweenState& ts2, float percent_between) { average_out.line_width= lerp(percent_between, ts1.line_width, ts2.line_width); - for(std::size_t v= 0; v < average_out.vertices.size(); ++v) + for(size_t v= 0; v < average_out.vertices.size(); ++v) { WeightedAvergeOfRSVs(average_out.vertices[v], ts1.vertices[v], ts2.vertices[v], percent_between); } @@ -718,7 +718,7 @@ public: } static int GetNumVertices( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumVertices() ); return 1; } - static void SetVertexFromStack(T* p, lua_State* L, std::size_t VertexIndex, int DataStackIndex) + static void SetVertexFromStack(T* p, lua_State* L, size_t VertexIndex, int DataStackIndex) { // Use the number of arguments to determine which property a table is for if(lua_type(L, DataStackIndex) != LUA_TTABLE) @@ -726,13 +726,13 @@ public: LuaHelpers::ReportScriptErrorFmt("ActorMultiVertex::SetVertex: non-table parameter supplied. Table of tables of vertex data expected."); return; } - std::size_t NumDataParts = lua_objlen(L, DataStackIndex); - for(std::size_t i = 0; i < NumDataParts; ++i) + size_t NumDataParts = lua_objlen(L, DataStackIndex); + for(size_t i = 0; i < NumDataParts; ++i) { lua_pushnumber(L, i+1); lua_gettable(L, DataStackIndex); int DataPieceIndex = lua_gettop(L); - std::size_t DataPieceElements = lua_objlen(L, DataPieceIndex); + size_t DataPieceElements = lua_objlen(L, DataPieceIndex); if(lua_type(L, DataPieceIndex) != LUA_TTABLE) { LuaHelpers::ReportScriptErrorFmt( "ActorMultiVertex::SetVertex: non-table parameter %u supplied inside table of parameters, table expected.", (unsigned int)i ); @@ -950,7 +950,7 @@ public: static int GetSpline(T* p, lua_State* L) { - std::size_t i= static_cast(IArg(1)-1); + size_t i= static_cast(IArg(1)-1); if(i >= ActorMultiVertex::num_vert_splines) { luaL_error(L, "Spline index must be greater than 0 and less than or equal to %zu.", ActorMultiVertex::num_vert_splines); @@ -1021,14 +1021,14 @@ public: p->AddState(s); COMMON_RETURN_SELF; } - static std::size_t ValidStateIndex(T* p, lua_State *L, int pos) + static size_t ValidStateIndex(T* p, lua_State *L, int pos) { int index= IArg(pos)-1; if(index < 0 || index >= p->GetNumStates()) { luaL_error(L, "Invalid state index %d.", index+1); } - return static_cast(index); + return static_cast(index); } static int RemoveState(T* p, lua_State *L) { @@ -1091,9 +1091,9 @@ public: luaL_error(L, "The texture must be set before adding states."); } std::vector new_states; - std::size_t num_states= lua_objlen(L, 1); + size_t num_states= lua_objlen(L, 1); new_states.resize(num_states); - for(std::size_t i= 0; i < num_states; ++i) + for(size_t i= 0; i < num_states; ++i) { lua_rawgeti(L, 1, i+1); FillStateFromLua(L, new_states[i], tex, -1); @@ -1118,14 +1118,14 @@ public: lua_pushnumber(L, p->GetNumQuadStates()); return 1; } - static std::size_t QuadStateIndex(T* p, lua_State *L, int pos) + static size_t QuadStateIndex(T* p, lua_State *L, int pos) { int index= IArg(pos)-1; - if(index < 0 || static_cast(index) >= p->GetNumQuadStates()) + if(index < 0 || static_cast(index) >= p->GetNumQuadStates()) { luaL_error(L, "Invalid state index %d.", index+1); } - return static_cast(index); + return static_cast(index); } static int AddQuadState(T* p, lua_State *L) { diff --git a/src/ActorMultiVertex.h b/src/ActorMultiVertex.h index 7118a3db7c..7cd4621320 100644 --- a/src/ActorMultiVertex.h +++ b/src/ActorMultiVertex.h @@ -31,7 +31,7 @@ class RageTexture; class ActorMultiVertex: public Actor { public: - static const std::size_t num_vert_splines= 4; + static const size_t num_vert_splines= 4; ActorMultiVertex(); ActorMultiVertex( const ActorMultiVertex &cpy ); virtual ~ActorMultiVertex(); @@ -52,7 +52,7 @@ public: int GetSafeNumToDraw( DrawMode dm, int num ) const; std::vector vertices; - std::vector quad_states; + std::vector quad_states; DrawMode _DrawMode; int FirstToDraw; @@ -90,7 +90,7 @@ public: void LoadFromTexture( RageTextureID ID ); void UnloadTexture(); - void SetNumVertices( std::size_t n ); + void SetNumVertices( size_t n ); void ResizeVertices(std::vector& vertices, int size); void AddVertex(); @@ -108,15 +108,15 @@ public: DrawMode GetCurrDrawMode() const { return AMV_current._DrawMode; } int GetCurrFirstToDraw() const { return AMV_current.FirstToDraw; } int GetCurrNumToDraw() const { return AMV_current.NumToDraw; } - std::size_t GetNumVertices() { return AMV_DestTweenState().vertices.size(); } + size_t GetNumVertices() { return AMV_DestTweenState().vertices.size(); } void SetVertexPos( int index , float x , float y , float z ); void SetVertexColor( int index , RageColor c ); void SetVertexCoords( int index , float TexCoordX , float TexCoordY ); - inline void SetVertsFromSplinesInternal(std::size_t num_splines, std::size_t start_vert); + inline void SetVertsFromSplinesInternal(size_t num_splines, size_t start_vert); void SetVertsFromSplines(); - CubicSplineN* GetSpline(std::size_t i); + CubicSplineN* GetSpline(size_t i); struct State { @@ -125,12 +125,12 @@ public: }; int GetNumStates() const override { return _states.size(); } void AddState(const State& new_state) { _states.push_back(new_state); } - void RemoveState(std::size_t i) + void RemoveState(size_t i) { ASSERT(i < _states.size()); _states.erase(_states.begin()+i); } - std::size_t GetState() { return _cur_state; } - State& GetStateData(std::size_t i) + size_t GetState() { return _cur_state; } + State& GetStateData(size_t i) { ASSERT(i < _states.size()); return _states[i]; } - void SetStateData(std::size_t i, const State& s) + void SetStateData(size_t i, const State& s) { ASSERT(i < _states.size()); _states[i]= s; } void SetStateProperties(const std::vector& new_states) { _states= new_states; SetState(0); } @@ -139,15 +139,15 @@ public: float GetAnimationLengthSeconds() const override; void SetSecondsIntoAnimation(float seconds) override; void UpdateAnimationState(bool force_update= false); - std::size_t GetNumQuadStates() const + size_t GetNumQuadStates() const { return AMV_DestTweenState().quad_states.size(); } - void AddQuadState(std::size_t s) + void AddQuadState(size_t s) { AMV_DestTweenState().quad_states.push_back(s); } - void RemoveQuadState(std::size_t i) + void RemoveQuadState(size_t i) { AMV_DestTweenState().quad_states.erase(AMV_DestTweenState().quad_states.begin()+i); } - std::size_t GetQuadState(std::size_t i) + size_t GetQuadState(size_t i) { return AMV_DestTweenState().quad_states[i]; } - void SetQuadState(std::size_t i, std::size_t s) + void SetQuadState(size_t i, size_t s) { AMV_DestTweenState().quad_states[i]= s; } bool _use_animation_state; bool _decode_movie; @@ -174,7 +174,7 @@ private: bool _skip_next_update; float _secs_into_state; - std::size_t _cur_state; + size_t _cur_state; std::vector _states; }; diff --git a/src/AdjustSync.cpp b/src/AdjustSync.cpp index 3a78b94dc8..6812625b8e 100644 --- a/src/AdjustSync.cpp +++ b/src/AdjustSync.cpp @@ -361,7 +361,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector &vsAddTo ) const std::vector &bpmTest = testing.GetTimingSegments(SEGMENT_BPM); const std::vector &bpmOrig = original.GetTimingSegments(SEGMENT_BPM); SEGMENTS_MISMATCH_MESSAGE(bpmOrig, bpmTest, bpm); - for(std::size_t i= 0; i < bpmTest.size() && i < bpmOrig.size(); i++) + for(size_t i= 0; i < bpmTest.size() && i < bpmOrig.size(); i++) { float fNew = Quantize( ToBPM(bpmTest[i])->GetBPM(), 0.001f ); float fOld = Quantize( ToBPM(bpmOrig[i])->GetBPM(), 0.001f ); @@ -385,7 +385,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector &vsAddTo ) const std::vector &stopOrig = original.GetTimingSegments(SEGMENT_STOP); SEGMENTS_MISMATCH_MESSAGE(stopOrig, stopTest, stop); - for(std::size_t i= 0; i < stopTest.size() && i < stopOrig.size(); i++) + for(size_t i= 0; i < stopTest.size() && i < stopOrig.size(); i++) { float fOld = Quantize( ToStop(stopOrig[i])->GetPause(), 0.001f ); float fNew = Quantize( ToStop(stopTest[i])->GetPause(), 0.001f ); @@ -408,7 +408,7 @@ void AdjustSync::GetSyncChangeTextSong( std::vector &vsAddTo ) const std::vector &delyOrig = original.GetTimingSegments(SEGMENT_DELAY); SEGMENTS_MISMATCH_MESSAGE(delyOrig, delyTest, delay); - for(std::size_t i= 0; i < delyTest.size() && i < delyOrig.size(); i++) + for(size_t i= 0; i < delyTest.size() && i < delyOrig.size(); i++) { if( delyTest[i] == delyOrig[i] ) continue; diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index 1fe97c4a8f..28a0396b6d 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -53,15 +53,15 @@ static ThemeMetric TIPSY_OFFSET_TIMER_FREQUENCY( "ArrowEffects", "TipsyOf static ThemeMetric TIPSY_OFFSET_COLUMN_FREQUENCY( "ArrowEffects", "TipsyOffsetColumnFrequency" ); static ThemeMetric TIPSY_OFFSET_ARROW_MAGNITUDE( "ArrowEffects", "TipsyOffsetArrowMagnitude" ); -static RString TPSTL_NAME(std::size_t i) { return ssprintf("Tornado%cPositionScaleToLow", dimension_names[i]); } +static RString TPSTL_NAME(size_t i) { return ssprintf("Tornado%cPositionScaleToLow", dimension_names[i]); } static ThemeMetric1D TORNADO_POSITION_SCALE_TO_LOW("ArrowEffects", TPSTL_NAME, 3); -static RString TPSTH_NAME(std::size_t i) { return ssprintf("Tornado%cPositionScaleToHigh", dimension_names[i]); } +static RString TPSTH_NAME(size_t i) { return ssprintf("Tornado%cPositionScaleToHigh", dimension_names[i]); } static ThemeMetric1D TORNADO_POSITION_SCALE_TO_HIGH("ArrowEffects", TPSTH_NAME, 3); -static RString TOF_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetFrequency", dimension_names[i]); } +static RString TOF_NAME(size_t i) { return ssprintf("Tornado%cOffsetFrequency", dimension_names[i]); } static ThemeMetric1D TORNADO_OFFSET_FREQUENCY("ArrowEffects", TOF_NAME, 3); -static RString TOSFL_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetScaleFromLow", dimension_names[i]); } +static RString TOSFL_NAME(size_t i) { return ssprintf("Tornado%cOffsetScaleFromLow", dimension_names[i]); } static ThemeMetric1D TORNADO_OFFSET_SCALE_FROM_LOW("ArrowEffects", TOSFL_NAME, 3); -static RString TOSFH_NAME(std::size_t i) { return ssprintf("Tornado%cOffsetScaleFromHigh", dimension_names[i]); } +static RString TOSFH_NAME(size_t i) { return ssprintf("Tornado%cOffsetScaleFromHigh", dimension_names[i]); } static ThemeMetric1D TORNADO_OFFSET_SCALE_FROM_HIGH("ArrowEffects", TOSFH_NAME, 3); static ThemeMetric DRUNK_COLUMN_FREQUENCY( "ArrowEffects", "DrunkColumnFrequency" ); diff --git a/src/BitmapText.h b/src/BitmapText.h index 115dd2282c..6df371df04 100644 --- a/src/BitmapText.h +++ b/src/BitmapText.h @@ -66,7 +66,7 @@ public: void SetMaxHeight( float fMaxHeight ); void SetMaxDimUseZoom(bool use); void SetWrapWidthPixels( int iWrapWidthPixels ); - void CropLineToWidth(std::size_t l, int width); + void CropLineToWidth(size_t l, int width); void CropToWidth(int width); virtual bool EarlyAbortDraw() const override; @@ -107,7 +107,7 @@ public: }; Attribute GetDefaultAttribute() const; - void AddAttribute( std::size_t iPos, const Attribute &attr ); + void AddAttribute( size_t iPos, const Attribute &attr ); void ClearAttributes(); // Commands @@ -133,7 +133,7 @@ protected: std::vector m_aVertices; std::vector m_vpFontPageTextures; - std::map m_mAttributes; + std::map m_mAttributes; bool m_bHasGlowAttribute; TextGlowMode m_TextGlowMode; diff --git a/src/CombinedLifeMeterTug.cpp b/src/CombinedLifeMeterTug.cpp index c38355a311..4ca4bdbac4 100644 --- a/src/CombinedLifeMeterTug.cpp +++ b/src/CombinedLifeMeterTug.cpp @@ -10,7 +10,7 @@ ThemeMetric METER_WIDTH ("CombinedLifeMeterTug","MeterWidth"); -static void TugMeterPercentChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) +static void TugMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TugMeterPercentChange" + ScoreEventToString( (ScoreEvent)i ); switch( i ) diff --git a/src/Command.cpp b/src/Command.cpp index fc735e0d4f..c0c4f1b766 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -44,9 +44,9 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, std::v if( sSource.empty() ) return; - std::size_t startpos = 0; + size_t startpos = 0; do { - std::size_t pos = startpos; + size_t pos = startpos; while( pos < sSource.size() ) { if( sSource[pos] == Delimitor ) diff --git a/src/Course.cpp b/src/Course.cpp index f134f1b3ec..8910be4e02 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -790,7 +790,7 @@ void Course::GetTrailUnsortedEndless( const std::vector &entries, T ASSERT(e->iChooseIndex >= 0); // If we're trying to pick BEST100 when only 99 songs exist, // we have a problem, so bail out - if (static_cast(e->iChooseIndex) >= vpSongs.size()) { + if (static_cast(e->iChooseIndex) >= vpSongs.size()) { continue; } @@ -1317,7 +1317,7 @@ public: DEFINE_METHOD( GetCourseType, GetCourseType() ) static int GetCourseEntry(T* p, lua_State* L) { - std::size_t id= static_cast(IArg(1)); + size_t id= static_cast(IArg(1)); if(id >= p->m_vEntries.size()) { lua_pushnil(L); diff --git a/src/CreateZip.cpp b/src/CreateZip.cpp index a83d8b03f0..139b96d2fb 100644 --- a/src/CreateZip.cpp +++ b/src/CreateZip.cpp @@ -146,7 +146,7 @@ typedef char TCHAR; typedef unsigned char uch; // unsigned 8-bit value typedef unsigned short ush; // unsigned 16-bit value typedef unsigned long ulg; // unsigned 32-bit value -typedef std::size_t extent; // file size +typedef size_t extent; // file size typedef unsigned Pos; // must be at least 32 bits typedef unsigned IPos; // A Pos is an index in the character window. Pos is used only for parameter passing @@ -349,7 +349,7 @@ typedef struct iztimes { typedef struct zlist { ush vem, ver, flg, how; // See central header in zipfile.c for what vem..off are ulg tim, crc, siz, len; - std::size_t nam, ext, cext, com; // offset of ext must be >= LOCHEAD + size_t nam, ext, cext, com; // offset of ext must be >= LOCHEAD ush dsk, att, lflg; // offset of lflg must be >= LOCHEAD ulg atx, off; char name[MAX_PATH]; // File name in zip file @@ -402,12 +402,12 @@ int putlocal(struct zlist *z, WRITEFUNC wfunc,void *param) PUTLG(z->len, f); PUTSH(z->nam, f); PUTSH(z->ext, f); - std::size_t res = (std::size_t)wfunc(param, z->iname, (unsigned int)z->nam); + size_t res = (size_t)wfunc(param, z->iname, (unsigned int)z->nam); if (res!=z->nam) return ZE_TEMP; if (z->ext) { - res = (std::size_t)wfunc(param, z->extra, (unsigned int)z->ext); + res = (size_t)wfunc(param, z->extra, (unsigned int)z->ext); if (res!=z->ext) return ZE_TEMP; } @@ -443,15 +443,15 @@ int putcentral(struct zlist *z, WRITEFUNC wfunc, void *param) PUTSH(z->att, f); PUTLG(z->atx, f); PUTLG(z->off, f); - if ((std::size_t)wfunc(param, z->iname, (unsigned int)z->nam) != z->nam || - (z->cext && (std::size_t)wfunc(param, z->cextra, (unsigned int)z->cext) != z->cext) || - (z->com && (std::size_t)wfunc(param, z->comment, (unsigned int)z->com) != z->com)) + if ((size_t)wfunc(param, z->iname, (unsigned int)z->nam) != z->nam || + (z->cext && (size_t)wfunc(param, z->cextra, (unsigned int)z->cext) != z->cext) || + (z->com && (size_t)wfunc(param, z->comment, (unsigned int)z->com) != z->com)) return ZE_TEMP; return ZE_OK; } -int putend(int n, ulg s, ulg c, std::size_t m, char *z, WRITEFUNC wfunc, void *param) +int putend(int n, ulg s, ulg c, size_t m, char *z, WRITEFUNC wfunc, void *param) { // write the end of the central-directory-data to file *f. PUTLG(ENDSIG, f); @@ -532,7 +532,7 @@ const ulg crc_table[256] = { #define DO4(buf) DO2(buf); DO2(buf) #define DO8(buf) DO4(buf); DO4(buf) -ulg crc32(ulg crc, const uch *buf, std::size_t len) +ulg crc32(ulg crc, const uch *buf, size_t len) { if (buf== nullptr) return 0L; crc = crc ^ 0xffffffffL; diff --git a/src/CubicSpline.cpp b/src/CubicSpline.cpp index 6bd90ec500..e9df7e6918 100644 --- a/src/CubicSpline.cpp +++ b/src/CubicSpline.cpp @@ -31,29 +31,29 @@ struct SplineSolutionCache void solve_diagonals_straight(std::vector& diagonals, std::vector& multiples); void solve_diagonals_looped(std::vector& diagonals, std::vector& multiples); private: - void prep_inner(std::size_t last, std::vector& out); + void prep_inner(size_t last, std::vector& out); bool find_in_cache(std::list& cache, std::vector& outd, std::vector& outm); void add_to_cache(std::list& cache, std::vector& outd, std::vector& outm); std::list straight_diagonals; std::list looped_diagonals; }; -const std::size_t solution_cache_limit= 16; +const size_t solution_cache_limit= 16; bool SplineSolutionCache::find_in_cache(std::list& cache, std::vector& outd, std::vector& outm) { - std::size_t out_size= outd.size(); + size_t out_size= outd.size(); for(std::list::iterator entry= cache.begin(); entry != cache.end(); ++entry) { if(out_size == entry->diagonals.size()) { - for(std::size_t i= 0; i < out_size; ++i) + for(size_t i= 0; i < out_size; ++i) { outd[i]= entry->diagonals[i]; } outm.resize(entry->multiples.size()); - for(std::size_t i= 0; i < entry->multiples.size(); ++i) + for(size_t i= 0; i < entry->multiples.size(); ++i) { outm[i]= entry->multiples[i]; } @@ -74,9 +74,9 @@ void SplineSolutionCache::add_to_cache(std::list& cache, std::vector& out) +void SplineSolutionCache::prep_inner(size_t last, std::vector& out) { - for(std::size_t i= 1; i < last; ++i) + for(size_t i= 1; i < last; ++i) { out[i]= 4.0f; } @@ -102,7 +102,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector& diagonals // | 0 0 b 0 | -> | 0 0 b 0 | -> | 0 0 b 0 | // | 0 0 0 c | -> | 0 0 0 c | -> | 0 0 0 c | - std::size_t last= diagonals.size(); + size_t last= diagonals.size(); diagonals[0]= 2.0f; prep_inner(last-1, diagonals); diagonals[last-1]= 2.0f; @@ -111,7 +111,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector& diagonals // Operation: Add row[0] * -.5 to row[1] to zero [r1][c0]. diagonals[1]-= .5f; multiples.push_back(.5f); - for(std::size_t i= 1; i < last-1; ++i) + for(size_t i= 1; i < last-1; ++i) { // Operation: Add row[i] / -[ri][ci] to row[i+1] to zero [ri+1][ci]. const float diag_recip= 1.0f / diagonals[i]; @@ -119,7 +119,7 @@ void SplineSolutionCache::solve_diagonals_straight(std::vector& diagonals multiples.push_back(diag_recip); } // Stage two. - for(std::size_t i= last-1; i > 0; --i) + for(size_t i= last-1; i > 0; --i) { // Operation: Add row [i] / -[ri][ci] to row[i-1] to zero [ri-1][ci]. multiples.push_back(1.0f / diagonals[i]); @@ -164,7 +164,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector& diagonals, // | 0 0 0 c w | -> | 0 0 0 c w | -> | 0 0 0 c w | -> | 0 0 0 c 0 | // | 0 0 0 0 f | -> | 0 0 0 0 f | -> | 0 0 0 0 f | -> | 0 0 0 0 f | - std::size_t last= diagonals.size(); + size_t last= diagonals.size(); diagonals[0]= 4.0f; prep_inner(last, diagonals); // right_column is sized to not store the diagonal . @@ -173,7 +173,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector& diagonals, right_column[last-2]= 1.0f; // Stage one. - for(std::size_t i= 0; i < last-2; ++i) + for(size_t i= 0; i < last-2; ++i) { // Operation: Add row[i] / -[ri][ci] to row[i+1] to zero [ri+1][ci]. const float diag_recip= 1.0f / diagonals[i]; @@ -189,7 +189,7 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector& diagonals, multiples.push_back(diag_recip); } // Stage two. - for(std::size_t i= last-2; i > 0; --i) + for(size_t i= last-2; i > 0; --i) { // Operation: Add row[i] / -[ri][ci] to row[i-1] to zero [ri-1][ci]. const float diag_recip= 1.0f / diagonals[i]; @@ -204,8 +204,8 @@ void SplineSolutionCache::solve_diagonals_looped(std::vector& diagonals, multiples.push_back(diag_recip); } // Stage three. - const std::size_t end= last-1; - for(std::size_t i= 0; i < end; ++i) + const size_t end= last-1; + for(size_t i= 0; i < end; ++i) { // Operation: Add row[e] * (right_column[i] / [re][ce]) to row[i] to // zero right_column[i]. @@ -255,7 +255,7 @@ float loop_space_difference(float a, float b, float spatial_extent) void CubicSpline::solve_looped() { if(check_minimum_size()) { return; } - std::size_t last= m_points.size(); + size_t last= m_points.size(); std::vector results(m_points.size()); std::vector diagonals(m_points.size()); std::vector multiples; @@ -272,14 +272,14 @@ void CubicSpline::solve_looped() // SplineSolutionCache's Stage one loop ends at last-2 because it has to // handle right_column. This does not handle right_column, so the loop // goes to last-1. - for(std::size_t i= 0; i < last-1; ++i) + for(size_t i= 0; i < last-1; ++i) { // Operation: Add row[i] * -multiples[i] to row[i+1]. results[i+1]-= results[i] * multiples[i]; } - std::size_t next_mult= last-1; + size_t next_mult= last-1; // Stage two. - for(std::size_t i= last-2; i > 0; --i) + for(size_t i= last-2; i > 0; --i) { // Operation: Add row[i] * -multiples[nm] to row[i-1]. results[i-1]-= results[i] * multiples[next_mult]; @@ -290,8 +290,8 @@ void CubicSpline::solve_looped() results[last-1]-= results[0] * multiples[next_mult]; ++next_mult; // Stage three. - const std::size_t end= last-1; - for(std::size_t i= 0; i < end; ++i) + const size_t end= last-1; + for(size_t i= 0; i < end; ++i) { // Operation: Add row[e] * -multiples[nm] to row[i]. results[i]-= results[end] * multiples[next_mult]; @@ -304,7 +304,7 @@ void CubicSpline::solve_looped() void CubicSpline::solve_straight() { if(check_minimum_size()) { return; } - std::size_t last= m_points.size(); + size_t last= m_points.size(); std::vector results(m_points.size()); std::vector diagonals(m_points.size()); std::vector multiples; @@ -317,14 +317,14 @@ void CubicSpline::solve_straight() // Steps explained in detail in SplineSolutionCache. // Only the operations on the results column are performed here. // Stage one. - for(std::size_t i= 0; i < last-1; ++i) + for(size_t i= 0; i < last-1; ++i) { // Operation: Add row[i] * -multiples[i] to row[i+1]. results[i+1]-= results[i] * multiples[i]; } - std::size_t next_mult= last-1; + size_t next_mult= last-1; // Stage two. - for(std::size_t i= last-1; i > 0; --i) + for(size_t i= last-1; i > 0; --i) { // Operation: Add row[i] * -multiples[nm] to row [i-1]. results[i-1]-= results[i] * multiples[next_mult]; @@ -337,8 +337,8 @@ void CubicSpline::solve_straight() void CubicSpline::solve_polygonal() { if(check_minimum_size()) { return; } - std::size_t last= m_points.size() - 1; - for(std::size_t i= 0; i < last; ++i) + size_t last= m_points.size() - 1; + for(size_t i= 0; i < last; ++i) { m_points[i].b= loop_space_difference( m_points[i+1].a, m_points[i].a, m_spatial_extent); @@ -349,7 +349,7 @@ void CubicSpline::solve_polygonal() bool CubicSpline::check_minimum_size() { - std::size_t last= m_points.size(); + size_t last= m_points.size(); if(last < 2) { m_points[0].b= m_points[0].c= m_points[0].d= 0.0f; @@ -368,7 +368,7 @@ bool CubicSpline::check_minimum_size() } float a= m_points[0].a; bool all_points_identical= true; - for(std::size_t i= 0; i < m_points.size(); ++i) + for(size_t i= 0; i < m_points.size(); ++i) { m_points[i].b= m_points[i].c= m_points[i].d= 0.0f; if(m_points[i].a != a) { all_points_identical= false; } @@ -376,27 +376,27 @@ bool CubicSpline::check_minimum_size() return all_points_identical; } -void CubicSpline::prep_inner(std::size_t last, std::vector& results) +void CubicSpline::prep_inner(size_t last, std::vector& results) { - for(std::size_t i= 1; i < last - 1; ++i) + for(size_t i= 1; i < last - 1; ++i) { results[i]= 3 * loop_space_difference( m_points[i+1].a, m_points[i-1].a, m_spatial_extent); } } -void CubicSpline::set_results(std::size_t last, std::vector& diagonals, std::vector& results) +void CubicSpline::set_results(size_t last, std::vector& diagonals, std::vector& results) { // No more operations left, everything not a diagonal should be zero now. - for(std::size_t i= 0; i < last; ++i) + for(size_t i= 0; i < last; ++i) { results[i]/= diagonals[i]; } // Now we can go through and set the b, c, d values of each point. // b, c, d values of the last point are not set because they are unused. - for(std::size_t i= 0; i < last; ++i) + for(size_t i= 0; i < last; ++i) { - std::size_t next= (i+1) % last; + size_t next= (i+1) % last; float diff= loop_space_difference( m_points[next].a, m_points[i].a, m_spatial_extent); m_points[i].b= results[i]; @@ -411,14 +411,14 @@ void CubicSpline::set_results(std::size_t last, std::vector& diagonals, s // Solving is now complete. } -void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& tfrac) const +void CubicSpline::p_and_tfrac_from_t(float t, bool loop, size_t& p, float& tfrac) const { if(loop) { float max_t= static_cast(m_points.size()); t= std::fmod(t, max_t); if(t < 0.0f) { t+= max_t; } - p= static_cast(t); + p= static_cast(t); tfrac= t - static_cast(p); } else @@ -429,14 +429,14 @@ void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& p= 0; tfrac= 0; } - else if(static_cast(flort) >= m_points.size() - 1) + else if(static_cast(flort) >= m_points.size() - 1) { p= m_points.size() - 1; tfrac= 0; } else { - p= static_cast(flort); + p= static_cast(flort); tfrac= t - static_cast(p); } } @@ -444,7 +444,7 @@ void CubicSpline::p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& #define RETURN_IF_EMPTY if(m_points.empty()) { return 0.0f; } #define DECLARE_P_AND_TFRAC \ -std::size_t p= 0; float tfrac= 0.0f; \ +size_t p= 0; float tfrac= 0.0f; \ p_and_tfrac_from_t(t, loop, p, tfrac); float CubicSpline::evaluate(float t, bool loop) const @@ -483,13 +483,13 @@ float CubicSpline::evaluate_third_derivative(float t, bool loop) const #undef RETURN_IF_EMPTY #undef DECLARE_P_AND_TFRAC -void CubicSpline::set_point(std::size_t i, float v) +void CubicSpline::set_point(size_t i, float v) { ASSERT_M(i < m_points.size(), "CubicSpline::set_point requires the index to be less than the number of points."); m_points[i].a= v; } -void CubicSpline::set_coefficients(std::size_t i, float b, float c, float d) +void CubicSpline::set_coefficients(size_t i, float b, float c, float d) { ASSERT_M(i < m_points.size(), "CubicSpline: point index must be less than the number of points."); m_points[i].b= b; @@ -497,7 +497,7 @@ void CubicSpline::set_coefficients(std::size_t i, float b, float c, float d) m_points[i].d= d; } -void CubicSpline::get_coefficients(std::size_t i, float& b, float& c, float& d) const +void CubicSpline::get_coefficients(size_t i, float& b, float& c, float& d) const { ASSERT_M(i < m_points.size(), "CubicSpline: point index must be less than the number of points."); b= m_points[i].b; @@ -505,26 +505,26 @@ void CubicSpline::get_coefficients(std::size_t i, float& b, float& c, float& d) d= m_points[i].d; } -void CubicSpline::set_point_and_coefficients(std::size_t i, float a, float b, +void CubicSpline::set_point_and_coefficients(size_t i, float a, float b, float c, float d) { set_coefficients(i, b, c, d); m_points[i].a= a; } -void CubicSpline::get_point_and_coefficients(std::size_t i, float& a, float& b, +void CubicSpline::get_point_and_coefficients(size_t i, float& a, float& b, float& c, float& d) const { get_coefficients(i, b, c, d); a= m_points[i].a; } -void CubicSpline::resize(std::size_t s) +void CubicSpline::resize(size_t s) { m_points.resize(s); } -std::size_t CubicSpline::size() const +size_t CubicSpline::size() const { return m_points.size(); } @@ -555,27 +555,27 @@ void CubicSplineN::weighted_average(CubicSplineN& out, // Behavior for splines of different sizes: Use a size between the two. // Points that exist in both will be averaged. // Points that only exist in one will come only from that one. - const std::size_t from_size= from.size(); - const std::size_t to_size= to.size(); - std::size_t out_size= to_size; - std::size_t limit= to_size; + const size_t from_size= from.size(); + const size_t to_size= to.size(); + size_t out_size= to_size; + size_t limit= to_size; if(from_size < to_size) { - out_size= from_size + static_cast( + out_size= from_size + static_cast( static_cast(to_size - from_size) * between); } else if(to_size < from_size) { limit= from_size; - out_size= to_size + static_cast( + out_size= to_size + static_cast( static_cast(from_size - to_size) * between); } CLAMP(out_size, 0, limit); out.resize(out_size); - for(std::size_t spli= 0; spli < out.m_splines.size(); ++spli) + for(size_t spli= 0; spli < out.m_splines.size(); ++spli) { - for(std::size_t p= 0; p < out_size; ++p) + for(size_t p= 0; p < out_size; ++p) { float fc[4]= {0.0f, 0.0f, 0.0f, 0.0f}; float tc[4]= {0.0f, 0.0f, 0.0f, 0.0f}; @@ -683,42 +683,42 @@ CSN_EVAL_RV_SOMETHING(evaluate_derivative); #undef CSN_EVAL_RV_SOMETHING -void CubicSplineN::set_point(std::size_t i, const std::vector& v) +void CubicSplineN::set_point(size_t i, const std::vector& v) { ASSERT_M(v.size() == m_splines.size(), "CubicSplineN::set_point requires the passed point to be the same dimension as the spline."); - for(std::size_t n= 0; n < m_splines.size(); ++n) + for(size_t n= 0; n < m_splines.size(); ++n) { m_splines[n].set_point(i, v[n]); } m_dirty= true; } -void CubicSplineN::set_coefficients(std::size_t i, const std::vector& b, +void CubicSplineN::set_coefficients(size_t i, const std::vector& b, const std::vector& c, const std::vector& d) { ASSERT_M(b.size() == c.size() && c.size() == d.size() && d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be " "the same dimension as the spline."); - for(std::size_t n= 0; n < m_splines.size(); ++n) + for(size_t n= 0; n < m_splines.size(); ++n) { m_splines[n].set_coefficients(i, b[n], c[n], d[n]); } m_dirty= true; } -void CubicSplineN::get_coefficients(std::size_t i, std::vector& b, +void CubicSplineN::get_coefficients(size_t i, std::vector& b, std::vector& c, std::vector& d) { ASSERT_M(b.size() == c.size() && c.size() == d.size() && d.size() == m_splines.size(), "CubicSplineN: coefficient vectors must be " "the same dimension as the spline."); - for(std::size_t n= 0; n < m_splines.size(); ++n) + for(size_t n= 0; n < m_splines.size(); ++n) { m_splines[n].get_coefficients(i, b[n], c[n], d[n]); } } -void CubicSplineN::set_spatial_extent(std::size_t i, float extent) +void CubicSplineN::set_spatial_extent(size_t i, float extent) { ASSERT_M(i < m_splines.size(), "CubicSplineN: index of spline to set extent" " of is out of range."); @@ -726,14 +726,14 @@ void CubicSplineN::set_spatial_extent(std::size_t i, float extent) m_dirty= true; } -float CubicSplineN::get_spatial_extent(std::size_t i) +float CubicSplineN::get_spatial_extent(size_t i) { ASSERT_M(i < m_splines.size(), "CubicSplineN: index of spline to get extent" " of is out of range."); return m_splines[i].m_spatial_extent; } -void CubicSplineN::resize(std::size_t s) +void CubicSplineN::resize(size_t s) { for(spline_cont_t::iterator spline= m_splines.begin(); spline != m_splines.end(); ++spline) @@ -743,7 +743,7 @@ void CubicSplineN::resize(std::size_t s) m_dirty= true; } -std::size_t CubicSplineN::size() const +size_t CubicSplineN::size() const { if(!m_splines.empty()) { @@ -757,13 +757,13 @@ bool CubicSplineN::empty() const return m_splines.empty() || m_splines[0].empty(); } -void CubicSplineN::redimension(std::size_t d) +void CubicSplineN::redimension(size_t d) { m_splines.resize(d); m_dirty= true; } -std::size_t CubicSplineN::dimension() const +size_t CubicSplineN::dimension() const { return m_splines.size(); } @@ -791,18 +791,18 @@ SET_GET_MEM(m_dirty, dirty); struct LunaCubicSplineN : Luna { - static std::size_t dimension_index(T* p, lua_State* L, int s) + static size_t dimension_index(T* p, lua_State* L, int s) { - std::size_t i= static_cast(IArg(s)-1); + size_t i= static_cast(IArg(s)-1); if(i >= p->dimension()) { luaL_error(L, "Spline dimension index out of range."); } return i; } - static std::size_t point_index(T* p, lua_State* L, int s) + static size_t point_index(T* p, lua_State* L, int s) { - std::size_t i= static_cast(IArg(s)-1); + size_t i= static_cast(IArg(s)-1); if(i >= p->size()) { luaL_error(L, "Spline point index out of range."); @@ -820,7 +820,7 @@ struct LunaCubicSplineN : Luna std::vector pos; \ p->something(FArg(1), pos); \ lua_createtable(L, pos.size(), 0); \ - for(std::size_t i= 0; i < pos.size(); ++i) \ + for(size_t i= 0; i < pos.size(); ++i) \ { \ lua_pushnumber(L, pos[i]); \ lua_rawseti(L, -2, i+1); \ @@ -834,13 +834,13 @@ struct LunaCubicSplineN : Luna #undef LCSN_EVAL_SOMETHING static void get_element_table_from_stack(T* p, lua_State* L, int s, - std::size_t limit, std::vector& ret) + size_t limit, std::vector& ret) { - std::size_t elements= lua_objlen(L, s); + size_t elements= lua_objlen(L, s); // Too many elements is not an error because allowing it allows the user // to reuse the same position data set after changing the dimension size. // The same is true for too few elements. - for(std::size_t e= 0; e < elements; ++e) + for(size_t e= 0; e < elements; ++e) { lua_rawgeti(L, s, e+1); ret.push_back(FArg(-1)); @@ -851,7 +851,7 @@ struct LunaCubicSplineN : Luna } ret.resize(limit); } - static void set_point_from_stack(T* p, lua_State* L, std::size_t i, int s) + static void set_point_from_stack(T* p, lua_State* L, size_t i, int s) { if(!lua_istable(L, s)) { @@ -863,17 +863,17 @@ struct LunaCubicSplineN : Luna } static int set_point(T* p, lua_State* L) { - std::size_t i= point_index(p, L, 1); + size_t i= point_index(p, L, 1); set_point_from_stack(p, L, i, 2); COMMON_RETURN_SELF; } - static void set_coefficients_from_stack(T* p, lua_State* L, std::size_t i, int s) + static void set_coefficients_from_stack(T* p, lua_State* L, size_t i, int s) { if(!lua_istable(L, s) || !lua_istable(L, s+1) || !lua_istable(L, s+2)) { luaL_error(L, "Spline coefficient args must be three tables."); } - std::size_t limit= p->dimension(); + size_t limit= p->dimension(); std::vector b; get_element_table_from_stack(p, L, s, limit, b); std::vector c; get_element_table_from_stack(p, L, s+1, limit, c); std::vector d; get_element_table_from_stack(p, L, s+2, limit, d); @@ -881,24 +881,24 @@ struct LunaCubicSplineN : Luna } static int set_coefficients(T* p, lua_State* L) { - std::size_t i= point_index(p, L, 1); + size_t i= point_index(p, L, 1); set_coefficients_from_stack(p, L, i, 2); COMMON_RETURN_SELF; } static int get_coefficients(T* p, lua_State* L) { - std::size_t i= point_index(p, L, 1); - std::size_t limit= p->dimension(); + size_t i= point_index(p, L, 1); + size_t limit= p->dimension(); std::vector > coeff(3); coeff[0].resize(limit); coeff[1].resize(limit); coeff[2].resize(limit); p->get_coefficients(i, coeff[0], coeff[1], coeff[2]); lua_createtable(L, 3, 0); - for(std::size_t co= 0; co < coeff.size(); ++co) + for(size_t co= 0; co < coeff.size(); ++co) { lua_createtable(L, limit, 0); - for(std::size_t v= 0; v < limit; ++v) + for(size_t v= 0; v < limit; ++v) { lua_pushnumber(L, coeff[co][v]); lua_rawseti(L, -2, v+1); @@ -909,13 +909,13 @@ struct LunaCubicSplineN : Luna } static int set_spatial_extent(T* p, lua_State* L) { - std::size_t i= dimension_index(p, L, 1); + size_t i= dimension_index(p, L, 1); p->set_spatial_extent(i, FArg(2)); COMMON_RETURN_SELF; } static int get_spatial_extent(T* p, lua_State* L) { - std::size_t i= dimension_index(p, L, 1); + size_t i= dimension_index(p, L, 1); lua_pushnumber(L, p->get_spatial_extent(i)); return 1; } @@ -931,7 +931,7 @@ struct LunaCubicSplineN : Luna { luaL_error(L, "A spline cannot have less than 0 points."); } - p->resize(static_cast(siz)); + p->resize(static_cast(siz)); COMMON_RETURN_SELF; } static int get_size(T* p, lua_State* L) @@ -951,7 +951,7 @@ struct LunaCubicSplineN : Luna { luaL_error(L, "A spline cannot have less than 0 dimensions."); } - p->redimension(static_cast(dim)); + p->redimension(static_cast(dim)); COMMON_RETURN_SELF; } static int get_dimension(T* p, lua_State* L) diff --git a/src/CubicSpline.h b/src/CubicSpline.h index c466681c6a..2856be5bdd 100644 --- a/src/CubicSpline.h +++ b/src/CubicSpline.h @@ -14,24 +14,24 @@ CubicSpline() :m_spatial_extent(0.0f) {} void solve_looped(); void solve_straight(); void solve_polygonal(); - void p_and_tfrac_from_t(float t, bool loop, std::size_t& p, float& tfrac) const; + void p_and_tfrac_from_t(float t, bool loop, size_t& p, float& tfrac) const; float evaluate(float t, bool loop) const; float evaluate_derivative(float t, bool loop) const; float evaluate_second_derivative(float t, bool loop) const; float evaluate_third_derivative(float t, bool loop) const; - void set_point(std::size_t i, float v); - void set_coefficients(std::size_t i, float b, float c, float d); - void get_coefficients(std::size_t i, float& b, float& c, float& d) const; - void set_point_and_coefficients(std::size_t i, float a, float b, float c, float d); - void get_point_and_coefficients(std::size_t i, float& a, float& b, float& c, float& d) const; - void resize(std::size_t s); - std::size_t size() const; + void set_point(size_t i, float v); + void set_coefficients(size_t i, float b, float c, float d); + void get_coefficients(size_t i, float& b, float& c, float& d) const; + void set_point_and_coefficients(size_t i, float a, float b, float c, float d); + void get_point_and_coefficients(size_t i, float& a, float& b, float& c, float& d) const; + void resize(size_t s); + size_t size() const; bool empty() const; float m_spatial_extent; private: bool check_minimum_size(); - void prep_inner(std::size_t last, std::vector& results); - void set_results(std::size_t last, std::vector& diagonals, std::vector& results); + void prep_inner(size_t last, std::vector& results); + void set_results(size_t last, std::vector& diagonals, std::vector& results); struct SplinePoint { @@ -54,17 +54,17 @@ struct CubicSplineN void evaluate_third_derivative(float t, std::vector& v) const; void evaluate(float t, RageVector3& v) const; void evaluate_derivative(float t, RageVector3& v) const; - void set_point(std::size_t i, const std::vector& v); - void set_coefficients(std::size_t i, const std::vector& b, + void set_point(size_t i, const std::vector& v); + void set_coefficients(size_t i, const std::vector& b, const std::vector& c, const std::vector& d); - void get_coefficients(std::size_t i, std::vector& b, + void get_coefficients(size_t i, std::vector& b, std::vector& c, std::vector& d); - void set_spatial_extent(std::size_t i, float extent); - float get_spatial_extent(std::size_t i); - void resize(std::size_t s); - std::size_t size() const; - void redimension(std::size_t d); - std::size_t dimension() const; + void set_spatial_extent(size_t i, float extent); + float get_spatial_extent(size_t i); + void resize(size_t s); + size_t size() const; + void redimension(size_t d); + size_t dimension() const; bool empty() const; float get_max_t() const { if(m_loop) { return static_cast(size()); } diff --git a/src/DifficultyList.cpp b/src/DifficultyList.cpp index 7f0eebc2aa..3dd41d8be7 100644 --- a/src/DifficultyList.cpp +++ b/src/DifficultyList.cpp @@ -216,13 +216,13 @@ void StepsDisplayList::UpdatePositions() void StepsDisplayList::PositionItems() { - for( std::size_t i = 0; i < MAX_METERS; ++i ) + for( size_t i = 0; i < MAX_METERS; ++i ) { bool bUnused = ( i >= m_Rows.size() ); m_Lines[i].m_Meter.SetVisible( !bUnused ); } - for( std::size_t m = 0; m < m_Rows.size(); ++m ) + for( size_t m = 0; m < m_Rows.size(); ++m ) { Row &row = m_Rows[m]; bool bHidden = row.m_bHidden; @@ -240,7 +240,7 @@ void StepsDisplayList::PositionItems() m_Lines[m].m_Meter.SetY( row.m_fY ); } - for( std::size_t m=0; m < MAX_METERS; ++m ) + for( size_t m=0; m < MAX_METERS; ++m ) { bool bHidden = true; if( m_bShown && m < m_Rows.size() ) @@ -306,7 +306,7 @@ void StepsDisplayList::SetFromGameState() UpdatePositions(); PositionItems(); - for( std::size_t m = 0; m < MAX_METERS; ++m ) + for( size_t m = 0; m < MAX_METERS; ++m ) m_Lines[m].m_Meter.FinishTweening(); } @@ -326,7 +326,7 @@ void StepsDisplayList::TweenOnScreen() FOREACH_HumanPlayer( pn ) ON_COMMAND( m_Cursors[pn] ); - for( std::size_t m = 0; m < MAX_METERS; ++m ) + for( size_t m = 0; m < MAX_METERS; ++m ) ON_COMMAND( m_Lines[m].m_Meter ); this->SetHibernate( 0.5f ); diff --git a/src/DynamicActorScroller.cpp b/src/DynamicActorScroller.cpp index 51af902de0..d34c6541ee 100644 --- a/src/DynamicActorScroller.cpp +++ b/src/DynamicActorScroller.cpp @@ -24,7 +24,7 @@ void DynamicActorScroller::LoadFromNode( const XNode *pNode ) { LuaHelpers::ReportScriptErrorFmt("%s: DynamicActorScroller: loaded %i nodes; require exactly one", ActorUtil::GetWhere(pNode).c_str(), (int)m_SubActors.size()); // Remove all but one. - for( std::size_t i=1; i &v ) { diff --git a/src/Font.cpp b/src/Font.cpp index 731c0b651c..2196c09e47 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -259,7 +259,7 @@ int Font::GetLineHeightInSourcePixels( const std::wstring &szLine ) const } // width is a pointer so that we can return the used width through it. -std::size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const +size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const { if(*width == 0) { @@ -267,7 +267,7 @@ std::size_t Font::GetGlyphsThatFit(const std::wstring& line, int* width) const return line.size(); } int curr_width= 0; - std::size_t i= 0; + size_t i= 0; for(i= 0; i < line.size() && curr_width < *width; ++i) { curr_width+= GetGlyph(line[i]).m_iHadvance; @@ -441,11 +441,11 @@ void Font::GetFontPaths( const RString &sFontIniPath, std::vector &asTe RString Font::GetPageNameFromFileName( const RString &sFilename ) { - std::size_t begin = sFilename.find_first_of( '[' ); + size_t begin = sFilename.find_first_of( '[' ); if( begin == std::string::npos ) return "main"; - std::size_t end = sFilename.find_first_of( ']', begin ); + size_t end = sFilename.find_first_of( ']', begin ); if( end == std::string::npos ) return "main"; diff --git a/src/Font.h b/src/Font.h index 0a67fa0e7a..3dcf2a7a39 100644 --- a/src/Font.h +++ b/src/Font.h @@ -158,7 +158,7 @@ public: int GetLineWidthInSourcePixels( const std::wstring &szLine ) const; int GetLineHeightInSourcePixels( const std::wstring &szLine ) const; - std::size_t GetGlyphsThatFit(const std::wstring& line, int* width) const; + size_t GetGlyphsThatFit(const std::wstring& line, int* width) const; bool FontCompleteForString( const std::wstring &str ) const; diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index f32ca52f98..be2f77cf52 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -361,7 +361,7 @@ void GameCommand::LoadOne( const Command& cmd ) } else { - for(std::size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2) + for(size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2) { m_SetEnv[cmd.m_vsArgs[i]]= cmd.m_vsArgs[i+1]; } @@ -451,7 +451,7 @@ void GameCommand::LoadOne( const Command& cmd ) } else { - for(std::size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2) + for(size_t i= 1; i < cmd.m_vsArgs.size(); i+= 2) { if(IPreference::GetPreferenceByName(cmd.m_vsArgs[i]) == nullptr) { diff --git a/src/GameManager.cpp b/src/GameManager.cpp index 6c386fcbdb..a006c7856b 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -3270,7 +3270,7 @@ void GameManager::GetStylesForGame( const Game *pGame, std::vector const Game *GameManager::GetGameForStyle( const Style *pStyle ) { - for( std::size_t g=0; gm_apStyles[s]; ++s ) @@ -3284,7 +3284,7 @@ const Game *GameManager::GetGameForStyle( const Style *pStyle ) const Style* GameManager::GetEditorStyleForStepsType( StepsType st ) { - for( std::size_t g=0; gm_apStyles[s]; ++s ) @@ -3395,7 +3395,7 @@ const Style *GameManager::GetFirstCompatibleStyle( const Game *pGame, int iNumPl void GameManager::GetEnabledGames( std::vector& aGamesOut ) { - for( std::size_t g=0; gm_szName) ) return g_Games[i]; @@ -3544,7 +3544,7 @@ public: std::vector aGames; p->GetEnabledGames( aGames ); lua_createtable(L, aGames.size(), 0); - for(std::size_t i= 0; i < aGames.size(); ++i) + for(size_t i= 0; i < aGames.size(); ++i) { lua_pushstring(L, aGames[i]->m_szName); lua_rawseti(L, -2, i+1); diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index 645981cd66..01cd448da6 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -915,7 +915,7 @@ int LuaFunc_get_sound_driver_list(lua_State* L) { std::vector driver_names = RageSoundDriver::GetSoundDriverList(); lua_createtable(L, driver_names.size(), 0); - for(std::size_t n= 0; n < driver_names.size(); ++n) + for(size_t n= 0; n < driver_names.size(); ++n) { lua_pushstring(L, driver_names[n].c_str()); lua_rawseti(L, -2, n+1); diff --git a/src/GameState.cpp b/src/GameState.cpp index bd1c5383b5..3f3f4d220f 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -1484,7 +1484,7 @@ int GameState::prepare_song_for_gameplay() copy_exts.push_back("lrc"); std::vector files_in_dir; FILEMAN->GetDirListingWithMultipleExtensions(from_dir, copy_exts, files_in_dir); - for(std::size_t i= 0; i < files_in_dir.size(); ++i) + for(size_t i= 0; i < files_in_dir.size(); ++i) { RString& fname= files_in_dir[i]; if(!FileCopy(from_dir + fname, to_dir + fname)) @@ -3336,7 +3336,7 @@ public: { int i= IArg(1) - 1; if(i < 0) { lua_pushnil(L); return 1; } - std::size_t si= static_cast(i); + size_t si= static_cast(i); if(si >= p->m_autogen_fargs.size()) { lua_pushnil(L); return 1; } lua_pushnumber(L, p->GetAutoGenFarg(si)); return 1; @@ -3349,7 +3349,7 @@ public: luaL_error(L, "%i is not a valid autogen arg index.", i); } float v= FArg(2); - std::size_t si= static_cast(i); + size_t si= static_cast(i); while(si >= p->m_autogen_fargs.size()) { p->m_autogen_fargs.push_back(0.0f); diff --git a/src/GameState.h b/src/GameState.h index ddb3ca305a..45d229498c 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -417,7 +417,7 @@ public: // Autogen stuff. This should probably be moved to its own singleton or // something when autogen is generalized and more customizable. -Kyz - float GetAutoGenFarg(std::size_t i) + float GetAutoGenFarg(size_t i) { if(i >= m_autogen_fargs.size()) { return 0.0f; } return m_autogen_fargs[i]; diff --git a/src/GhostArrowRow.cpp b/src/GhostArrowRow.cpp index 199152a10d..773f409a94 100644 --- a/src/GhostArrowRow.cpp +++ b/src/GhostArrowRow.cpp @@ -43,7 +43,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset void GhostArrowRow::SetColumnRenderers(std::vector& renderers) { ASSERT_M(renderers.size() == m_Ghost.size(), "Notefield has different number of columns than ghost row."); - for(std::size_t c= 0; c < m_Ghost.size(); ++c) + for(size_t c= 0; c < m_Ghost.size(); ++c) { m_Ghost[c]->SetFakeParent(&(renderers[c])); } diff --git a/src/GradeDisplay.cpp b/src/GradeDisplay.cpp index 43f16cc18d..9c0ec00d35 100644 --- a/src/GradeDisplay.cpp +++ b/src/GradeDisplay.cpp @@ -27,7 +27,7 @@ void GradeDisplay::Load( RString sMetricsGroup ) void GradeDisplay::SetGrade( Grade grade ) { - std::size_t i = 0; + size_t i = 0; FOREACH_PossibleGrade( g ) { if(i >= m_vSpr.size()) diff --git a/src/HighScore.cpp b/src/HighScore.cpp index 4fdbf69f0f..f35ddf9b42 100644 --- a/src/HighScore.cpp +++ b/src/HighScore.cpp @@ -547,7 +547,7 @@ public: static int GetHighestScoreOfName( T* p, lua_State *L ) { RString name= SArg(1); - for(std::size_t i= 0; i < p->vHighScores.size(); ++i) + for(size_t i= 0; i < p->vHighScores.size(); ++i) { if(name == p->vHighScores[i].GetName()) { @@ -562,8 +562,8 @@ public: static int GetRankOfName( T* p, lua_State *L ) { RString name= SArg(1); - std::size_t rank= 0; - for(std::size_t i= 0; i < p->vHighScores.size(); ++i) + size_t rank= 0; + for(size_t i= 0; i < p->vHighScores.size(); ++i) { if(name == p->vHighScores[i].GetName()) { diff --git a/src/ImageCache.cpp b/src/ImageCache.cpp index 4c2c30711f..8e2a34ac46 100644 --- a/src/ImageCache.cpp +++ b/src/ImageCache.cpp @@ -274,7 +274,7 @@ RageTextureID ImageCache::LoadCachedImage( RString sImageDir, RString sImagePath { RageTextureID ID( GetImageCachePath(sImageDir,sImagePath) ); - std::size_t Found = sImagePath.find("_blank"); + size_t Found = sImagePath.find("_blank"); if( sImagePath == "" || Found!=RString::npos ) return ID; diff --git a/src/IniFile.cpp b/src/IniFile.cpp index 62da670571..afeebb77c3 100644 --- a/src/IniFile.cpp +++ b/src/IniFile.cpp @@ -97,7 +97,7 @@ bool IniFile::ReadFile( RageFileBasic &f ) if(keychild == nullptr) { break; } // New value. - std::size_t iEqualIndex = line.find("="); + size_t iEqualIndex = line.find("="); if( iEqualIndex != std::string::npos ) { RString valuename = line.Left((int) iEqualIndex); diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 1927ef2255..75bef4d15c 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -987,7 +987,7 @@ bool InputMapper::IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const } std::vector GameI; MenuToGame( MenuI, pn, GameI ); - for( std::size_t i=0; i& GameI, MultiPlayer mp, const DeviceInputList *pButtonState ) const { bool pressed= false; - for(std::size_t i= 0; i < GameI.size(); ++i) + for(size_t i= 0; i < GameI.size(); ++i) { pressed |= IsBeingPressed(GameI[i], mp, pButtonState); } @@ -1027,7 +1027,7 @@ void InputMapper::RepeatStopKey( GameButton MenuI, PlayerNumber pn ) } std::vector GameI; MenuToGame( MenuI, pn, GameI ); - for( std::size_t i=0; i GameI; MenuToGame( MenuI, pn, GameI ); - for( std::size_t i=0; i GameI; MenuToGame( MenuI, pn, GameI ); - for( std::size_t i=0; i -static RString LIFE_PERCENT_CHANGE_NAME( std::size_t i ) { return "LifePercentChange" + ScoreEventToString( (ScoreEvent)i ); } +static RString LIFE_PERCENT_CHANGE_NAME( size_t i ) { return "LifePercentChange" + ScoreEventToString( (ScoreEvent)i ); } LifeMeterBar::LifeMeterBar() { diff --git a/src/LifeMeterTime.cpp b/src/LifeMeterTime.cpp index ece496c179..ed256c475d 100644 --- a/src/LifeMeterTime.cpp +++ b/src/LifeMeterTime.cpp @@ -39,7 +39,7 @@ static const float g_fTimeMeterSecondsChangeInit[] = }; static_assert( ARRAYLEN(g_fTimeMeterSecondsChangeInit) == NUM_ScoreEvent ); -static void TimeMeterSecondsChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) +static void TimeMeterSecondsChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TimeMeterSecondsChange" + ScoreEventToString( (ScoreEvent)i ); defaultValueOut = g_fTimeMeterSecondsChangeInit[i]; diff --git a/src/LightsManager.cpp b/src/LightsManager.cpp index 6cc630b10b..bb9d101825 100644 --- a/src/LightsManager.cpp +++ b/src/LightsManager.cpp @@ -87,7 +87,7 @@ static void GetUsedGameInputs( std::vector &vGameInputsOut ) { std::vector gi; style->StyleInputToGameInput( iCol, pn, gi ); - for(std::size_t i= 0; i < gi.size(); ++i) + for(size_t i= 0; i < gi.size(); ++i) { if(gi[i].IsValid()) { diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index c8d7063436..edde82a107 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -98,7 +98,7 @@ namespace LuaHelpers template<> bool FromStack( Lua *L, unsigned int &Object, int iOffset ) { Object = lua_tointeger( L, iOffset ); return true; } template<> bool FromStack( Lua *L, RString &Object, int iOffset ) { - std::size_t iLen; + size_t iLen; const char *pStr = lua_tolstring( L, iOffset, &iLen ); if( pStr != nullptr ) Object.assign( pStr, iLen ); diff --git a/src/MemoryCardManager.cpp b/src/MemoryCardManager.cpp index 1233a24d81..0927c9c1db 100644 --- a/src/MemoryCardManager.cpp +++ b/src/MemoryCardManager.cpp @@ -18,25 +18,25 @@ MemoryCardManager* MEMCARDMAN = nullptr; // global and accessible from anywhere in our program -static void MemoryCardOsMountPointInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) +static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardOsMountPointP%d", int(i+1) ); defaultValueOut = ""; } -static void MemoryCardUsbBusInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbBusInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbBusP%d", int(i+1) ); defaultValueOut = -1; } -static void MemoryCardUsbPortInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbPortInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbPortP%d",int(i+1) ); defaultValueOut = -1; } -static void MemoryCardUsbLevelInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbLevelInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbLevelP%d", int(i+1) ); defaultValueOut = -1; diff --git a/src/MenuTimer.cpp b/src/MenuTimer.cpp index bf52b158e6..1d0b9bc80c 100644 --- a/src/MenuTimer.cpp +++ b/src/MenuTimer.cpp @@ -12,7 +12,7 @@ #include #include -RString WARNING_COMMAND_NAME( std::size_t i ) { return ssprintf("Warning%dCommand",int(i)); } +RString WARNING_COMMAND_NAME( size_t i ) { return ssprintf("Warning%dCommand",int(i)); } static const float TIMER_PAUSE_SECONDS = 99.99f; diff --git a/src/MenuTimer.h b/src/MenuTimer.h index b85194b067..78fc1a5284 100644 --- a/src/MenuTimer.h +++ b/src/MenuTimer.h @@ -11,7 +11,7 @@ #include -RString WARNING_COMMAND_NAME( std::size_t i ); +RString WARNING_COMMAND_NAME( size_t i ); class MenuTimer : public ActorFrame { diff --git a/src/Model.cpp b/src/Model.cpp index 9c4f668704..880fc57fba 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -605,7 +605,7 @@ void Model::AdvanceFrame( float fDeltaTime ) void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vector &vpBones ) { - for( std::size_t i = 0; i < pAnimation->Bones.size(); ++i ) + for( size_t i = 0; i < pAnimation->Bones.size(); ++i ) { const msBone *pBone = &pAnimation->Bones[i]; if( pBone->PositionKeys.size() == 0 && pBone->RotationKeys.size() == 0 ) @@ -616,7 +616,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vectorPositionKeys.size(); ++j ) + for( size_t j = 0; j < pBone->PositionKeys.size(); ++j ) { const msPositionKey *pPositionKey = &pBone->PositionKeys[j]; if( pPositionKey->fTime >= fFrame ) @@ -640,7 +640,7 @@ void Model::SetBones( const msAnimation* pAnimation, float fFrame, std::vectorRotationKeys.size(); ++j ) + for( size_t j = 0; j < pBone->RotationKeys.size(); ++j ) { const msRotationKey *pRotationKey = &pBone->RotationKeys[j]; if( pRotationKey->fTime >= fFrame ) diff --git a/src/ModsGroup.h b/src/ModsGroup.h index b4f99df17d..fec60cc990 100644 --- a/src/ModsGroup.h +++ b/src/ModsGroup.h @@ -58,7 +58,7 @@ public: } template - inline void Assign_n( ModsLevel level, U (T::*member)[n], std::size_t index, const U &val ) + inline void Assign_n( ModsLevel level, U (T::*member)[n], size_t index, const U &val ) { DEBUG_ASSERT( index < n ); if( level != ModsLevel_Song ) diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 51a3c920c0..6a5e1f48b3 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -35,7 +35,7 @@ static Preference g_bPrecacheAllSorts( "PreCacheAllWheelSorts", false); #define WHEEL_TEXT(s) THEME->GetString( "MusicWheel", ssprintf("%sText",s.c_str()) ); #define CUSTOM_ITEM_WHEEL_TEXT(s) THEME->GetString( "MusicWheel", ssprintf("CustomItem%sText",s.c_str()) ); -static RString SECTION_COLORS_NAME( std::size_t i ) { return ssprintf("SectionColor%d",int(i+1)); } +static RString SECTION_COLORS_NAME( size_t i ) { return ssprintf("SectionColor%d",int(i+1)); } static RString CHOICE_NAME( RString s ) { return ssprintf("Choice%s",s.c_str()); } static RString CUSTOM_WHEEL_ITEM_NAME( RString s ) { return ssprintf("CustomWheelItem%s",s.c_str()); } static RString CUSTOM_WHEEL_ITEM_COLOR( RString s ) { return ssprintf("%sColor",s.c_str()); } @@ -458,7 +458,7 @@ void MusicWheel::GetSongList( std::vector &arraySongs, SortOrder so ) if(GAMESTATE->IsPlayerEnabled(pn)) { Profile* prof= PROFILEMAN->GetProfile(pn); - for(std::size_t i= 0; i < prof->m_songs.size(); ++i) + for(size_t i= 0; i < prof->m_songs.size(); ++i) { apAllSongs.push_back(prof->m_songs[i]); } diff --git a/src/NetworkManager.cpp b/src/NetworkManager.cpp index 23538b2c5b..4c167d3c5a 100644 --- a/src/NetworkManager.cpp +++ b/src/NetworkManager.cpp @@ -141,7 +141,7 @@ bool NetworkManager::IsUrlAllowed(const std::string& url) // subdomain wildcards; ".domain" doesn't match "*.domain", but "a.domain" does if (allowedHost.substr(0, 2) == "*." && host.length() >= allowedHost.length()) { - std::size_t pos = host.length() - allowedHost.length() + 1; + size_t pos = host.length() - allowedHost.length() + 1; if (host.substr(pos) == allowedHost.substr(1)) return true; } @@ -340,7 +340,7 @@ int WebSocketHandle::Send(lua_State *L) void *udata = luaL_checkudata(L, 1, "WebSocketHandle"); auto handle = *static_cast(udata); - std::size_t len; + size_t len; const char *s = luaL_checklstring(L, 2, &len); std::string data(s, len); @@ -453,7 +453,7 @@ public: { if (lua_isstring(L, -1)) { - std::size_t len; + size_t len; const char *s = lua_tolstring(L, -1, &len); args.body = std::string(s, len); } @@ -469,7 +469,7 @@ public: { if (lua_isstring(L, -1)) { - std::size_t len; + size_t len; const char *s = lua_tolstring(L, -1, &len); args.multipartBoundary = std::string(s, len); } diff --git a/src/NoteData.cpp b/src/NoteData.cpp index d9ade853a5..73e023ea2f 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -1411,12 +1411,12 @@ template if(added) { int avg_row= 0; - for(std::size_t p= 0; p < m_PrevCurrentRows.size(); ++p) + for(size_t p= 0; p < m_PrevCurrentRows.size(); ++p) { avg_row+= m_PrevCurrentRows[p]; } avg_row/= m_PrevCurrentRows.size(); - for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a) + for(size_t a= 0; a < added_or_removed_tracks.size(); ++a) { int track_id= added_or_removed_tracks[a]; m_PrevCurrentRows.insert(m_PrevCurrentRows.begin()+track_id, avg_row); @@ -1427,7 +1427,7 @@ template } else { - for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a) + for(size_t a= 0; a < added_or_removed_tracks.size(); ++a) { int track_id= added_or_removed_tracks[a]; m_PrevCurrentRows.erase(m_PrevCurrentRows.begin()+track_id); diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index bbd3839e2f..06ba566eec 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -868,7 +868,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin } // prev_limb_panels keeps track of which panel in the track list the limb // hit last. - std::vector prev_limb_panels(num_kickbox_limbs, 0); + std::vector prev_limb_panels(num_kickbox_limbs, 0); std::vector panel_repeat_counts(num_kickbox_limbs, 0); std::vector panel_repeat_goals(num_kickbox_limbs, 0); RandomGen rnd(nonrandom_seed); @@ -965,7 +965,7 @@ void NoteDataUtil::AutogenKickbox(const NoteData& in, NoteData& out, const Timin default: break; } - std::size_t this_panel= prev_limb_panels[this_limb]; + size_t this_panel= prev_limb_panels[this_limb]; if(panel_repeat_counts[this_limb] + 1 > panel_repeat_goals[this_limb]) { // Use a different panel. @@ -1047,7 +1047,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds, float total_taps= 0; const float voltage_window_beats= 8.0f; const int voltage_window= BeatToNoteRow(voltage_window_beats); - std::size_t max_notes_in_voltage_window= 0; + size_t max_notes_in_voltage_window= 0; int num_chaos_rows= 0; crv_state state; @@ -1060,7 +1060,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds, state.num_notes_on_curr_row= 0; state.num_holds_on_curr_row= 0; state.judgable= timing->IsJudgableAtRow(curr_row); - for(std::size_t n= 0; n < state.hold_ends.size(); ++n) + for(size_t n= 0; n < state.hold_ends.size(); ++n) { if(state.hold_ends[n] < curr_row) { @@ -1068,7 +1068,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds, --n; } } - for(std::size_t n= 0; n < recent_notes.size(); ++n) + for(size_t n= 0; n < recent_notes.size(); ++n) { if(recent_notes[n].row < curr_row - voltage_window) { @@ -2115,7 +2115,7 @@ static void HyperShuffleNotes( NoteData &inout, int iStartIndex, int iEndIndex) std::shuffle(viTargetTracks.begin(), viTargetTracks.end(), g_RandomNumberGenerator); // Go through the tracks in their shuffled order and drop tap notes. - for(std::size_t i = 0; i < viTargetTracks.size(); i++) + for(size_t i = 0; i < viTargetTracks.size(); i++) { const int targetTrack = viTargetTracks[i]; const TapNote current_tn = vtnTargetTaps[i]; diff --git a/src/NoteDataWithScoring.cpp b/src/NoteDataWithScoring.cpp index 561a8816fb..3cd39d4ded 100644 --- a/src/NoteDataWithScoring.cpp +++ b/src/NoteDataWithScoring.cpp @@ -253,8 +253,8 @@ static void DoRowEndRadarActualCalc(garv_state& state, RadarValues& out) { if(state.worst_tns_on_row >= state.hands_tns) { - std::size_t holds_down= 0; - for(std::size_t n= 0; n < state.hold_ends.size(); ++n) + size_t holds_down= 0; + for(size_t n= 0; n < state.hold_ends.size(); ++n) { holds_down+= (state.curr_row <= state.hold_ends[n].last_held_row); } @@ -307,7 +307,7 @@ void NoteDataWithScoring::GetActualRadarValues(const NoteData &in, state.num_notes_on_curr_row= 0; state.num_holds_on_curr_row= 0; state.judgable= timing->IsJudgableAtRow(state.curr_row); - for(std::size_t n= 0; n < state.hold_ends.size(); ++n) + for(size_t n= 0; n < state.hold_ends.size(); ++n) { if(state.hold_ends[n].end_row < state.curr_row) { diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 5f577cd9f5..fb9e1676e6 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -37,7 +37,7 @@ static ThemeMetric BAR_8TH_ALPHA( "NoteField", "Bar8thAlpha" ); static ThemeMetric BAR_16TH_ALPHA( "NoteField", "Bar16thAlpha" ); static ThemeMetric FADE_FAIL_TIME( "NoteField", "FadeFailTime" ); -static RString RoutineNoteSkinName( std::size_t i ) { return ssprintf("RoutineNoteSkinP%i",int(i+1)); } +static RString RoutineNoteSkinName( size_t i ) { return ssprintf("RoutineNoteSkinP%i",int(i+1)); } static ThemeMetric1D ROUTINE_NOTESKIN( "NoteField", RoutineNoteSkinName, NUM_PLAYERS ); NoteField::NoteField() @@ -314,7 +314,7 @@ void NoteField::InitColumnRenderers() m_FieldRenderArgs.ghost_row= &(m_pCurDisplay->m_GhostArrowRow); m_FieldRenderArgs.note_data= m_pNoteData; m_ColumnRenderers.resize(GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer); - for(std::size_t ncr= 0; ncr < m_ColumnRenderers.size(); ++ncr) + for(size_t ncr= 0; ncr < m_ColumnRenderers.size(); ++ncr) { FOREACH_EnabledPlayer(pn) { @@ -339,7 +339,7 @@ void NoteField::Update( float fDeltaTime ) ActorFrame::Update( fDeltaTime ); ArrowEffects::SetCurrentOptions(&m_pPlayerState->m_PlayerOptions.GetCurrent()); - for(std::size_t c= 0; c < m_ColumnRenderers.size(); ++c) + for(size_t c= 0; c < m_ColumnRenderers.size(); ++c) { m_ColumnRenderers[c].Update(fDeltaTime); } @@ -826,7 +826,7 @@ void NoteField::DrawPrimitives() { const std::vector &tSigs = *segs[SEGMENT_TIME_SIG]; int iMeasureIndex = 0; - for (std::size_t i = 0; i < tSigs.size(); i++) + for (size_t i = 0; i < tSigs.size(); i++) { const TimeSignatureSegment *ts = ToTimeSignature(tSigs[i]); int iSegmentEndRow = (i + 1 == tSigs.size()) ? m_FieldRenderArgs.last_row : tSigs[i+1]->GetRow(); @@ -882,7 +882,7 @@ void NoteField::DrawPrimitives() #define draw_all_segments(str_exp, name, caps_name) \ horiz_align= caps_name##_IS_LEFT_SIDE ? align_right : align_left; \ side_sign= caps_name##_IS_LEFT_SIDE ? -1 : 1; \ - for(std::size_t i= 0; i < segs[SEGMENT_##caps_name]->size(); ++i) \ + for(size_t i= 0; i < segs[SEGMENT_##caps_name]->size(); ++i) \ { \ const name##Segment* seg= To##name((*segs[SEGMENT_##caps_name])[i]); \ if(seg->GetRow() >= m_FieldRenderArgs.first_row && \ @@ -1289,7 +1289,7 @@ public: static int get_column_actors(T* p, lua_State* L) { lua_createtable(L, p->m_ColumnRenderers.size(), 0); - for(std::size_t i= 0; i < p->m_ColumnRenderers.size(); ++i) + for(size_t i= 0; i < p->m_ColumnRenderers.size(); ++i) { p->m_ColumnRenderers[i].PushSelf(L); lua_rawseti(L, -2, i+1); diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 2aa0a6596b..044d2e5470 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -213,7 +213,7 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, std::vector bool NoteSkinManager::NoteSkinNameInList(const RString name, std::vector name_list) { - for(std::size_t i= 0; i < name_list.size(); ++i) + for(size_t i= 0; i < name_list.size(); ++i) { if(0 == strcasecmp(name, name_list[i])) { diff --git a/src/NotesLoader.cpp b/src/NotesLoader.cpp index 498ed95977..3361da0363 100644 --- a/src/NotesLoader.cpp +++ b/src/NotesLoader.cpp @@ -18,7 +18,7 @@ void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, R for( unsigned i=0; i const& exts= ActorUtil::GetTypeExtensionList(FT_Sound); - for(std::size_t i = 0; i < exts.size(); ++i) + for(size_t i = 0; i < exts.size(); ++i) { RString fn = SetExtension( normalizedFilename, exts[i] ); if( IsAFile(dir + fn) ) @@ -720,7 +720,7 @@ bool BMSSong::GetBackground( RString filename, RString path, RString &bgfile ) std::vector exts; ActorUtil::AddTypeExtensionsToList(FT_Movie, exts); ActorUtil::AddTypeExtensionsToList(FT_Bitmap, exts); - for(std::size_t i = 0; i < exts.size(); ++i) + for(size_t i = 0; i < exts.size(); ++i) { RString fn = SetExtension( normalizedFilename, exts[i] ); if( IsAFile(dir + fn) ) diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index b2ea1d5ee5..b1c1a36961 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -130,7 +130,7 @@ static void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2O * @param pos the position of the step data. * @return true if it's a 192nd note, false otherwise. */ -static bool Is192( const RString &sStepData, std::size_t pos ) +static bool Is192( const RString &sStepData, size_t pos ) { while( pos < sStepData.size() ) { @@ -254,7 +254,7 @@ static NoteData ParseNoteData(RString &step1, RString &step2, double fCurrentBeat = 0; double fCurrentIncrementer = 1.0/8 * BEATS_PER_MEASURE; - for( std::size_t i=0; i * to pick up images used here as song images (eg. banners). */ RString param = sParams[1]; /* "{foo} ... {foo2}" */ - std::size_t pos = 0; + size_t pos = 0; while( pos < RString::npos ) { - std::size_t startpos = param.find('{', pos); + size_t startpos = param.find('{', pos); if( startpos == RString::npos ) break; - std::size_t endpos = param.find('}', startpos); + size_t endpos = param.find('}', startpos); if( endpos == RString::npos ) break; diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index e820707f61..61900fa9dc 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -1406,9 +1406,9 @@ void SMLoader::ParseBGChangesString(const RString& _sChanges, std::vector()); // first value of this set. create our vector { - std::size_t eqpos = sChanges.find('=', start); - std::size_t compos = sChanges.find(',', start); + size_t eqpos = sChanges.find('=', start); + size_t compos = sChanges.find(',', start); if ((eqpos == RString::npos) && (compos == RString::npos)) { diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index b2030c11f4..f5527bd6ab 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -366,11 +366,11 @@ void SetRadarValues(StepsTagInfo& info) // Instead of trying to use the version to figure out how many // categories to expect, look at the number of values and split them // evenly. -Kyz - std::size_t cats_per_player= values.size() / NUM_PlayerNumber; + size_t cats_per_player= values.size() / NUM_PlayerNumber; RadarValues v[NUM_PLAYERS]; FOREACH_PlayerNumber(pn) { - for(std::size_t i= 0; i < cats_per_player; ++i) + for(size_t i= 0; i < cats_per_player; ++i) { v[pn][i]= StringToFloat(values[pn * cats_per_player + i]); } diff --git a/src/OptionRow.cpp b/src/OptionRow.cpp index d70d36a80b..1111fb98be 100644 --- a/src/OptionRow.cpp +++ b/src/OptionRow.cpp @@ -32,8 +32,8 @@ RString OptionRow::GetThemedItemText( int iChoice ) const return s; } -RString ITEMS_LONG_ROW_X_NAME( std::size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } -RString MOD_ICON_X_NAME( std::size_t p ) { return ssprintf("ModIconP%dX",int(p+1)); } +RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } +RString MOD_ICON_X_NAME( size_t p ) { return ssprintf("ModIconP%dX",int(p+1)); } OptionRow::OptionRow( const OptionRowType *pSource ) { diff --git a/src/OptionRow.h b/src/OptionRow.h index de19a7a153..75a70dce74 100644 --- a/src/OptionRow.h +++ b/src/OptionRow.h @@ -19,8 +19,8 @@ class OptionRowHandler; class GameCommand; struct OptionRowDefinition; -RString ITEMS_LONG_ROW_X_NAME( std::size_t p ); -RString MOD_ICON_X_NAME( std::size_t p ); +RString ITEMS_LONG_ROW_X_NAME( size_t p ); +RString MOD_ICON_X_NAME( size_t p ); class OptionRowType { diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index 876b41ef1c..861b825377 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -210,7 +210,7 @@ inline void VerifySelected(SelectType st, std::vector &selected, const RSt int num_selected = 0; if( st == SELECT_ONE ) { - std::size_t first_selected= std::numeric_limits::max(); + size_t first_selected= std::numeric_limits::max(); if(selected.empty()) { LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one " @@ -218,12 +218,12 @@ inline void VerifySelected(SelectType st, std::vector &selected, const RSt "elements.", sName.c_str()); return; } - for(std::size_t e= 0; e < selected.size(); ++e) + for(size_t e= 0; e < selected.size(); ++e) { if(selected[e]) { num_selected++; - if(first_selected == std::numeric_limits::max()) + if(first_selected == std::numeric_limits::max()) { first_selected= e; } @@ -234,7 +234,7 @@ inline void VerifySelected(SelectType st, std::vector &selected, const RSt LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one " "thing to be selected, but %i out of %i things are selected.", sName.c_str(), num_selected, static_cast(selected.size())); - for(std::size_t e= 0; e < selected.size(); ++e) + for(size_t e= 0; e < selected.size(); ++e) { if(selected[e] && e != first_selected) { diff --git a/src/OptionsBinding.h b/src/OptionsBinding.h index 33ecc5d4ba..4a094f7b8b 100644 --- a/src/OptionsBinding.h +++ b/src/OptionsBinding.h @@ -106,19 +106,19 @@ { \ int original_top= lua_gettop(L); \ lua_createtable(L, p->m_ ## member.size(), 0); \ - for(std::size_t n= 0; n < p->m_ ## member.size(); ++n) \ + for(size_t n= 0; n < p->m_ ## member.size(); ++n) \ { \ lua_pushnumber(L, p->m_ ## member[n]); \ lua_rawseti(L, -2, n+1); \ } \ if(lua_istable(L, 1) && original_top >= 1) \ { \ - std::size_t size= lua_objlen(L, 1); \ + size_t size= lua_objlen(L, 1); \ if(valid(L, 1)) \ { \ p->m_ ## member.clear(); \ p->m_ ## member.reserve(size); \ - for(std::size_t n= 1; n <= size; ++n) \ + for(size_t n= 1; n <= size; ++n) \ { \ lua_pushnumber(L, n); \ lua_gettable(L, 1); \ diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 9597f2a13f..76b1b1e748 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -232,7 +232,7 @@ void OptionsList::Load( RString sType, PlayerNumber pn ) m_Rows[sLineName] = pHand; m_asLoadedRows.push_back( sLineName ); - for( std::size_t i = 0; i < pHand->m_Def.m_vsChoices.size(); ++i ) + for( size_t i = 0; i < pHand->m_Def.m_vsChoices.size(); ++i ) { RString sScreen = pHand->GetScreen(i); if( !sScreen.empty() ) @@ -573,7 +573,7 @@ void OptionsList::SetDefaultCurrentRow() int OptionsList::FindScreenInHandler( const OptionRowHandler *pHandler, RString sScreen ) { - for( std::size_t i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i ) + for( size_t i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i ) { if( pHandler->GetScreen(i) == sScreen ) return i; diff --git a/src/Player.cpp b/src/Player.cpp index cfb83bf885..6ce0ab022d 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -46,8 +46,8 @@ #include -RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides ); -void TimingWindowSecondsInit( std::size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ); +RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ); +void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ); /** * @brief Helper class to ensure that each row is only judged once without taking too much memory. @@ -58,9 +58,9 @@ class JudgedRows int m_iStart; int m_iOffset; - void Resize( std::size_t iMin ) + void Resize( size_t iMin ) { - std::size_t iNewSize = std::max( 2*m_vRows.size(), iMin ); + size_t iNewSize = std::max( 2*m_vRows.size(), iMin ); std::vector vNewRows( m_vRows.begin() + m_iOffset, m_vRows.end() ); vNewRows.reserve( iNewSize ); vNewRows.insert( vNewRows.end(), m_vRows.begin(), m_vRows.begin() + m_iOffset ); @@ -98,7 +98,7 @@ public: }; -RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides ) { return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } +RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ) { return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } /** * @brief Distance to search for a note in Step(), in seconds. @@ -106,7 +106,7 @@ RString ATTACK_DISPLAY_X_NAME( std::size_t p, std::size_t both_sides ) { return * TODO: This should be calculated based on the max size of the current judgment windows. */ static const float StepSearchDistance = 1.0f; -void TimingWindowSecondsInit( std::size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ) +void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TimingWindowSeconds" + TimingWindowToString( static_cast(i) ); switch( i ) @@ -2182,7 +2182,7 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele std::vector GameI; GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( t, pn, GameI ); float secs_held= 0.0f; - for(std::size_t i= 0; i < GameI.size(); ++i) + for(size_t i= 0; i < GameI.size(); ++i) { secs_held= std::max(secs_held, INPUTMAPPER->GetSecsHeld( GameI[i] )); } @@ -2881,7 +2881,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI ); if( PREFSMAN->m_fPadStickSeconds > 0.f ) { - for(std::size_t i= 0; i < GameI.size(); ++i) + for(size_t i= 0; i < GameI.size(); ++i) { float fSecsHeld = INPUTMAPPER->GetSecsHeld(GameI[i], m_pPlayerState->m_mp); if(fSecsHeld >= PREFSMAN->m_fPadStickSeconds) @@ -2909,7 +2909,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn, GameI ); if( PREFSMAN->m_fPadStickSeconds > 0.0f ) { - for(std::size_t i= 0; i < GameI.size(); ++i) + for(size_t i= 0; i < GameI.size(); ++i) { float fSecsHeld = INPUTMAPPER->GetSecsHeld(GameI[i], m_pPlayerState->m_mp); if(fSecsHeld >= PREFSMAN->m_fPadStickSeconds) diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index 71ea18781c..293d3b3335 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -793,7 +793,7 @@ public: static int GetComboList( T* p, lua_State *L ) { lua_createtable(L, p->m_ComboList.size(), 0); - for( std::size_t i= 0; i < p->m_ComboList.size(); ++i) + for( size_t i= 0; i < p->m_ComboList.size(); ++i) { lua_createtable(L, 0, 6); lua_pushstring(L, "StartSecond"); diff --git a/src/Preference.h b/src/Preference.h index ef017c4de2..f3cd2bbb82 100644 --- a/src/Preference.h +++ b/src/Preference.h @@ -154,9 +154,9 @@ public: typedef Preference PreferenceT; std::vector m_v; - Preference1D( void pfn(std::size_t i, RString &sNameOut, T &defaultValueOut ), std::size_t N, PreferenceType type = PreferenceType::Mutable ) + Preference1D( void pfn(size_t i, RString &sNameOut, T &defaultValueOut ), size_t N, PreferenceType type = PreferenceType::Mutable ) { - for( std::size_t i=0; i& operator[]( std::size_t i ) const + const Preference& operator[]( size_t i ) const { return *m_v[i]; } - Preference& operator[]( std::size_t i ) + Preference& operator[]( size_t i ) { return *m_v[i]; } diff --git a/src/Profile.cpp b/src/Profile.cpp index 01708ee6c1..f11c834936 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -86,7 +86,7 @@ void Profile::ClearSongs() return; } Song* gamestate_curr_song= GAMESTATE->m_pCurSong; - for(std::size_t i= 0; i < m_songs.size(); ++i) + for(size_t i= 0; i < m_songs.size(); ++i) { Song* curr_song= m_songs[i]; if(curr_song == gamestate_curr_song) @@ -925,10 +925,10 @@ void Profile::MergeScoresFromOtherProfile(Profile* other, bool skip_totals, { // The old screenshot count is stored so we know where to start in the // list when copying the screenshot images. - std::size_t old_count= m_vScreenshots.size(); + size_t old_count= m_vScreenshots.size(); m_vScreenshots.insert(m_vScreenshots.end(), other->m_vScreenshots.begin(), other->m_vScreenshots.end()); - for(std::size_t sid= old_count; sid < m_vScreenshots.size(); ++sid) + for(size_t sid= old_count; sid < m_vScreenshots.size(); ++sid) { RString old_path= from_dir + "Screenshots/" + m_vScreenshots[sid].sFileName; RString new_path= to_dir + "Screenshots/" + m_vScreenshots[sid].sFileName; @@ -1199,7 +1199,7 @@ void Profile::LoadSongsFromDir(RString const& dir, ProfileSlot prof_slot) StripMacResourceForks(song_folders); LOG->Trace("Found %i songs in profile.", int(song_folders.size())); // Only songs that are successfully loaded count towards the limit. -Kyz - for(std::size_t song_index= 0; song_index < song_folders.size() + for(size_t song_index= 0; song_index < song_folders.size() && m_songs.size() < PREFSMAN->m_custom_songs_max_count; ++song_index) { @@ -2787,7 +2787,7 @@ public: { lua_createtable(L, p->m_songs.size(), 0); int song_tab= lua_gettop(L); - for(std::size_t i= 0; i < p->m_songs.size(); ++i) + for(size_t i= 0; i < p->m_songs.size(); ++i) { p->m_songs[i]->PushSelf(L); lua_rawseti(L, song_tab, i+1); diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 2e7e9e88d4..b230d3275f 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -34,7 +34,7 @@ ProfileManager* PROFILEMAN = nullptr; // global and accessible from anywhere in #define ID_DIGITS_STR "8" #define MAX_ID 99999999 -static void DefaultLocalProfileIDInit( std::size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) +static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) { sNameOut = ssprintf( "DefaultLocalProfileIDP%d", int(i+1) ); defaultValueOut = ""; @@ -942,7 +942,7 @@ void ProfileManager::MergeLocalProfileIntoMachine(RString const& from_id, bool s void ProfileManager::ChangeProfileType(int index, ProfileType new_type) { - if(index < 0 || static_cast(index) >= g_vLocalProfile.size()) + if(index < 0 || static_cast(index) >= g_vLocalProfile.size()) { return; } if(new_type == g_vLocalProfile[index].profile.m_Type) { return; } @@ -954,7 +954,7 @@ void ProfileManager::ChangeProfileType(int index, ProfileType new_type) void ProfileManager::MoveProfileTopBottom(int index, bool top) { - if (index < 0 || static_cast(index) >= g_vLocalProfile.size()) + if (index < 0 || static_cast(index) >= g_vLocalProfile.size()) { return; } @@ -962,7 +962,7 @@ void ProfileManager::MoveProfileTopBottom(int index, bool top) int swindex = 0; // There may be guest profiles at the top of the list, so we need to skip over them if moving to the top. // If we're moving the profile to the bottom we should stop once we find the first test profile. - for (std::size_t i= 0; i < g_vLocalProfile.size(); ++i) + for (size_t i= 0; i < g_vLocalProfile.size(); ++i) { ProfileType type= g_vLocalProfile[i].profile.m_Type; if (!top) @@ -996,14 +996,14 @@ void ProfileManager::MoveProfileTopBottom(int index, bool top) void ProfileManager::MoveProfileSorted(int index, bool bAscending) { - if (index < 0 || static_cast(index) >= g_vLocalProfile.size()) + if (index < 0 || static_cast(index) >= g_vLocalProfile.size()) { return; } int swindex = 0; // There may be guest profiles at the top of the list, so we need to skip over them. - for (std::size_t i= 0; i < g_vLocalProfile.size(); ++i) + for (size_t i= 0; i < g_vLocalProfile.size(); ++i) { ProfileType type= g_vLocalProfile[i].profile.m_Type; if (type != ProfileType_Guest) @@ -1038,7 +1038,7 @@ void ProfileManager::MoveProfileSorted(int index, bool bAscending) { void ProfileManager::MoveProfilePriority(int index, bool up) { - if(index < 0 || static_cast(index) >= g_vLocalProfile.size()) + if(index < 0 || static_cast(index) >= g_vLocalProfile.size()) { return; } // Changing the priority is complicated a bit because the profiles might // all have the same priority. So this function has to assign priorities @@ -1047,7 +1047,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up) int swindex= index + ((up * -2) + 1); ProfileType type= g_vLocalProfile[index].profile.m_Type; int priority= 0; - for(std::size_t i= 0; i < g_vLocalProfile.size(); ++i) + for(size_t i= 0; i < g_vLocalProfile.size(); ++i) { DirAndProfile* curr= &g_vLocalProfile[i]; if(curr->profile.m_Type == type) @@ -1055,7 +1055,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up) if(curr->profile.m_ListPriority != priority) { curr->profile.m_ListPriority= priority; - if(i != static_cast(index) && i != static_cast(swindex)) + if(i != static_cast(index) && i != static_cast(swindex)) { curr->profile.SaveTypeToDir(curr->sDir); } @@ -1068,7 +1068,7 @@ void ProfileManager::MoveProfilePriority(int index, bool up) } } // Only swap if both indices are valid and the types match. - if(swindex >= 0 && static_cast(swindex) < g_vLocalProfile.size() && + if(swindex >= 0 && static_cast(swindex) < g_vLocalProfile.size() && g_vLocalProfile[swindex].profile.m_Type == g_vLocalProfile[index].profile.m_Type) { @@ -1280,7 +1280,7 @@ int ProfileManager::GetNumLocalProfiles() const void ProfileManager::SetStatsPrefix(RString const& prefix) { m_stats_prefix= prefix; - for(std::size_t i= 0; i < g_vLocalProfile.size(); ++i) + for(size_t i= 0; i < g_vLocalProfile.size(); ++i) { g_vLocalProfile[i].profile.HandleStatsPrefixChange(g_vLocalProfile[i].sDir, PREFSMAN->m_bSignProfileData); } diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index a5e5da5f23..3ddd85a527 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -978,8 +978,8 @@ void RageCompiledGeometry::Set( const std::vector &vMeshes, bool bNeedsN { m_bNeedsNormals = bNeedsNormals; - std::size_t totalVerts = 0; - std::size_t totalTriangles = 0; + size_t totalVerts = 0; + size_t totalTriangles = 0; m_bAnyNeedsTextureMatrixScale = false; diff --git a/src/RageDisplay.h b/src/RageDisplay.h index d4889fea26..b9371349ed 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -40,8 +40,8 @@ public: virtual void Draw( int iMeshIndex ) const = 0; protected: - std::size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; } - std::size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; } + size_t GetTotalVertices() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iVertexStart + m_vMeshInfo.back().iVertexCount; } + size_t GetTotalTriangles() const { if( m_vMeshInfo.empty() ) return 0; return m_vMeshInfo.back().iTriangleStart + m_vMeshInfo.back().iTriangleCount; } struct MeshInfo { diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index 59f3468ae2..51ef79e74a 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -48,8 +48,8 @@ const D3DFORMAT g_DefaultAdapterFormat = D3DFMT_X8R8G8B8; /* Direct3D doesn't associate a palette with textures. Instead, we load a * palette into a slot. We need to keep track of which texture's palette is * stored in what slot. */ -std::map g_TexResourceToPaletteIndex; -std::list g_PaletteIndex; +std::map g_TexResourceToPaletteIndex; +std::list g_PaletteIndex; struct TexturePalette { PALETTEENTRY p[256]; }; std::map g_TexResourceToTexturePalette; @@ -67,7 +67,7 @@ static void SetPalette( std::uintptr_t TexResource ) UINT iPalIndex = static_cast(g_PaletteIndex.front()); // If any other texture is currently using this slot, mark that palette unloaded. - for( std::map::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i ) + for( std::map::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i ) { if( i->second != iPalIndex ) continue; @@ -85,7 +85,7 @@ static void SetPalette( std::uintptr_t TexResource ) const int iPalIndex = g_TexResourceToPaletteIndex[TexResource]; // Find this palette index in the least-recently-used queue and move it to the end. - for(std::list::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i) + for(std::list::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i) { if( *i != iPalIndex ) continue; @@ -331,7 +331,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP) } // Test each back buffer format until we find something that works. - for( std::size_t i=0; i < vBackBufferFormats.size(); i++ ) + for( size_t i=0; i < vBackBufferFormats.size(); i++ ) { D3DFORMAT fmtBackBuffer = vBackBufferFormats[i]; @@ -786,18 +786,18 @@ public: } void Change( const std::vector &vMeshes ) { - for( std::size_t i=0; i &Vertices = mesh.Vertices; const std::vector &Triangles = mesh.Triangles; - for( std::size_t j=0; j vIndices; - std::size_t uOldSize = vIndices.size(); - std::size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); + size_t uOldSize = vIndices.size(); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( std::uint16_t i=(std::uint16_t)uOldSize/6; i<(std::uint16_t)iNumQuads; i++ ) { @@ -891,8 +891,8 @@ void RageDisplay_D3D::DrawQuadStripInternal( const RageSpriteVertex v[], int iNu // make a temporary index buffer static std::vector vIndices; - std::size_t uOldSize = vIndices.size(); - std::size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); + size_t uOldSize = vIndices.size(); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( std::uint16_t i=(std::uint16_t)uOldSize/6; i<(std::uint16_t)iNumQuads; i++ ) { @@ -926,8 +926,8 @@ void RageDisplay_D3D::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[] // make a temporary index buffer static std::vector vIndices; - std::size_t uOldSize = vIndices.size(); - std::size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); + size_t uOldSize = vIndices.size(); + size_t uNewSize = std::max(uOldSize, static_cast(iNumIndices)); vIndices.resize( uNewSize ); for( std::uint16_t i=(std::uint16_t)uOldSize/12; i<(std::uint16_t)iNumPieces; i++ ) { diff --git a/src/RageDisplay_GLES2.cpp b/src/RageDisplay_GLES2.cpp index d2e6d64aba..020afce6fa 100644 --- a/src/RageDisplay_GLES2.cpp +++ b/src/RageDisplay_GLES2.cpp @@ -264,12 +264,12 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende } sort( extensions.begin(), extensions.end() ); - std::size_t next = 0; + size_t next = 0; while( next < extensions.size() ) { - std::size_t last = next; + size_t last = next; string type; - for( std::size_t i = next; i segments; split(extensions[i], '_', segments); @@ -311,12 +311,12 @@ RageDisplay_GLES2::Init( const VideoModeParams &p, bool bAllowUnacceleratedRende std::vector asExtensions; split( szExtensionString, " ", asExtensions ); sort( asExtensions.begin(), asExtensions.end() ); - std::size_t iNextToPrint = 0; + size_t iNextToPrint = 0; while( iNextToPrint < asExtensions.size() ) { - std::size_t iLastToPrint = iNextToPrint; + size_t iLastToPrint = iNextToPrint; RString sType; - for( std::size_t i = iNextToPrint; i asBits; split( asExtensions[i], "_", asBits ); diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 8767ce368a..f49f3ef9df 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -497,12 +497,12 @@ RString RageDisplay_Legacy::Init( const VideoModeParams &p, bool bAllowUnacceler std::vector asExtensions; split( szExtensionString, " ", asExtensions ); sort( asExtensions.begin(), asExtensions.end() ); - std::size_t iNextToPrint = 0; + size_t iNextToPrint = 0; while( iNextToPrint < asExtensions.size() ) { - std::size_t iLastToPrint = iNextToPrint; + size_t iLastToPrint = iNextToPrint; RString sType; - for( std::size_t i = iNextToPrint; i asBits; split( asExtensions[i], "_", asBits ); diff --git a/src/RageFile.cpp b/src/RageFile.cpp index a115ae7369..df261e1aa5 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -146,7 +146,7 @@ void RageFile::SetError( const RString &err ) m_sError = err; } -int RageFile::Read( void *pBuffer, std::size_t iBytes ) +int RageFile::Read( void *pBuffer, size_t iBytes ) { ASSERT_READ; return m_File->Read( pBuffer, iBytes ); @@ -182,14 +182,14 @@ int RageFile::Read( RString &buffer, int bytes ) return m_File->Read( buffer, bytes ); } -int RageFile::Write( const void *buffer, std::size_t bytes ) +int RageFile::Write( const void *buffer, size_t bytes ) { ASSERT_WRITE; return m_File->Write( buffer, bytes ); } -int RageFile::Write( const void *buffer, std::size_t bytes, int nmemb ) +int RageFile::Write( const void *buffer, size_t bytes, int nmemb ) { ASSERT_WRITE; return m_File->Write( buffer, bytes, nmemb ); @@ -206,7 +206,7 @@ int RageFile::Flush() return m_File->Flush(); } -int RageFile::Read( void *buffer, std::size_t bytes, int nmemb ) +int RageFile::Read( void *buffer, size_t bytes, int nmemb ) { ASSERT_READ; return m_File->Read( buffer, bytes, nmemb ); diff --git a/src/RageFile.h b/src/RageFile.h index 9797ac08bd..aee3cb2fdb 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -62,15 +62,15 @@ public: int GetFD(); /* Raw I/O: */ - int Read( void *buffer, std::size_t bytes ); + int Read( void *buffer, size_t bytes ); int Read( RString &buffer, int bytes = -1 ); - int Write( const void *buffer, std::size_t bytes ); + int Write( const void *buffer, size_t bytes ); int Write( const RString& string ) { return Write( string.data(), string.size() ); } int Flush(); /* These are just here to make wrappers (eg. vorbisfile, SDL_rwops) easier. */ - int Write( const void *buffer, std::size_t bytes, int nmemb ); - int Read( void *buffer, std::size_t bytes, int nmemb ); + int Write( const void *buffer, size_t bytes, int nmemb ); + int Read( void *buffer, size_t bytes, int nmemb ); int Seek( int offset, int whence ); /* Line-based I/O: */ diff --git a/src/RageFileBasic.cpp b/src/RageFileBasic.cpp index 8f70caa30a..7e0919e2d1 100644 --- a/src/RageFileBasic.cpp +++ b/src/RageFileBasic.cpp @@ -102,7 +102,7 @@ int RageFileObj::Seek( int offset, int whence ) return Seek( (int) offset ); } -int RageFileObj::Read( void *pBuffer, std::size_t iBytes ) +int RageFileObj::Read( void *pBuffer, size_t iBytes ) { int iRet = 0; @@ -189,7 +189,7 @@ int RageFileObj::Read( RString &sBuffer, int iBytes ) return iRet; } -int RageFileObj::Read( void *pBuffer, std::size_t iBytes, int iNmemb ) +int RageFileObj::Read( void *pBuffer, size_t iBytes, int iNmemb ) { const int iRet = Read( pBuffer, iBytes*iNmemb ); if( iRet == -1 ) @@ -231,7 +231,7 @@ int RageFileObj::EmptyWriteBuf() return 0; } -int RageFileObj::Write( const void *pBuffer, std::size_t iBytes ) +int RageFileObj::Write( const void *pBuffer, size_t iBytes ) { if( m_pWriteBuffer != nullptr ) { @@ -269,7 +269,7 @@ int RageFileObj::Write( const void *pBuffer, std::size_t iBytes ) return iRet; } -int RageFileObj::Write( const void *pBuffer, std::size_t iBytes, int iNmemb ) +int RageFileObj::Write( const void *pBuffer, size_t iBytes, int iNmemb ) { /* Simple write. We never return partial writes. */ int iRet = Write( pBuffer, iBytes*iNmemb ) / iBytes; diff --git a/src/RageFileBasic.h b/src/RageFileBasic.h index 996fab9ecc..d7f97f9cff 100644 --- a/src/RageFileBasic.h +++ b/src/RageFileBasic.h @@ -31,14 +31,14 @@ public: * 0 on end of stream, or -1 on error. Note that reading less than iSize * does not necessarily mean that the end of the stream has been reached; * keep reading until 0 is returned. */ - virtual int Read( void *pBuffer, std::size_t iBytes ) = 0; + virtual int Read( void *pBuffer, size_t iBytes ) = 0; virtual int Read( RString &buffer, int bytes = -1 ) = 0; - virtual int Read( void *buffer, std::size_t bytes, int nmemb ) = 0; + virtual int Read( void *buffer, size_t bytes, int nmemb ) = 0; /* Write iSize bytes of data from pBuf. Return 0 on success, -1 on error. */ - virtual int Write( const void *pBuffer, std::size_t iBytes ) = 0; + virtual int Write( const void *pBuffer, size_t iBytes ) = 0; virtual int Write( const RString &sString ) = 0; - virtual int Write( const void *buffer, std::size_t bytes, int nmemb ) = 0; + virtual int Write( const void *buffer, size_t bytes, int nmemb ) = 0; /* Due to buffering, writing may not happen by the end of a Write() call, so not * all errors may be returned by it. Data will be flushed when the stream (or its @@ -81,13 +81,13 @@ public: int Seek( int offset, int whence ); int Tell() const { return m_iFilePos; } - int Read( void *pBuffer, std::size_t iBytes ); + int Read( void *pBuffer, size_t iBytes ); int Read( RString &buffer, int bytes = -1 ); - int Read( void *buffer, std::size_t bytes, int nmemb ); + int Read( void *buffer, size_t bytes, int nmemb ); - int Write( const void *pBuffer, std::size_t iBytes ); + int Write( const void *pBuffer, size_t iBytes ); int Write( const RString &sString ) { return Write( sString.data(), sString.size() ); } - int Write( const void *buffer, std::size_t bytes, int nmemb ); + int Write( const void *buffer, size_t bytes, int nmemb ); int Flush(); @@ -104,8 +104,8 @@ public: protected: virtual int SeekInternal( int /* iOffset */ ) { FAIL_M( "Seeking unimplemented" ); } - virtual int ReadInternal( void *pBuffer, std::size_t iBytes ) = 0; - virtual int WriteInternal( const void *pBuffer, std::size_t iBytes ) = 0; + virtual int ReadInternal( void *pBuffer, size_t iBytes ) = 0; + virtual int WriteInternal( const void *pBuffer, size_t iBytes ) = 0; virtual int FlushInternal() { return 0; } void EnableReadBuffering(); diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 2cbb5a6184..55d4ea5744 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -79,13 +79,13 @@ RageFileObjInflate::~RageFileObjInflate() delete m_pInflate; } -int RageFileObjInflate::ReadInternal( void *buf, std::size_t bytes ) +int RageFileObjInflate::ReadInternal( void *buf, size_t bytes ) { /* Don't read more than m_iUncompressedSize of data. If we don't do this, it's * possible for a .gz to contain a header claiming 500k of data, but to actually * contain much more deflated data. */ ASSERT_M( m_iFilePos <= m_iUncompressedSize, ssprintf("%i, %i",m_iFilePos, m_iUncompressedSize) ); - bytes = std::min( bytes, std::size_t(m_iUncompressedSize-m_iFilePos) ); + bytes = std::min( bytes, size_t(m_iUncompressedSize-m_iFilePos) ); bool done=false; int ret = 0; @@ -224,7 +224,7 @@ RageFileObjDeflate::~RageFileObjDeflate() delete m_pDeflate; } -int RageFileObjDeflate::WriteInternal( const void *pBuffer, std::size_t iBytes ) +int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes ) { if( iBytes == 0 ) { diff --git a/src/RageFileDriverDeflate.h b/src/RageFileDriverDeflate.h index 0294b1580d..a28c3dafd0 100644 --- a/src/RageFileDriverDeflate.h +++ b/src/RageFileDriverDeflate.h @@ -18,8 +18,8 @@ public: RageFileObjInflate( RageFileBasic *pFile, int iUncompressedSize ); RageFileObjInflate( const RageFileObjInflate &cpy ); ~RageFileObjInflate(); - int ReadInternal( void *pBuffer, std::size_t iBytes ); - int WriteInternal( const void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } + int ReadInternal( void *pBuffer, size_t iBytes ); + int WriteInternal( const void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } int SeekInternal( int iOffset ); int GetFileSize() const { return m_iUncompressedSize; } int GetFD() { return m_pFile->GetFD(); } @@ -50,8 +50,8 @@ public: void DeleteFileWhenFinished() { m_bFileOwned = true; } protected: - int ReadInternal( void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } - int WriteInternal( const void *pBuffer, std::size_t iBytes ); + int ReadInternal( void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } + int WriteInternal( const void *pBuffer, size_t iBytes ); int FlushInternal(); RageFileBasic *m_pFile; diff --git a/src/RageFileDriverDirect.cpp b/src/RageFileDriverDirect.cpp index 0414aa65bc..555eb4df88 100644 --- a/src/RageFileDriverDirect.cpp +++ b/src/RageFileDriverDirect.cpp @@ -389,7 +389,7 @@ RageFileObjDirect::~RageFileObjDirect() DoRemove( MakeTempFilename(m_sPath) ); } -int RageFileObjDirect::ReadInternal( void *pBuf, std::size_t iBytes ) +int RageFileObjDirect::ReadInternal( void *pBuf, size_t iBytes ) { int iRet = DoRead( m_iFD, pBuf, iBytes ); if( iRet == -1 ) @@ -402,7 +402,7 @@ int RageFileObjDirect::ReadInternal( void *pBuf, std::size_t iBytes ) } // write(), but retry a couple times on EINTR. -static int RetriedWrite( int iFD, const void *pBuf, std::size_t iCount ) +static int RetriedWrite( int iFD, const void *pBuf, size_t iCount ) { int iTries = 3, iRet; do @@ -426,7 +426,7 @@ int RageFileObjDirect::FlushInternal() return 0; } -int RageFileObjDirect::WriteInternal( const void *pBuf, std::size_t iBytes ) +int RageFileObjDirect::WriteInternal( const void *pBuf, size_t iBytes ) { if( WriteFailed() ) { diff --git a/src/RageFileDriverDirect.h b/src/RageFileDriverDirect.h index 21027e8d4c..58ed1f52ca 100644 --- a/src/RageFileDriverDirect.h +++ b/src/RageFileDriverDirect.h @@ -37,8 +37,8 @@ class RageFileObjDirect: public RageFileObj public: RageFileObjDirect( const RString &sPath, int iFD, int iMode ); virtual ~RageFileObjDirect(); - virtual int ReadInternal( void *pBuffer, std::size_t iBytes ); - virtual int WriteInternal( const void *pBuffer, std::size_t iBytes ); + virtual int ReadInternal( void *pBuffer, size_t iBytes ); + virtual int WriteInternal( const void *pBuffer, size_t iBytes ); virtual int FlushInternal(); virtual int SeekInternal( int offset ); virtual RageFileObjDirect *Copy() const; diff --git a/src/RageFileDriverMemory.cpp b/src/RageFileDriverMemory.cpp index affdf26ab5..e34d758fb6 100644 --- a/src/RageFileDriverMemory.cpp +++ b/src/RageFileDriverMemory.cpp @@ -53,12 +53,12 @@ RageFileObjMem::~RageFileObjMem() RageFileObjMemFile::ReleaseReference( m_pFile ); } -int RageFileObjMem::ReadInternal( void *buffer, std::size_t bytes ) +int RageFileObjMem::ReadInternal( void *buffer, size_t bytes ) { LockMut(m_pFile->m_Mutex); m_iFilePos = std::min( m_iFilePos, GetFileSize() ); - bytes = std::min( bytes, (std::size_t) GetFileSize() - m_iFilePos ); + bytes = std::min( bytes, (size_t) GetFileSize() - m_iFilePos ); if( bytes == 0 ) return 0; memcpy( buffer, &m_pFile->m_sBuf[m_iFilePos], bytes ); @@ -67,7 +67,7 @@ int RageFileObjMem::ReadInternal( void *buffer, std::size_t bytes ) return bytes; } -int RageFileObjMem::WriteInternal( const void *buffer, std::size_t bytes ) +int RageFileObjMem::WriteInternal( const void *buffer, size_t bytes ) { m_pFile->m_Mutex.Lock(); m_pFile->m_sBuf.replace( m_iFilePos, bytes, (const char *) buffer, bytes ); diff --git a/src/RageFileDriverMemory.h b/src/RageFileDriverMemory.h index c20dfc3580..a3e8bdaac4 100644 --- a/src/RageFileDriverMemory.h +++ b/src/RageFileDriverMemory.h @@ -19,8 +19,8 @@ public: RageFileObjMem( const RageFileObjMem &cpy ); ~RageFileObjMem(); - int ReadInternal( void *buffer, std::size_t bytes ); - int WriteInternal( const void *buffer, std::size_t bytes ); + int ReadInternal( void *buffer, size_t bytes ); + int WriteInternal( const void *buffer, size_t bytes ); int SeekInternal( int offset ); int GetFileSize() const; RageFileObjMem *Copy() const; diff --git a/src/RageFileDriverReadAhead.cpp b/src/RageFileDriverReadAhead.cpp index 174e53b9d9..68300b055d 100644 --- a/src/RageFileDriverReadAhead.cpp +++ b/src/RageFileDriverReadAhead.cpp @@ -116,7 +116,7 @@ void RageFileDriverReadAhead::FillBuffer( int iBytes ) RageFileManagerReadAhead::CacheHintStreaming( m_pFile ); } -int RageFileDriverReadAhead::ReadInternal( void *pBuffer, std::size_t iBytes ) +int RageFileDriverReadAhead::ReadInternal( void *pBuffer, size_t iBytes ) { int iRet = -1; if( m_bReadAheadNeeded && m_iFilePos < (int) m_sBuffer.size() ) diff --git a/src/RageFileDriverReadAhead.h b/src/RageFileDriverReadAhead.h index aa8968cb70..1d68e22715 100644 --- a/src/RageFileDriverReadAhead.h +++ b/src/RageFileDriverReadAhead.h @@ -24,8 +24,8 @@ public: virtual RString GetError() const { return m_pFile->GetError(); } virtual void ClearError() { return m_pFile->ClearError(); } - int ReadInternal( void *pBuffer, std::size_t iBytes ); - int WriteInternal( const void *pBuffer, std::size_t iBytes ) { return m_pFile->Write( pBuffer, iBytes ); } + int ReadInternal( void *pBuffer, size_t iBytes ); + int WriteInternal( const void *pBuffer, size_t iBytes ) { return m_pFile->Write( pBuffer, iBytes ); } int SeekInternal( int iOffset ); int GetFileSize() const { return m_pFile->GetFileSize(); } int GetFD() { return m_pFile->GetFD(); } diff --git a/src/RageFileDriverSlice.cpp b/src/RageFileDriverSlice.cpp index 52def239cd..5684926541 100644 --- a/src/RageFileDriverSlice.cpp +++ b/src/RageFileDriverSlice.cpp @@ -34,7 +34,7 @@ RageFileDriverSlice *RageFileDriverSlice::Copy() const return pRet; } -int RageFileDriverSlice::ReadInternal( void *buf, std::size_t bytes ) +int RageFileDriverSlice::ReadInternal( void *buf, size_t bytes ) { /* Make sure we're reading from the right place. We might have been constructed * with a file not pointing to iOffset. */ diff --git a/src/RageFileDriverSlice.h b/src/RageFileDriverSlice.h index 601af0c7b7..e7ce0701c2 100644 --- a/src/RageFileDriverSlice.h +++ b/src/RageFileDriverSlice.h @@ -18,8 +18,8 @@ public: void DeleteFileWhenFinished() { m_bFileOwned = true; } - int ReadInternal( void *pBuffer, std::size_t iBytes ); - int WriteInternal( const void * /* pBuffer */, std::size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } + int ReadInternal( void *pBuffer, size_t iBytes ); + int WriteInternal( const void * /* pBuffer */, size_t /* iBytes */ ) { SetError( "Not implemented" ); return -1; } int SeekInternal( int iOffset ); int GetFileSize() const { return m_iFileSize; } int GetFD() { return m_pFile->GetFD(); } diff --git a/src/RageFileDriverTimeout.cpp b/src/RageFileDriverTimeout.cpp index 0757aa8402..c1929bba39 100644 --- a/src/RageFileDriverTimeout.cpp +++ b/src/RageFileDriverTimeout.cpp @@ -782,7 +782,7 @@ protected: } - int ReadInternal( void *pBuffer, std::size_t iBytes ) + int ReadInternal( void *pBuffer, size_t iBytes ) { RString sError; int iRet = m_pWorker->Read( m_pFile, pBuffer, iBytes, sError ); @@ -799,7 +799,7 @@ protected: return iRet; } - int WriteInternal( const void *pBuffer, std::size_t iBytes ) + int WriteInternal( const void *pBuffer, size_t iBytes ) { RString sError; int iRet = m_pWorker->Write( m_pFile, pBuffer, iBytes, sError ); diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 89755981d7..a94921dfe8 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -115,7 +115,7 @@ void RageFileManager::ReleaseFileDriver( RageFileDriver *pDriver ) g_Mutex->Unlock(); } -std::size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, std::size_t n) +size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) { RageFile *f = static_cast(pOpaque); @@ -128,7 +128,7 @@ std::size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, std::size_t n return f->Read(pBuf, n); } -std::size_t zipWriteFile(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, std::size_t n) +size_t zipWriteFile(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) { RageFile *f = static_cast(pOpaque); @@ -192,7 +192,7 @@ bool RageFileManager::Unzip(const std::string &zipPath, std::string targetPath, for (int i = 0; i < strip; i++) { - std::size_t pos = filename.find('/'); + size_t pos = filename.find('/'); if (pos != std::string::npos) pos++; filename.erase(0, pos); @@ -302,7 +302,7 @@ static RageFileDriverMountpoints *g_Mountpoints = nullptr; static RString ExtractDirectory( RString sPath ) { // return the directory containing sPath - std::size_t n = sPath.find_last_of("/"); + size_t n = sPath.find_last_of("/"); if( n != sPath.npos ) sPath.erase(n); else diff --git a/src/RageFileManager_ReadAhead.cpp b/src/RageFileManager_ReadAhead.cpp index 9f776b2e09..0228338d42 100644 --- a/src/RageFileManager_ReadAhead.cpp +++ b/src/RageFileManager_ReadAhead.cpp @@ -118,7 +118,7 @@ static std::vector g_apReadAheads; void RageFileManagerReadAhead::Init() { } void RageFileManagerReadAhead::Shutdown() { - for( std::size_t i = 0; i < g_apReadAheads.size(); ++i ) + for( size_t i = 0; i < g_apReadAheads.size(); ++i ) delete g_apReadAheads[i]; g_apReadAheads.clear(); } @@ -143,7 +143,7 @@ void RageFileManagerReadAhead::ReadAhead( RageFileBasic *pFile, int iBytes ) RageFileReadAheadThread *pReadAhead = new RageFileReadAheadThread( iFD, iStart, iBytes ); g_apReadAheads.push_back( pReadAhead ); - for( std::size_t i = 0; i < g_apReadAheads.size(); ++i ) + for( size_t i = 0; i < g_apReadAheads.size(); ++i ) { if( g_apReadAheads[i]->IsFinished() ) { diff --git a/src/RageSoundReader_Resample_Good.cpp b/src/RageSoundReader_Resample_Good.cpp index 77a025f463..641102fa6e 100644 --- a/src/RageSoundReader_Resample_Good.cpp +++ b/src/RageSoundReader_Resample_Good.cpp @@ -586,7 +586,7 @@ RageSoundReader_Resample_Good::RageSoundReader_Resample_Good( RageSoundReader *p /* Call this if the input position is changed or reset. */ void RageSoundReader_Resample_Good::Reset() { - for( std::size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel ) m_apResamplers[iChannel]->Reset(); } @@ -613,14 +613,14 @@ void RageSoundReader_Resample_Good::GetFactors( int &iDownFactor, int &iUpFactor /* Call this if the sample factor changes. */ void RageSoundReader_Resample_Good::ReopenResampler() { - for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) delete m_apResamplers[iChannel]; m_apResamplers.clear(); int iDownFactor, iUpFactor; GetFactors( iDownFactor, iUpFactor ); - for( std::size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_pSource->GetNumChannels(); ++iChannel ) { int iMinDownFactor = iDownFactor; int iMaxDownFactor = iDownFactor; @@ -634,13 +634,13 @@ void RageSoundReader_Resample_Good::ReopenResampler() if( m_fRate != -1 ) iDownFactor = static_cast((m_fRate * iDownFactor) + 0.5 ); - for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) m_apResamplers[iChannel]->SetDownFactor( iDownFactor ); } RageSoundReader_Resample_Good::~RageSoundReader_Resample_Good() { - for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) delete m_apResamplers[iChannel]; } @@ -713,7 +713,7 @@ void RageSoundReader_Resample_Good::SetRate( float fRatio ) /* Set m_fRate to the actual rate, after quantization by iUpFactor. */ m_fRate = float(iDownFactor) / iUpFactor; - for( std::size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) + for( size_t iChannel = 0; iChannel < m_apResamplers.size(); ++iChannel ) m_apResamplers[iChannel]->SetDownFactor( iDownFactor ); } @@ -728,7 +728,7 @@ float RageSoundReader_Resample_Good::GetRate() const RageSoundReader_Resample_Good::RageSoundReader_Resample_Good( const RageSoundReader_Resample_Good &cpy ): RageSoundReader_Filter(cpy) { - for( std::size_t i = 0; i < cpy.m_apResamplers.size(); ++i ) + for( size_t i = 0; i < cpy.m_apResamplers.size(); ++i ) this->m_apResamplers.push_back( new RageSoundResampler_Polyphase(*cpy.m_apResamplers[i]) ); this->m_iSampleRate = cpy.m_iSampleRate; this->m_fRate = cpy.m_fRate; diff --git a/src/RageSoundReader_SpeedChange.cpp b/src/RageSoundReader_SpeedChange.cpp index ae9da772e4..81a34bfc27 100644 --- a/src/RageSoundReader_SpeedChange.cpp +++ b/src/RageSoundReader_SpeedChange.cpp @@ -36,7 +36,7 @@ void RageSoundReader_SpeedChange::Reset() { m_fTrailingSpeedRatio = m_fSpeedRatio; m_iDataBufferAvailFrames = 0; - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; c.m_iCorrelatedPos = 0; @@ -102,7 +102,7 @@ int RageSoundReader_SpeedChange::FillData( int iMaxFrames ) return iGotFrames; } - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; @@ -134,7 +134,7 @@ void RageSoundReader_SpeedChange::EraseData( int iFramesToDelete ) int iFramesToMove = m_iDataBufferAvailFrames - iFramesToDelete; m_iDataBufferAvailFrames -= iFramesToDelete; m_iUncorrelatedPos -= iFramesToDelete; - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; if( iFramesToMove ) @@ -154,7 +154,7 @@ int RageSoundReader_SpeedChange::Step() { /* Advance m_iCorrelatedPos past the data that was just copied, to point to the * sound that we would have played if we had continued copying at that point. */ - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ASSERT( m_Channels[i].m_iCorrelatedPos + m_iPos <= m_iDataBufferAvailFrames ); m_Channels[i].m_iCorrelatedPos += m_iPos; @@ -179,7 +179,7 @@ int RageSoundReader_SpeedChange::Step() /* We don't need any data before the earlier of m_iUncorrelatedPos or m_iCorrelatedPos. */ int iToDelete = m_iUncorrelatedPos; - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; ASSERT( c.m_iCorrelatedPos <= m_iDataBufferAvailFrames ); @@ -191,7 +191,7 @@ int RageSoundReader_SpeedChange::Step() /* Fill as much data as we might need to do the search and use the result. */ { int iMaxPositionNeeded = m_iUncorrelatedPos + GetToleranceFrames() + GetWindowSizeFrames(); - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) iMaxPositionNeeded = std::max( iMaxPositionNeeded, m_Channels[i].m_iCorrelatedPos + GetWindowSizeFrames() ); int iGot = FillData( iMaxPositionNeeded ); @@ -212,7 +212,7 @@ int RageSoundReader_SpeedChange::Step() int iCorrelatedToMatch = GetWindowSizeFrames()/4; int iUncorrelatedToMatch = GetToleranceFrames() + iCorrelatedToMatch; // maximum distance to search - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; ASSERT( c.m_iCorrelatedPos >= 0 ); @@ -229,7 +229,7 @@ int RageSoundReader_SpeedChange::Step() int RageSoundReader_SpeedChange::GetCursorAvail() const { int iCursorAvail = GetWindowSizeFrames() - m_iPos; - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { int iCursorAvailForChannel = (m_iDataBufferAvailFrames-m_Channels[i].m_iCorrelatedPos) - m_iPos; iCursorAvail = std::min( iCursorAvail, iCursorAvailForChannel ); @@ -275,7 +275,7 @@ int RageSoundReader_SpeedChange::Read( float *pBuf, int iFrames ) int iWindowSizeFrames = GetWindowSizeFrames(); while( iFramesAvail-- ) { - for( std::size_t i = 0; i < m_Channels.size(); ++i ) + for( size_t i = 0; i < m_Channels.size(); ++i ) { ChannelInfo &c = m_Channels[i]; float i1 = c.m_DataBuffer[c.m_iCorrelatedPos+m_iPos]; diff --git a/src/RageSoundReader_Vorbisfile.cpp b/src/RageSoundReader_Vorbisfile.cpp index 124f2145e5..f238fd3e27 100644 --- a/src/RageSoundReader_Vorbisfile.cpp +++ b/src/RageSoundReader_Vorbisfile.cpp @@ -16,7 +16,7 @@ #include #include -static std::size_t OggRageFile_read_func( void *ptr, std::size_t size, std::size_t nmemb, void *datasource ) +static size_t OggRageFile_read_func( void *ptr, size_t size, size_t nmemb, void *datasource ) { RageFileBasic *f = (RageFileBasic *) datasource; return f->Read( ptr, size, nmemb ); diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index 713b8446f1..6b4146a00c 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -859,7 +859,7 @@ RageSurface *RageSurfaceUtils::PalettizeToGrayscale( const RageSurface *src_surf const unsigned int Amask = ((1u << AlphaBits) - 1u) << Ashift; // alpha mask const unsigned int Aloss = 8u-AlphaBits; - for( std::size_t index = 0; index < TotalColors; ++index ) + for( size_t index = 0; index < TotalColors; ++index ) { const unsigned int I = (index & Imask) >> Ishift; const unsigned int A = (index & Amask) >> Ashift; diff --git a/src/RageSurface_Load_JPEG.cpp b/src/RageSurface_Load_JPEG.cpp index d8fc80b4a6..fd64d2d681 100644 --- a/src/RageSurface_Load_JPEG.cpp +++ b/src/RageSurface_Load_JPEG.cpp @@ -68,7 +68,7 @@ void RageFile_JPEG_init_source( j_decompress_ptr cinfo ) boolean RageFile_JPEG_fill_input_buffer( j_decompress_ptr cinfo ) { RageFile_source_mgr *src = (RageFile_source_mgr *) cinfo->src; - std::size_t nbytes = src->file->Read( src->buffer, sizeof(src->buffer) ); + size_t nbytes = src->file->Read( src->buffer, sizeof(src->buffer) ); if( nbytes <= 0 ) { diff --git a/src/RageSurface_Save_JPEG.cpp b/src/RageSurface_Save_JPEG.cpp index 8436425f3d..5858e3618a 100644 --- a/src/RageSurface_Save_JPEG.cpp +++ b/src/RageSurface_Save_JPEG.cpp @@ -105,7 +105,7 @@ bool RageSurfaceUtils::SaveJPEG( RageSurface *surface, RageFile &f, bool bHighQu /* Now we can initialize the JPEG compression object. */ jpeg::jpeg_CreateCompress(&cinfo, JPEG_LIB_VERSION, \ - (std::size_t) sizeof(struct jpeg::jpeg_compress_struct)); + (size_t) sizeof(struct jpeg::jpeg_compress_struct)); cinfo.image_width = surface->w; /* image width and height, in pixels */ cinfo.image_height = surface->h; diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 8b196ab11c..f126b7748c 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -29,7 +29,7 @@ const RString CUSTOM_SONG_PATH= "/@mem/"; bool HexToBinary(const RString&, RString&); void utf8_sanitize(RString &); -void UnicodeUpperLower(wchar_t *, std::size_t, const unsigned char *); +void UnicodeUpperLower(wchar_t *, size_t, const unsigned char *); RandomGen g_RandomNumberGenerator; @@ -148,7 +148,7 @@ bool IsAnInt( const RString &s ) if( !s.size() ) return false; - for( std::size_t i=0; i < s.size(); ++i ) + for( size_t i=0; i < s.size(); ++i ) if( s[i] < '0' || s[i] > '9' ) return false; @@ -160,7 +160,7 @@ bool IsHexVal( const RString &s ) if( !s.size() ) return false; - for( std::size_t i=0; i < s.size(); ++i ) + for( size_t i=0; i < s.size(); ++i ) if( !(s[i] >= '0' && s[i] <= '9') && !(toupper(s[i]) >= 'A' && toupper(s[i]) <= 'F')) return false; @@ -168,11 +168,11 @@ bool IsHexVal( const RString &s ) return true; } -RString BinaryToHex( const void *pData_, std::size_t iNumBytes ) +RString BinaryToHex( const void *pData_, size_t iNumBytes ) { const unsigned char *pData = (const unsigned char *) pData_; RString s; - for( std::size_t i=0; i= 3 && iPercent > 2 && sStr[iEnd-2] == 'l' && sStr[iEnd-1] == 'l' ) { sRet.append( sStr, iPercent, iEnd - iPercent - 2 ); // % @@ -678,9 +678,9 @@ RString join( const RString &sDeliminator, const std::vector &sSource) return RString(); RString sTmp; - std::size_t final_size= 0; - std::size_t delim_size= sDeliminator.size(); - for(std::size_t n= 0; n < sSource.size()-1; ++n) + size_t final_size= 0; + size_t delim_size= sDeliminator.size(); + for(size_t n= 0; n < sSource.size()-1; ++n) { final_size+= sSource[n].size() + delim_size; } @@ -702,8 +702,8 @@ RString join( const RString &sDelimitor, std::vector::const_iterator be return RString(); RString sRet; - std::size_t final_size= 0; - std::size_t delim_size= sDelimitor.size(); + size_t final_size= 0; + size_t delim_size= sDelimitor.size(); for(std::vector::const_iterator curr= begin; curr != end; ++curr) { final_size+= curr->size(); @@ -822,10 +822,10 @@ void do_split( const S &Source, const C Delimitor, std::vector &AddIt, const if( Source.empty() ) return; - std::size_t startpos = 0; + size_t startpos = 0; do { - std::size_t pos; + size_t pos; pos = Source.find( Delimitor, startpos ); if( pos == Source.npos ) pos = Source.size(); @@ -907,7 +907,7 @@ void do_split( const S &Source, const S &Delimitor, int &begin, int &size, int l /* Where's the string function to find within a substring? * C++ strings apparently are missing that ... */ - std::size_t pos; + size_t pos; if( Delimitor.size() == 1 ) pos = Source.find( Delimitor[0], begin ); else @@ -996,11 +996,11 @@ RString SetExtension( const RString &sPath, const RString &sExt ) RString GetExtension( const RString &sPath ) { - std::size_t pos = sPath.rfind( '.' ); + size_t pos = sPath.rfind( '.' ); if( pos == sPath.npos ) return RString(); - std::size_t slash = sPath.find( '/', pos ); + size_t slash = sPath.find( '/', pos ); if( slash != sPath.npos ) return RString(); /* rare: path/dir.ext/fn */ @@ -1046,11 +1046,11 @@ bool FindFirstFilenameContaining(const std::vector& filenames, RString& out, const std::vector& starts_with, const std::vector& contains, const std::vector& ends_with) { - for(std::size_t i= 0; i < filenames.size(); ++i) + for(size_t i= 0; i < filenames.size(); ++i) { RString lower= GetFileNameWithoutExtension(filenames[i]); lower.MakeLower(); - for(std::size_t s= 0; s < starts_with.size(); ++s) + for(size_t s= 0; s < starts_with.size(); ++s) { if(!lower.compare(0, starts_with[s].size(), starts_with[s])) { @@ -1058,12 +1058,12 @@ bool FindFirstFilenameContaining(const std::vector& filenames, return true; } } - std::size_t lower_size= lower.size(); - for(std::size_t s= 0; s < ends_with.size(); ++s) + size_t lower_size= lower.size(); + for(size_t s= 0; s < ends_with.size(); ++s) { if(lower_size >= ends_with[s].size()) { - std::size_t end_pos= lower_size - ends_with[s].size(); + size_t end_pos= lower_size - ends_with[s].size(); if(!lower.compare(end_pos, std::string::npos, ends_with[s])) { out= filenames[i]; @@ -1071,7 +1071,7 @@ bool FindFirstFilenameContaining(const std::vector& filenames, } } } - for(std::size_t s= 0; s < contains.size(); ++s) + for(size_t s= 0; s < contains.size(); ++s) { if(lower.find(contains[s]) != std::string::npos) { @@ -1111,7 +1111,7 @@ bool GetCommandlineArgument( const RString &option, RString *argument, int iInde { const RString CurArgument = g_argv[arg]; - const std::size_t i = CurArgument.find( "=" ); + const size_t i = CurArgument.find( "=" ); RString CurOption = CurArgument.substr(0,i); if( CurOption.CompareNoCase(optstr) ) continue; // no match @@ -1151,7 +1151,7 @@ RString GetCwd() * http://www.theorem.com/java/CRC32.java, * http://www.faqs.org/rfcs/rfc1952.html */ -void CRC32( unsigned int &iCRC, const void *pVoidBuffer, std::size_t iSize ) +void CRC32( unsigned int &iCRC, const void *pVoidBuffer, size_t iSize ) { static unsigned tab[256]; static bool initted = false; @@ -1663,7 +1663,7 @@ bool utf8_to_wchar_ec( const RString &s, unsigned &start, wchar_t &ch ) } /* Like utf8_to_wchar_ec, but only does enough error checking to prevent crashing. */ -bool utf8_to_wchar( const char *s, std::size_t iLength, unsigned &start, wchar_t &ch ) +bool utf8_to_wchar( const char *s, size_t iLength, unsigned &start, wchar_t &ch ) { if( start >= iLength ) return false; @@ -1791,7 +1791,7 @@ void utf8_remove_bom( RString &sLine ) sLine.erase(0, 3); } -static int UnicodeDoUpper( char *p, std::size_t iLen, const unsigned char pMapping[256] ) +static int UnicodeDoUpper( char *p, size_t iLen, const unsigned char pMapping[256] ) { // Note: this has problems with certain accented characters. -aj wchar_t wc = L'\0'; @@ -1818,7 +1818,7 @@ static int UnicodeDoUpper( char *p, std::size_t iLen, const unsigned char pMappi /* Fast in-place MakeUpper and MakeLower. This only replaces characters with characters of the same UTF-8 * length, so we never have to move the whole string. This is optimized for strings that have no * non-ASCII characters. */ -void MakeUpper( char *p, std::size_t iLen ) +void MakeUpper( char *p, size_t iLen ) { char *pStart = p; char *pEnd = p + iLen; @@ -1838,7 +1838,7 @@ void MakeUpper( char *p, std::size_t iLen ) } } -void MakeLower( char *p, std::size_t iLen ) +void MakeLower( char *p, size_t iLen ) { char *pStart = p; char *pEnd = p + iLen; @@ -1858,7 +1858,7 @@ void MakeLower( char *p, std::size_t iLen ) } } -void UnicodeUpperLower( wchar_t *p, std::size_t iLen, const unsigned char pMapping[256] ) +void UnicodeUpperLower( wchar_t *p, size_t iLen, const unsigned char pMapping[256] ) { wchar_t *pEnd = p + iLen; while( p != pEnd ) @@ -1876,12 +1876,12 @@ void UnicodeUpperLower( wchar_t *p, std::size_t iLen, const unsigned char pMappi } } -void MakeUpper( wchar_t *p, std::size_t iLen ) +void MakeUpper( wchar_t *p, size_t iLen ) { UnicodeUpperLower( p, iLen, g_UpperCase ); } -void MakeLower( wchar_t *p, std::size_t iLen ) +void MakeLower( wchar_t *p, size_t iLen ) { UnicodeUpperLower( p, iLen, g_LowerCase ); } @@ -1911,7 +1911,7 @@ RString FloatToString( const float &num ) return ss.str(); } -int StringToInt( const std::string& str, std::size_t* pos, int base, int exceptVal ) +int StringToInt( const std::string& str, size_t* pos, int base, int exceptVal ) { try { @@ -1926,7 +1926,7 @@ int StringToInt( const std::string& str, std::size_t* pos, int base, int exceptV return exceptVal; } -long StringToLong( const std::string& str, std::size_t* pos, int base, long exceptVal ) +long StringToLong( const std::string& str, size_t* pos, int base, long exceptVal ) { try { @@ -1941,7 +1941,7 @@ long StringToLong( const std::string& str, std::size_t* pos, int base, long exce return exceptVal; } -long long StringToLLong( const std::string& str, std::size_t* pos, int base, long long exceptVal ) +long long StringToLLong( const std::string& str, size_t* pos, int base, long long exceptVal ) { try { @@ -2004,10 +2004,10 @@ void ReplaceEntityText( RString &sText, const std::map &m ) { RString sRet; - std::size_t iOffset = 0; + size_t iOffset = 0; while( iOffset != sText.size() ) { - std::size_t iStart = sText.find( '&', iOffset ); + size_t iStart = sText.find( '&', iOffset ); if( iStart == sText.npos ) { // Optimization: if we didn't replace anything at all, do nothing. @@ -2024,7 +2024,7 @@ void ReplaceEntityText( RString &sText, const std::map &m ) iOffset += iStart-iOffset; // Optimization: stop early on "&", so "&&&&&&&&&&&" isn't n^2. - std::size_t iEnd = sText.find_first_of( "&;", iStart+1 ); + size_t iEnd = sText.find_first_of( "&;", iStart+1 ); if( iEnd == sText.npos || sText[iEnd] == '&' ) { // & with no matching ;, or two & in a row. Append the & and continue. @@ -2062,10 +2062,10 @@ void ReplaceEntityText( RString &sText, const std::map &m ) RString sRet; - std::size_t iOffset = 0; + size_t iOffset = 0; while( iOffset != sText.size() ) { - std::size_t iStart = sText.find_first_of( sFind, iOffset ); + size_t iStart = sText.find_first_of( sFind, iOffset ); if( iStart == sText.npos ) { // Optimization: if we didn't replace anything at all, do nothing. @@ -2104,7 +2104,7 @@ void Replace_Unicode_Markers( RString &sText ) { // Look for &#digits; bool bHex = false; - std::size_t iPos = sText.find( "&#", iStart ); + size_t iPos = sText.find( "&#", iStart ); if( iPos == sText.npos ) { bHex = true; @@ -2160,11 +2160,11 @@ RString WcharDisplayText( wchar_t c ) */ RString Basename( const RString &sDir ) { - std::size_t iEnd = sDir.find_last_not_of( "/\\" ); + size_t iEnd = sDir.find_last_not_of( "/\\" ); if( iEnd == sDir.npos ) return RString(); - std::size_t iStart = sDir.find_last_of( "/\\", iEnd ); + size_t iStart = sDir.find_last_of( "/\\", iEnd ); if( iStart == sDir.npos ) iStart = 0; else @@ -2281,8 +2281,8 @@ void CollapsePath( RString &sPath, bool bRemoveLeadingDot ) RString sOut; sOut.reserve( sPath.size() ); - std::size_t iPos = 0; - std::size_t iNext; + size_t iPos = 0; + size_t iNext; for( ; iPos < sPath.size(); iPos = iNext ) { // Find the next slash. @@ -2318,7 +2318,7 @@ void CollapsePath( RString &sPath, bool bRemoveLeadingDot ) } // Search backwards for the previous path element. - std::size_t iPrev = sOut.rfind( '/', sOut.size()-2 ); + size_t iPrev = sOut.rfind( '/', sOut.size()-2 ); if( iPrev == RString::npos ) iPrev = 0; else @@ -2493,7 +2493,7 @@ LuaFunction( lerp, lerp(FArg(1), FArg(2), FArg(3)) ); int LuaFunc_BinaryToHex(lua_State* L); int LuaFunc_BinaryToHex(lua_State* L) { - std::size_t l; + size_t l; const char *s = luaL_checklstring(L, 1, &l); RString hex = BinaryToHex(s, l); @@ -2561,7 +2561,7 @@ int LuaFunc_JsonEncode(lua_State* L) return Json::Value(val); } case LUA_TSTRING: { - std::size_t len; + size_t len; const char *s = lua_tolstring(L, index, &len); return Json::Value(std::string(s, len)); @@ -2575,7 +2575,7 @@ int LuaFunc_JsonEncode(lua_State* L) index = lua_gettop(L) + index + 1; } - std::size_t len = lua_objlen(L, index); + size_t len = lua_objlen(L, index); if (len > 0) { @@ -2605,7 +2605,7 @@ int LuaFunc_JsonEncode(lua_State* L) luaL_error(L, "object keys must be strings"); } - std::size_t keylen; + size_t keylen; const char *key = lua_tolstring(L, -2, &keylen); obj[std::string(key, keylen)] = convert(-1); lua_pop(L, 1); @@ -2654,7 +2654,7 @@ int LuaFunc_JsonDecode(lua_State* L) luaL_error(L, "JsonDecode requires an argument"); } - std::size_t datalen; + size_t datalen; const char *data = lua_tolstring(L, 1, &datalen); Json::Reader reader; @@ -2763,9 +2763,9 @@ int LuaFunc_multiapproach(lua_State* L) { luaL_error(L, "multiapproach: A table of current values, a table of goal values, and a table of speeds must be passed."); } - std::size_t currents_len= lua_objlen(L, 1); - std::size_t goals_len= lua_objlen(L, 2); - std::size_t speeds_len= lua_objlen(L, 3); + size_t currents_len= lua_objlen(L, 1); + size_t goals_len= lua_objlen(L, 2); + size_t speeds_len= lua_objlen(L, 3); float mult= 1.0f; if(lua_isnumber(L, 4)) { @@ -2779,7 +2779,7 @@ int LuaFunc_multiapproach(lua_State* L) { luaL_error(L, "multiapproach: current, goal, and speed must all be tables."); } - for(std::size_t i= 1; i <= currents_len; ++i) + for(size_t i= 1; i <= currents_len; ++i) { lua_rawgeti(L, 1, i); lua_rawgeti(L, 2, i); diff --git a/src/RageUtil.h b/src/RageUtil.h index ae214c9723..31e190cc4b 100644 --- a/src/RageUtil.h +++ b/src/RageUtil.h @@ -331,7 +331,7 @@ float fmodfp( float x, float y ); int power_of_two( int input ); bool IsAnInt( const RString &s ); bool IsHexVal( const RString &s ); -RString BinaryToHex( const void *pData_, std::size_t iNumBytes ); +RString BinaryToHex( const void *pData_, size_t iNumBytes ); RString BinaryToHex( const RString &sString ); bool HexToBinary( const RString &s, unsigned char *stringOut ); bool HexToBinary( const RString &s, RString *sOut ); @@ -378,16 +378,16 @@ bool FindFirstFilenameContaining( extern const wchar_t INVALID_CHAR; int utf8_get_char_len( char p ); -bool utf8_to_wchar( const char *s, std::size_t iLength, unsigned &start, wchar_t &ch ); +bool utf8_to_wchar( const char *s, size_t iLength, unsigned &start, wchar_t &ch ); bool utf8_to_wchar_ec( const RString &s, unsigned &start, wchar_t &ch ); void wchar_to_utf8( wchar_t ch, RString &out ); wchar_t utf8_get_char( const RString &s ); bool utf8_is_valid( const RString &s ); void utf8_remove_bom( RString &s ); -void MakeUpper( char *p, std::size_t iLen ); -void MakeLower( char *p, std::size_t iLen ); -void MakeUpper( wchar_t *p, std::size_t iLen ); -void MakeLower( wchar_t *p, std::size_t iLen ); +void MakeUpper( char *p, size_t iLen ); +void MakeLower( char *p, size_t iLen ); +void MakeUpper( wchar_t *p, size_t iLen ); +void MakeLower( wchar_t *p, size_t iLen ); // TODO: Have the three functions below be moved to better locations. float StringToFloat( const RString &sString ); @@ -401,9 +401,9 @@ inline bool operator>>(const RString& lhs, T& rhs) // Exception-safe wrappers around stoi and friends // Additional argument exceptVal will be returned if the conversion couldn't be performed -int StringToInt( const std::string& str, std::size_t* pos = 0, int base = 10, int exceptVal = 0 ); -long StringToLong( const std::string& str, std::size_t* pos = 0, int base = 10, long exceptVal = 0 ); -long long StringToLLong( const std::string& str, std::size_t* pos = 0, int base = 10, long long exceptVal = 0 ); +int StringToInt( const std::string& str, size_t* pos = 0, int base = 10, int exceptVal = 0 ); +long StringToLong( const std::string& str, size_t* pos = 0, int base = 10, long exceptVal = 0 ); +long long StringToLLong( const std::string& str, size_t* pos = 0, int base = 10, long long exceptVal = 0 ); RString WStringToRString( const std::wstring &sString ); RString WcharToUTF8( wchar_t c ); @@ -455,7 +455,7 @@ bool GetCommandlineArgument( const RString &option, RString *argument=nullptr, i extern int g_argc; extern char **g_argv; -void CRC32( unsigned int &iCRC, const void *pBuffer, std::size_t iSize ); +void CRC32( unsigned int &iCRC, const void *pBuffer, size_t iSize ); unsigned int GetHashForString( const RString &s ); unsigned int GetHashForFile( const RString &sPath ); unsigned int GetHashForDirectory( const RString &sDir ); // a hash value that remains the same as long as nothing in the directory has changed @@ -571,7 +571,7 @@ struct char_traits_char_nocase: public std::char_traits static inline bool lt( char c1, char c2 ) { return g_UpperCase[(unsigned char)c1] < g_UpperCase[(unsigned char)c2]; } - static int compare( const char* s1, const char* s2, std::size_t n ) + static int compare( const char* s1, const char* s2, size_t n ) { int ret = 0; while( n-- ) diff --git a/src/RageUtil_CharConversions.cpp b/src/RageUtil_CharConversions.cpp index b472055e7c..0f63aaeb1d 100644 --- a/src/RageUtil_CharConversions.cpp +++ b/src/RageUtil_CharConversions.cpp @@ -51,19 +51,19 @@ static bool ConvertFromCharset( RString &sText, const char *szCharset ) /* Copy the string into a char* for iconv */ ICONV_CONST char *szTextIn = const_cast( sText.data() ); - std::size_t iInLeft = sText.size(); + size_t iInLeft = sText.size(); /* Create a new string with enough room for the new conversion */ RString sBuf; sBuf.resize( sText.size() * 5 ); char *sTextOut = const_cast( sBuf.data() ); - std::size_t iOutLeft = sBuf.size(); - std::size_t size = iconv( converter, &szTextIn, &iInLeft, &sTextOut, &iOutLeft ); + size_t iOutLeft = sBuf.size(); + size_t size = iconv( converter, &szTextIn, &iInLeft, &sTextOut, &iOutLeft ); iconv_close( converter ); - if( size == (std::size_t)(-1) ) + if( size == (size_t)(-1) ) { LOG->Trace( "%s\n", strerror( errno ) ); return false; /* Returned an error */ @@ -103,7 +103,7 @@ static bool ConvertFromCP( RString &sText, int iCodePage ) if( old == nullptr ) return false; - const std::size_t size = CFStringGetMaximumSizeForEncoding( CFStringGetLength(old), kCFStringEncodingUTF8 ); + const size_t size = CFStringGetMaximumSizeForEncoding( CFStringGetLength(old), kCFStringEncodingUTF8 ); char *buf = new char[size+1]; buf[0] = '\0'; diff --git a/src/RageUtil_FileDB.cpp b/src/RageUtil_FileDB.cpp index b57a8b2434..47d3ddb5f2 100644 --- a/src/RageUtil_FileDB.cpp +++ b/src/RageUtil_FileDB.cpp @@ -50,7 +50,7 @@ void FileSet::GetFilesMatching( const RString &sBeginning_, const RString &sCont * search instead of string match). */ if( !sContaining.empty() ) { - std::size_t pos = sPath.find( sContaining, sBeginning.size() ); + size_t pos = sPath.find( sContaining, sBeginning.size() ); if( pos == sPath.npos ) continue; /* doesn't contain it */ if( pos + sContaining.size() > unsigned(end_pos) ) @@ -108,7 +108,7 @@ static void SplitPath( RString sPath, RString &sDir, RString &sName ) if( sPath.Right(1) == "/" ) sPath.erase( sPath.size()-1 ); - std::size_t iSep = sPath.find_last_of( '/' ); + size_t iSep = sPath.find_last_of( '/' ); if( iSep == RString::npos ) { sDir = ""; @@ -238,14 +238,14 @@ void FilenameDB::GetFilesEqualTo( const RString &sDir, const RString &sFile, std void FilenameDB::GetFilesSimpleMatch( const RString &sDir, const RString &sMask, std::vector &asOut, bool bOnlyDirs ) { /* Does this contain a wildcard? */ - std::size_t first_pos = sMask.find_first_of( '*' ); + size_t first_pos = sMask.find_first_of( '*' ); if( first_pos == sMask.npos ) { /* No; just do a regular search. */ GetFilesEqualTo( sDir, sMask, asOut, bOnlyDirs ); return; } - std::size_t second_pos = sMask.find_first_of( '*', first_pos+1 ); + size_t second_pos = sMask.find_first_of( '*', first_pos+1 ); if( second_pos == sMask.npos ) { /* Only one *: "A*B". */ @@ -580,7 +580,7 @@ void FilenameDB::GetDirListing( const RString &sPath_, std::vector &asA ASSERT( !sPath.empty() ); /* Strip off the last path element and use it as a mask. */ - std::size_t pos = sPath.find_last_of( '/' ); + size_t pos = sPath.find_last_of( '/' ); RString fn; if( pos == sPath.npos ) { diff --git a/src/ReceptorArrowRow.cpp b/src/ReceptorArrowRow.cpp index ac75e6f4f9..4b56523c85 100644 --- a/src/ReceptorArrowRow.cpp +++ b/src/ReceptorArrowRow.cpp @@ -38,7 +38,7 @@ void ReceptorArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOff void ReceptorArrowRow::SetColumnRenderers(std::vector& renderers) { ASSERT_M(renderers.size() == m_ReceptorArrow.size(), "Notefield has different number of columns than receptor row."); - for(std::size_t c= 0; c < m_ReceptorArrow.size(); ++c) + for(size_t c= 0; c < m_ReceptorArrow.size(); ++c) { m_ReceptorArrow[c]->SetFakeParent(&(renderers[c])); } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 79586d5688..789c4ca3fe 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -25,8 +25,8 @@ #include -static RString PercentScoreWeightName( std::size_t i ) { return "PercentScoreWeight" + ScoreEventToString( (ScoreEvent)i ); } -static RString GradeWeightName( std::size_t i ) { return "GradeWeight" + ScoreEventToString( (ScoreEvent)i ); } +static RString PercentScoreWeightName( size_t i ) { return "PercentScoreWeight" + ScoreEventToString( (ScoreEvent)i ); } +static RString GradeWeightName( size_t i ) { return "GradeWeight" + ScoreEventToString( (ScoreEvent)i ); } static ThemeMetric1D g_iPercentScoreWeight("ScoreKeeperNormal", PercentScoreWeightName, NUM_ScoreEvent ); static ThemeMetric1D g_iGradeWeight("ScoreKeeperNormal", GradeWeightName, NUM_ScoreEvent ); diff --git a/src/ScoreKeeperRave.cpp b/src/ScoreKeeperRave.cpp index 017653885f..37af6bc226 100644 --- a/src/ScoreKeeperRave.cpp +++ b/src/ScoreKeeperRave.cpp @@ -14,7 +14,7 @@ ThemeMetric ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds"); -static void SuperMeterPercentChangeInit( std::size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) +static void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { ScoreEvent ci = (ScoreEvent)i; sNameOut = "SuperMeterPercentChange" + ScoreEventToString( ci ); diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 43f3ab9cc2..2e2a84c9a8 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -549,7 +549,7 @@ void ScreenEdit::LoadKeymapSectionIntoMappingsMember(XNode const* section, MapEd attr->second->GetValue(joined_names); std::vector key_names; split(joined_names, DEVICE_INPUT_SEPARATOR, key_names, false); - for(std::size_t k= 0; k < key_names.size() && k < NUM_EDIT_TO_DEVICE_SLOTS; ++k) + for(size_t k= 0; k < key_names.size() && k < NUM_EDIT_TO_DEVICE_SLOTS; ++k) { DeviceInput devi; devi.FromString(key_names[k]); @@ -1380,7 +1380,7 @@ static float g_fLastInsertAttackDurationSeconds = -1; static float g_fLastInsertAttackPositionSeconds = -1; static BackgroundLayer g_CurrentBGChangeLayer = BACKGROUND_LAYER_Invalid; -static void SetDefaultEditorNoteSkin( std::size_t num, RString &sNameOut, RString &defaultValueOut ) +static void SetDefaultEditorNoteSkin( size_t num, RString &sNameOut, RString &defaultValueOut ) { sNameOut = ssprintf( "EditorNoteSkinP%d", int(num + 1) ); @@ -1698,7 +1698,7 @@ void ScreenEdit::Update( float fDeltaTime ) std::vector GameI; GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1, GameI ); float fSecsHeld= 0.0f; - for(std::size_t i= 0; i < GameI.size(); ++i) + for(size_t i= 0; i < GameI.size(); ++i) { fSecsHeld= std::max(fSecsHeld, INPUTMAPPER->GetSecsHeld(GameI[i])); } @@ -5018,7 +5018,7 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS { std::vector mapping_input; split(mapstr, ",", mapping_input); - std::size_t tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks; + size_t tracks_for_type= GAMEMAN->GetStepsTypeInfo(GAMESTATE->m_pCurSteps[0]->m_StepsType).iNumTracks; if(mapping_input.size() > tracks_for_type) { error= TOO_MANY_TRACKS; @@ -5026,7 +5026,7 @@ static bool ConvertMappingInputToMapping(RString const& mapstr, int* mapping, RS } // mapping_input.size() < tracks_for_type is not checked because // unspecified tracks are mapped directly. -Kyz - std::size_t track= 0; + size_t track= 0; // track will be used for filling in the unspecified part of the mapping. for(; track < mapping_input.size(); ++track) { diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index c0b935a33e..d8d6dc8b62 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -267,7 +267,7 @@ void ScreenEvaluation::Init() { if( SUMMARY ) { - for( std::size_t i=0; im_vpPlayedSongs.size() + for( size_t i=0; im_vpPlayedSongs.size() && i < MAX_SONGS_TO_SHOW; i++ ) { Song *pSong = m_pStageStats->m_vpPlayedSongs[i]; diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 17410d3d8d..1012a81a0b 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -2101,7 +2101,7 @@ void ScreenGameplay::UpdateHasteRate() float scale_from_high= 1; float scale_to_low= 0; float scale_to_high=0; - for(std::size_t turning_point= 0; turning_point < m_HasteTurningPoints.size(); + for(size_t turning_point= 0; turning_point < m_HasteTurningPoints.size(); ++turning_point) { float curr_turning_point= m_HasteTurningPoints[turning_point]; @@ -2203,7 +2203,7 @@ void ScreenGameplay::UpdateLights() { std::vector gi; pStyle->StyleInputToGameInput( t, pi->m_pn, gi ); - for(std::size_t i= 0; i < gi.size(); ++i) + for(size_t i= 0; i < gi.size(); ++i) { bBlinkGameButton[gi[i].controller][gi[i].button] = true; } @@ -2872,7 +2872,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) GAMESTATE->SetNewStageSeed(); course->InvalidateTrailCache(); course->RegenerateNonFixedTrails(); - std::size_t info_id= 0; // Can't use the player number in the playerinfo + size_t info_id= 0; // Can't use the player number in the playerinfo // because it won't match up in 2-player. FOREACH_EnabledPlayerInfo(m_vPlayerInfo, pi) { @@ -3260,13 +3260,13 @@ public: static int GetHasteRate( T* p, lua_State *L ) { lua_pushnumber( L, p->GetHasteRate() ); return 1; } static bool TurningPointsValid(lua_State* L, int index) { - std::size_t size= lua_objlen(L, index); + size_t size= lua_objlen(L, index); if(size < 2) { luaL_error(L, "Invalid number of entries %zu", size); } float prev_turning= -1; - for(std::size_t n= 1; n < size; ++n) + for(size_t n= 1; n < size; ++n) { lua_pushnumber(L, n); lua_gettable(L, index); diff --git a/src/ScreenHighScores.cpp b/src/ScreenHighScores.cpp index 19b4dead52..ce8178b9b1 100644 --- a/src/ScreenHighScores.cpp +++ b/src/ScreenHighScores.cpp @@ -10,8 +10,8 @@ #include -RString COLUMN_DIFFICULTY_NAME( std::size_t i ); -RString COLUMN_STEPS_TYPE_NAME( std::size_t i ); +RString COLUMN_DIFFICULTY_NAME( size_t i ); +RString COLUMN_STEPS_TYPE_NAME( size_t i ); static const char *HighScoresTypeNames[] = { "AllSteps", @@ -205,8 +205,8 @@ void ScoreScroller::Load( RString sMetricsGroup ) ///////////////////////////////////////////// -RString COLUMN_DIFFICULTY_NAME( std::size_t i ) { return ssprintf("ColumnDifficulty%d",int(i+1)); } -RString COLUMN_STEPS_TYPE_NAME( std::size_t i ) { return ssprintf("ColumnStepsType%d",int(i+1)); } +RString COLUMN_DIFFICULTY_NAME( size_t i ) { return ssprintf("ColumnDifficulty%d",int(i+1)); } +RString COLUMN_STEPS_TYPE_NAME( size_t i ) { return ssprintf("ColumnStepsType%d",int(i+1)); } void ScreenHighScores::Init() { diff --git a/src/ScreenMapControllers.cpp b/src/ScreenMapControllers.cpp index ccf10d339a..f69fc65e87 100644 --- a/src/ScreenMapControllers.cpp +++ b/src/ScreenMapControllers.cpp @@ -35,7 +35,7 @@ ScreenMapControllers::ScreenMapControllers() ScreenMapControllers::~ScreenMapControllers() { - for(std::size_t i= 0; i < m_Line.size(); ++i) + for(size_t i= 0; i < m_Line.size(); ++i) { RageUtil::SafeDelete(m_Line[i]); } diff --git a/src/ScreenNameEntry.cpp b/src/ScreenNameEntry.cpp index 6f715fe10d..08954aeb85 100644 --- a/src/ScreenNameEntry.cpp +++ b/src/ScreenNameEntry.cpp @@ -66,10 +66,10 @@ void ScreenNameEntry::ScrollingText::Init( const RString &sName, const std::vect void ScreenNameEntry::ScrollingText::DrawPrimitives() { const float fFakeBeat = GAMESTATE->m_Position.m_fSongBeat; - const std::size_t iClosestIndex = std::lrint( fFakeBeat ) % CHARS_CHOICES.size(); + const size_t iClosestIndex = std::lrint( fFakeBeat ) % CHARS_CHOICES.size(); const float fClosestYOffset = GetClosestCharYOffset( fFakeBeat ); - std::size_t iCharIndex = ( iClosestIndex - NUM_CHARS_TO_DRAW_BEHIND + CHARS_CHOICES.size() ) % CHARS_CHOICES.size(); + size_t iCharIndex = ( iClosestIndex - NUM_CHARS_TO_DRAW_BEHIND + CHARS_CHOICES.size() ) % CHARS_CHOICES.size(); float fY = GRAY_ARROWS_Y + ( fClosestYOffset - g_iNumCharsToDrawBehind ) * g_fCharsSpacingY; for( int i = 0; i < NUM_CHARS_TO_DRAW_TOTAL; ++i ) @@ -277,7 +277,7 @@ void ScreenNameEntry::Init() std::vector gi; GAMESTATE->GetCurrentStyle(p)->StyleInputToGameInput( iCol, p, gi ); bool gi_is_start= false; - for(std::size_t i= 0; i < gi.size(); ++i) + for(size_t i= 0; i < gi.size(); ++i) { gi_is_start|= (INPUTMAPPER->GameButtonToMenuButton(gi[i].button) == GAME_BUTTON_START); diff --git a/src/ScreenOptionsManageCourses.cpp b/src/ScreenOptionsManageCourses.cpp index fe3eff7075..0127c8411a 100644 --- a/src/ScreenOptionsManageCourses.cpp +++ b/src/ScreenOptionsManageCourses.cpp @@ -238,7 +238,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus & ) { std::vector vpCourses; EditCourseUtil::GetAllEditCourses( vpCourses ); - if( vpCourses.size() >= (std::size_t)EditCourseUtil::MAX_PER_PROFILE ) + if( vpCourses.size() >= (size_t)EditCourseUtil::MAX_PER_PROFILE ) { RString s = ssprintf( YOU_HAVE_MAX.GetValue()+"\n\n"+YOU_MUST_DELETE.GetValue(), EditCourseUtil::MAX_PER_PROFILE ); ScreenPrompt::Prompt( SM_None, s ); diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 8b123477e4..7f0fa155b2 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -255,7 +255,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus & ) { std::vector v; SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine ); - if( v.size() >= std::size_t(MAX_EDIT_STEPS_PER_PROFILE) ) + if( v.size() >= size_t(MAX_EDIT_STEPS_PER_PROFILE) ) { RString s = ssprintf( YOU_HAVE_MAX_STEP_EDITS.GetValue()+"\n\n"+YOU_MUST_DELETE.GetValue(), MAX_EDIT_STEPS_PER_PROFILE ); ScreenPrompt::Prompt( SM_None, s ); diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index 8b564cc1c4..9001d6cc25 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -34,7 +34,7 @@ bool ScreenOptionsMemoryCard::UpdateCurrentUsbStorageDevices() const std::vector &aNewDevices = MEMCARDMAN->GetStorageDevices(); m_CurrentUsbStorageDevices.clear(); - for( std::size_t i = 0; i < aNewDevices.size(); ++i ) + for( size_t i = 0; i < aNewDevices.size(); ++i ) { const UsbStorageDevice &dev = aNewDevices[i]; if( dev.m_State == UsbStorageDevice::STATE_CHECKING ) diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index 9ca5f50b09..b5e975d859 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -34,7 +34,7 @@ REGISTER_SCREEN_CLASS( ScreenRanking ); #define TIME_X(row) (TIME_START_X+ROW_SPACING_X*row) #define TIME_Y(row) (TIME_START_Y+ROW_SPACING_Y*row) -static RString STEPS_TYPE_COLOR_NAME( std::size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); } +static RString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); } void ScreenRanking::Init() { diff --git a/src/ScreenSelect.cpp b/src/ScreenSelect.cpp index ca411ddbde..3968ecbd77 100644 --- a/src/ScreenSelect.cpp +++ b/src/ScreenSelect.cpp @@ -48,8 +48,8 @@ void ScreenSelect::Init() } else { - std::size_t len= lua_objlen(L, 1); - for(std::size_t i= 1; i <= len; ++i) + size_t len= lua_objlen(L, 1); + for(size_t i= 1; i <= len; ++i) { lua_rawgeti(L, 1, i); if(!lua_isstring(L, -1)) diff --git a/src/ScreenSelectMaster.cpp b/src/ScreenSelectMaster.cpp index 01372b6e5a..fa0cb4c3c4 100644 --- a/src/ScreenSelectMaster.cpp +++ b/src/ScreenSelectMaster.cpp @@ -26,10 +26,10 @@ XToString( MenuDir ); AutoScreenMessage( SM_PlayPostSwitchPage ); -static RString CURSOR_OFFSET_X_FROM_ICON_NAME( std::size_t p ) { return ssprintf("CursorP%dOffsetXFromIcon",int(p+1)); } -static RString CURSOR_OFFSET_Y_FROM_ICON_NAME( std::size_t p ) { return ssprintf("CursorP%dOffsetYFromIcon",int(p+1)); } +static RString CURSOR_OFFSET_X_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetXFromIcon",int(p+1)); } +static RString CURSOR_OFFSET_Y_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetYFromIcon",int(p+1)); } // e.g. "OptionOrderLeft=0:1,1:2,2:3,3:4" -static RString OPTION_ORDER_NAME( std::size_t dir ) { return "OptionOrder"+MenuDirToString((MenuDir)dir); } +static RString OPTION_ORDER_NAME( size_t dir ) { return "OptionOrder"+MenuDirToString((MenuDir)dir); } REGISTER_SCREEN_CLASS( ScreenSelectMaster ); @@ -136,8 +136,8 @@ void ScreenSelectMaster::Init() } else { - std::size_t poses= lua_objlen(L, -1); - for(std::size_t p= 1; p <= poses; ++p) + size_t poses= lua_objlen(L, -1); + for(size_t p= 1; p <= poses; ++p) { lua_rawgeti(L, -1, p); RageVector3 pos(0.0f, 0.0f, 0.0f); diff --git a/src/Song.cpp b/src/Song.cpp index d51077555c..fc040da6be 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -730,7 +730,7 @@ void Song::TidyUpData( bool from_cache, bool /* duringCache */ ) RString file_ext= GetExtension(*filename).MakeLower(); if(!file_ext.empty()) { - for(std::size_t tf= 0; tf < lists_to_fill.size(); ++ tf) + for(size_t tf= 0; tf < lists_to_fill.size(); ++ tf) { for(std::vector::const_iterator ext= fill_exts[tf]->begin(); ext != fill_exts[tf]->end(); ++ext) @@ -1397,7 +1397,7 @@ void Song::RemoveAutosave() // Change all the steps to point to the actual file, not the autosave // file. -Kyz RString extension= GetExtension(m_sSongFileName); - for(std::size_t i= 0; i < m_vpSteps.size(); ++i) + for(size_t i= 0; i < m_vpSteps.size(); ++i) { if(!m_vpSteps[i]->IsAutogen()) { @@ -1704,13 +1704,13 @@ RString Song::GetCacheFile(RString sType) for( std::pair PreSet : PreSets[sType.c_str()] ) { // Search for image using PreSets. - std::size_t Found = Image.find(PreSet.second.c_str()); + size_t Found = Image.find(PreSet.second.c_str()); if(Found!=RString::npos) return GetSongAssetPath( Image, m_sSongDir ); } // Search for the image directly if it doesnt exist in PreSets, // Or incase we define our own stuff. - std::size_t Found = Image.find(sType.c_str()); + size_t Found = Image.find(sType.c_str()); if(Found!=RString::npos) return GetSongAssetPath( Image, m_sSongDir ); } @@ -2328,7 +2328,7 @@ public: { const std::vector& changes= p->GetBackgroundChanges(BACKGROUND_LAYER_1); lua_createtable(L, changes.size(), 0); - for(std::size_t c= 0; c < changes.size(); ++c) + for(size_t c= 0; c < changes.size(); ++c) { lua_createtable(L, 0, 8); lua_pushnumber(L, changes[c].m_fStartBeat); diff --git a/src/SongCacheIndex.cpp b/src/SongCacheIndex.cpp index 5b3cbdcf87..0fbf0325f8 100644 --- a/src/SongCacheIndex.cpp +++ b/src/SongCacheIndex.cpp @@ -51,7 +51,7 @@ RString SongCacheIndex::GetCacheFilePath( const RString &sGroup, const RString & * so we should probably replace them with combining diacritics. * XXX How do we do this and is it even worth it? */ const char *invalid = "/\xc0\xc1\xfe\xff\xf8\xf9\xfa\xfb\xfc\xfd\xf5\xf6\xf7"; - for( std::size_t pos = s.find_first_of(invalid); pos != RString::npos; pos = s.find_first_of(invalid, pos) ) + for( size_t pos = s.find_first_of(invalid); pos != RString::npos; pos = s.find_first_of(invalid, pos) ) s[pos] = '_'; // CACHE_DIR ends with a /. return ssprintf( "%s%s/%s", SpecialFiles::CACHE_DIR.c_str(), sGroup.c_str(), s.c_str() ); diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 0ad655d5fe..af07e60c23 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -60,9 +60,9 @@ static const ThemeMetric EXTRA_STAGE2_DIFFICULTY_MAX ( "SongManager", "Ext static Preference g_sDisabledSongs( "DisabledSongs", "" ); static Preference g_bHideIncompleteCourses( "HideIncompleteCourses", false ); -RString SONG_GROUP_COLOR_NAME( std::size_t i ) { return ssprintf( "SongGroupColor%i", (int) i+1 ); } -RString COURSE_GROUP_COLOR_NAME( std::size_t i ) { return ssprintf( "CourseGroupColor%i", (int) i+1 ); } -RString profile_song_group_color_name(std::size_t i) { return ssprintf("ProfileSongGroupColor%i", (int)i+1); } +RString SONG_GROUP_COLOR_NAME( size_t i ) { return ssprintf( "SongGroupColor%i", (int) i+1 ); } +RString COURSE_GROUP_COLOR_NAME( size_t i ) { return ssprintf( "CourseGroupColor%i", (int) i+1 ); } +RString profile_song_group_color_name(size_t i) { return ssprintf("ProfileSongGroupColor%i", (int)i+1); } static const float next_loading_window_update= 0.02f; @@ -579,7 +579,7 @@ void SongManager::UnlistSong(Song *song) std::vector* songVectors[3] = { &m_pSongs, &m_pPopularSongs, &m_pShuffledSongs }; for (int songVecIdx=0; songVecIdx<3; ++songVecIdx) { std::vector& v = *songVectors[songVecIdx]; - for (std::size_t i=0; i -RString SONG_GROUP_COLOR_NAME( std::size_t i ); -RString COURSE_GROUP_COLOR_NAME( std::size_t i ); +RString SONG_GROUP_COLOR_NAME( size_t i ); +RString COURSE_GROUP_COLOR_NAME( size_t i ); bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2); /** @brief The max number of edit steps a profile can have. */ diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 9d369abe4c..be579a0eb0 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -338,7 +338,7 @@ void SongUtil::AdjustDuplicateSteps( Song *pSong ) */ static RString RemoveInitialWhitespace( RString s ) { - std::size_t i = s.find_first_not_of(" \t\r\n"); + size_t i = s.find_first_not_of(" \t\r\n"); if( i != s.npos ) s.erase( 0, i ); return s; diff --git a/src/Sprite.cpp b/src/Sprite.cpp index 1b73076a7f..2ae20a279f 100644 --- a/src/Sprite.cpp +++ b/src/Sprite.cpp @@ -1212,12 +1212,12 @@ public: luaL_error(L, "State properties must be in a table."); } std::vector new_states; - std::size_t num_states= lua_objlen(L, 1); + size_t num_states= lua_objlen(L, 1); if(num_states == 0) { luaL_error(L, "A Sprite cannot have zero states."); } - for(std::size_t s= 0; s < num_states; ++s) + for(size_t s= 0; s < num_states; ++s) { Sprite::State new_state; lua_rawgeti(L, 1, s+1); diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index 17d42cd184..ed21f104c3 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -101,7 +101,7 @@ void StatsManager::GetFinalEvalStageStats( StageStats& statsOut ) const { statsOut.Init(); std::vector vssToCount; - for(std::size_t i= 0; i < m_vPlayedStageStats.size(); ++i) + for(size_t i= 0; i < m_vPlayedStageStats.size(); ++i) { vssToCount.push_back(m_vPlayedStageStats[i]); } diff --git a/src/StdString.h b/src/StdString.h index c0eaed34b8..fa77dbb672 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -103,10 +103,10 @@ typedef wchar_t* PWSTR; #include /* In RageUtil: */ -void MakeUpper( char *p, std::size_t iLen ); -void MakeLower( char *p, std::size_t iLen ); -void MakeUpper( wchar_t *p, std::size_t iLen ); -void MakeLower( wchar_t *p, std::size_t iLen ); +void MakeUpper( char *p, size_t iLen ); +void MakeLower( char *p, size_t iLen ); +void MakeUpper( wchar_t *p, size_t iLen ); +void MakeLower( wchar_t *p, size_t iLen ); /** * @brief Inline functions on which CStdString relies on. @@ -227,32 +227,32 @@ inline int ssicmp(const CT* pA1, const CT* pA2) // ----------------------------------------------------------------------------- #if 0 template - inline void sslwr(CT* pT, std::size_t nLen) + inline void sslwr(CT* pT, size_t nLen) { - for ( CT* p = pT; static_cast(p - pT) < nLen; ++p) + for ( CT* p = pT; static_cast(p - pT) < nLen; ++p) *p = (CT)sstolower(*p); } template - inline void ssupr(CT* pT, std::size_t nLen) + inline void ssupr(CT* pT, size_t nLen) { - for ( CT* p = pT; static_cast(p - pT) < nLen; ++p) + for ( CT* p = pT; static_cast(p - pT) < nLen; ++p) *p = (CT)sstoupper(*p); } #endif -inline void sslwr(char *pT, std::size_t nLen) +inline void sslwr(char *pT, size_t nLen) { MakeLower( pT, nLen ); } -inline void ssupr(char *pT, std::size_t nLen) +inline void ssupr(char *pT, size_t nLen) { MakeUpper( pT, nLen ); } -inline void sslwr(wchar_t *pT, std::size_t nLen) +inline void sslwr(wchar_t *pT, size_t nLen) { MakeLower( pT, nLen ); } -inline void ssupr(wchar_t *pT, std::size_t nLen) +inline void ssupr(wchar_t *pT, size_t nLen) { MakeUpper( pT, nLen ); } diff --git a/src/Steps.cpp b/src/Steps.cpp index 5bb1eeaeb3..b5c08603ff 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -327,7 +327,7 @@ void Steps::CalculateRadarValues( float fMusicLengthSeconds ) std::vector vParts; NoteDataUtil::SplitCompositeNoteData( tempNoteData, vParts ); - for( std::size_t pn = 0; pn < std::min(vParts.size(), std::size_t(NUM_PLAYERS)); ++pn ) + for( size_t pn = 0; pn < std::min(vParts.size(), size_t(NUM_PLAYERS)); ++pn ) NoteDataUtil::CalculateRadarValues( vParts[pn], fMusicLengthSeconds, m_CachedRadarValues[pn] ); } else if (GAMEMAN->GetStepsTypeInfo(this->m_StepsType).m_StepsTypeCategory == StepsTypeCategory_Couple) @@ -661,7 +661,7 @@ RString Steps::GenerateChartKey(NoteData &nd, TimingData *td) { #pragma omp section { - for (std::size_t r = 0; r < nerv.size() / 2; r++) { + for (size_t r = 0; r < nerv.size() / 2; r++) { int row = nerv[r]; for (int t = 0; t < nd.GetNumTracks(); ++t) { const TapNote &tn = nd.GetTapNote(t, row); @@ -678,7 +678,7 @@ RString Steps::GenerateChartKey(NoteData &nd, TimingData *td) #pragma omp section { - for (std::size_t r = nerv.size() / 2; r < nerv.size(); r++) { + for (size_t r = nerv.size() / 2; r < nerv.size(); r++) { int row = nerv[r]; for (int t = 0; t < nd.GetNumTracks(); ++t) { const TapNote &tn = nd.GetTapNote(t, row); diff --git a/src/StepsUtil.cpp b/src/StepsUtil.cpp index 1d12a1f501..af1b76327c 100644 --- a/src/StepsUtil.cpp +++ b/src/StepsUtil.cpp @@ -85,7 +85,7 @@ void StepsUtil::GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, st { const std::vector &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() : pSong->GetStepsByStepsType( stc.m_st ) ); - const std::size_t previousSize = out.size(); + const size_t previousSize = out.size(); int successful = false; GetAllMatching( pSong, stc, out ); diff --git a/src/Texture Font Generator/Utils.cpp b/src/Texture Font Generator/Utils.cpp index f6751cc8fa..7919744542 100644 --- a/src/Texture Font Generator/Utils.cpp +++ b/src/Texture Font Generator/Utils.cpp @@ -111,7 +111,7 @@ void GetBounds( const Surface *pSurf, RECT *out ) static void File_png_write( png_struct *pPng, png_byte *pData, png_size_t iSize ) { FILE *f = (FILE *) png_get_io_ptr(pPng); - std::size_t iGot = fwrite( pData, (int) iSize, 1, f ); + size_t iGot = fwrite( pData, (int) iSize, 1, f ); if( iGot == 0 ) png_error( pPng, strerror(errno) ); } diff --git a/src/ThemeManager.cpp b/src/ThemeManager.cpp index 6dc229c12b..ccc35eb748 100644 --- a/src/ThemeManager.cpp +++ b/src/ThemeManager.cpp @@ -584,7 +584,7 @@ struct CompareLanguageTag { RString sLower( sFile ); sLower.MakeLower(); - std::size_t iPos = sLower.find( m_sLanguageString ); + size_t iPos = sLower.find( m_sLanguageString ); return iPos != RString::npos; } }; @@ -712,7 +712,7 @@ bool ThemeManager::GetPathInfoToRaw( PathInfo &out, const RString &sThemeName_, "'%s/%s/%s'. Please remove all but one of these matches: ", sThemeName.c_str(), sCategory.c_str(), MetricsGroupAndElementToFileName(sMetricsGroup,sElement).c_str() ); message+= asElementPaths[1]; - for(std::size_t i= 1; i < asElementPaths.size(); ++i) + for(size_t i= 1; i < asElementPaths.size(); ++i) { message+= ", " + asElementPaths[i]; } @@ -1451,7 +1451,7 @@ public: { lua_createtable(L, g_vThemes.size(), 0); int ret= lua_gettop(L); - for(std::size_t tid= 0; tid < g_vThemes.size(); ++tid) + for(size_t tid= 0; tid < g_vThemes.size(); ++tid) { lua_pushstring(L, g_vThemes[tid].sThemeName.c_str()); lua_rawseti(L, ret, tid+1); diff --git a/src/ThemeMetric.h b/src/ThemeMetric.h index 8b78b82e85..c1672b7193 100644 --- a/src/ThemeMetric.h +++ b/src/ThemeMetric.h @@ -182,7 +182,7 @@ public: bool operator == ( const T& input ) const { return GetValue() == input; } }; -typedef RString (*MetricName1D)(std::size_t N); +typedef RString (*MetricName1D)(size_t N); template class ThemeMetric1D : public IThemeMetric @@ -191,7 +191,7 @@ class ThemeMetric1D : public IThemeMetric std::vector m_metric; public: - ThemeMetric1D( const RString& sGroup, MetricName1D pfn, std::size_t N ) + ThemeMetric1D( const RString& sGroup, MetricName1D pfn, size_t N ) { Load( sGroup, pfn, N ); } @@ -199,7 +199,7 @@ public: { Load( RString(), nullptr, 0 ); } - void Load( const RString& sGroup, MetricName1D pfn, std::size_t N ) + void Load( const RString& sGroup, MetricName1D pfn, size_t N ) { m_metric.resize( N ); for( unsigned i=0; i class ThemeMetric2D : public IThemeMetric @@ -231,11 +231,11 @@ class ThemeMetric2D : public IThemeMetric std::vector m_metric; public: - ThemeMetric2D( const RString& sGroup = "", MetricName2D pfn = nullptr, std::size_t N = 0, std::size_t M = 0 ) + ThemeMetric2D( const RString& sGroup = "", MetricName2D pfn = nullptr, size_t N = 0, size_t M = 0 ) { Load( sGroup, pfn, N, M ); } - void Load( const RString& sGroup, MetricName2D pfn, std::size_t N, std::size_t M ) + void Load( const RString& sGroup, MetricName2D pfn, size_t N, size_t M ) { m_metric.resize( N ); for( unsigned i=0; i& stops= m_avpTimingSegments[SEGMENT_STOP]; const std::vector& delays= m_avpTimingSegments[SEGMENT_DELAY]; LOG->Trace("%s lookup table:", name.c_str()); - for(std::size_t lit= 0; lit < lookup.size(); ++lit) + for(size_t lit= 0; lit < lookup.size(); ++lit) { const lookup_item_t& item= lookup[lit]; const GetBeatStarts& starts= item.second; @@ -176,8 +176,8 @@ TimingData::beat_start_lookup_t::const_iterator FindEntryInLookup( { return lookup.end(); } - std::size_t lower= 0; - std::size_t upper= lookup.size()-1; + size_t lower= 0; + size_t upper= lookup.size()-1; if(lookup[lower].first > entry) { return lookup.end(); @@ -189,7 +189,7 @@ TimingData::beat_start_lookup_t::const_iterator FindEntryInLookup( } while(upper - lower > 1) { - std::size_t next= (upper + lower) / 2; + size_t next= (upper + lower) / 2; if(lookup[next].first > entry) { upper= next; @@ -233,7 +233,7 @@ void TimingData::CopyRange(int start_row, int end_row, if(seg_type == copy_type || copy_type == TimingSegmentType_Invalid) { const std::vector& segs= GetTimingSegments(seg_type); - for(std::size_t i= 0; i < segs.size(); ++i) + for(size_t i= 0; i < segs.size(); ++i) { if(segs[i]->GetRow() >= start_row && segs[i]->GetRow() <= end_row) { @@ -269,7 +269,7 @@ void TimingData::ShiftRange(int start_row, int end_row, // the rows of the segments, the second time removing segments that // have been run over by a segment being moved. Attempts to combine // both operations into a single loop were error prone. -Kyz - for(std::size_t i= first_affected; i <= static_cast(last_affected) && i < segs.size(); ++i) + for(size_t i= first_affected; i <= static_cast(last_affected) && i < segs.size(); ++i) { int seg_row= segs[i]->GetRow(); if(seg_row > 0 && seg_row >= start_row && seg_row <= end_row) @@ -278,7 +278,7 @@ void TimingData::ShiftRange(int start_row, int end_row, segs[i]->SetRow(dest_row); } } - for(std::size_t i= first_affected; i <= static_cast(last_affected) && i < segs.size(); ++i) + for(size_t i= first_affected; i <= static_cast(last_affected) && i < segs.size(); ++i) { bool erased= false; int seg_row= segs[i]->GetRow(); @@ -655,7 +655,7 @@ void TimingData::AddSegment( const TimingSegment *seg ) // and adding the new segment. // If the new segment is also redundant, erase the next segment because // that effectively moves it back to the prev segment. -Kyz - if(static_cast(index) < vSegs.size() - 1) + if(static_cast(index) < vSegs.size() - 1) { TimingSegment* next= vSegs[index + 1]; if((*seg) == (*next)) @@ -1310,7 +1310,7 @@ void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State lua_createtable(L, segs.size(), 0); if(tst == SEGMENT_LABEL) { - for(std::size_t i= 0; i < segs.size(); ++i) + for(size_t i= 0; i < segs.size(); ++i) { lua_createtable(L, 2, 0); lua_pushnumber(L, segs[i]->GetBeat()); @@ -1322,13 +1322,13 @@ void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State } else { - for(std::size_t i= 0; i < segs.size(); ++i) + for(size_t i= 0; i < segs.size(); ++i) { std::vector values= segs[i]->GetValues(); lua_createtable(L, values.size()+1, 0); lua_pushnumber(L, segs[i]->GetBeat()); lua_rawseti(L, -2, 1); - for(std::size_t v= 0; v < values.size(); ++v) + for(size_t v= 0; v < values.size(); ++v) { lua_pushnumber(L, values[v]); lua_rawseti(L, -2, v+2); diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index d7cb6eb2f4..bdac9814f8 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -714,7 +714,7 @@ namespace lua_pop( L, 1 ); // Recursively process tables. - for( std::size_t i = 0; i < NodesToAdd.size(); ++i ) + for( size_t i = 0; i < NodesToAdd.size(); ++i ) { const RString &sNodeName = NodeNamesToAdd[i]; LuaReference &NodeToAdd = NodesToAdd[i]; diff --git a/src/XmlToLua.cpp b/src/XmlToLua.cpp index 25aaeced07..b7668e7da1 100644 --- a/src/XmlToLua.cpp +++ b/src/XmlToLua.cpp @@ -81,9 +81,9 @@ RString maybe_conv_pos(RString pos, RString (*conv_func)(float p)) return pos; } -std::size_t after_slash_or_zero(RString const& s) +size_t after_slash_or_zero(RString const& s) { - std::size_t ret= s.rfind('/'); + size_t ret= s.rfind('/'); if(ret != std::string::npos) { return ret+1; @@ -94,13 +94,13 @@ std::size_t after_slash_or_zero(RString const& s) RString add_extension_to_relative_path_from_found_file( RString const& relative_path, RString const& found_file) { - std::size_t rel_last_slash= after_slash_or_zero(relative_path); - std::size_t found_last_slash= after_slash_or_zero(found_file); + size_t rel_last_slash= after_slash_or_zero(relative_path); + size_t found_last_slash= after_slash_or_zero(found_file); return relative_path.Left(rel_last_slash) + found_file.substr(found_last_slash, std::string::npos); } -bool verify_arg_count(RString cmd, std::vector& args, std::size_t req) +bool verify_arg_count(RString cmd, std::vector& args, size_t req) { if(args.size() < req) { @@ -113,7 +113,7 @@ bool verify_arg_count(RString cmd, std::vector& args, std::size_t req) typedef void (*arg_converter_t)(std::vector& args); std::map arg_converters; -std::map tween_counters; +std::map tween_counters; std::set fields_that_are_strings; std::map chunks_to_replace; @@ -162,7 +162,7 @@ void diffuse_conv(std::vector& args) { COMMON_ARG_VERIFY(2); RString retarg; - for(std::size_t i= 1; i < args.size(); ++i) + for(size_t i= 1; i < args.size(); ++i) { retarg+= args[i]; if(i < args.size()-1) @@ -308,7 +308,7 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm } std::vector cmds; split(full_cmd, ";", cmds, true); - std::size_t queue_size= 0; + size_t queue_size= 0; // If someone has a simfile that uses a playcommand that pushes tween // states onto the queue, queue size counting will have to be made much // more complex to prevent that from causing an overflow. @@ -320,8 +320,8 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm { for(std::vector::iterator arg= args.begin(); arg != args.end(); ++arg) { - std::size_t first_nonspace= 0; - std::size_t last_nonspace= arg->size(); + size_t first_nonspace= 0; + size_t last_nonspace= arg->size(); while((*arg)[first_nonspace] == ' ') { ++first_nonspace; @@ -337,7 +337,7 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm { conv->second(args); } - std::map::iterator counter= tween_counters.find(args[0]); + std::map::iterator counter= tween_counters.find(args[0]); if(counter != tween_counters.end()) { queue_size+= counter->second; @@ -350,9 +350,9 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm // foreground loading that ran InitCommand twice. -Kyz if(queue_size >= TWEEN_QUEUE_MAX) { - std::size_t num_to_make= (queue_size / TWEEN_QUEUE_MAX) + 1; - std::size_t states_per= (queue_size / num_to_make) + 1; - std::size_t states_in_curr= 0; + size_t num_to_make= (queue_size / TWEEN_QUEUE_MAX) + 1; + size_t states_per= (queue_size / num_to_make) + 1; + size_t states_in_curr= 0; RString this_name= cmd_name; std::vector curr_cmd; for(std::vector::iterator cmd= cmds.begin(); cmd != cmds.end(); ++cmd) @@ -362,7 +362,7 @@ void actor_template_t::store_cmd(RString const& cmd_name, RString const& full_cm split(*cmd, ",", args, true); if(!args.empty()) { - std::map::iterator counter= tween_counters.find(args[0]); + std::map::iterator counter= tween_counters.find(args[0]); if(counter != tween_counters.end()) { states_in_curr+= counter->second; diff --git a/src/arch/ArchHooks/ArchHooks_MacOSX.mm b/src/arch/ArchHooks/ArchHooks_MacOSX.mm index e9a8b0fda2..220d45e287 100644 --- a/src/arch/ArchHooks/ArchHooks_MacOSX.mm +++ b/src/arch/ArchHooks/ArchHooks_MacOSX.mm @@ -155,7 +155,7 @@ void ArchHooks_MacOSX::DumpDebugInfo() SystemVersion = ssprintf("macOS %s", [productVersion cStringUsingEncoding:[NSString defaultCStringEncoding]]); } - std::size_t size; + size_t size; #define GET_PARAM( name, var ) (size = sizeof(var), sysctlbyname(name, &var, &size, nil, 0) ) // Get memory float fRam; diff --git a/src/arch/InputHandler/InputHandler_SextetStream.cpp b/src/arch/InputHandler/InputHandler_SextetStream.cpp index d60225f61c..ee3f431b47 100644 --- a/src/arch/InputHandler/InputHandler_SextetStream.cpp +++ b/src/arch/InputHandler/InputHandler_SextetStream.cpp @@ -37,7 +37,7 @@ namespace private: // The buffer size isn't critical; the RString will simply be // extended until the line is done. - static const std::size_t BUFFER_SIZE = 64; + static const size_t BUFFER_SIZE = 64; char buffer[BUFFER_SIZE]; std::FILE * file; int timeout_ms; @@ -100,7 +100,7 @@ namespace bool ReadLine(RString& line) { bool afterFirst = false; - std::size_t len; + size_t len; line = ""; @@ -133,7 +133,7 @@ class InputHandler_SextetStream::Impl } std::uint8_t stateBuffer[STATE_BUFFER_SIZE]; - std::size_t timeout_ms; + size_t timeout_ms; RageThread inputThread; bool continueInputThread; @@ -194,8 +194,8 @@ class InputHandler_SextetStream::Impl inline void GetNewState(std::uint8_t * buffer, RString& line) { - std::size_t lineLen = line.length(); - std::size_t i, cursor; + size_t lineLen = line.length(); + size_t i, cursor; cursor = 0; memset(buffer, 0, STATE_BUFFER_SIZE); @@ -215,7 +215,7 @@ class InputHandler_SextetStream::Impl } } - inline DeviceButton ButtonAtIndex(std::size_t index) + inline DeviceButton ButtonAtIndex(size_t index) { if(index < COUNT_JOY_BUTTON) { return enum_add2(FIRST_JOY_BUTTON, index); @@ -235,14 +235,14 @@ class InputHandler_SextetStream::Impl RageTimer now; // XOR to find differences - for(std::size_t i = 0; i < STATE_BUFFER_SIZE; ++i) { + for(size_t i = 0; i < STATE_BUFFER_SIZE; ++i) { changes[i] = stateBuffer[i] ^ newStateBuffer[i]; } // Report on changes - for(std::size_t m = 0; m < STATE_BUFFER_SIZE; ++m) { - for(std::size_t n = 0; n < 6; ++n) { - std::size_t bi = (m * 6) + n; + for(size_t m = 0; m < STATE_BUFFER_SIZE; ++m) { + for(size_t n = 0; n < 6; ++n) { + size_t bi = (m * 6) + n; if(bi < BUTTON_COUNT) { if(changes[m] & (1 << n)) { bool value = newStateBuffer[m] & (1 << n); diff --git a/src/arch/Lights/LightsDriver_LinuxWeedTech.cpp b/src/arch/Lights/LightsDriver_LinuxWeedTech.cpp index 702a3417e5..dfcc887440 100644 --- a/src/arch/Lights/LightsDriver_LinuxWeedTech.cpp +++ b/src/arch/Lights/LightsDriver_LinuxWeedTech.cpp @@ -29,7 +29,7 @@ static inline void SerialClose() fd = -1; } -static inline void SerialOut( const char *str, std::size_t len ) +static inline void SerialOut( const char *str, size_t len ) { if( fd ==-1 ) return; diff --git a/src/arch/Lights/SextetUtils.h b/src/arch/Lights/SextetUtils.h index 0b3ca1e84d..cfe49909e2 100644 --- a/src/arch/Lights/SextetUtils.h +++ b/src/arch/Lights/SextetUtils.h @@ -12,11 +12,11 @@ */ // Number of printable characters used to encode lights -static const std::size_t CABINET_SEXTET_COUNT = 1; -static const std::size_t CONTROLLER_SEXTET_COUNT = 6; +static const size_t CABINET_SEXTET_COUNT = 1; +static const size_t CONTROLLER_SEXTET_COUNT = 6; // Number of bytes to contain the full pack and a trailing LF -static const std::size_t FULL_SEXTET_COUNT = CABINET_SEXTET_COUNT + (NUM_GameController * CONTROLLER_SEXTET_COUNT) + 1; +static const size_t FULL_SEXTET_COUNT = CABINET_SEXTET_COUNT + (NUM_GameController * CONTROLLER_SEXTET_COUNT) + 1; // Serialization routines @@ -60,7 +60,7 @@ inline std::uint8_t packPrintableSextet(bool b0, bool b1, bool b2, bool b3, bool } // Packs the cabinet lights into a printable sextet and adds it to a buffer -inline std::size_t packCabinetLights(const LightsState* ls, std::uint8_t* buffer) +inline size_t packCabinetLights(const LightsState* ls, std::uint8_t* buffer) { buffer[0] = packPrintableSextet( ls->m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT], @@ -74,7 +74,7 @@ inline std::size_t packCabinetLights(const LightsState* ls, std::uint8_t* buffer // Packs the button lights for a controller into 6 printable sextets and // adds them to a buffer -inline std::size_t packControllerLights(const LightsState* ls, GameController gc, std::uint8_t* buffer) +inline size_t packControllerLights(const LightsState* ls, GameController gc, std::uint8_t* buffer) { // Menu buttons buffer[0] = packPrintableSextet( @@ -127,9 +127,9 @@ inline std::size_t packControllerLights(const LightsState* ls, GameController gc return CONTROLLER_SEXTET_COUNT; } -inline std::size_t packLine(std::uint8_t* buffer, const LightsState* ls) +inline size_t packLine(std::uint8_t* buffer, const LightsState* ls) { - std::size_t index = 0; + size_t index = 0; index += packCabinetLights(ls, &(buffer[index])); diff --git a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm index b84be8e743..425cf1a95f 100644 --- a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm +++ b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm @@ -510,11 +510,11 @@ int LowLevelWindow_MacOSX::ChangeDisplayMode( const VideoModeParams& p ) } // http://lukassen.wordpress.com/2010/01/18/taming-snow-leopard-cgdisplaybitsperpixel-deprication/ -static std::size_t GetDisplayBitsPerPixel( CGDirectDisplayID displayId ) +static size_t GetDisplayBitsPerPixel( CGDirectDisplayID displayId ) { CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displayId); - std::size_t depth = 0; + size_t depth = 0; CFStringRef pixEnc = CGDisplayModeCopyPixelEncoding(mode); if(CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index e3c3728124..3db3e5b7f8 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -239,7 +239,7 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( std::vectorsOsMountDir ); memset( &pb, 0, sizeof(pb) ); - name[0] = std::min( base.length(), std::size_t(255) ); + name[0] = std::min( base.length(), size_t(255) ); strncpy( (char *)&name[1], base, name[0] ); pb.volumeParam.ioNamePtr = name; pb.volumeParam.ioVolIndex = -1; // Use ioNamePtr to find the volume. @@ -127,7 +127,7 @@ static RString GetStringProperty( io_registry_entry_t entry, CFStringRef key ) CFStringRef s = CFStringRef( t ); RString ret; - const std::size_t len = CFStringGetMaximumSizeForEncoding( CFStringGetLength(s), kCFStringEncodingUTF8 ); + const size_t len = CFStringGetMaximumSizeForEncoding( CFStringGetLength(s), kCFStringEncodingUTF8 ); char *buf = new char[len + 1]; if( CFStringGetCString( s, buf, len + 1, kCFStringEncodingUTF8 ) ) diff --git a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp index bbeb588725..91073d3312 100644 --- a/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp +++ b/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp @@ -158,7 +158,7 @@ void MemoryCardDriverThreaded_Windows::GetUSBStorageDevices( std::vector -FUNC(std::size_t, snd_pcm_hw_params_sizeof, (void)); -FUNC(std::size_t, snd_pcm_sw_params_sizeof, (void)); -FUNC(std::size_t, snd_pcm_info_sizeof, (void)); -FUNC(std::size_t, snd_ctl_card_info_sizeof, (void)); +FUNC(size_t, snd_pcm_hw_params_sizeof, (void)); +FUNC(size_t, snd_pcm_sw_params_sizeof, (void)); +FUNC(size_t, snd_pcm_info_sizeof, (void)); +FUNC(size_t, snd_ctl_card_info_sizeof, (void)); FUNC(int, snd_ctl_card_info, (snd_ctl_t *ctl, snd_ctl_card_info_t *info)); FUNC(int, snd_card_next, (int *card)); FUNC(const char *, snd_ctl_card_info_get_id, (const snd_ctl_card_info_t *obj)); @@ -14,7 +14,7 @@ FUNC(int, snd_ctl_close, (snd_ctl_t *ctl)); FUNC(int, snd_ctl_open, (snd_ctl_t **ctl, const char *name, int mode)); FUNC(int, snd_lib_error_set_handler, (snd_lib_error_handler_t handler)); FUNC(int, snd_output_buffer_open, (snd_output_t **outputp)); -FUNC(std::size_t, snd_output_buffer_string, (snd_output_t *output, char **buf)); +FUNC(size_t, snd_output_buffer_string, (snd_output_t *output, char **buf)); FUNC(int, snd_output_close, (snd_output_t *output)); FUNC(int, snd_output_flush, (snd_output_t *output)); FUNC(snd_pcm_sframes_t, snd_pcm_avail_update, (snd_pcm_t *pcm)); @@ -34,7 +34,7 @@ FUNC(int, snd_pcm_hw_params_set_buffer_size_near, (snd_pcm_t *pcm, snd_pcm_hw_pa FUNC(int, snd_pcm_hw_params_set_period_size_near, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)); FUNC(int, snd_pcm_status, (snd_pcm_t *pcm, snd_pcm_status_t *status)); FUNC(snd_pcm_uframes_t, snd_pcm_status_get_avail, (const snd_pcm_status_t *obj)); -FUNC(std::size_t, snd_pcm_status_sizeof, (void)); +FUNC(size_t, snd_pcm_status_sizeof, (void)); FUNC(int, snd_pcm_hwsync, (snd_pcm_t *pcm)); FUNC(int, snd_ctl_pcm_next_device, (snd_ctl_t *ctl, int *device)); FUNC(int, snd_ctl_pcm_info, (snd_ctl_t *ctl, snd_pcm_info_t * info)); diff --git a/src/arch/Sound/RageSoundDriver.cpp b/src/arch/Sound/RageSoundDriver.cpp index 5100e1c4fe..0e68355980 100644 --- a/src/arch/Sound/RageSoundDriver.cpp +++ b/src/arch/Sound/RageSoundDriver.cpp @@ -35,8 +35,8 @@ RageSoundDriver *RageSoundDriver::Create( const RString& drivers ) } else { - std::size_t start = 0; - std::size_t end = drivers.find(','); + size_t start = 0; + size_t end = drivers.find(','); while (end != RString::npos) { @@ -47,7 +47,7 @@ RageSoundDriver *RageSoundDriver::Create( const RString& drivers ) driversToTry.emplace_back(drivers.substr(start)); - std::size_t to_try = 0; + size_t to_try = 0; while (to_try < driversToTry.size()) { diff --git a/src/arch/Sound/RageSoundDriver_PulseAudio.cpp b/src/arch/Sound/RageSoundDriver_PulseAudio.cpp index 60d9a41c73..c62214d3b7 100644 --- a/src/arch/Sound/RageSoundDriver_PulseAudio.cpp +++ b/src/arch/Sound/RageSoundDriver_PulseAudio.cpp @@ -328,23 +328,23 @@ std::int64_t RageSoundDriver_PulseAudio::GetPositionUnlocked() const RageException::Throw("Pulse: pa_stream_get_time() failed: %s", pa_strerror(paErrno)); } - std::size_t length = pa_usec_to_bytes(usec, &m_ss); + size_t length = pa_usec_to_bytes(usec, &m_ss); return length / (sizeof(std::int16_t) * 2); /* we use 16-bit frames and 2 channels */ } -void RageSoundDriver_PulseAudio::StreamWriteCb(pa_stream *s, std::size_t length) +void RageSoundDriver_PulseAudio::StreamWriteCb(pa_stream *s, size_t length) { std::int64_t curPos = GetPositionUnlocked(); while(length > 0) { void* buf; - std::size_t bufsize = length; + size_t bufsize = length; if(pa_stream_begin_write(m_PulseStream, &buf, &bufsize) < 0) { RageException::Throw("Pulse: pa_stream_begin_write() failed: %s", pa_strerror(pa_context_errno(m_PulseCtx))); } - const std::size_t nbframes = bufsize / sizeof(std::int16_t); /* we use 16-bit frames */ + const size_t nbframes = bufsize / sizeof(std::int16_t); /* we use 16-bit frames */ std::int64_t pos1 = m_LastPosition; std::int64_t pos2 = pos1 + nbframes/2; /* Mix() position in stereo frames */ this->Mix( reinterpret_cast(buf), pos2-pos1, pos1, curPos); @@ -371,7 +371,7 @@ void RageSoundDriver_PulseAudio::StaticStreamStateCb(pa_stream *s, void *user) RageSoundDriver_PulseAudio *obj = (RageSoundDriver_PulseAudio*)user; obj->StreamStateCb(s); } -void RageSoundDriver_PulseAudio::StaticStreamWriteCb(pa_stream *s, std::size_t length, void *user) +void RageSoundDriver_PulseAudio::StaticStreamWriteCb(pa_stream *s, size_t length, void *user) { RageSoundDriver_PulseAudio *obj = (RageSoundDriver_PulseAudio*)user; obj->StreamWriteCb(s, length); diff --git a/src/arch/Sound/RageSoundDriver_PulseAudio.h b/src/arch/Sound/RageSoundDriver_PulseAudio.h index d21e82b832..4bfb2dff38 100644 --- a/src/arch/Sound/RageSoundDriver_PulseAudio.h +++ b/src/arch/Sound/RageSoundDriver_PulseAudio.h @@ -38,11 +38,11 @@ protected: public: void CtxStateCb(pa_context *c); void StreamStateCb(pa_stream *s); - void StreamWriteCb(pa_stream *s, std::size_t length); + void StreamWriteCb(pa_stream *s, size_t length); static void StaticCtxStateCb(pa_context *c, void *user); static void StaticStreamStateCb(pa_stream *s, void *user); - static void StaticStreamWriteCb(pa_stream *s, std::size_t length, void *user); + static void StaticStreamWriteCb(pa_stream *s, size_t length, void *user); }; #endif /* RAGE_SOUND_PULSEAUDIO_H */ diff --git a/src/arch/Sound/RageSoundDriver_WDMKS.cpp b/src/arch/Sound/RageSoundDriver_WDMKS.cpp index 784e62288c..e6741bd91f 100644 --- a/src/arch/Sound/RageSoundDriver_WDMKS.cpp +++ b/src/arch/Sound/RageSoundDriver_WDMKS.cpp @@ -503,7 +503,7 @@ bool WinWdmPin::IsFormatSupported( const WAVEFORMATEX *pFormat ) const if( pFormat->wFormatTag == WAVE_FORMAT_EXTENSIBLE ) guid = ((WAVEFORMATEXTENSIBLE*) pFormat)->SubFormat; - for( std::size_t i = 0; i < m_dataRangesItem.size(); i++ ) + for( size_t i = 0; i < m_dataRangesItem.size(); i++ ) { const KSDATARANGE_AUDIO *pDataRangeAudio = &m_dataRangesItem[i]; /* This is an audio or wildcard datarange... */ @@ -1270,7 +1270,7 @@ RString RageSoundDriver_WDMKS::Init() if( apFilters.empty() ) return "No supported audio devices found"; - for( std::size_t i = 0; i < apFilters.size(); ++i ) + for( size_t i = 0; i < apFilters.size(); ++i ) { const WinWdmFilter *pFilter = apFilters[i]; LOG->Trace( "Device #%i: %s", i, pFilter->m_sFriendlyName.c_str() ); @@ -1302,7 +1302,7 @@ RString RageSoundDriver_WDMKS::Init() } m_pFilter = apFilters[0]; - for( std::size_t i=0; i < apFilters.size(); ++i ) + for( size_t i=0; i < apFilters.size(); ++i ) { if( apFilters[i] != m_pFilter ) delete apFilters[i]; diff --git a/src/arch/Threads/Threads_Pthreads.cpp b/src/arch/Threads/Threads_Pthreads.cpp index c8c54cd7ea..c182338687 100644 --- a/src/arch/Threads/Threads_Pthreads.cpp +++ b/src/arch/Threads/Threads_Pthreads.cpp @@ -97,7 +97,7 @@ ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, std::uint64_t *p // Copy the thread name. const char *rawname = RageThread::GetThreadNameByID( *piThreadID ); - const std::size_t maxNameLen = sizeof( thread->name ); + const size_t maxNameLen = sizeof( thread->name ); if (strlen(rawname) < maxNameLen) { // If it fits, I sits^H^H^H^Hcopy. strncpy( thread->name, rawname, maxNameLen ); diff --git a/src/archutils/Darwin/Crash.mm b/src/archutils/Darwin/Crash.mm index 3347a9d1f0..6ddf09df61 100644 --- a/src/archutils/Darwin/Crash.mm +++ b/src/archutils/Darwin/Crash.mm @@ -79,7 +79,7 @@ bool CrashHandler::IsDebuggerPresent() int ret; int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; struct kinfo_proc info; - std::size_t size; + size_t size; // Initialize the flags so that, if sysctl fails for some bizarre // reason, we get a predictable result. diff --git a/src/archutils/Darwin/HIDDevice.h b/src/archutils/Darwin/HIDDevice.h index 2b2cb27334..423a26c1b2 100644 --- a/src/archutils/Darwin/HIDDevice.h +++ b/src/archutils/Darwin/HIDDevice.h @@ -52,7 +52,7 @@ namespace __gnu_cxx template<> struct hash : private hash { - std::size_t operator()( const IOHIDElementCookie& cookie ) const + size_t operator()( const IOHIDElementCookie& cookie ) const { return hash::operator()( std::uintptr_t(cookie) ); } diff --git a/src/archutils/Darwin/KeyboardDevice.cpp b/src/archutils/Darwin/KeyboardDevice.cpp index d3e877dcc4..0697049300 100644 --- a/src/archutils/Darwin/KeyboardDevice.cpp +++ b/src/archutils/Darwin/KeyboardDevice.cpp @@ -481,7 +481,7 @@ bool KeyboardDevice::DeviceButtonToMacVirtualKey( DeviceButton button, UInt8 &iM for( int iUsbKey = 0; iUsbKey < 256; ++iUsbKey ) { DeviceButton button2; - if( UsbKeyToDeviceButton(iUsbKey, button2) && std::size_t(button2) < sizeof(g_iDeviceButtonToMacVirtualKey) ) + if( UsbKeyToDeviceButton(iUsbKey, button2) && size_t(button2) < sizeof(g_iDeviceButtonToMacVirtualKey) ) g_iDeviceButtonToMacVirtualKey[button2] = g_iUsbKeyToMacVirtualKey[iUsbKey]; } bInited = true; diff --git a/src/archutils/Unix/Backtrace.cpp b/src/archutils/Unix/Backtrace.cpp index 01a5b9c2d2..851f044bc1 100644 --- a/src/archutils/Unix/Backtrace.cpp +++ b/src/archutils/Unix/Backtrace.cpp @@ -310,7 +310,7 @@ bool IsValidFrame( const StackFrame *frame ) /* This x86 backtracer attempts to walk the stack frames. If we come to a * place that doesn't look like a valid frame, we'll look forward and try * to find one again. */ -static void do_backtrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +static void do_backtrace( const void **buf, size_t size, const BacktraceContext *ctx ) { /* Read /proc/pid/maps to find the address range of the stack. */ get_readable_ranges( g_ReadableBegin, g_ReadableEnd, 1024 ); @@ -410,7 +410,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc ) #error #endif -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) { InitializeBacktrace(); @@ -543,7 +543,7 @@ static bool PointsToValidCall( vm_address_t start, const void *ptr ) } -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) { InitializeBacktrace(); @@ -569,7 +569,7 @@ void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *c vm_prot_t protection = 0; vm_address_t start = 0; - std::size_t i = 0; + size_t i = 0; if( i < size-1 && ctx->ip ) buf[i++] = ctx->ip; @@ -668,7 +668,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc ) void InitializeBacktrace() { } -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) { BacktraceContext CurrentCtx; if( ctx == nullptr ) @@ -716,7 +716,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc ) void InitializeBacktrace() { } -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) { BacktraceContext CurrentCtx; @@ -753,7 +753,7 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc ) // NYI } -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx ) +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx ) { buf[0] = BACKTRACE_METHOD_NOT_AVAILABLE; buf[1] = nullptr; diff --git a/src/archutils/Unix/Backtrace.h b/src/archutils/Unix/Backtrace.h index 42853dc339..192a16331b 100644 --- a/src/archutils/Unix/Backtrace.h +++ b/src/archutils/Unix/Backtrace.h @@ -37,7 +37,7 @@ void InitializeBacktrace(); * null-terminated. If ctx is nullptr, retrieve the current backtrace; otherwise * retrieve a backtrace for the given context. (Not all backtracers may * support contexts.) */ -void GetBacktrace( const void **buf, std::size_t size, const BacktraceContext *ctx = nullptr ); +void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx = nullptr ); /* Set up a BacktraceContext to get a backtrace for a thread. ThreadID may * not be the current thread. True is returned on success, false on failure. */ diff --git a/src/archutils/Unix/BacktraceNames.cpp b/src/archutils/Unix/BacktraceNames.cpp index 5ef61b2ba5..f3de602f75 100644 --- a/src/archutils/Unix/BacktraceNames.cpp +++ b/src/archutils/Unix/BacktraceNames.cpp @@ -81,7 +81,7 @@ RString BacktraceNames::Format() const if( ShortenedPath != "" ) { /* Abbreviate the module name. */ - std::size_t slash = ShortenedPath.rfind('/'); + size_t slash = ShortenedPath.rfind('/'); if( slash != ShortenedPath.npos ) ShortenedPath = ShortenedPath.substr(slash+1); ShortenedPath = RString("(") + ShortenedPath + ")"; @@ -326,7 +326,7 @@ void BacktraceNames::FromString( RString s ) if( MangledAndOffset != "" ) { - std::size_t plus = MangledAndOffset.rfind('+'); + size_t plus = MangledAndOffset.rfind('+'); if(plus == MangledAndOffset.npos) { diff --git a/src/archutils/Unix/CrashHandler.cpp b/src/archutils/Unix/CrashHandler.cpp index 052a515837..b0fc6b70a8 100644 --- a/src/archutils/Unix/CrashHandler.cpp +++ b/src/archutils/Unix/CrashHandler.cpp @@ -40,7 +40,7 @@ static void safe_print( int fd, ... ) { break; } - std::size_t len = strlen( p ); + size_t len = strlen( p ); while( len ) { ssize_t result = write( fd, p, strlen(p) ); @@ -102,7 +102,7 @@ static void spawn_child_process( int from_parent ) } /* write(), but retry a couple times on EINTR. */ -static int retried_write( int fd, const void *buf, std::size_t count ) +static int retried_write( int fd, const void *buf, size_t count ) { int tries = 3, ret; do @@ -114,7 +114,7 @@ static int retried_write( int fd, const void *buf, std::size_t count ) return ret; } -static bool parent_write( int to_child, const void *p, std::size_t size ) +static bool parent_write( int to_child, const void *p, size_t size ) { int ret = retried_write( to_child, p, size ); if( ret == -1 ) @@ -123,7 +123,7 @@ static bool parent_write( int to_child, const void *p, std::size_t size ) return false; } - if( std::size_t(ret) != size ) + if( size_t(ret) != size ) { safe_print( fileno(stderr), "Unexpected write() result (", itoa(ret), ")\n", nullptr ); return false; diff --git a/src/archutils/Win32/Crash.cpp b/src/archutils/Win32/Crash.cpp index 16a632530b..610b2c75df 100644 --- a/src/archutils/Win32/Crash.cpp +++ b/src/archutils/Win32/Crash.cpp @@ -82,7 +82,7 @@ void CrashHandler::SetForegroundWindow( HWND hWnd ) g_hForegroundWnd = hWnd; } -void WriteToChild( HANDLE hPipe, const void *pData, std::size_t iSize ) +void WriteToChild( HANDLE hPipe, const void *pData, size_t iSize ) { while( iSize ) { @@ -472,7 +472,7 @@ static bool PointsToValidCall( ULONG_PTR ptr ) return IsValidCall(buf+7, len); } -void CrashHandler::do_backtrace( const void **buf, std::size_t size, +void CrashHandler::do_backtrace( const void **buf, size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext ) { const void **pLast = buf + size - 1; diff --git a/src/archutils/Win32/Crash.h b/src/archutils/Win32/Crash.h index f0553512ae..8a0b8d847c 100644 --- a/src/archutils/Win32/Crash.h +++ b/src/archutils/Win32/Crash.h @@ -10,7 +10,7 @@ namespace CrashHandler { extern long __stdcall ExceptionHandler(struct _EXCEPTION_POINTERS *ExceptionInfo); - void do_backtrace( const void **buf, std::size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext ); + void do_backtrace( const void **buf, size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext ); void SymLookup( const void *ptr, char *buf ); void ForceCrash( const char *reason ); void ForceDeadlock( RString reason, std::uint64_t iID ); diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index 822368aa81..9fde6451f1 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -107,10 +107,10 @@ namespace VDDebugInfo src += 64; const int* pVer = reinterpret_cast(src); - const std::size_t* pRVASize = reinterpret_cast(src + sizeof(int)); - const std::size_t* pFNamSize = reinterpret_cast(src + sizeof(int) + sizeof(std::size_t)); - const int* pSegCnt = reinterpret_cast(src + sizeof(int) + 2 * sizeof(std::size_t)); - src += 2 * (sizeof(int) + sizeof(std::size_t)); + const size_t* pRVASize = reinterpret_cast(src + sizeof(int)); + const size_t* pFNamSize = reinterpret_cast(src + sizeof(int) + sizeof(size_t)); + const int* pSegCnt = reinterpret_cast(src + sizeof(int) + 2 * sizeof(size_t)); + src += 2 * (sizeof(int) + sizeof(size_t)); pctx->nBuildNumber = *pVer; pctx->pRVAHeap = reinterpret_cast(src + sizeof(std::uintptr_t)); @@ -150,7 +150,7 @@ namespace VDDebugInfo if( dwFileSize == INVALID_FILE_SIZE ) break; - char *buffer = new char[static_cast(dwFileSize) + 1]; + char *buffer = new char[static_cast(dwFileSize) + 1]; std::fill(buffer, buffer + dwFileSize + 1, '\0' ); DWORD dwActual; @@ -181,7 +181,7 @@ namespace VDDebugInfo return false; } - static const char *GetNameFromHeap(const char *heap, std::size_t idx) + static const char *GetNameFromHeap(const char *heap, size_t idx) { while(idx--) while(*heap++); @@ -196,7 +196,7 @@ namespace VDDebugInfo const unsigned char *pr = pctx->pRVAHeap; const unsigned char *pr_limit = (const unsigned char *)pctx->pFuncNameHeap; - std::size_t idx = 0; + size_t idx = 0; // Linearly unpack RVA deltas and find lower_bound rva -= pctx->nFirstRVA; @@ -344,7 +344,7 @@ namespace SymbolLookup return "???"; } RString sName; - char *buffer = new char[static_cast(iSize) + 1]; + char *buffer = new char[static_cast(iSize) + 1]; std::fill(buffer, buffer + iSize + 1, '\0'); if (!ReadFromParent(iFD, buffer, iSize)) { @@ -491,7 +491,7 @@ static void MakeCrashReport( const CompleteCrashData &Data, RString &sOut ) sOut += ssprintf( "\n" ); sOut += ssprintf( "Partial log:\n" ); - for( std::size_t i = 0; i < Data.m_asRecent.size(); ++i ) + for( size_t i = 0; i < Data.m_asRecent.size(); ++i ) sOut += ssprintf( "%s\n", Data.m_asRecent[i].c_str() ); sOut += ssprintf( "\n" ); @@ -531,7 +531,7 @@ bool ReadCrashDataFromParent( int iFD, CompleteCrashData &Data ) if( !ReadFromParent(iFD, &iSize, sizeof(iSize)) ) return false; - char *buffer = new char[static_cast(iSize) + 1]; + char *buffer = new char[static_cast(iSize) + 1]; std::fill(buffer, buffer + iSize + 1, '\0'); bool wasReadSuccessful = ReadFromParent(iFD, buffer, iSize); RString tmp = buffer; diff --git a/src/archutils/Win32/CrashHandlerNetworking.cpp b/src/archutils/Win32/CrashHandlerNetworking.cpp index fa84744ab0..19da95e015 100644 --- a/src/archutils/Win32/CrashHandlerNetworking.cpp +++ b/src/archutils/Win32/CrashHandlerNetworking.cpp @@ -73,14 +73,14 @@ public: /* Read data. Block until any data is received, then return all data * available. Return the number of bytes read. The return value will always * be >= 0, unless an error or cancellation occured. */ - virtual int Read( void *pBuffer, std::size_t iSize ) = 0; + virtual int Read( void *pBuffer, size_t iSize ) = 0; /* Write data to the socket. (Design note: we always write all of the data * unless an error or cancellation occurs, and those states are checked * with GetState(). If that happens, the number of bytes written is * meaningless, since it may have simply been buffered and never sent. * So, this function returns no value.) */ - virtual void Write( const void *pBuffer, std::size_t iSize ) = 0; + virtual void Write( const void *pBuffer, size_t iSize ) = 0; /* Cancel the connection. This operation can clear an error state, aborts * any blocking calls, never fails, and will always result in the socket @@ -128,8 +128,8 @@ public: void Open( const RString &sHost, int iPort, ConnectionType ct = CONN_TCP ); void Shutdown(); void Close(); - int Read( void *pBuffer, std::size_t iSize ); - void Write( const void *pBuffer, std::size_t iSize ); + int Read( void *pBuffer, size_t iSize ); + void Write( const void *pBuffer, size_t iSize ); void Cancel(); @@ -492,7 +492,7 @@ void NetworkStream_Win32::Cancel() m_Mutex.Unlock(); } -int NetworkStream_Win32::Read( void *pBuffer, std::size_t iSize ) +int NetworkStream_Win32::Read( void *pBuffer, size_t iSize ) { if( m_State != STATE_CONNECTED ) return 0; @@ -541,7 +541,7 @@ int NetworkStream_Win32::Read( void *pBuffer, std::size_t iSize ) return iRead; } -void NetworkStream_Win32::Write( const void *pBuffer, std::size_t iSize ) +void NetworkStream_Win32::Write( const void *pBuffer, size_t iSize ) { if( m_State != STATE_CONNECTED ) return; diff --git a/src/archutils/Win32/RegistryAccess.cpp b/src/archutils/Win32/RegistryAccess.cpp index cf00ffb0a3..23c461ea5b 100644 --- a/src/archutils/Win32/RegistryAccess.cpp +++ b/src/archutils/Win32/RegistryAccess.cpp @@ -13,7 +13,7 @@ * the HKEY_LOCAL_MACHINE constant in key. */ static bool GetRegKeyType( const RString &sIn, RString &sOut, HKEY &key ) { - std::size_t iBackslash = sIn.find( '\\' ); + size_t iBackslash = sIn.find( '\\' ); if( iBackslash == sIn.npos ) { LOG->Warn( "Invalid registry key: \"%s\" ", sIn.c_str() ); diff --git a/src/archutils/Win32/mapconv.cpp b/src/archutils/Win32/mapconv.cpp index 3bb5347780..f0967aaa16 100644 --- a/src/archutils/Win32/mapconv.cpp +++ b/src/archutils/Win32/mapconv.cpp @@ -224,7 +224,7 @@ int main(int argc, char **argv) { // printf("Processing RVA entries...\n"); - for (std::size_t i = 0; i < rvabuf.size(); ++i) { + for (size_t i = 0; i < rvabuf.size(); ++i) { std::uint16_t grp; std::uint32_t start; std::uintptr_t rva; @@ -240,7 +240,7 @@ int main(int argc, char **argv) { // printf("Processing segment entries...\n"); - for (std::size_t i = 0; i < segcnt; i++) { + for (size_t i = 0; i < segcnt; i++) { segbuf[i][0] += grpstart[seggrp[i]]; // printf("\t#%-2zu %p-%p\n", i + 1, reinterpret_cast(segbuf[i][0]), reinterpret_cast(segbuf[i][0] + segbuf[i][1] - 1)); } @@ -288,7 +288,7 @@ int main(int argc, char **argv) { fwrite(header, 64, 1, fo); - std::size_t t; + size_t t; fwrite(&ver, sizeof ver, 1, fo); diff --git a/src/smpackage/SMPackageUtil.cpp b/src/smpackage/SMPackageUtil.cpp index fbfafeaf30..1460133df6 100644 --- a/src/smpackage/SMPackageUtil.cpp +++ b/src/smpackage/SMPackageUtil.cpp @@ -212,7 +212,7 @@ RString SMPackageUtil::GetLanguageCodeFromDisplayString( const RString &sDisplay { RString s = sDisplayString; // strip the space and everything after - std::size_t iSpace = s.find(' '); + size_t iSpace = s.find(' '); ASSERT( iSpace != s.npos ); s.erase( s.begin()+iSpace, s.end() ); return s; @@ -259,7 +259,7 @@ bool RageFileOsAbsolute::Open( const RString& path, int mode ) FILEMAN->Unmount( "dir", m_sOsDir, TEMP_MOUNT_POINT ); m_sOsDir = path; - std::size_t iStart = m_sOsDir.find_last_of( "/\\" ); + size_t iStart = m_sOsDir.find_last_of( "/\\" ); ASSERT( iStart != m_sOsDir.npos ); m_sOsDir.erase( m_sOsDir.begin()+iStart, m_sOsDir.end() ); diff --git a/src/smpackage/ZipArchive/Linux/ZipFileMapping.h b/src/smpackage/ZipArchive/Linux/ZipFileMapping.h index 55db5f3acc..9393ccc95e 100644 --- a/src/smpackage/ZipArchive/Linux/ZipFileMapping.h +++ b/src/smpackage/ZipArchive/Linux/ZipFileMapping.h @@ -63,7 +63,7 @@ namespace ziparchv } protected: void* m_pFileMap; - std::size_t m_iSize; + size_t m_iSize; }; } diff --git a/src/smpackage/ZipArchive/Windows/ZipPlatform.cpp b/src/smpackage/ZipArchive/Windows/ZipPlatform.cpp index 40f849f08b..4b9bb3f539 100644 --- a/src/smpackage/ZipArchive/Windows/ZipPlatform.cpp +++ b/src/smpackage/ZipArchive/Windows/ZipPlatform.cpp @@ -262,7 +262,7 @@ ZIPINLINE bool ZipPlatform::GetSystemCaseSensitivity() #ifdef _UNICODE int ZipPlatform::WideToSingle(LPCTSTR lpWide, CZipAutoBuffer &szSingle) { - std::size_t wideLen = wcslen(lpWide); + size_t wideLen = wcslen(lpWide); if (wideLen == 0) { szSingle.Release(); diff --git a/src/smpackage/ZipArchive/ZipArchive.cpp b/src/smpackage/ZipArchive/ZipArchive.cpp index 65df23f9fe..ed6741899d 100644 --- a/src/smpackage/ZipArchive/ZipArchive.cpp +++ b/src/smpackage/ZipArchive/ZipArchive.cpp @@ -1633,7 +1633,7 @@ bool CZipArchive::SetPassword(LPCTSTR lpszPassword) int iLen = WideToSingle(lpszPassword, m_pszPassword); if (iLen == -1) return false; - for (std::size_t i = 0; (int)i < iLen; i++) + for (size_t i = 0; (int)i < iLen; i++) if (m_pszPassword[i] <= 0) { m_pszPassword.Release(); @@ -1800,7 +1800,7 @@ int CZipArchive::WideToSingle(LPCTSTR lpWide, CZipAutoBuffer &szSingle) return ZipPlatform::WideToSingle(lpWide, szSingle); #else - std::size_t iLen = strlen(lpWide); + size_t iLen = strlen(lpWide); // if not UNICODE just copy // iLen does not include the NULL character szSingle.Allocate(iLen); diff --git a/src/smpackage/ZipArchive/ZipMemFile.cpp b/src/smpackage/ZipArchive/ZipMemFile.cpp index 2e9f109dc5..a82ec4aadd 100644 --- a/src/smpackage/ZipArchive/ZipMemFile.cpp +++ b/src/smpackage/ZipArchive/ZipMemFile.cpp @@ -24,13 +24,13 @@ // Construction/Destruction ////////////////////////////////////////////////////////////////////// -void CZipMemFile::Grow(std::size_t nGrowTo) +void CZipMemFile::Grow(size_t nGrowTo) { if (m_nBufSize < (UINT)nGrowTo) { if (m_nGrowBy == 0) CZipException::Throw(CZipException::memError); - std::size_t nNewSize = m_nBufSize; + size_t nNewSize = m_nBufSize; while (nNewSize < nGrowTo) nNewSize += m_nGrowBy; BYTE* lpNew; @@ -49,10 +49,10 @@ void CZipMemFile::Grow(std::size_t nGrowTo) void CZipMemFile::SetLength(ZIP_ULONGLONG nNewLen) { if (m_nBufSize < (UINT)nNewLen) - Grow((std::size_t)nNewLen); + Grow((size_t)nNewLen); else - m_nPos = (std::size_t)nNewLen; - m_nDataSize = (std::size_t)nNewLen; + m_nPos = (size_t)nNewLen; + m_nDataSize = (size_t)nNewLen; } UINT CZipMemFile::Read(void *lpBuf, UINT nCount) @@ -95,6 +95,6 @@ ZIP_ULONGLONG CZipMemFile::Seek(ZIP_LONGLONG lOff, int nFrom) if (lNew< 0) CZipException::Throw(CZipException::memError); - m_nPos = (std::size_t)lNew; + m_nPos = (size_t)lNew; return lNew; } diff --git a/src/smpackage/ZipArchive/ZipMemFile.h b/src/smpackage/ZipArchive/ZipMemFile.h index 8a7cbf0caf..4ef056e828 100644 --- a/src/smpackage/ZipArchive/ZipMemFile.h +++ b/src/smpackage/ZipArchive/ZipMemFile.h @@ -38,8 +38,8 @@ class ZIP_API CZipMemFile : public CZipAbstractFile { protected: - std::size_t m_nGrowBy, m_nPos; - std::size_t m_nBufSize, m_nDataSize; + size_t m_nGrowBy, m_nPos; + size_t m_nBufSize, m_nDataSize; BYTE* m_lpBuf; bool m_bAutoDelete; void Free() @@ -57,7 +57,7 @@ protected: m_lpBuf = NULL; } - void Grow(std::size_t nBytes); + void Grow(size_t nBytes); public: bool IsClosed() const { return m_lpBuf == NULL;} void Flush(){} diff --git a/src/smpackage/ZipArchive/ZipPlatform.cpp b/src/smpackage/ZipArchive/ZipPlatform.cpp index 40f849f08b..4b9bb3f539 100644 --- a/src/smpackage/ZipArchive/ZipPlatform.cpp +++ b/src/smpackage/ZipArchive/ZipPlatform.cpp @@ -262,7 +262,7 @@ ZIPINLINE bool ZipPlatform::GetSystemCaseSensitivity() #ifdef _UNICODE int ZipPlatform::WideToSingle(LPCTSTR lpWide, CZipAutoBuffer &szSingle) { - std::size_t wideLen = wcslen(lpWide); + size_t wideLen = wcslen(lpWide); if (wideLen == 0) { szSingle.Release(); diff --git a/src/tests/test_audio_readers.cpp b/src/tests/test_audio_readers.cpp index 1fe7d6e44f..cc3f2145bb 100644 --- a/src/tests/test_audio_readers.cpp +++ b/src/tests/test_audio_readers.cpp @@ -257,8 +257,8 @@ const int TestDataSize = 2; /* Find "haystack" in "needle". Start looking at "expect" and move outward; find * the closest. */ -void *xmemsearch( const float *haystack, std::size_t iHaystackSamples, - const std::int16_t *needle, std::size_t iNeedleSamples, +void *xmemsearch( const float *haystack, size_t iHaystackSamples, + const std::int16_t *needle, size_t iNeedleSamples, int expect ) { if( !iNeedleSamples ) diff --git a/src/tests/test_file_errors.cpp b/src/tests/test_file_errors.cpp index c67543e6b3..c928618e65 100644 --- a/src/tests/test_file_errors.cpp +++ b/src/tests/test_file_errors.cpp @@ -76,8 +76,8 @@ class RageFileObjTest: public RageFileObj public: RageFileObjTest( const RString &path ); RageFileObjTest( const RageFileObjTest &cpy ); - int ReadInternal(void *buffer, std::size_t bytes); - int WriteInternal(const void *buffer, std::size_t bytes); + int ReadInternal(void *buffer, size_t bytes); + int WriteInternal(const void *buffer, size_t bytes); int Flush(); void Rewind() { pos = 0; } int Seek( int offset ) @@ -133,7 +133,7 @@ RageFileObjTest::RageFileObjTest( const RString &path_ ) pos = 0; } -int RageFileObjTest::ReadInternal( void *buf, std::size_t bytes ) +int RageFileObjTest::ReadInternal( void *buf, size_t bytes ) { bytes = std::min( bytes, g_TestFile.size()-pos ); @@ -154,7 +154,7 @@ int RageFileObjTest::ReadInternal( void *buf, std::size_t bytes ) return bytes; } -int RageFileObjTest::WriteInternal( const void *buf, std::size_t bytes ) +int RageFileObjTest::WriteInternal( const void *buf, size_t bytes ) { if( g_BytesUntilError != -1 ) {