From 3171f15df2b55b1dd97cd6b66f3e670364b61c3e Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 30 Apr 2013 20:36:04 -0400 Subject: [PATCH] I should be using + instead of += apparently. Yay for ##c++ for pointing this out. --- src/Command.cpp | 2 +- src/ModelTypes.cpp | 2 +- src/PlayerStageStats.cpp | 2 +- src/Sprite.cpp | 2 +- src/Trail.cpp | 4 ++-- src/TrailUtil.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Command.cpp b/src/Command.cpp index 6d60a7747f..267fcc64f8 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -81,7 +81,7 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector RString Commands::GetOriginalCommandString() const { - return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res += c.GetOriginalCommandString(); }); + return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res + c.GetOriginalCommandString(); }); } void ParseCommands( const RString &sCommands, Commands &vCommandsOut ) diff --git a/src/ModelTypes.cpp b/src/ModelTypes.cpp index b5a20d17b1..5bd55ca4ca 100644 --- a/src/ModelTypes.cpp +++ b/src/ModelTypes.cpp @@ -150,7 +150,7 @@ void AnimatedTexture::SetState( int iState ) float AnimatedTexture::GetAnimationLengthSeconds() const { return std::accumulate(vFrames.begin(), vFrames.end(), 0.f, - [](float total, AnimatedTextureState const &state) { return total += state.fDelaySecs; }); + [](float total, AnimatedTextureState const &state) { return total + state.fDelaySecs; }); } void AnimatedTexture::SetSecondsIntoAnimation( float fSeconds ) diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index f0637a6bce..88c50d67c2 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -315,7 +315,7 @@ int PlayerStageStats::GetLessonScoreActual() const int PlayerStageStats::GetLessonScoreNeeded() const { float score = std::accumulate(m_vpPossibleSteps.begin(), m_vpPossibleSteps.end(), 0.f, - [](float total, Steps const *steps) { return total += steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; }); + [](float total, Steps const *steps) { return total + steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; }); return lrintf( score * LESSON_PASS_THRESHOLD ); } diff --git a/src/Sprite.cpp b/src/Sprite.cpp index 6fc061aff1..a7b6f1d18b 100644 --- a/src/Sprite.cpp +++ b/src/Sprite.cpp @@ -743,7 +743,7 @@ void Sprite::SetState( int iNewState ) float Sprite::GetAnimationLengthSeconds() const { - return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total += s.fDelay; }); + return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total + s.fDelay; }); } void Sprite::SetSecondsIntoAnimation( float fSeconds ) diff --git a/src/Trail.cpp b/src/Trail.cpp index 0268796eae..4888130960 100644 --- a/src/Trail.cpp +++ b/src/Trail.cpp @@ -159,14 +159,14 @@ int Trail::GetMeter() const int Trail::GetTotalMeter() const { return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0, [](int total, TrailEntry const &e) { - return total += e.pSteps->GetMeter(); + return total + e.pSteps->GetMeter(); }); } float Trail::GetLengthSeconds() const { return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0.f, [](float total, TrailEntry const &e) { - return total += e.pSong->m_fMusicLengthSeconds; + return total + e.pSong->m_fMusicLengthSeconds; }); } diff --git a/src/TrailUtil.cpp b/src/TrailUtil.cpp index a7b741ed62..83d1754970 100644 --- a/src/TrailUtil.cpp +++ b/src/TrailUtil.cpp @@ -15,7 +15,7 @@ int TrailUtil::GetNumSongs( const Trail *pTrail ) float TrailUtil::GetTotalSeconds( const Trail *pTrail ) { auto const &entries = pTrail->m_vEntries; - return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total += e.pSong->m_fMusicLengthSeconds; }); + return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total + e.pSong->m_fMusicLengthSeconds; }); } ///////////////////////////////////////////////////////////////////////