2001-07-06 01:24:39 +08:00
|
|
|
/* ffs -- Find the first bit set in the parameter
|
|
|
|
|
Makefile.in (TEXIFILES): Add fnmatch.txh.
* Makefile.in (TEXIFILES): Add fnmatch.txh.
(maint-undoc): New.
maint-tool: Add "undoc" tool.
* alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c,
fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c,
make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c,
strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update
documentation.
* fnmatch.txh: New.
* functions.texi: Regenerate.
From-SVN: r46274
2001-10-16 10:50:13 +08:00
|
|
|
@deftypefn Supplemental int ffs (int @var{valu})
|
2001-07-06 01:24:39 +08:00
|
|
|
|
Makefile.in (TEXIFILES): Add fnmatch.txh.
* Makefile.in (TEXIFILES): Add fnmatch.txh.
(maint-undoc): New.
maint-tool: Add "undoc" tool.
* alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c,
fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c,
make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c,
strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update
documentation.
* fnmatch.txh: New.
* functions.texi: Regenerate.
From-SVN: r46274
2001-10-16 10:50:13 +08:00
|
|
|
Find the first (least significant) bit set in @var{valu}. Bits are
|
|
|
|
numbered from right to left, starting with bit 1 (corresponding to the
|
|
|
|
value 1). If @var{valu} is zero, zero is returned.
|
2001-07-06 01:24:39 +08:00
|
|
|
|
Makefile.in (TEXIFILES): Add fnmatch.txh.
* Makefile.in (TEXIFILES): Add fnmatch.txh.
(maint-undoc): New.
maint-tool: Add "undoc" tool.
* alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c,
fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c,
make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c,
strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update
documentation.
* fnmatch.txh: New.
* functions.texi: Regenerate.
From-SVN: r46274
2001-10-16 10:50:13 +08:00
|
|
|
@end deftypefn
|
2001-07-06 01:24:39 +08:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
|
|
|
ffs (valu)
|
|
|
|
register int valu;
|
|
|
|
{
|
|
|
|
register int bit;
|
|
|
|
|
|
|
|
if (valu == 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
for (bit = 1; !(valu & 1); bit++)
|
|
|
|
valu >>= 1;
|
|
|
|
|
|
|
|
return bit;
|
|
|
|
}
|
|
|
|
|