summaryrefslogtreecommitdiff
path: root/src/misc/ffs.c
blob: 673ce5a9758284c7eca182b32de3902c9b353b3f (plain) (blame)
1
2
3
4
5
6
7
#include <strings.h>
#include "atomic.h"

int ffs(int i)
{
	return i ? a_ctz_l(i)+1 : 0;
}