Answer the question
In order to leave comments, you need to log in
What is varInt+ and varInt-?
int readVarint (int/*bool*/optimizePositive) {
unsigned char b = readByte();
int value = b & 0x7F;
if (b & 0x80) {
b = readByte();
value |= (b & 0x7F) << 7;
if (b & 0x80) {
b = readByte();
value |= (b & 0x7F) << 14;
if (b & 0x80) {
b = readByte();
value |= (b & 0x7F) << 21;
if (b & 0x80) value |= (readByte() & 0x7F) << 28;
}
}
}
if (!optimizePositive) value = (((unsigned int)value >> 1) ^ -(value & 1));
return value;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question