]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
FreeTDM: Fix "ftdm core flags/spanflags" with flag names
authorStefan Knoblich <stkn@openisdn.net>
Sat, 1 Jun 2013 20:30:45 +0000 (22:30 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Sat, 1 Jun 2013 20:30:45 +0000 (22:30 +0200)
commit85e2eaaf58a1e67dfdcd42dd572cd4bc44c4be4f
tree6e4ba746501d0d426ca3f14f4b2ad92bd7cbbba8
parente857527a3bbbecc57a7a204c3145c427347ac22f
FreeTDM: Fix "ftdm core flags/spanflags" with flag names

"x >> 1" is _NOT_ the reverse of "1 << x"...

Use code from Sean Eron Andersen's "Bit Twiddling Hacks"
(=> http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog)
to compute the log2 value (= position in the enum) of the bitflag.

This preserves the current behaviour, which is rather odd because
it is based on the position of the value in the enum, not its
actual (bit flag) value.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/src/ftdm_io.c