MCPcopy Create free account
hub / github.com/F-Stack/f-stack / read_unaligned_byte

Function read_unaligned_byte

dpdk/lib/hash/rte_thash.c:696–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694}
695
696static inline uint8_t
697read_unaligned_byte(uint8_t *ptr, unsigned int offset)
698{
699 uint8_t ret = 0;
700
701 ret = ptr[offset / CHAR_BIT];
702 if (offset % CHAR_BIT) {
703 ret <<= (offset % CHAR_BIT);
704 ret |= ptr[(offset / CHAR_BIT) + 1] >>
705 (CHAR_BIT - (offset % CHAR_BIT));
706 }
707
708 return ret;
709}
710
711static inline uint32_t
712read_unaligned_bits(uint8_t *ptr, int len, int offset)

Callers 1

read_unaligned_bitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected