| 163 | } |
| 164 | |
| 165 | bool GetVarint32(StringPiece* input, uint32* value) { |
| 166 | const char* p = input->data(); |
| 167 | const char* limit = p + input->size(); |
| 168 | const char* q = GetVarint32Ptr(p, limit, value); |
| 169 | if (q == nullptr) { |
| 170 | return false; |
| 171 | } else { |
| 172 | *input = StringPiece(q, limit - q); |
| 173 | return true; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | const char* GetVarint64Ptr(const char* p, const char* limit, uint64* value) { |
| 178 | uint64 result = 0; |
no test coverage detected