diff options
author | pg <pg@yandex-team.com> | 2023-02-06 20:48:31 +0300 |
---|---|---|
committer | pg <pg@yandex-team.com> | 2023-02-06 20:48:31 +0300 |
commit | 6cabb77676668397e5ac0afacc8c68b54c41c86b (patch) | |
tree | 8fa149d5288f046e8ecb7944fa299c69f17f86fe /contrib/libs/protoc/src/google/protobuf | |
parent | 717dbc4b00249886f789109e9af0432ece4d9586 (diff) | |
download | ydb-6cabb77676668397e5ac0afacc8c68b54c41c86b.tar.gz |
less shim
К сожалению, люди успели наплодить переменных и методов c именами i64(), ui64(), поэтому для генеренного кода проще всего оказалось завести несколько type alias arc_ui64 -> ui64, и так далее.
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf')
32 files changed, 134 insertions, 134 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.cc b/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.cc index 35c9cc914e..7f065c8bbd 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.cc @@ -201,7 +201,7 @@ bool GetProtocAbsolutePath(TProtoStringType* path) { int len = 0; char dirtybuffer[PATH_MAX]; - ui32 size = sizeof(dirtybuffer); + arc_ui32 size = sizeof(dirtybuffer); if (_NSGetExecutablePath(dirtybuffer, &size) == 0) { realpath(dirtybuffer, buffer); len = strlen(buffer); @@ -2149,7 +2149,7 @@ Parse PROTO_FILES and generate output based on the options given: } bool CommandLineInterface::EnforceProto3OptionalSupport( - const TProtoStringType& codegen_name, ui64 supported_features, + const TProtoStringType& codegen_name, arc_ui64 supported_features, const std::vector<const FileDescriptor*>& parsed_files) const { bool supports_proto3_optional = supported_features & CodeGenerator::FEATURE_PROTO3_OPTIONAL; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.h b/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.h index 0e601a4777..a5f1fc7008 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.h @@ -230,7 +230,7 @@ class PROTOC_EXPORT CommandLineInterface { // Fails if these files use proto3 optional and the code generator doesn't // support it. This is a permanent check. bool EnforceProto3OptionalSupport( - const TProtoStringType& codegen_name, ui64 supported_features, + const TProtoStringType& codegen_name, arc_ui64 supported_features, const std::vector<const FileDescriptor*>& parsed_files) const; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_enum.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_enum.cc index 4f97b1c5e1..263dff4079 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -53,13 +53,13 @@ namespace { // is kint32max, GOOGLE_ARRAYSIZE will overflow. In such cases we should omit the // generation of the GOOGLE_ARRAYSIZE constant. bool ShouldGenerateArraySize(const EnumDescriptor* descriptor) { - i32 max_value = descriptor->value(0)->number(); + arc_i32 max_value = descriptor->value(0)->number(); for (int i = 0; i < descriptor->value_count(); i++) { if (descriptor->value(i)->number() > max_value) { max_value = descriptor->value(i)->number(); } } - return max_value != std::numeric_limits<i32>::max(); + return max_value != std::numeric_limits<arc_i32>::max(); } // Returns the number of unique numeric enum values. This is less than diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.cc index 0cc2dc4175..0a5d2cd772 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.cc @@ -269,7 +269,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor, (*variables)["}"] = ""; } -void FieldGenerator::SetHasBitIndex(i32 has_bit_index) { +void FieldGenerator::SetHasBitIndex(arc_i32 has_bit_index) { if (!HasHasbit(descriptor_)) { GOOGLE_CHECK_EQ(has_bit_index, -1); return; @@ -282,7 +282,7 @@ void FieldGenerator::SetHasBitIndex(i32 has_bit_index) { strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;"); } -void FieldGenerator::SetInlinedStringIndex(i32 inlined_string_index) { +void FieldGenerator::SetInlinedStringIndex(arc_i32 inlined_string_index) { if (!IsStringInlined(descriptor_, options_)) { GOOGLE_CHECK_EQ(inlined_string_index, -1); return; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.h index 90236d48ae..8d50f88f12 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.h @@ -183,8 +183,8 @@ class FieldGenerator { virtual bool IsInlined() const { return false; } - void SetHasBitIndex(i32 has_bit_index); - void SetInlinedStringIndex(i32 inlined_string_index); + void SetHasBitIndex(arc_i32 has_bit_index); + void SetInlinedStringIndex(arc_i32 inlined_string_index); protected: const FieldDescriptor* descriptor_; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_helpers.cc index 53f46a229b..c5aa700c24 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_helpers.cc @@ -635,7 +635,7 @@ const char* DeclaredTypeMethodName(FieldDescriptor::Type type) { } TProtoStringType Int32ToString(int number) { - if (number == std::numeric_limits<i32>::min()) { + if (number == std::numeric_limits<arc_i32>::min()) { // This needs to be special-cased, see explanation here: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661 return StrCat(number + 1, " - 1"); @@ -644,17 +644,17 @@ TProtoStringType Int32ToString(int number) { } } -static TProtoStringType Int64ToString(i64 number) { - if (number == std::numeric_limits<i64>::min()) { +static TProtoStringType Int64ToString(arc_i64 number) { + if (number == std::numeric_limits<arc_i64>::min()) { // This needs to be special-cased, see explanation here: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661 - return StrCat("int64_t{", number + 1, "} - 1"); + return StrCat("arc_i64{", number + 1, "} - 1"); } - return StrCat("int64_t{", number, "}"); + return StrCat("arc_i64{", number, "}"); } -static TProtoStringType UInt64ToString(ui64 number) { - return StrCat("uint64_t{", number, "u}"); +static TProtoStringType UInt64ToString(arc_ui64 number) { + return StrCat("arc_ui64{", number, "u}"); } TProtoStringType DefaultValue(const FieldDescriptor* field) { diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.cc index 98ba9a393a..062b2bb754 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -83,7 +83,7 @@ static constexpr int kNoHasbit = -1; // masks is allowed to be shorter than _has_bits_, but at least one element of // masks must be non-zero. TProtoStringType ConditionalToCheckBitmasks( - const std::vector<ui32>& masks, bool return_success = true, + const std::vector<arc_ui32>& masks, bool return_success = true, StringPiece has_bits_var = "_has_bits_") { std::vector<TProtoStringType> parts; for (int i = 0; i < masks.size(); i++) { @@ -422,23 +422,23 @@ std::vector<std::vector<const FieldDescriptor*>> CollectFields( // Returns a bit mask based on has_bit index of "fields" that are typically on // the same chunk. It is used in a group presence check where _has_bits_ is // masked to tell if any thing in "fields" is present. -ui32 GenChunkMask(const std::vector<const FieldDescriptor*>& fields, +arc_ui32 GenChunkMask(const std::vector<const FieldDescriptor*>& fields, const std::vector<int>& has_bit_indices) { GOOGLE_CHECK(!fields.empty()); int first_index_offset = has_bit_indices[fields.front()->index()] / 32; - ui32 chunk_mask = 0; + arc_ui32 chunk_mask = 0; for (auto field : fields) { // "index" defines where in the _has_bits_ the field appears. int index = has_bit_indices[field->index()]; GOOGLE_CHECK_EQ(first_index_offset, index / 32); - chunk_mask |= static_cast<ui32>(1) << (index % 32); + chunk_mask |= static_cast<arc_ui32>(1) << (index % 32); } GOOGLE_CHECK_NE(0, chunk_mask); return chunk_mask; } // Return the number of bits set in n, a non-negative integer. -static int popcnt(ui32 n) { +static int popcnt(arc_ui32 n) { int result = 0; while (n != 0) { result += (n & 1); @@ -524,7 +524,7 @@ void ColdChunkSkipper::OnStartChunk(int chunk, int cached_has_word_index, format("if (PROTOBUF_PREDICT_FALSE("); int first_word = HasbitWord(chunk, 0); while (chunk < limit_chunk_) { - ui32 mask = 0; + arc_ui32 mask = 0; int this_word = HasbitWord(chunk, 0); // Generate mask for chunks on the same word. for (; chunk < limit_chunk_ && HasbitWord(chunk, 0) == this_word; chunk++) { @@ -2088,7 +2088,7 @@ namespace { // We need to calculate for each field what function the table driven code // should use to serialize it. This returns the index in a lookup table. -ui32 CalcFieldNum(const FieldGenerator& generator, +arc_ui32 CalcFieldNum(const FieldGenerator& generator, const FieldDescriptor* field, const Options& options) { bool is_a_map = IsMapEntryMessage(field->containing_type()); int type = field->type(); @@ -2143,7 +2143,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { const FieldDescriptor* field = sorted[i]; const FieldGenerator& generator = field_generators_.get(field); - ui32 tag = internal::WireFormatLite::MakeTag( + arc_ui32 tag = internal::WireFormatLite::MakeTag( field->number(), WireFormat::WireTypeForFieldType(field->type())); std::map<TProtoStringType, TProtoStringType> vars; @@ -2200,7 +2200,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { if (i == sorted.size()) break; const FieldDescriptor* field = sorted[i]; - ui32 tag = internal::WireFormatLite::MakeTag( + arc_ui32 tag = internal::WireFormatLite::MakeTag( field->number(), WireFormat::WireTypeForFieldType(field->type())); if (field->is_packed()) { tag = internal::WireFormatLite::MakeTag( @@ -2263,7 +2263,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { tag); } else if (field->real_containing_oneof()) { format.Set("oneofoffset", - sizeof(ui32) * field->containing_oneof()->index()); + sizeof(arc_ui32) * field->containing_oneof()->index()); format( "{PROTOBUF_FIELD_OFFSET($classtype$, $field_name$_), $1$," " PROTOBUF_FIELD_OFFSET($classtype$, _oneof_case_) + " @@ -2374,7 +2374,7 @@ void MessageGenerator::GenerateClassMethods(io::Printer* printer) { } } if (num_required_fields_ > 0) { - const std::vector<ui32> masks_for_has_bits = RequiredFieldsBitMask(); + const std::vector<arc_ui32> masks_for_has_bits = RequiredFieldsBitMask(); format( "static bool MissingRequiredFields(const HasBits& has_bits) " "{\n" @@ -3285,7 +3285,7 @@ void MessageGenerator::GenerateClear(io::Printer* printer) { if (have_outer_if) { // Emit an if() that will let us skip the whole chunk if none are set. - ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); + arc_ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); TProtoStringType chunk_mask_str = StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); @@ -3599,7 +3599,7 @@ void MessageGenerator::GenerateClassSpecificMergeFrom(io::Printer* printer) { if (have_outer_if) { // Emit an if() that will let us skip the whole chunk if none are set. - ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); + arc_ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); TProtoStringType chunk_mask_str = StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); @@ -4220,9 +4220,9 @@ void MessageGenerator::GenerateSerializeWithCachedSizesBodyShuffled( format("}\n"); } -std::vector<ui32> MessageGenerator::RequiredFieldsBitMask() const { +std::vector<arc_ui32> MessageGenerator::RequiredFieldsBitMask() const { const int array_size = HasBitsSize(); - std::vector<ui32> masks(array_size, 0); + std::vector<arc_ui32> masks(array_size, 0); for (auto field : FieldRange(descriptor_)) { if (!field->is_required()) { @@ -4230,7 +4230,7 @@ std::vector<ui32> MessageGenerator::RequiredFieldsBitMask() const { } const int has_bit_index = has_bit_indices_[field->index()]; - masks[has_bit_index / 32] |= static_cast<ui32>(1) + masks[has_bit_index / 32] |= static_cast<arc_ui32>(1) << (has_bit_index % 32); } return masks; @@ -4315,7 +4315,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* printer) { // present then the fast path executes; otherwise the slow path executes. if (num_required_fields_ > 1) { // The fast path works if all required fields are present. - const std::vector<ui32> masks_for_has_bits = RequiredFieldsBitMask(); + const std::vector<arc_ui32> masks_for_has_bits = RequiredFieldsBitMask(); format("if ($1$) { // All required fields are present.\n", ConditionalToCheckBitmasks(masks_for_has_bits)); format.Indent(); @@ -4371,7 +4371,7 @@ void MessageGenerator::GenerateByteSize(io::Printer* printer) { if (have_outer_if) { // Emit an if() that will let us skip the whole chunk if none are set. - ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); + arc_ui32 chunk_mask = GenChunkMask(chunk, has_bit_indices_); TProtoStringType chunk_mask_str = StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h index 8bd87df416..939f21a1da 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h @@ -183,7 +183,7 @@ class MessageGenerator { int HasByteIndex(const FieldDescriptor* a) const; int HasWordIndex(const FieldDescriptor* a) const; bool SameHasByte(const FieldDescriptor* a, const FieldDescriptor* b) const; - std::vector<ui32> RequiredFieldsBitMask() const; + std::vector<arc_ui32> RequiredFieldsBitMask() const; const Descriptor* descriptor_; int index_in_file_messages_; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc index d8c8739035..ac3e57cda8 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc @@ -66,7 +66,7 @@ bool HasInternalAccessors(const FieldOptions::CType ctype) { return ctype == FieldOptions::STRING || ctype == FieldOptions::CORD; } -int TagSize(ui32 field_number) { +int TagSize(arc_ui32 field_number) { if (field_number < 16) return 1; GOOGLE_CHECK_LT(field_number, (1 << 14)) << "coded tag for " << field_number << " too big for uint16_t"; @@ -109,7 +109,7 @@ TProtoStringType MessageTcParseFunctionName(const FieldDescriptor* field, TProtoStringType FieldParseFunctionName(const FieldDescriptor* field, const Options& options, - ui32 table_size_log2); + arc_ui32 table_size_log2); } // namespace @@ -152,7 +152,7 @@ TailCallTableInfo::TailCallTableInfo(const Descriptor* descriptor, // byte 0 byte 1 // 1nnnnttt 0nnnnnnn // ^^^^^^^ ^^^^^^^ - ui32 tag = WireFormat::MakeTag(field); + arc_ui32 tag = WireFormat::MakeTag(field); if (tag >= 1 << 14) { continue; } else if (tag >= 1 << 7) { @@ -167,7 +167,7 @@ TailCallTableInfo::TailCallTableInfo(const Descriptor* descriptor, // ^^^^^ // This means that any field number that does not fit in the lower 4 bits // will always have the top bit of its table index asserted: - ui32 idx = (tag >> 3) & (table_size - 1); + arc_ui32 idx = (tag >> 3) & (table_size - 1); // If this entry in the table is already used, then this field will be // handled by the generated fallback function. if (!fast_path_fields[idx].func_name.empty()) continue; @@ -425,7 +425,7 @@ void ParseFunctionGenerator::GenerateTailcallFieldParseFunctions( " PROTOBUF_MUSTTAIL " "return table->fallback(PROTOBUF_TC_PARAM_PASS);\n" " ptr += $1$;\n" - " hasbits |= (uint64_t{1} << data.hasbit_idx());\n" + " hasbits |= (arc_ui64{1} << data.hasbit_idx());\n" " ::$proto_ns$::internal::TcParserBase::SyncHasbits" "(msg, hasbits, table);\n" " auto& field = ::$proto_ns$::internal::TcParserBase::" @@ -834,7 +834,7 @@ void ParseFunctionGenerator::GenerateFieldBody( {{"put_field", StrCat("set_", FieldName(field))}, {"mutable_field", StrCat("mutable_", FieldName(field))}}); } - ui32 tag = WireFormatLite::MakeTag(field->number(), wiretype); + arc_ui32 tag = WireFormatLite::MakeTag(field->number(), wiretype); switch (wiretype) { case WireFormatLite::WIRETYPE_VARINT: { TProtoStringType type = PrimitiveTypeName(options_, field->cpp_type()); @@ -925,15 +925,15 @@ void ParseFunctionGenerator::GenerateFieldBody( // Returns the tag for this field and in case of repeated packable fields, // sets a fallback tag in fallback_tag_ptr. -static ui32 ExpectedTag(const FieldDescriptor* field, - ui32* fallback_tag_ptr) { - ui32 expected_tag; +static arc_ui32 ExpectedTag(const FieldDescriptor* field, + arc_ui32* fallback_tag_ptr) { + arc_ui32 expected_tag; if (field->is_packable()) { auto expected_wiretype = WireFormat::WireTypeForFieldType(field->type()); expected_tag = WireFormatLite::MakeTag(field->number(), expected_wiretype); GOOGLE_CHECK(expected_wiretype != WireFormatLite::WIRETYPE_LENGTH_DELIMITED); auto fallback_wiretype = WireFormatLite::WIRETYPE_LENGTH_DELIMITED; - ui32 fallback_tag = + arc_ui32 fallback_tag = WireFormatLite::MakeTag(field->number(), fallback_wiretype); if (field->is_packed()) std::swap(expected_tag, fallback_tag); @@ -996,9 +996,9 @@ void ParseFunctionGenerator::GenerateParseIterationBody( descriptor->extension_range(i); if (i > 0) format(" ||\n "); - ui32 start_tag = WireFormatLite::MakeTag( + arc_ui32 start_tag = WireFormatLite::MakeTag( range->start, static_cast<WireFormatLite::WireType>(0)); - ui32 end_tag = WireFormatLite::MakeTag( + arc_ui32 end_tag = WireFormatLite::MakeTag( range->end, static_cast<WireFormatLite::WireType>(0)); if (range->end > FieldDescriptor::kMaxNumber) { @@ -1035,13 +1035,13 @@ void ParseFunctionGenerator::GenerateFieldSwitch( PrintFieldComment(format, field); format("case $1$:\n", field->number()); format.Indent(); - ui32 fallback_tag = 0; - ui32 expected_tag = ExpectedTag(field, &fallback_tag); + arc_ui32 fallback_tag = 0; + arc_ui32 expected_tag = ExpectedTag(field, &fallback_tag); format("if (PROTOBUF_PREDICT_TRUE(static_cast<$uint8$>(tag) == $1$)) {\n", expected_tag & 0xFF); format.Indent(); auto wiretype = WireFormatLite::GetTagWireType(expected_tag); - ui32 tag = WireFormatLite::MakeTag(field->number(), wiretype); + arc_ui32 tag = WireFormatLite::MakeTag(field->number(), wiretype); int tag_size = io::CodedOutputStream::VarintSize32(tag); bool is_repeat = ShouldRepeat(field, wiretype); if (is_repeat) { @@ -1087,7 +1087,7 @@ namespace { TProtoStringType FieldParseFunctionName(const FieldDescriptor* field, const Options& options, - ui32 table_size_log2) { + arc_ui32 table_size_log2) { ParseCardinality card = // field->is_packed() ? ParseCardinality::kPacked : field->is_repeated() ? ParseCardinality::kRepeated @@ -1244,20 +1244,20 @@ TProtoStringType GetTailCallFieldHandlerName(ParseCardinality card, switch (type_format) { case TypeFormat::kVar64: case TypeFormat::kFixed64: - name.append("uint64_t, "); + name.append("arc_ui64, "); break; case TypeFormat::kSInt64: - name.append("int64_t, "); + name.append("arc_i64, "); break; case TypeFormat::kVar32: case TypeFormat::kFixed32: - name.append("uint32_t, "); + name.append("arc_ui32, "); break; case TypeFormat::kSInt32: - name.append("int32_t, "); + name.append("arc_i32, "); break; case TypeFormat::kBool: diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h index 71eb82626f..820f7b3089 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h @@ -65,7 +65,7 @@ struct TailCallTableInfo { // Table size. int table_size_log2; // Mask for has-bits of required fields. - ui32 has_hasbits_required_mask; + arc_ui32 has_hasbits_required_mask; // True if a generated fallback function is required instead of generic. bool use_generated_fallback; }; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc index 9c32e1821b..a037f6289c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc @@ -70,7 +70,7 @@ void SetEnumVariables(const FieldDescriptor* descriptor, int messageBitIndex, (*variables)["default_number"] = StrCat(descriptor->default_value_enum()->number()); (*variables)["tag"] = StrCat( - static_cast<i32>(internal::WireFormat::MakeTag(descriptor))); + static_cast<arc_i32>(internal::WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( internal::WireFormat::TagSize(descriptor->number(), GetType(descriptor))); // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc index 73ef7ddfa4..300da77b9c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc @@ -77,7 +77,7 @@ void SetEnumVariables(const FieldDescriptor* descriptor, int messageBitIndex, (*variables)["default_number"] = StrCat(descriptor->default_value_enum()->number()); (*variables)["tag"] = StrCat( - static_cast<i32>(internal::WireFormat::MakeTag(descriptor))); + static_cast<arc_i32>(internal::WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( internal::WireFormat::TagSize(descriptor->number(), GetType(descriptor))); // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc index 161565a62d..4c613af8ea 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc @@ -576,11 +576,11 @@ TProtoStringType DefaultValue(const FieldDescriptor* field, bool immutable, return StrCat(field->default_value_int32()); case FieldDescriptor::CPPTYPE_UINT32: // Need to print as a signed int since Java has no unsigned. - return StrCat(static_cast<i32>(field->default_value_uint32())); + return StrCat(static_cast<arc_i32>(field->default_value_uint32())); case FieldDescriptor::CPPTYPE_INT64: return StrCat(field->default_value_int64()) + "L"; case FieldDescriptor::CPPTYPE_UINT64: - return StrCat(static_cast<i64>(field->default_value_uint64())) + + return StrCat(static_cast<arc_i64>(field->default_value_uint64())) + "L"; case FieldDescriptor::CPPTYPE_DOUBLE: { double value = field->default_value_double(); @@ -972,7 +972,7 @@ bool HasRepeatedFields(const Descriptor* descriptor) { // // Note that we only use code points in [0x0000, 0xD7FF] and [0xE000, 0xFFFF]. // There will be no surrogate pairs in the encoded character sequence. -void WriteUInt32ToUtf16CharSequence(ui32 number, +void WriteUInt32ToUtf16CharSequence(arc_ui32 number, std::vector<uint16_t>* output) { // For values in [0x0000, 0xD7FF], only use one char to encode it. if (number < 0xD800) { diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h index 487b43f13e..dd80e23d3f 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h @@ -426,12 +426,12 @@ inline TProtoStringType GeneratedCodeVersionSuffix() { return "V3"; } -void WriteUInt32ToUtf16CharSequence(ui32 number, +void WriteUInt32ToUtf16CharSequence(arc_ui32 number, std::vector<uint16_t>* output); inline void WriteIntToUtf16CharSequence(int value, std::vector<uint16_t>* output) { - WriteUInt32ToUtf16CharSequence(static_cast<ui32>(value), output); + WriteUInt32ToUtf16CharSequence(static_cast<arc_ui32>(value), output); } // Escape a UTF-16 character so it can be embedded in a Java string literal. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc index b245106ab7..83c5fb5dd6 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc @@ -1222,11 +1222,11 @@ void ImmutableMessageGenerator::GenerateParsingConstructor( for (int i = 0; i < descriptor_->field_count(); i++) { const FieldDescriptor* field = sorted_fields[i]; - ui32 tag = WireFormatLite::MakeTag( + arc_ui32 tag = WireFormatLite::MakeTag( field->number(), WireFormat::WireTypeForFieldType(field->type())); printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast<i32>(tag))); + StrCat(static_cast<arc_i32>(tag))); printer->Indent(); field_generators_.get(field).GenerateParsingCode(printer); @@ -1239,10 +1239,10 @@ void ImmutableMessageGenerator::GenerateParsingConstructor( if (field->is_packable()) { // To make packed = true wire compatible, we generate parsing code from a // packed version of this field regardless of field->options().packed(). - ui32 packed_tag = WireFormatLite::MakeTag( + arc_ui32 packed_tag = WireFormatLite::MakeTag( field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED); printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast<i32>(packed_tag))); + StrCat(static_cast<arc_i32>(packed_tag))); printer->Indent(); field_generators_.get(field).GenerateParsingCodeFromPacked(printer); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc index a90dc71d0a..51e91affd8 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc @@ -114,7 +114,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, (*variables)["capitalized_type"] = GetCapitalizedType(descriptor, /* immutable = */ true); (*variables)["tag"] = - StrCat(static_cast<i32>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<arc_i32>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); if (IsReferenceType(GetJavaType(descriptor))) { diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc index 16ad9881c9..24fef33624 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc @@ -80,7 +80,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, (*variables)["capitalized_type"] = GetCapitalizedType(descriptor, /* immutable = */ true); (*variables)["tag"] = - StrCat(static_cast<i32>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<arc_i32>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); (*variables)["required"] = descriptor->is_required() ? "true" : "false"; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc index 6b4b058eba..2d0eb752a8 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc @@ -73,7 +73,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, "= " + ImmutableDefaultValue(descriptor, name_resolver); (*variables)["capitalized_type"] = "String"; (*variables)["tag"] = - StrCat(static_cast<i32>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<arc_i32>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); (*variables)["null_check"] = diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc index b448ae8930..42198cc266 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc @@ -74,7 +74,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, "= " + ImmutableDefaultValue(descriptor, name_resolver); (*variables)["capitalized_type"] = "java.lang.String"; (*variables)["tag"] = - StrCat(static_cast<i32>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<arc_i32>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); // We use `x.getClass()` as a null check because it generates less bytecode diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum.cc b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum.cc index 8149a47c83..c3836faa2a 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum.cc @@ -154,7 +154,7 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { " * Checks to see if the given value is defined by the enum or was not known at\n" " * the time this source was generated.\n" " **/\n" - "BOOL $name$_IsValidValue(int32_t value);\n" + "BOOL $name$_IsValidValue(arc_i32 value);\n" "\n", "name", name_); } @@ -200,7 +200,7 @@ void EnumGenerator::GenerateSource(io::Printer* printer) { } printer->Print( ";\n" - " static const int32_t values[] = {\n"); + " static const arc_i32 values[] = {\n"); for (int i = 0; i < all_values_.size(); i++) { printer->Print(" $name$,\n", "name", EnumValueName(all_values_[i])); } @@ -212,7 +212,7 @@ void EnumGenerator::GenerateSource(io::Printer* printer) { " [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol($name$)\n" " valueNames:valueNames\n" " values:values\n" - " count:(uint32_t)(sizeof(values) / sizeof(int32_t))\n" + " count:(arc_ui32)(sizeof(values) / sizeof(arc_i32))\n" " enumVerifier:$name$_IsValidValue];\n", "name", name_); } else { @@ -222,7 +222,7 @@ void EnumGenerator::GenerateSource(io::Printer* printer) { " [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol($name$)\n" " valueNames:valueNames\n" " values:values\n" - " count:(uint32_t)(sizeof(values) / sizeof(int32_t))\n" + " count:(arc_ui32)(sizeof(values) / sizeof(arc_i32))\n" " enumVerifier:$name$_IsValidValue\n" " extraTextFormatInfo:extraTextFormatInfo];\n", "name", name_, @@ -238,7 +238,7 @@ void EnumGenerator::GenerateSource(io::Printer* printer) { "}\n\n"); printer->Print( - "BOOL $name$_IsValidValue(int32_t value__) {\n" + "BOOL $name$_IsValidValue(arc_i32 value__) {\n" " switch (value__) {\n", "name", name_); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc index cd0d721066..474b70a8ad 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc @@ -85,13 +85,13 @@ void EnumFieldGenerator::GenerateCFunctionDeclarations( " * Fetches the raw value of a @c $owning_message_class$'s @c $name$ property, even\n" " * if the value was not defined by the enum at the time the code was generated.\n" " **/\n" - "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message);\n" + "arc_i32 $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message);\n" "/**\n" " * Sets the raw value of an @c $owning_message_class$'s @c $name$ property, allowing\n" " * it to be set to a value that was not defined by the enum at the time the code\n" " * was generated.\n" " **/\n" - "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, int32_t value);\n" + "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, arc_i32 value);\n" "\n"); } @@ -101,13 +101,13 @@ void EnumFieldGenerator::GenerateCFunctionImplementations( printer->Print( variables_, - "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message) {\n" + "arc_i32 $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message) {\n" " GPBDescriptor *descriptor = [$owning_message_class$ descriptor];\n" " GPBFieldDescriptor *field = [descriptor fieldWithNumber:$field_number_name$];\n" " return GPBGetMessageRawEnumField(message, field);\n" "}\n" "\n" - "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, int32_t value) {\n" + "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, arc_i32 value) {\n" " GPBDescriptor *descriptor = [$owning_message_class$ descriptor];\n" " GPBFieldDescriptor *field = [descriptor fieldWithNumber:$field_number_name$];\n" " GPBSetMessageRawEnumField(message, field, value);\n" diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_field.cc index 7fcd00a24c..0e1bb33070 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_field.cc @@ -109,7 +109,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor, (*variables)["dataTypeSpecific_value"] = "Nil"; (*variables)["storage_offset_value"] = - "(uint32_t)offsetof(" + classname + "__storage_, " + camel_case_name + ")"; + "(arc_ui32)offsetof(" + classname + "__storage_, " + camel_case_name + ")"; (*variables)["storage_offset_comment"] = ""; // Clear some common things so they can be set just when needed. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_message.cc index 0f0087e5a3..39f8fd50fb 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_message.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_message.cc @@ -450,7 +450,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { printer->Print( "\n" "typedef struct $classname$__storage_ {\n" - " uint32_t _has_storage_[$sizeof_has_storage$];\n", + " arc_ui32 _has_storage_[$sizeof_has_storage$];\n", "classname", class_name_, "sizeof_has_storage", StrCat(sizeof_has_storage)); printer->Indent(); @@ -510,7 +510,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { vars["fields"] = has_fields ? "fields" : "NULL"; if (has_fields) { vars["fields_count"] = - "(uint32_t)(sizeof(fields) / sizeof(" + field_description_type + "))"; + "(arc_ui32)(sizeof(fields) / sizeof(" + field_description_type + "))"; } else { vars["fields_count"] = "0"; } @@ -547,7 +547,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { printer->Print( " };\n" " [localDescriptor setupOneofs:oneofs\n" - " count:(uint32_t)(sizeof(oneofs) / sizeof(char*))\n" + " count:(arc_ui32)(sizeof(oneofs) / sizeof(char*))\n" " firstHasIndex:$first_has_index$];\n", "first_has_index", oneof_generators_[0]->HasIndexAsString()); } @@ -579,7 +579,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { printer->Print( " };\n" " [localDescriptor setupExtensionRanges:ranges\n" - " count:(uint32_t)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n"); + " count:(arc_ui32)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n"); } if (descriptor_->containing_type() != NULL) { TProtoStringType containing_class = ClassName(descriptor_->containing_type()); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc index b8f4faebca..767068107a 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc @@ -52,13 +52,13 @@ const char* PrimitiveTypeName(const FieldDescriptor* descriptor) { ObjectiveCType type = GetObjectiveCType(descriptor); switch (type) { case OBJECTIVECTYPE_INT32: - return "int32_t"; + return "arc_i32"; case OBJECTIVECTYPE_UINT32: - return "uint32_t"; + return "arc_ui32"; case OBJECTIVECTYPE_INT64: - return "int64_t"; + return "arc_i64"; case OBJECTIVECTYPE_UINT64: - return "uint64_t"; + return "arc_ui64"; case OBJECTIVECTYPE_FLOAT: return "float"; case OBJECTIVECTYPE_DOUBLE: @@ -70,7 +70,7 @@ const char* PrimitiveTypeName(const FieldDescriptor* descriptor) { case OBJECTIVECTYPE_DATA: return "NSData"; case OBJECTIVECTYPE_ENUM: - return "int32_t"; + return "arc_i32"; case OBJECTIVECTYPE_MESSAGE: return NULL; // Messages go through objectivec_message_field.cc|h. } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc b/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc index 0e8d1fe6e3..03b00dd0e8 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc @@ -242,9 +242,9 @@ bool Parser::ConsumeIdentifier(TProtoStringType* output, const char* error) { bool Parser::ConsumeInteger(int* output, const char* error) { if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { - ui64 value = 0; + arc_ui64 value = 0; if (!io::Tokenizer::ParseInteger(input_->current().text, - std::numeric_limits<i32>::max(), + std::numeric_limits<arc_i32>::max(), &value)) { AddError("Integer out of range."); // We still return true because we did, in fact, parse an integer. @@ -260,19 +260,19 @@ bool Parser::ConsumeInteger(int* output, const char* error) { bool Parser::ConsumeSignedInteger(int* output, const char* error) { bool is_negative = false; - ui64 max_value = std::numeric_limits<i32>::max(); + arc_ui64 max_value = std::numeric_limits<arc_i32>::max(); if (TryConsume("-")) { is_negative = true; max_value += 1; } - ui64 value = 0; + arc_ui64 value = 0; DO(ConsumeInteger64(max_value, &value, error)); if (is_negative) value *= -1; *output = value; return true; } -bool Parser::ConsumeInteger64(ui64 max_value, ui64* output, +bool Parser::ConsumeInteger64(arc_ui64 max_value, arc_ui64* output, const char* error) { if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { if (!io::Tokenizer::ParseInteger(input_->current().text, max_value, @@ -296,9 +296,9 @@ bool Parser::ConsumeNumber(double* output, const char* error) { return true; } else if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { // Also accept integers. - ui64 value = 0; + arc_ui64 value = 0; if (!io::Tokenizer::ParseInteger(input_->current().text, - std::numeric_limits<ui64>::max(), + std::numeric_limits<arc_ui64>::max(), &value)) { AddError("Integer out of range."); // We still return true because we did, in fact, parse a number. @@ -827,7 +827,7 @@ bool IsMessageSetWireFormatMessage(const DescriptorProto& message) { void AdjustExtensionRangesWithMaxEndNumber(DescriptorProto* message) { const bool is_message_set = IsMessageSetWireFormatMessage(*message); const int max_extension_number = is_message_set - ? std::numeric_limits<i32>::max() + ? std::numeric_limits<arc_i32>::max() : FieldDescriptor::kMaxNumber + 1; for (int i = 0; i < message->extension_range_size(); ++i) { if (message->extension_range(i).end() == kMaxRangeSentinel) { @@ -842,7 +842,7 @@ void AdjustExtensionRangesWithMaxEndNumber(DescriptorProto* message) { void AdjustReservedRangesWithMaxEndNumber(DescriptorProto* message) { const bool is_message_set = IsMessageSetWireFormatMessage(*message); const int max_field_number = is_message_set - ? std::numeric_limits<i32>::max() + ? std::numeric_limits<arc_i32>::max() : FieldDescriptor::kMaxNumber + 1; for (int i = 0; i < message->reserved_range_size(); ++i) { if (message->reserved_range(i).end() == kMaxRangeSentinel) { @@ -1259,11 +1259,11 @@ bool Parser::ParseDefaultAssignment( case FieldDescriptorProto::TYPE_SINT64: case FieldDescriptorProto::TYPE_SFIXED32: case FieldDescriptorProto::TYPE_SFIXED64: { - ui64 max_value = std::numeric_limits<i64>::max(); + arc_ui64 max_value = std::numeric_limits<arc_i64>::max(); if (field->type() == FieldDescriptorProto::TYPE_INT32 || field->type() == FieldDescriptorProto::TYPE_SINT32 || field->type() == FieldDescriptorProto::TYPE_SFIXED32) { - max_value = std::numeric_limits<i32>::max(); + max_value = std::numeric_limits<arc_i32>::max(); } // These types can be negative. @@ -1273,7 +1273,7 @@ bool Parser::ParseDefaultAssignment( ++max_value; } // Parse the integer to verify that it is not out-of-range. - ui64 value; + arc_ui64 value; DO(ConsumeInteger64(max_value, &value, "Expected integer for field default value.")); // And stringify it again. @@ -1285,10 +1285,10 @@ bool Parser::ParseDefaultAssignment( case FieldDescriptorProto::TYPE_UINT64: case FieldDescriptorProto::TYPE_FIXED32: case FieldDescriptorProto::TYPE_FIXED64: { - ui64 max_value = std::numeric_limits<ui64>::max(); + arc_ui64 max_value = std::numeric_limits<arc_ui64>::max(); if (field->type() == FieldDescriptorProto::TYPE_UINT32 || field->type() == FieldDescriptorProto::TYPE_FIXED32) { - max_value = std::numeric_limits<ui32>::max(); + max_value = std::numeric_limits<arc_ui32>::max(); } // Numeric, not negative. @@ -1296,7 +1296,7 @@ bool Parser::ParseDefaultAssignment( AddError("Unsigned field can't have negative default value."); } // Parse the integer to verify that it is not out-of-range. - ui64 value; + arc_ui64 value; DO(ConsumeInteger64(max_value, &value, "Expected integer for field default value.")); // And stringify it again. @@ -1528,17 +1528,17 @@ bool Parser::ParseOption(Message* options, } case io::Tokenizer::TYPE_INTEGER: { - ui64 value; - ui64 max_value = + arc_ui64 value; + arc_ui64 max_value = is_negative - ? static_cast<ui64>(std::numeric_limits<i64>::max()) + 1 - : std::numeric_limits<ui64>::max(); + ? static_cast<arc_ui64>(std::numeric_limits<arc_i64>::max()) + 1 + : std::numeric_limits<arc_ui64>::max(); DO(ConsumeInteger64(max_value, &value, "Expected integer.")); if (is_negative) { value_location.AddPath( UninterpretedOption::kNegativeIntValueFieldNumber); uninterpreted_option->set_negative_int_value( - static_cast<i64>(-value)); + static_cast<arc_i64>(-value)); } else { value_location.AddPath( UninterpretedOption::kPositiveIntValueFieldNumber); @@ -2338,8 +2338,8 @@ bool Parser::ParsePackage(FileDescriptorProto* file, } bool Parser::ParseImport(RepeatedPtrField<TProtoStringType>* dependency, - RepeatedField<i32>* public_dependency, - RepeatedField<i32>* weak_dependency, + RepeatedField<arc_i32>* public_dependency, + RepeatedField<arc_i32>* weak_dependency, const LocationRecorder& root_location, const FileDescriptorProto* containing_file) { LocationRecorder location(root_location, diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/parser.h b/contrib/libs/protoc/src/google/protobuf/compiler/parser.h index b7c487405b..0a1bfc6827 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/parser.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/parser.h @@ -175,7 +175,7 @@ class PROTOBUF_EXPORT Parser { bool ConsumeSignedInteger(int* output, const char* error); // Consume a 64-bit integer and store its value in "output". If the value // is greater than max_value, an error will be reported. - bool ConsumeInteger64(ui64 max_value, ui64* output, + bool ConsumeInteger64(arc_ui64 max_value, arc_ui64* output, const char* error); // Consume a number and store its value in "output". This will accept // tokens of either INTEGER or FLOAT type. @@ -327,8 +327,8 @@ class PROTOBUF_EXPORT Parser { const LocationRecorder& root_location, const FileDescriptorProto* containing_file); bool ParseImport(RepeatedPtrField<TProtoStringType>* dependency, - RepeatedField<i32>* public_dependency, - RepeatedField<i32>* weak_dependency, + RepeatedField<arc_i32>* public_dependency, + RepeatedField<arc_i32>* weak_dependency, const LocationRecorder& root_location, const FileDescriptorProto* containing_file); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/perlxs/perlxs_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/perlxs/perlxs_generator.cc index 3ae4a39fd5..7c5f0fa395 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/perlxs/perlxs_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/perlxs/perlxs_generator.cc @@ -165,7 +165,7 @@ PerlXSGenerator::GenerateMessageXS(const Descriptor* descriptor, "\n" " int64_t ByteCount() const\n" " {\n" - " return (int64_t)SvCUR(sv_);\n" + " return (arc_i64)SvCUR(sv_);\n" " }\n" "\n" "private:\n" @@ -1896,14 +1896,14 @@ PerlXSGenerator::FieldFromHashrefHelper(io::Printer& printer, break; case FieldDescriptor::CPPTYPE_INT64: printer.Print(vars, - "int64_t iv$pdepth$ = " + "arc_i64 iv$pdepth$ = " "strtoll(SvPV_nolen($var$), NULL, 0);\n" "\n" "$msg$->$do$_$cppname$(iv$pdepth$);\n"); break; case FieldDescriptor::CPPTYPE_UINT64: printer.Print(vars, - "uint64_t uv$pdepth$ = " + "arc_ui64 uv$pdepth$ = " "strtoull(SvPV_nolen($var$), NULL, 0);\n" "\n" "$msg$->$do$_$cppname$(uv$pdepth$);\n"); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/php/php_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/php/php_generator.cc index 7210b37bcb..56c7d10338 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/php/php_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/php/php_generator.cc @@ -1896,7 +1896,7 @@ void GenerateCEnum(const EnumDescriptor* desc, io::Printer* printer) { " const upb_enumdef *e = upb_symtab_lookupenum(symtab, \"$name$\");\n" " char *name = NULL;\n" " size_t name_len;\n" - " int32_t num;\n" + " arc_i32 num;\n" " if (zend_parse_parameters(ZEND_NUM_ARGS(), \"s\", &name,\n" " &name_len) == FAILURE) {\n" " return;\n" diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.cc b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.cc index cf849bb168..092d2ba17f 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.cc @@ -67,7 +67,7 @@ constexpr CodeGeneratorResponse::CodeGeneratorResponse( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : file_() , error_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , supported_features_(ui64{0u}){} + , supported_features_(arc_ui64{0u}){} struct CodeGeneratorResponseDefaultTypeInternal { constexpr CodeGeneratorResponseDefaultTypeInternal() : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} @@ -1282,7 +1282,7 @@ CodeGeneratorResponse::CodeGeneratorResponse(const CodeGeneratorResponse& from) void CodeGeneratorResponse::SharedCtor() { error_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -supported_features_ = ui64{0u}; +supported_features_ = arc_ui64{0u}; } CodeGeneratorResponse::~CodeGeneratorResponse() { @@ -1318,7 +1318,7 @@ void CodeGeneratorResponse::Clear() { if (cached_has_bits & 0x00000001u) { error_.ClearNonDefaultToEmpty(); } - supported_features_ = ui64{0u}; + supported_features_ = arc_ui64{0u}; _has_bits_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h index 63d5f0b323..1b75172781 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h @@ -1741,7 +1741,7 @@ inline bool CodeGeneratorResponse::has_supported_features() const { return _internal_has_supported_features(); } inline void CodeGeneratorResponse::clear_supported_features() { - supported_features_ = ui64{0u}; + supported_features_ = arc_ui64{0u}; _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 CodeGeneratorResponse::_internal_supported_features() const { diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.cc b/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.cc index 2a7fa391fc..37feced21f 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.cc @@ -47,7 +47,7 @@ namespace compiler { // see https://msdn.microsoft.com/en-us/library/9kkf9tah.aspx static const uint16_t kDosEpoch = 1 << 5 | 1; -static const ui32 kCRC32Table[256] = { +static const arc_ui32 kCRC32Table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, @@ -92,8 +92,8 @@ static const ui32 kCRC32Table[256] = { 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; -static ui32 ComputeCRC32(const TProtoStringType& buf) { - ui32 x = ~0U; +static arc_ui32 ComputeCRC32(const TProtoStringType& buf) { + arc_ui32 x = ~0U; for (int i = 0; i < buf.size(); ++i) { unsigned char c = buf[i]; x = kCRC32Table[(x ^ c) & 0xff] ^ (x >> 8); @@ -145,16 +145,16 @@ bool ZipWriter::Write(const TProtoStringType& filename, bool ZipWriter::WriteDirectory() { uint16_t num_entries = files_.size(); - ui32 dir_ofs = raw_output_->ByteCount(); + arc_ui32 dir_ofs = raw_output_->ByteCount(); // write central directory io::CodedOutputStream output(raw_output_); for (int i = 0; i < num_entries; ++i) { const TProtoStringType& filename = files_[i].name; uint16_t filename_size = filename.size(); - ui32 crc32 = files_[i].crc32; - ui32 size = files_[i].size; - ui32 offset = files_[i].offset; + arc_ui32 crc32 = files_[i].crc32; + arc_ui32 size = files_[i].size; + arc_ui32 offset = files_[i].offset; output.WriteLittleEndian32(0x02014b50); // magic WriteShort(&output, 10); // version made by @@ -175,7 +175,7 @@ bool ZipWriter::WriteDirectory() { output.WriteLittleEndian32(offset); // local header offset output.WriteString(filename); // file name } - ui32 dir_len = output.ByteCount(); + arc_ui32 dir_len = output.ByteCount(); // write end of central directory marker output.WriteLittleEndian32(0x06054b50); // magic diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.h b/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.h index 2d8c0c67b5..1ebb2e2508 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.h @@ -51,9 +51,9 @@ class ZipWriter { private: struct FileInfo { TProtoStringType name; - ui32 offset; - ui32 size; - ui32 crc32; + arc_ui32 offset; + arc_ui32 size; + arc_ui32 crc32; }; io::ZeroCopyOutputStream* raw_output_; |