MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / forReadOffset

Function forReadOffset

pj_datastore/src/encoding.cpp:221–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219namespace {
220
221uint64_t forReadOffset(const uint8_t* data, std::size_t row, uint8_t offset_bytes) {
222 switch (offset_bytes) {
223 case 1: {
224 uint8_t v = 0;
225 std::memcpy(&v, data + row, sizeof(v));
226 return v;
227 }
228 case 2: {
229 uint16_t v = 0;
230 std::memcpy(&v, data + row * 2, sizeof(v));
231 return v;
232 }
233 default: {
234 uint32_t v = 0;
235 std::memcpy(&v, data + row * 4, sizeof(v));
236 return v;
237 }
238 }
239}
240
241} // namespace
242

Callers 2

forDecodeOneAsDoubleFunction · 0.85
forDecodeOneAsInt64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected