diff options
-rw-r--r-- | lib/libc/string/ffs.c | 13 | ||||
-rw-r--r-- | sys/lib/libkern/ffs.c | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/lib/libc/string/ffs.c b/lib/libc/string/ffs.c index de4c205cd04..887ce437d47 100644 --- a/lib/libc/string/ffs.c +++ b/lib/libc/string/ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.c,v 1.4 2000/07/02 01:00:01 mickey Exp $ */ +/* $OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $ */ /* * Public domain. @@ -6,7 +6,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ffs.c,v 1.4 2000/07/02 01:00:01 mickey Exp $"; +static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:10:38 mickey Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -28,18 +28,19 @@ ffs(mask) -28, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, - 3, 1, 2, 1 }; + 3, 1, 2, 1 + }; bit = 0; - if (0 == (r & 0xffff)) { + if (!(r & 0xffff)) { bit += 16; r >>= 16; } - if (0 == (r & 0xff)) { + if (!(r & 0xff)) { bit += 8; r >>= 8; } - if (0 == (r & 0xf)) { + if (!(r & 0xf)) { bit += 4; r >>= 4; } diff --git a/sys/lib/libkern/ffs.c b/sys/lib/libkern/ffs.c index 1a823fd9d3c..63b3cbfb950 100644 --- a/sys/lib/libkern/ffs.c +++ b/sys/lib/libkern/ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.c,v 1.4 2000/07/02 01:03:29 mickey Exp $ */ +/* $OpenBSD: ffs.c,v 1.5 2000/07/02 03:09:44 mickey Exp $ */ /* * Public domain. @@ -6,7 +6,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ffs.c,v 1.4 2000/07/02 01:03:29 mickey Exp $"; +static char *rcsid = "$OpenBSD: ffs.c,v 1.5 2000/07/02 03:09:44 mickey Exp $"; #endif /* LIBC_SCCS and not lint */ #if !defined(_KERNEL) && !defined(_STANDALONE) @@ -28,18 +28,19 @@ ffs(mask) -28, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, - 3, 1, 2, 1 }; + 3, 1, 2, 1 + }; bit = 0; - if (0 == (r & 0xffff)) { + if (!(r & 0xffff)) { bit += 16; r >>= 16; } - if (0 == (r & 0xff)) { + if (!(r & 0xff)) { bit += 8; r >>= 8; } - if (0 == (r & 0xf)) { + if (!(r & 0xf)) { bit += 4; r >>= 4; } |