[opengtl-commits] [589] integers operations allows to always get the same result

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 589
Author:   cyrille
Date:     2009-03-07 21:00:41 +0100 (Sat, 07 Mar 2009)

Log Message:
-----------
integers operations allows to always get the same result

Modified Paths:
--------------
    trunk/OpenGTL/Extensions/RawDC/RawDC.cpp


Modified: trunk/OpenGTL/Extensions/RawDC/RawDC.cpp
===================================================================
--- trunk/OpenGTL/Extensions/RawDC/RawDC.cpp	2009-03-07 07:18:06 UTC (rev 588)
+++ trunk/OpenGTL/Extensions/RawDC/RawDC.cpp	2009-03-07 20:00:41 UTC (rev 589)
@@ -92,10 +92,12 @@
   }
   
   output = array->data<unsigned short>();
-  double coef = 0xFFFF / (double)maxou;
   for(int i = 0; i < count; ++i)
   {
-    *output *= coef;
+    int o = *output;
+    o *= 0xFFFF;
+    o /= maxou;
+    *output = o;
     ++output;
   }
   


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/