diff options
| author | pg <[email protected]> | 2023-02-05 17:18:56 +0300 |
|---|---|---|
| committer | pg <[email protected]> | 2023-02-05 17:18:56 +0300 |
| commit | f0dcf26e6c8006eed936664c53ef5234ac773c75 (patch) | |
| tree | b3728c8bc17c24a6f8b3b9f762cc87b8dab1e54e /contrib/libs/protoc/src/google/protobuf/compiler/java | |
| parent | 9331e4d05e2f395a0a5ab5f5647517eab412bbed (diff) | |
replace hand-crafted patch with computer program
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/java')
9 files changed, 15 insertions, 15 deletions
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 318c8201985..9c32e1821b9 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<int32_t>(internal::WireFormat::MakeTag(descriptor))); + static_cast<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 91b6b4842e8..73ef7ddfa42 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<int32_t>(internal::WireFormat::MakeTag(descriptor))); + static_cast<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 a498388ade7..161565a62d5 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<int32_t>(field->default_value_uint32())); + return StrCat(static_cast<i32>(field->default_value_uint32())); case FieldDescriptor::CPPTYPE_INT64: return StrCat(field->default_value_int64()) + "L"; case FieldDescriptor::CPPTYPE_UINT64: - return StrCat(static_cast<int64_t>(field->default_value_uint64())) + + return StrCat(static_cast<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(uint32_t number, +void WriteUInt32ToUtf16CharSequence(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 5acc729c1db..487b43f13e1 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(uint32_t number, +void WriteUInt32ToUtf16CharSequence(ui32 number, std::vector<uint16_t>* output); inline void WriteIntToUtf16CharSequence(int value, std::vector<uint16_t>* output) { - WriteUInt32ToUtf16CharSequence(static_cast<uint32_t>(value), output); + WriteUInt32ToUtf16CharSequence(static_cast<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 3cc9c24e90a..b245106ab72 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]; - uint32_t tag = WireFormatLite::MakeTag( + ui32 tag = WireFormatLite::MakeTag( field->number(), WireFormat::WireTypeForFieldType(field->type())); printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast<int32_t>(tag))); + StrCat(static_cast<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(). - uint32_t packed_tag = WireFormatLite::MakeTag( + ui32 packed_tag = WireFormatLite::MakeTag( field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED); printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast<int32_t>(packed_tag))); + StrCat(static_cast<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 ab550761b1e..a90dc71d0a1 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<int32_t>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<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 35f78fce9e4..16ad9881c9e 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<int32_t>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<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 ac17bb77fd0..6b4b058eba4 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<int32_t>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<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 bfaedeba9a1..b448ae89304 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<int32_t>(WireFormat::MakeTag(descriptor))); + StrCat(static_cast<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 |
