| 206 | } |
| 207 | |
| 208 | static 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 | |
| 225 | static int gCurDataId = 0; |
| 226 | BfParserData::BfParserData() |