[Gridflow-cvs] [svn] commit: r4638 - /trunk/src/number.cxx

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sun Nov 1 17:29:47 EST 2009


Author: matju
Date: Sun Nov  1 17:29:47 2009
New Revision: 4638

Log:
remove useless kludge

Modified:
    trunk/src/number.cxx

Modified: trunk/src/number.cxx
==============================================================================
--- trunk/src/number.cxx (original)
+++ trunk/src/number.cxx Sun Nov  1 17:29:47 2009
@@ -180,12 +180,6 @@
 template <class T> static inline T gf_trunc (T a) {
 	return (T) floor(abs((double)a)) * (a<0?-1:1); }
 
-namespace {
-// trying to avoid GCC warning about uint8 too small for ==256
-template <class T> static bool equal256 (T     x) {return x==256;}
-template <>               bool equal256 (uint8 x) {return false;}
-};
-
 #ifdef PASS1
 DEF_OP(ignore, a, 0, side==at_right, side==at_left)
 DEF_OP(put,    b, 0, side==at_left, side==at_right)
@@ -193,7 +187,7 @@
 DEF_OP(sub,  a-b, 0, side==at_right && x==0, false)
 DEF_OP(bus,  b-a, 0, side==at_left  && x==0, false)
 DEF_OP(mul,  a*b, 1, x==1, x==0)
-DEF_OP(mulshr8, (a*b)>>8, 256, equal256(x), x==0)
+DEF_OP(mulshr8, (a*b)>>8, 256, x==256, x==0)
 DEF_OP(div,  b==0 ? (T)0 :      a/b , 1, side==at_right && x==1, false)
 DEF_OP(div2, b==0 ?    0 : div2(a,b), 1, side==at_right && x==1, false)
 DEF_OP(vid,  a==0 ? (T)0 :      b/a , 1, side==at_left  && x==1, false)



More information about the Gridflow-cvs mailing list