aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/string/ffs.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-01-13 16:05:47 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-01-13 16:05:47 +0000
commitf434fe1237e333414c9aa8e906c60f2630f1f11b (patch)
treeec554f27ccb99efb17cf19602b6279f86f0db08b /lib/libc/string/ffs.c
parent8746a69a28843500a0acb39fcfb411f9f107c663 (diff)
downloadsrc-f434fe1237e333414c9aa8e906c60f2630f1f11b.tar.gz
src-f434fe1237e333414c9aa8e906c60f2630f1f11b.zip
Add and document ffsl(), fls() and flsl().
Notes
Notes: svn path=/head/; revision=124483
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 f08e0d124e33..abd214693911 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);
}