source: trunk/libs/newlib/src/newlib/libc/misc/ffs.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 431 bytes
Line 
1/*
2FUNCTION
3        <<ffs>>---find first bit set in a word
4
5INDEX
6        ffs
7
8SYNOPSIS
9        #include <strings.h>
10        int ffs(int <[word]>);
11
12DESCRIPTION
13
14<<ffs>> returns the first bit set in a word.
15
16RETURNS
17<<ffs>> returns 0 if <[c]> is 0, 1 if <[c]> is odd, 2 if <[c]> is a multiple of
182, etc.
19
20PORTABILITY
21<<ffs>> is not ANSI C.
22
23No supporting OS subroutines are required.  */
24
25#include <strings.h>
26
27int
28ffs(int i)
29{
30
31        return (__builtin_ffs(i));
32}
Note: See TracBrowser for help on using the repository browser.