MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / getBit2

Method getBit2

GPRS/ByteVector.cpp:413–418  ·  view source on GitHub ↗

Get a bit from the specified byte, numbered like this: bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7

Source from the content-addressed store, hash-verified

411// Get a bit from the specified byte, numbered like this:
412// bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
413bool ByteVector::getBit2(size_t byteIndex, unsigned bitIndex) const
414{
415 BVASSERT(bitIndex >= 0 && bitIndex <= 7);
416 //return !!(getByte(byteIndex) & (1 << (7-bitIndex)));
417 return !!(getByte(byteIndex) & bitMasks[bitIndex]);
418}
419
420// Get a bit from the specified byte, numbered like this:
421// bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7

Callers 2

ByteVectorTestFunction · 0.80
handleXidFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected