Revision b39ade83 cutils.c
b/cutils.c | ||
---|---|---|
95 | 95 |
t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec; |
96 | 96 |
return t; |
97 | 97 |
} |
98 |
|
|
99 |
int fls(int i) |
|
100 |
{ |
|
101 |
int bit; |
|
102 |
|
|
103 |
for (bit=31; bit >= 0; bit--) |
|
104 |
if (i & (1 << bit)) |
|
105 |
return bit+1; |
|
106 |
|
|
107 |
return 0; |
|
108 |
} |
Also available in: Unified diff