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