Commit b4596f8e authored by Christian Maurer's avatar Christian Maurer Committed by Adam Cozzette

treat enum,bool as 32bit; shrink ReadVarint32

parent 91ed6dcb
......@@ -467,11 +467,11 @@ inline const char* ReadSINT32(const char* ptr, int32* value) {
}
template <typename E>
inline const char* ReadENUM(const char* ptr, E* value) {
*value = static_cast<E>(ReadVarint64(&ptr));
*value = static_cast<E>(ReadVarint32(&ptr));
return ptr;
}
inline const char* ReadBOOL(const char* ptr, bool* value) {
*value = static_cast<bool>(ReadVarint64(&ptr));
*value = static_cast<bool>(ReadVarint32(&ptr));
return ptr;
}
......
......@@ -586,9 +586,9 @@ inline uint64 ReadVarint64(const char** p) {
}
inline uint32 ReadVarint32(const char** p) {
uint64 tmp;
uint32 tmp;
*p = VarintParse(*p, &tmp);
return static_cast<uint32>(tmp);
return tmp;
}
inline int64 ReadVarintZigZag64(const char** p) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment