use a compiler builtin (which uses processor instructions) for this operation

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-06-13 20:59:15 +00:00
parent a6d0d04141
commit fca19e7635
2 changed files with 14 additions and 11 deletions

View File

@@ -1334,12 +1334,13 @@ static struct ast_channel *agent_request(const char *type, int format, void *dat
return chan;
}
static int powerof(unsigned int v)
static force_inline int powerof(unsigned int d)
{
int x;
for (x=0;x<32;x++) {
if (v & (1 << x)) return x;
}
int x = ffs(d);
if (x)
return x - 1;
return 0;
}