diff options
author | 2017-01-24 17:37:33 -0800 | |
---|---|---|
committer | 2017-02-15 11:39:39 -0800 | |
commit | 9db5b11c9cf2922435b53495b9c1e114525f0428 (patch) | |
tree | be2e4da2021e6d25558ec2595f615724d9839781 /src/google/protobuf/compiler/plugin.pb.cc | |
parent | 0026dff9f6e7fbea541fd293cbf8ebcd254e374d (diff) |
Work with truncated tag numbers.
This allows more compact comparisons (1 byte instead of 4 byte
immediates on x86) for each possible wire/tag inside each field.
Diffstat (limited to 'src/google/protobuf/compiler/plugin.pb.cc')
-rw-r--r-- | src/google/protobuf/compiler/plugin.pb.cc | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index e781e41d..f806392a 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -287,7 +287,8 @@ bool Version::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 major = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { set_has_major(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -300,7 +301,8 @@ bool Version::MergePartialFromCodedStream( // optional int32 minor = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { set_has_minor(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -313,7 +315,8 @@ bool Version::MergePartialFromCodedStream( // optional int32 patch = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { set_has_patch(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( @@ -326,7 +329,8 @@ bool Version::MergePartialFromCodedStream( // optional string suffix = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_suffix())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -800,7 +804,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated string file_to_generate = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_file_to_generate())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -816,7 +821,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // optional string parameter = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_parameter())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -831,7 +837,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // optional .google.protobuf.compiler.Version compiler_version = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_compiler_version())); } else { @@ -842,7 +849,8 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( // repeated .google.protobuf.FileDescriptorProto proto_file = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_proto_file())); @@ -1404,7 +1412,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1419,7 +1428,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( // optional string insertion_point = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_insertion_point())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1434,7 +1444,8 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream( // optional string content = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_content())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1944,7 +1955,8 @@ bool CodeGeneratorResponse::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string error = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_error())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( @@ -1959,7 +1971,8 @@ bool CodeGeneratorResponse::MergePartialFromCodedStream( // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; case 15: { - if (tag == 122u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(122u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_file())); |