userlibandfileserver/fileserver/sfat32/sl_utl.cpp
changeset 33 0173bcd7697c
parent 15 4122176ea935
child 36 538db54a451d
--- a/userlibandfileserver/fileserver/sfat32/sl_utl.cpp	Wed Dec 23 11:43:31 2009 +0000
+++ b/userlibandfileserver/fileserver/sfat32/sl_utl.cpp	Thu Jan 07 13:38:45 2010 +0200
@@ -39,18 +39,7 @@
 
 TUint32 Log2(TUint32 aVal)
 {
-    __ASSERT_COMPILE(sizeof(TUint32) == 4);
-    ASSERT(aVal);
-
-    TUint32 bitPos=31;
-
-    if(!(aVal >> 16)) {bitPos-=16; aVal<<=16;}
-    if(!(aVal >> 24)) {bitPos-=8;  aVal<<=8 ;}
-    if(!(aVal >> 28)) {bitPos-=4;  aVal<<=4 ;}
-    if(!(aVal >> 30)) {bitPos-=2;  aVal<<=2 ;}
-    if(!(aVal >> 31)) {bitPos-=1;}
-    
-    return bitPos;
+    return Log2_inline(aVal);
 }