From 137e5984aff3e7cbc26ce4bf5923ae438cd6ecef Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Thu, 26 Oct 2023 07:23:40 -0700 Subject: [PATCH] Rollback changes to Utf8Validation PiperOrigin-RevId: 576863528 --- src/google/protobuf/descriptor.pb.cc | 18 +++++++++--------- src/google/protobuf/descriptor.pb.h | 10 +++++----- src/google/protobuf/descriptor.proto | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 88308d71f4..ae02aa9a2d 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1864,8 +1864,8 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] AB "SED\020\002\"V\n\025RepeatedFieldEncoding\022#\n\037REPEAT" "ED_FIELD_ENCODING_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022" "\014\n\010EXPANDED\020\002\"C\n\016Utf8Validation\022\033\n\027UTF8_" - "VALIDATION_UNKNOWN\020\000\022\n\n\006VERIFY\020\002\022\010\n\004NONE" - "\020\003\"S\n\017MessageEncoding\022\034\n\030MESSAGE_ENCODIN" + "VALIDATION_UNKNOWN\020\000\022\010\n\004NONE\020\001\022\n\n\006VERIFY" + "\020\002\"S\n\017MessageEncoding\022\034\n\030MESSAGE_ENCODIN" "G_UNKNOWN\020\000\022\023\n\017LENGTH_PREFIXED\020\001\022\r\n\tDELI" "MITED\020\002\"H\n\nJsonFormat\022\027\n\023JSON_FORMAT_UNK" "NOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_BEST_EFFORT\020" @@ -2260,16 +2260,16 @@ const ::google::protobuf::EnumDescriptor* FeatureSet_Utf8Validation_descriptor() return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[12]; } PROTOBUF_CONSTINIT const uint32_t FeatureSet_Utf8Validation_internal_data_[] = { - 65536u, 32u, 6u, }; + 196608u, 0u, }; bool FeatureSet_Utf8Validation_IsValid(int value) { - return 0 <= value && value <= 3 && ((13u >> value) & 1) != 0; + return 0 <= value && value <= 2; } #if (__cplusplus < 201703) && \ (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr FeatureSet_Utf8Validation FeatureSet::UTF8_VALIDATION_UNKNOWN; -constexpr FeatureSet_Utf8Validation FeatureSet::VERIFY; constexpr FeatureSet_Utf8Validation FeatureSet::NONE; +constexpr FeatureSet_Utf8Validation FeatureSet::VERIFY; constexpr FeatureSet_Utf8Validation FeatureSet::Utf8Validation_MIN; constexpr FeatureSet_Utf8Validation FeatureSet::Utf8Validation_MAX; constexpr int FeatureSet::Utf8Validation_ARRAYSIZE; @@ -11687,8 +11687,8 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { {::_pbi::TcParser::FastEr0S1, {24, 2, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.repeated_field_encoding_)}}, // optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { - {::_pbi::TcParser::FastEvS1, - {32, 3, 3, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_)}}, + {::_pbi::TcParser::FastEr0S1, + {32, 3, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_)}}, // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {::_pbi::TcParser::FastEr0S1, {40, 4, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_)}}, @@ -11710,7 +11710,7 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.utf8_validation_), _Internal::kHasBitsOffset + 3, 3, - (0 | ::_fl::kFcOptional | ::_fl::kEnum)}, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_), _Internal::kHasBitsOffset + 4, 4, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, @@ -11721,7 +11721,7 @@ constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { {0, 4}, {0, 3}, {0, 3}, - {::_pbi::FieldAuxEnumData{}, ::google::protobuf::FeatureSet_Utf8Validation_internal_data_}, + {0, 3}, {0, 3}, {0, 3}, }}, {{ diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index fc613d584d..ea38e1f3d0 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -548,15 +548,15 @@ inline bool FeatureSet_RepeatedFieldEncoding_Parse(absl::string_view name, Featu } enum FeatureSet_Utf8Validation : int { FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN = 0, + FeatureSet_Utf8Validation_NONE = 1, FeatureSet_Utf8Validation_VERIFY = 2, - FeatureSet_Utf8Validation_NONE = 3, }; PROTOBUF_EXPORT bool FeatureSet_Utf8Validation_IsValid(int value); PROTOBUF_EXPORT extern const uint32_t FeatureSet_Utf8Validation_internal_data_[]; constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MIN = static_cast(0); -constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MAX = static_cast(3); -constexpr int FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE = 3 + 1; +constexpr FeatureSet_Utf8Validation FeatureSet_Utf8Validation_Utf8Validation_MAX = static_cast(2); +constexpr int FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE = 2 + 1; PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FeatureSet_Utf8Validation_descriptor(); template @@ -569,7 +569,7 @@ const std::string& FeatureSet_Utf8Validation_Name(T value) { template <> inline const std::string& FeatureSet_Utf8Validation_Name(FeatureSet_Utf8Validation value) { return ::google::protobuf::internal::NameOfDenseEnum( + 0, 2>( static_cast(value)); } inline bool FeatureSet_Utf8Validation_Parse(absl::string_view name, FeatureSet_Utf8Validation* value) { @@ -1817,8 +1817,8 @@ class PROTOBUF_EXPORT FeatureSet final : using Utf8Validation = FeatureSet_Utf8Validation; static constexpr Utf8Validation UTF8_VALIDATION_UNKNOWN = FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN; - static constexpr Utf8Validation VERIFY = FeatureSet_Utf8Validation_VERIFY; static constexpr Utf8Validation NONE = FeatureSet_Utf8Validation_NONE; + static constexpr Utf8Validation VERIFY = FeatureSet_Utf8Validation_VERIFY; static inline bool Utf8Validation_IsValid(int value) { return FeatureSet_Utf8Validation_IsValid(value); } diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index fe66e71f58..474864353a 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -974,8 +974,8 @@ message FeatureSet { enum Utf8Validation { UTF8_VALIDATION_UNKNOWN = 0; + NONE = 1; VERIFY = 2; - NONE = 3; } optional Utf8Validation utf8_validation = 4 [ retention = RETENTION_RUNTIME,