| 227 | } |
| 228 | |
| 229 | uint64_t getUnsignedBitfield(unsigned char *p, uint64_t offset, uint64_t bits) { |
| 230 | uint64_t byte, bit, byteval, bitval, j, value = 0; |
| 231 | |
| 232 | for (j = 0; j < bits; j++) { |
| 233 | byte = offset >> 3; |
| 234 | bit = 7 - (offset & 0x7); |
| 235 | byteval = p[byte]; |
| 236 | bitval = (byteval >> bit) & 1; |
| 237 | value = (value<<1) | bitval; |
| 238 | offset++; |
| 239 | } |
| 240 | return value; |
| 241 | } |
| 242 | |
| 243 | int64_t getSignedBitfield(unsigned char *p, uint64_t offset, uint64_t bits) { |
| 244 | int64_t value; |
no outgoing calls
no test coverage detected