Index: src/atom.cc =================================================================== --- src/atom.cc (revision 583) +++ src/atom.cc (working copy) @@ -36,6 +36,7 @@ bool toNextPotenialExactAtom(string::const_iterator& p, const string::const_iterator& end, bool ignoreMissingPrefix); bool sequenceAdvance(const string& sequence, string::const_iterator& p, const string::const_iterator& end); int versionNumberCompare(const string& ls, const string& rs); +int toCannocalValue(int arg); class PVSuffixToken { @@ -192,12 +193,16 @@ } //we want this function to return -1, 0 or 1! - int tmp = lls.compare(rrs); - if(tmp == 0) - return 0; - return (tmp < 0 ? -1 : 1); + return toCannocalValue(lls.compare(rrs)); } +inline int toCannocalValue(int arg) +{ + if(arg != 0) + return (arg < 0 ? -1 : 1); + return 0; +} + PVSuffixToken::PVSuffixToken(const string& str) { const char *prefixes[] = { "alpha", "beta", "pre", "rc", "p" }; @@ -468,7 +473,7 @@ { string opMe(getCategory() + getPN()); string opOther(other.getCategory() + other.getPN()); - return opMe.compare(opOther); + return local::toCannocalValue(opMe.compare(opOther)); } int Atom::comparePV(const ExactAtom& other) const @@ -483,7 +488,7 @@ string ov(other._pv); if(ov.size() > mv.size()) ov.erase(mv.size()); - return mv.compare(ov); + return local::toCannocalValue(mv.compare(ov)); } if(_pv.empty() || other._pv.empty()) @@ -523,7 +528,7 @@ { hlp = mTok[i].compare(oTok[i]); if(hlp != 0) - return hlp; + return local::toCannocalValue(hlp); ++i; } else if(isPVOptionalLetterComponentIndex(i)) @@ -575,7 +580,7 @@ local::PVSuffixToken tokO(oTok[i]); int hlp = tokL.compare(tokO); if(hlp != 0) - return hlp; + return local::toCannocalValue(hlp); } return trailingPVPartIncoperate(other); } @@ -887,7 +892,7 @@ bool ExactAtom::operator<(const ExactAtom& other) const { - return compare(other) == -1; + return compare(other) < 0; } int ExactAtom::compare(const ExactAtom& other) const Index: ChangeLog =================================================================== --- ChangeLog (revision 583) +++ ChangeLog (working copy) @@ -2,6 +2,8 @@ * src/atom.cc: Hopefully fixed a PCC related test failure. + * src/atom.cc: OK, should be fixed now. + ************************************************************ 2008-07-09 gatt-0.6.2 released by opfer ************************************************************