From 69c03da03255d08934449cc2bc9cb6f62eea121a Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 31 May 2011 19:22:51 -0400 Subject: [PATCH] Bad file, but need a record of key comment. I think this is the key issue. gcc is doing some magic for us. VS20** is forcing us to do it right. Yes AJ, that means Windows is better on something. Revert this file if needed: the record is now made. --- src/TimingSegments.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/TimingSegments.h b/src/TimingSegments.h index a738c2c682..01768c4b71 100644 --- a/src/TimingSegments.h +++ b/src/TimingSegments.h @@ -13,7 +13,7 @@ struct BaseTimingSegment /** @brief Set up a BaseTimingSegment with default values. */ BaseTimingSegment(): - startingRow(-1) {}; + startingRow(static_cast(-1)) {}; BaseTimingSegment(const BaseTimingSegment &b) { @@ -22,10 +22,11 @@ struct BaseTimingSegment /** * @brief Set up a BaseTimingSegment with specified values. - * @param s the starting row / beat. */ + * @param s the starting row / beat. + * + * NOTE: On Windows, it's passing in the Segments, not ints or floats. */ template - BaseTimingSegment(StartType s): - startingRow(ToNoteRow(s)) {}; + BaseTimingSegment(StartType s): startingRow(ToNoteRow(s)) {} virtual ~BaseTimingSegment(); @@ -67,7 +68,7 @@ template struct TimingSegment: public BaseTimingSegment { - TimingSegment(): BaseTimingSegment() {}; + TimingSegment(): BaseTimingSegment(static_cast(-1)) {}; template TimingSegment(StartType s): BaseTimingSegment(s) {}; @@ -399,7 +400,10 @@ struct BPMSegment : public TimingSegment * It is best to override the values as soon as possible. */ BPMSegment() : - TimingSegment(), bps(-1.0f) { } + TimingSegment(static_cast(-1)), bps(-1.0f) { } + + operator int() const { return 1; } + operator float() const { return 2.0f; } /** * @brief Creates a BPM Segment with the specified starting row and beats per second. @@ -408,7 +412,7 @@ struct BPMSegment : public TimingSegment */ template BPMSegment( StartType s, float bpm ): - TimingSegment(max((StartType)0, s)), bps(0.0f) { SetBPM(bpm); } + TimingSegment(max((StartType)0, ToNoteRow(s))), bps(0.0f) { SetBPM(bpm); } /** * @brief Get the label in this LabelSegment.