2009-03-02 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / decimal.c
index 0324858156dcbba9004c3493dac943278a24a594..6524443eab3d57168325a710d2ac93e05d74671a 100644 (file)
@@ -1,12 +1,12 @@
 /* 
  decimal.c
-
  conversions and numerical operations for the c# type System.Decimal
-
  Author: Martin Weindel (martin.weindel@t-online.de)
-
  (C) 2001 by Martin Weindel
-*/
* decimal.c
+ *
* conversions and numerical operations for the c# type System.Decimal
+ *
* Author: Martin Weindel (martin.weindel@t-online.de)
+ *
* (C) 2001 by Martin Weindel
+ */
 
 /*
  * machine dependent configuration for 
@@ -579,7 +579,15 @@ my_g_bit_nth_msf (gsize mask)
                return bIndex;
        return -1;
 #else
-       return g_bit_nth_msf (mask, sizeof (gsize) * 8);
+       int i;
+
+       i = sizeof (gsize) * 8;
+       while (i > 0) {
+               i --;
+               if (mask & (1UL << i))
+                       return i;
+       }
+       return -1;
 #endif
 }