Following up on my email from a couple weeks ago.Any opinions? What is now checked in is broken in debug builds for VC++ which I think is unacceptable (makes it a lot hard to run GEOS under the VC++ or WinDebug debuggers).
I want to revert to strk's original version ... but his comments worry me. Charlie Charlie Savage wrote:
There appears to be a fairly serious issue with the trunk version of GEOS with STRtree:yComparator(Boundable *a, Boundable *b).There are various comments from mloskot and strk about how the comparison should work. Choices seem to be:return STRtree::centreY(aEnv) < STRtree::centreY(bEnv); Or return std::fabs( STRtree::centreY(aEnv) - STRtree::centreY(bEnv) ) < 1e-30Currently, the second option is used. But on Windows, using a debug VC++ build, that is almost guaranteed to cause an assertion failure. VC++ has code in xutility that checks the comparison in both directions:template<class _Pr, class _Ty1, class _Ty2> inlinebool __CLRCALL_OR_CDECL _Debug_lt_pred(_Pr _Pred, _Ty1& _Left, _Ty2& _Right,const wchar_t *_Where, unsigned int _Line) { // test if _Pred(_Left, _Right) and _Pred is strict weak ordering if (!_Pred(_Left, _Right)) return (false); else if (_Pred(_Right, _Left)) _DEBUG_ERROR2("invalid operator<", _Where, _Line); return (true); }Assume the centers of the two envelopes are equivalent - that will trigger the 2nd part of the if statement causing an assertion failure.Can this be fixed so that the comparison works as expected? The first version does the trick, but strk wrote some scary comments that it corrupts memory in some cases (although with a quick glance I don't see how).Thanks, Charlie ------------------------------------------------------------------------ _______________________________________________ geos-devel mailing list geos-devel@geos.refractions.net http://geos.refractions.net/mailman/listinfo/geos-devel
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ geos-devel mailing list geos-devel@geos.refractions.net http://geos.refractions.net/mailman/listinfo/geos-devel