From: Matthew Fernandez Date: Sat, 4 Sep 2021 01:02:22 +0000 (-0700) Subject: overlapSeg: rephrase the order of comparisons to avoid a -Wfloat-equal warning X-Git-Tag: 2.49.1~27^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3258e343c1a3f17049b11ebd144cde5880a68040;p=graphviz overlapSeg: rephrase the order of comparisons to avoid a -Wfloat-equal warning Simply makes it clearer to the compiler what this code is doing. --- diff --git a/lib/ortho/ortho.c b/lib/ortho/ortho.c index 839c3d347..d61366d98 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -621,15 +621,13 @@ overlapSeg (segment* S1, segment* S2, bend T1, bend T2) else if(S1->l2==T2&&S2->l1==T1) return(1); else return(0); } - else if(S1->p.p2==S2->p.p2) { - if(S2->l1==T2) return eqEndSeg (S1->l2, S2->l2, T1, T2); - else return -1*eqEndSeg (S2->l2, S1->l2, T1, T2); - } - else { /* S1->p.p2>S2->p.p2 */ + if (S1->p.p2 > S2->p.p2) { if(S2->l1==T2&&S2->l2==T2) return(-1); else if (S2->l1==T1&&S2->l2==T1) return(1); else return(0); } + if (S2->l1 == T2) return eqEndSeg (S1->l2, S2->l2, T1, T2); + return -1 * eqEndSeg(S2->l2, S1->l2, T1, T2); } static int