MCPcopy Create free account
hub / github.com/beefytech/Beef / DecodeInt

Function DecodeInt

IDEHelper/Compiler/BfParser.cpp:208–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static int DecodeInt(uint8* buf, int& idx)
209{
210 int value = 0;
211 int shift = 0;
212 int curByte;
213 do
214 {
215 curByte = buf[idx++];
216 value |= ((curByte & 0x7f) << shift);
217 shift += 7;
218 } while (curByte >= 128);
219 // Sign extend negative numbers.
220 if (((curByte & 0x40) != 0) && (shift < 64))
221 value |= ~0LL << shift;
222 return value;
223}
224
225static int gCurDataId = 0;
226BfParserData::BfParserData()

Callers 1

GetCharIdAtIndexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected