From e19a2109268016073d7b93effff06ab28ec61838 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 4 Jul 2011 21:22:05 -0400 Subject: [PATCH] I don't like shadowed variables. --- src/TimingSegments.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/TimingSegments.cpp b/src/TimingSegments.cpp index 0d241da25d..304623c285 100644 --- a/src/TimingSegments.cpp +++ b/src/TimingSegments.cpp @@ -250,18 +250,24 @@ void SpeedSegment::SetUnit(const int i) this->unit = static_cast(i); } -void SpeedSegment::Scale( int start, int length, int newLength ) +void SpeedSegment::Scale( int start, int oldLength, int newLength ) { if( GetUnit() == 0 ) { // XXX: this function is duplicated, there should be a better way float startBeat = GetBeat(); float endBeat = startBeat + GetLength(); - float newStartBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), startBeat ); - float newEndBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), endBeat ); + float newStartBeat = ScalePosition(NoteRowToBeat(start), + NoteRowToBeat(oldLength), + NoteRowToBeat(newLength), + startBeat); + float newEndBeat = ScalePosition(NoteRowToBeat(start), + NoteRowToBeat(oldLength), + NoteRowToBeat(newLength), + endBeat); SetLength( newEndBeat - newStartBeat ); } - TimingSegment::Scale( start, length, newLength ); + TimingSegment::Scale( start, oldLength, newLength ); } bool SpeedSegment::operator<( const SpeedSegment &other ) const