]> mj.ucw.cz Git - libucw.git/blobdiff - lib/log2.c
Added overflow-safe string functions allocating everything on the stack.
[libucw.git] / lib / log2.c
index 3cd983357d573dd658c58dd99786c1c6099a9812..8fedaf6be67880d666305017a3941b79262f758e 100644 (file)
@@ -1,19 +1,18 @@
 /*
- *     Sherlock Library -- Binary Logarithm
+ *     UCW Library -- Binary Logarithm
  *
- *     (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ *     (c) 1997 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
-#include <stdio.h>
-
-#include "lib.h"
-
-#undef log2
+#include "lib/lib.h"
 
 int
-log2(ulg x)
+fls(u32 x)
 {
-  ulg l;
+  uns l;
 
   if (!x)
        return 0;