Revision: 56785
          http://sourceforge.net/p/brlcad/code/56785
Author:   phoenixyjll
Date:     2013-08-13 13:38:18 +0000 (Tue, 13 Aug 2013)
Log Message:
-----------
Returning the result of minus and implicit conversion to int for comparison is 
not correct for floating points. Should use explicit > and < comparison.

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/boolean.cpp

Modified: brlcad/trunk/src/libbrep/boolean.cpp
===================================================================
--- brlcad/trunk/src/libbrep/boolean.cpp        2013-08-13 13:29:03 UTC (rev 
56784)
+++ brlcad/trunk/src/libbrep/boolean.cpp        2013-08-13 13:38:18 UTC (rev 
56785)
@@ -77,7 +77,7 @@
 {
     if ((*a)->m_seg != (*b)->m_seg)
        return (*a)->m_seg - (*b)->m_seg;
-    return (*a)->m_t - (*b)->m_t;
+    return (*a)->m_t - (*b)->m_t > 0.0 ? 1 : ((*a)->m_t < (*b)->m_t ? -1 : 0);
 }
 
 
@@ -432,6 +432,8 @@
            bu_log("stack error or sort failure.\n");
            bu_log("s.top() = %d, i = %d\n", s.top(), i);
            bu_log("p->m_pos = %d, q->m_pos = %d\n", p->m_pos, q->m_pos);
+           bu_log("p->m_seg = %d, q->m_seg = %d\n", p->m_seg, q->m_seg);
+           bu_log("p->m_t = %g, q->m_t = %g\n", p->m_t, q->m_t);
            continue;
        }
        if (q->m_type != p->m_type) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to