Skip to content

Commit

Permalink
Use ReadVarint32 for Int32 types (protocolbuffers#8769)
Browse files Browse the repository at this point in the history
* Add INT32 to list of 32-bit varint types

* update descriptor protos

Co-authored-by: Greg Stoll <[email protected]>
  • Loading branch information
rkevingibson and gregstoll authored Sep 3, 2021
1 parent a8b73fb commit 10d0fae
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,8 @@ void ParseFunctionGenerator::GenerateFieldBody(
field->number());
}
} else {
std::string size = (field->type() == FieldDescriptor::TYPE_SINT32 ||
std::string size = (field->type() == FieldDescriptor::TYPE_INT32 ||
field->type() == FieldDescriptor::TYPE_SINT32 ||
field->type() == FieldDescriptor::TYPE_UINT32)
? "32"
: "64";
Expand Down
6 changes: 3 additions & 3 deletions src/google/protobuf/compiler/plugin.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions src/google/protobuf/descriptor.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/google/protobuf/duration.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/google/protobuf/timestamp.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/google/protobuf/type.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/google/protobuf/wrappers.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10d0fae

Please sign in to comment.