| 113 | |
| 114 | |
| 115 | uint64 RawRead::GetV() |
| 116 | { |
| 117 | uint64 Result=0; |
| 118 | // Need to check Shift<64, because for shift greater than or equal to |
| 119 | // the width of the promoted left operand, the behavior is undefined. |
| 120 | for (uint Shift=0;ReadPos<DataSize && Shift<64;Shift+=7) |
| 121 | { |
| 122 | byte CurByte=Data[ReadPos++]; |
| 123 | Result+=uint64(CurByte & 0x7f)<<Shift; |
| 124 | if ((CurByte & 0x80)==0) |
| 125 | return Result; // Decoded successfully. |
| 126 | } |
| 127 | return 0; // Out of buffer border. |
| 128 | } |
| 129 | |
| 130 | |
| 131 | // Return a number of bytes in current variable length integer. |
no outgoing calls
no test coverage detected