2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
12 libc_hidden_proto(ffs)
17 /* inlined binary search method */
19 #if UINT_MAX == 0xffffU
20 /* nothing to do here -- just trying to avoiding possible problems */
21 #elif UINT_MAX == 0xffffffffU
27 #error ffs needs rewriting!
42 return (i) ? (n + ((i+1) & 0x01)) : 0;
45 /* linear search -- slow, but small */
48 for (n = 0 ; i ; ++n) {