diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | missing/ffs.c | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu May 13 21:40:39 2010 Tanaka Akira <akr@fsij.org> + + * missing/ffs.c (ffs): fixed for non-zero values. + Thu May 13 18:45:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/io/console/console.c (get_write_fd): return primary fd if no diff --git a/missing/ffs.c b/missing/ffs.c index 1a1189968a..bad99cf116 100644 --- a/missing/ffs.c +++ b/missing/ffs.c @@ -6,11 +6,13 @@ int ffs(int arg) { unsigned int x = (unsigned int)arg; - int r = 0; + int r; if (x == 0) return 0; + r = 1; + #if 32 < SIZEOF_INT * CHAR_BIT if ((x & 0xffffffff) == 0) { x >>= 32; |