* .version: bumped version number to 2.4.5
[fw/sdcc] / device / lib / pic16 / libsdcc / int / mulint.c
index f024fe73124b9cd88ed34a67214c38164bf15c3f..5979fe6c0637a90c636214b57a7c816dec796381 100644 (file)
    has the same precision as the input.
 */
 
+#include <sdcc-lib.h>
+
 union uu {
        struct { unsigned char lo,hi ;} s;
         unsigned int t;
 } ;
 
-int _mulint (int a, int b)
+int _mulint (int a, int b) _IL_REENTRANT
 {
-#if 0
-  register union uu *x;
-  register union uu *y;
-  union uu t;
-
-       x = (union uu *)&a;
-       y = (union uu *)&b;
-
-        t.t = x->s.lo * y->s.lo;
-        t.s.hi += (x->s.lo * y->s.hi) + (x->s.hi * y->s.lo);
-
-       return t.t;
-#else
   union uu x;
   union uu y;
   union uu t;
 
-        x.t = a;
-        y.t = b;
-        t.t = x.s.lo * y.s.lo;
-        t.s.hi += (x.s.lo * y.s.hi) + (x.s.hi * y.s.lo);
+    x.t = a;
+    y.t = b;
+    t.t = x.s.lo * y.s.lo;
+    t.s.hi += (x.s.lo * y.s.hi) + (x.s.hi * y.s.lo);
 
   return t.t;
-#endif
 }