[Gridflow-cvs] [svn] commit: r3981 - /trunk/gridflow.h

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Jul 4 16:34:02 EDT 2008


Author: matju
Date: Fri Jul  4 16:34:02 2008
New Revision: 3981

Log:
fixed warnings about & in comparisons (Claude)

Modified:
    trunk/gridflow.h

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Fri Jul  4 16:34:02 2008
@@ -107,10 +107,10 @@
 // greatest common divisor, the binary algorithm. haven't tried yet.
 template <class T> static T gcd2 (T a, T b) {
 	int s=0;
-	while ((a|b)&1==0) { a>>=1; b>>=1; s++; }
+	while (((a|b)&1)==0) { a>>=1; b>>=1; s++; }
 	while (a) {
-		if (a&1==0) a>>=1;
-		else if (b&1==0) b>>=1;
+		if ((a&1)==0) a>>=1;
+		else if ((b&1)==0) b>>=1;
 		else {T t=abs(a-b); if (a<b) b=t; else a=t;}
 	}
 	return b<<s;



More information about the Gridflow-cvs mailing list