aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/wrappers.pb.cc
diff options
context:
space:
mode:
authorGravatar Chris Kennelly <ckennelly@google.com>2017-01-24 17:37:33 -0800
committerGravatar Chris Kennelly <ckennelly@google.com>2017-02-15 11:39:39 -0800
commit9db5b11c9cf2922435b53495b9c1e114525f0428 (patch)
treebe2e4da2021e6d25558ec2595f615724d9839781 /src/google/protobuf/wrappers.pb.cc
parent0026dff9f6e7fbea541fd293cbf8ebcd254e374d (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/wrappers.pb.cc')
-rw-r--r--src/google/protobuf/wrappers.pb.cc27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc
index 3b9bf7a4..0dad64a4 100644
--- a/src/google/protobuf/wrappers.pb.cc
+++ b/src/google/protobuf/wrappers.pb.cc
@@ -312,7 +312,8 @@ bool DoubleValue::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// double value = 1;
case 1: {
- if (tag == 9u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(9u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
@@ -567,7 +568,8 @@ bool FloatValue::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// float value = 1;
case 1: {
- if (tag == 13u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(13u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
@@ -822,7 +824,8 @@ bool Int64Value::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// int64 value = 1;
case 1: {
- if (tag == 8u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(8u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
@@ -1079,7 +1082,8 @@ bool UInt64Value::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// uint64 value = 1;
case 1: {
- if (tag == 8u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(8u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
@@ -1336,7 +1340,8 @@ bool Int32Value::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// int32 value = 1;
case 1: {
- if (tag == 8u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(8u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
@@ -1593,7 +1598,8 @@ bool UInt32Value::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// uint32 value = 1;
case 1: {
- if (tag == 8u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(8u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
@@ -1850,7 +1856,8 @@ bool BoolValue::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// bool value = 1;
case 1: {
- if (tag == 8u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(8u)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
@@ -2110,7 +2117,8 @@ bool StringValue::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string value = 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_value()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
@@ -2437,7 +2445,8 @@ bool BytesValue::MergePartialFromCodedStream(
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// bytes value = 1;
case 1: {
- if (tag == 10u) {
+ if (static_cast<::google::protobuf::uint8>(tag) ==
+ static_cast<::google::protobuf::uint8>(10u)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_value()));
} else {