summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/ffs.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-01-13 16:05:47 +0000
committerdes <des@FreeBSD.org>2004-01-13 16:05:47 +0000
commitec1fd605cbbcb4bc5ec851a6775a363b01d56029 (patch)
treeec554f27ccb99efb17cf19602b6279f86f0db08b /lib/libc/string/ffs.c
parentdfa545653779c51e8c959ed4a6ebb441f043566c (diff)
downloadFreeBSD-src-ec1fd605cbbcb4bc5ec851a6775a363b01d56029.zip
FreeBSD-src-ec1fd605cbbcb4bc5ec851a6775a363b01d56029.tar.gz
Add and document ffsl(), fls() and flsl().
Diffstat (limited to 'lib/libc/string/ffs.c')
-rw-r--r--lib/libc/string/ffs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/string/ffs.c b/lib/libc/string/ffs.c
index f08e0d1..abd2146 100644
--- a/lib/libc/string/ffs.c
+++ b/lib/libc/string/ffs.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#include <strings.h>
/*
- * ffs -- vax ffs instruction
+ * Find First Set bit
*/
int
ffs(int mask)
@@ -50,6 +50,6 @@ ffs(int mask)
if (mask == 0)
return(0);
for (bit = 1; !(mask & 1); bit++)
- mask >>= 1;
- return(bit);
+ (unsigned int)mask >>= 1;
+ return (bit);
}
OpenPOWER on IntegriCloud