Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21098/src

Modified Files:
        Envelope.cpp 
Log Message:
Assertions failing due to double < double comparisons.  We need to allow for 
small rounding errors.

Index: Envelope.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Envelope.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- Envelope.cpp        16 May 2009 11:13:12 -0000      1.66
+++ Envelope.cpp        23 Aug 2009 09:22:10 -0000      1.67
@@ -988,14 +988,18 @@
 
    double tprev, vprev, tnext = 0, vnext, vstep = 0;
 
+   // JC: I believe small rounding errors are OK,
+   // and that the previous tests (with epsilon==0)
+   // were too stringent.
+   const double epsilon=0.0000000001; // a small value
    // in debug builds, do a spot of argument checking
-   if(t0 > mTrackLen)
+   if(t0 > (mTrackLen+epsilon))
    {
       wxString msg;
       msg = wxString::Format(wxT("t0 %.20f mTrackLen %.20f diff %.20f"), t0, 
mTrackLen, t0-mTrackLen);
       wxASSERT_MSG(t0 <= mTrackLen, msg);
    }
-   if(t0 < 0)
+   if(t0 < (-epsilon))
    {
       wxString msg;
       msg = wxString::Format(wxT("t0 %.20f"), t0);


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to