diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-13 16:05:47 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-13 16:05:47 +0000 |
commit | f434fe1237e333414c9aa8e906c60f2630f1f11b (patch) | |
tree | ec554f27ccb99efb17cf19602b6279f86f0db08b /lib/libc/string/ffs.c | |
parent | 8746a69a28843500a0acb39fcfb411f9f107c663 (diff) | |
download | src-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.c | 6 |
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); } |