| 133 | } |
| 134 | |
| 135 | const char* Varint::Decode64(const char* p, const char* limit, uint64_t* value) { |
| 136 | uint64_t result = 0; |
| 137 | for (uint32_t shift = 0; shift <= 63 && p < limit; shift += 7) { |
| 138 | uint64_t byte = *(reinterpret_cast<const unsigned char*>(p)); |
| 139 | p++; |
| 140 | if (byte & kIncompleteMask) { |
| 141 | // More bytes are present |
| 142 | result |= ((byte & 127) << shift); |
| 143 | } else { |
| 144 | result |= (byte << shift); |
| 145 | *value = result; |
| 146 | return reinterpret_cast<const char*>(p); |
| 147 | } |
| 148 | } |
| 149 | return NULL; |
| 150 | } |
| 151 | |
| 152 | bool Varint::Get64(StringPiece* input, uint64_t* value) { |
| 153 | const char* p = input->data(); |
nothing calls this directly
no outgoing calls
no test coverage detected