From d61aede89cf188367766b971f59cf57d7835d8e8 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 4 Sep 2018 10:58:54 -0700 Subject: Down-integrate from google3. --- src/google/protobuf/duration.pb.cc | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'src/google/protobuf/duration.pb.cc') diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index e9a82770..02602d28 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -13,10 +13,6 @@ #include #include #include -// This is a temporary google only hack -#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS -#include "third_party/protobuf/version.h" -#endif // @@protoc_insertion_point(includes) #include @@ -39,7 +35,7 @@ static void InitDefaultsDuration_google_2fprotobuf_2fduration_2eproto() { ::google::protobuf::Duration::InitAsDefaultInstance(); } -LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_Duration_google_2fprotobuf_2fduration_2eproto = +PROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_Duration_google_2fprotobuf_2fduration_2eproto = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDuration_google_2fprotobuf_2fduration_2eproto}, {}}; void InitDefaults_google_2fprotobuf_2fduration_2eproto() { @@ -50,16 +46,16 @@ void InitDefaults_google_2fprotobuf_2fduration_2eproto() { constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr; constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr; -const ::google::protobuf::uint32 TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::Duration, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, seconds_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, nanos_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::Duration, seconds_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::Duration, nanos_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::google::protobuf::Duration)}, }; @@ -185,15 +181,14 @@ const char* Duration::_InternalParse(const char* begin, const char* end, void* o while (ptr < end) { ::google::protobuf::uint32 tag; ptr = Varint::Parse32Inline(ptr, &tag); - if (!ptr) goto error; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); switch (tag >> 3) { - case 0: goto error; // int64 seconds = 1; case 1: { if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; ::google::protobuf::uint64 val; ptr = Varint::Parse64(ptr, &val); - if (!ptr) goto error; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); ::google::protobuf::int64 value = val; msg->set_seconds(value); break; @@ -203,15 +198,16 @@ const char* Duration::_InternalParse(const char* begin, const char* end, void* o if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; ::google::protobuf::uint64 val; ptr = Varint::Parse64(ptr, &val); - if (!ptr) goto error; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); ::google::protobuf::int32 value = val; msg->set_nanos(value); break; } default: { handle_unusual: (void)&&handle_unusual; - if ((tag & 7) == 4) { - if (!ctx->ValidEndGroup(tag)) goto error; + if ((tag & 7) == 4 || tag == 0) { + bool ok = ctx->ValidEndGroup(tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ok); return ptr; } auto res = UnknownFieldParse(tag, {_InternalParse, msg}, @@ -222,8 +218,6 @@ const char* Duration::_InternalParse(const char* begin, const char* end, void* o } // switch } // while return ptr; -error: - return nullptr; len_delim_till_end: (void)&&len_delim_till_end; return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg}, {parser_till_end, object}, size); @@ -235,7 +229,7 @@ group_continues: (void)&&group_continues; #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER bool Duration::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Duration) for (;;) { @@ -455,10 +449,11 @@ void Duration::InternalSwap(Duration* other) { } // namespace google namespace google { namespace protobuf { -template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Duration* Arena::CreateMaybeMessage< ::google::protobuf::Duration >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::google::protobuf::Duration* Arena::CreateMaybeMessage< ::google::protobuf::Duration >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::Duration >(arena); } } // namespace protobuf } // namespace google // @@protoc_insertion_point(global_scope) +#include -- cgit v1.2.3