Fixed possible rounding in the VERSION_BCD() macros for some 0.01 step increments...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / StdDescriptors.h
index 031e01d..1056f0f 100644 (file)
                /* Macros: */
                        #define VERSION_TENS(x)                   (int)((int)(x) / 10)
                        #define VERSION_ONES(x)                   (int)((int)(x) % 10)
-                       #define VERSION_TENTHS(x)                 (int)(((x *  1) - ((int)(x *  1))) * 10)
-                       #define VERSION_HUNDREDTHS(x)             (int)(((x * 10) - ((int)(x * 10))) * 10)
+                       #define VERSION_TENTHS(x)                 (int)((x - (int)x) * 10)
+                       #define VERSION_HUNDREDTHS(x)             (int)((x * 100) - ((int)(x * 10) * 10))
        #endif
 
        /* Disable C linkage for C++ Compilers: */