Descriptiongoprotobuf: Split encoding of int32 and uint32 fields.
int32 needs special handling; negative values need to be sign-extended,
so need to be converted from uint32 back to int32 before converting to
uint64 for the varint encoding step (yielding 10 bytes).
uint32 is simpler and stays as just encoding the bit pattern,
and thus never takes more than 5 bytes.
This permits upgrading int32 fields to int64, and matches C++.
Patch Set 1 #Patch Set 2 : diff -r a244a9c2c29e https://code.google.com/p/goprotobuf #Patch Set 3 : diff -r a244a9c2c29e https://code.google.com/p/goprotobuf #Patch Set 4 : diff -r a244a9c2c29e https://code.google.com/p/goprotobuf #
MessagesTotal messages: 3
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||