This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
2007-09-16 18:36:40 +02:00
|
|
|
#include <strings.h>
|
|
|
|
|
2009-05-01 16:41:06 +02:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
|
2007-09-16 18:36:40 +02:00
|
|
|
int __flsl ( long x ) {
|
2007-09-16 18:39:29 +02:00
|
|
|
unsigned long value = x;
|
|
|
|
int ls = 0;
|
2007-09-16 18:36:40 +02:00
|
|
|
|
2007-09-16 18:39:29 +02:00
|
|
|
for ( ls = 0 ; value ; ls++ ) {
|
|
|
|
value >>= 1;
|
2007-09-16 18:36:40 +02:00
|
|
|
}
|
2007-09-16 18:39:29 +02:00
|
|
|
return ls;
|
2007-09-16 18:36:40 +02:00
|
|
|
}
|