MCPcopy Create free account
hub / github.com/comaps/comaps / ReadAtMost32Bits

Method ReadAtMost32Bits

libs/coding/bit_streams.hpp:179–190  ·  view source on GitHub ↗

Same as Read but accept up to 32 bits to read.

Source from the content-addressed store, hash-verified

177
178 // Same as Read but accept up to 32 bits to read.
179 uint32_t ReadAtMost32Bits(uint8_t n)
180 {
181 ASSERT_LESS_OR_EQUAL(n, 32, ());
182
183 uint32_t result = 0;
184
185 READ_BYTE(0);
186 READ_BYTE(1);
187 READ_BYTE(2);
188
189 return result | (static_cast<uint32_t>(Read(n)) << (3 * kMinBits));
190 }
191
192 // Same as Read but accept up to 64 bits to read.
193 uint64_t ReadAtMost64Bits(uint8_t n)

Callers 3

UNIT_TESTFunction · 0.80
ReadCrossMwmIdMethod · 0.80
DeserializeMethod · 0.80

Calls 1

ReadFunction · 0.70

Tested by 1

UNIT_TESTFunction · 0.64