Commit 29650b2b by Mark Klein Committed by DJ Delorie

Makefile.in: Add ffs.c dependency.

* Makefile.in: Add ffs.c dependency.
* configure.in: Add ffs.c.
* ffs.c: New file.

From-SVN: r43784
parent 68f9fcfc
2001-07-05 Mark Klein <mklein@dis.com>
* Makefile.in: Add ffs.c dependency.
* configure.in: Add ffs.c.
* ffs.c: New file.
2001-06-18 Richard Henderson <rth@redhat.com> 2001-06-18 Richard Henderson <rth@redhat.com>
* concat.c: Include <sys/types.h>. * concat.c: Include <sys/types.h>.
......
...@@ -122,7 +122,7 @@ dvi: dvi-subdir ...@@ -122,7 +122,7 @@ dvi: dvi-subdir
# configure.in. # configure.in.
CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \ bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \
cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \ cp-demangle.c dyn-string.c fdmatch.c fnmatch.c ffs.c getcwd.c \
getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \ getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
floatformat.c hashtab.c hex.c index.c insque.c lbasename.c \ floatformat.c hashtab.c hex.c index.c insque.c lbasename.c \
md5.c make-temp-file.c memchr.c \ md5.c make-temp-file.c memchr.c \
......
...@@ -1329,6 +1329,7 @@ funcs="$funcs bsearch" ...@@ -1329,6 +1329,7 @@ funcs="$funcs bsearch"
funcs="$funcs bzero" funcs="$funcs bzero"
funcs="$funcs calloc" funcs="$funcs calloc"
funcs="$funcs clock" funcs="$funcs clock"
funcs="$funcs ffs"
funcs="$funcs getcwd" funcs="$funcs getcwd"
funcs="$funcs getpagesize" funcs="$funcs getpagesize"
funcs="$funcs index" funcs="$funcs index"
...@@ -1700,7 +1701,7 @@ else ...@@ -1700,7 +1701,7 @@ else
fi fi
done done
for ac_func in sysconf times sbrk gettimeofday for ac_func in sysconf times sbrk gettimeofday ffs
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1707: checking for $ac_func" >&5 echo "configure:1707: checking for $ac_func" >&5
......
...@@ -87,6 +87,7 @@ funcs="$funcs bsearch" ...@@ -87,6 +87,7 @@ funcs="$funcs bsearch"
funcs="$funcs bzero" funcs="$funcs bzero"
funcs="$funcs calloc" funcs="$funcs calloc"
funcs="$funcs clock" funcs="$funcs clock"
funcs="$funcs ffs"
funcs="$funcs getcwd" funcs="$funcs getcwd"
funcs="$funcs getpagesize" funcs="$funcs getpagesize"
funcs="$funcs index" funcs="$funcs index"
...@@ -134,7 +135,7 @@ if test "x" = "y"; then ...@@ -134,7 +135,7 @@ if test "x" = "y"; then
AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr) AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr)
AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
AC_CHECK_FUNCS(sysconf times sbrk gettimeofday) AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs)
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
......
/* ffs -- Find the first bit set in the parameter
NAME
ffs -- Find the first bit set in the parameter
SYNOPSIS
int ffs (int valu)
DESCRIPTION
Find the first bit set in the parameter. Bits are numbered from
right to left, starting with bit 1.
*/
int
ffs (valu)
register int valu;
{
register int bit;
if (valu == 0)
return 0;
for (bit = 1; !(valu & 1); bit++)
valu >>= 1;
return bit;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment