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

Function set_value

libs/indexer/classificator.cpp:134–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132uint8_t const max_value = (1 << bits_count) - 1;
133
134void set_value(uint32_t & type, uint8_t level, uint8_t value)
135{
136 level *= bits_count; // level to bits
137
138 uint32_t const m1 = uint32_t(max_value) << level;
139 type &= (~m1); // zero bits
140
141 uint32_t const m2 = uint32_t(value) << level;
142 type |= m2; // set bits
143}
144
145uint8_t get_value(uint32_t type, uint8_t level)
146{

Callers 3

PushValueFunction · 0.85
PopValueFunction · 0.85
TruncValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected