projects
/
osmocom-bb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acffb60
)
bitvec: Fix decoding of H / L values
author
Andreas.Eversberg
<jolly@eversberg.eu>
Sun, 24 Oct 2010 09:59:33 +0000
(11:59 +0200)
committer
Sylvain Munaut
<tnt@246tNt.com>
Sun, 24 Oct 2010 09:59:33 +0000
(11:59 +0200)
it returns if a given bit in the vector is "high" or "low".
the bitval that represents "high" depends on the bit position.
bitval2mask returns that. so we must check if the bit in the vector
equals the returned bitval.
src/bitvec.c
patch
|
blob
|
history
diff --git
a/src/bitvec.c
b/src/bitvec.c
index
04c465a
..
95d78a5
100644
(file)
--- a/
src/bitvec.c
+++ b/
src/bitvec.c
@@
-90,7
+90,7
@@
enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv,
bitval = bitval2mask(H, bitnum);
- if (
bv->data[bytenum] &
bitval)
+ if (
(bv->data[bytenum] & (1 << bitnum)) ==
bitval)
return H;
return L;