aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf
diff options
context:
space:
mode:
authorpg <pg@yandex-team.com>2023-02-05 17:18:56 +0300
committerpg <pg@yandex-team.com>2023-02-05 17:18:56 +0300
commitf0dcf26e6c8006eed936664c53ef5234ac773c75 (patch)
treeb3728c8bc17c24a6f8b3b9f762cc87b8dab1e54e /contrib/libs/protoc/src/google/protobuf
parent9331e4d05e2f395a0a5ab5f5647517eab412bbed (diff)
downloadydb-f0dcf26e6c8006eed936664c53ef5234ac773c75.tar.gz
replace hand-crafted patch with computer program
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.cc4
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/command_line_interface.h2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_enum.cc4
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.cc4
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_field.h4
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_helpers.cc8
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.cc36
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_message.h2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc30
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_field_base.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_map_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_message_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_primitive_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h1
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc6
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h4
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc8
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/parser.cc50
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/parser.h6
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.cc6
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h2
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.cc16
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/zip_writer.h6
35 files changed, 105 insertions, 117 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 c1ae224e22..35c9cc914e 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];
- uint32_t size = sizeof(dirtybuffer);
+ 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, uint64_t supported_features,
+ const TProtoStringType& codegen_name, 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 337475c693..0e601a4777 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, uint64_t supported_features,
+ const TProtoStringType& codegen_name, 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 0d3da32158..4f97b1c5e1 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) {
- int32_t max_value = descriptor->value(0)->number();
+ 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<int32_t>::max();
+ return max_value != std::numeric_limits<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 22e2a8a4a6..0cc2dc4175 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(int32_t has_bit_index) {
+void FieldGenerator::SetHasBitIndex(i32 has_bit_index) {
if (!HasHasbit(descriptor_)) {
GOOGLE_CHECK_EQ(has_bit_index, -1);
return;
@@ -282,7 +282,7 @@ void FieldGenerator::SetHasBitIndex(int32_t has_bit_index) {
strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;");
}
-void FieldGenerator::SetInlinedStringIndex(int32_t inlined_string_index) {
+void FieldGenerator::SetInlinedStringIndex(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 d263b10e70..90236d48ae 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(int32_t has_bit_index);
- void SetInlinedStringIndex(int32_t inlined_string_index);
+ void SetHasBitIndex(i32 has_bit_index);
+ void SetInlinedStringIndex(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 308b3164a4..53f46a229b 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<int32_t>::min()) {
+ if (number == std::numeric_limits<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,8 +644,8 @@ TProtoStringType Int32ToString(int number) {
}
}
-static TProtoStringType Int64ToString(int64_t number) {
- if (number == std::numeric_limits<int64_t>::min()) {
+static TProtoStringType Int64ToString(i64 number) {
+ if (number == std::numeric_limits<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");
@@ -653,7 +653,7 @@ static TProtoStringType Int64ToString(int64_t number) {
return StrCat("int64_t{", number, "}");
}
-static TProtoStringType UInt64ToString(uint64_t number) {
+static TProtoStringType UInt64ToString(ui64 number) {
return StrCat("uint64_t{", number, "u}");
}
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 7d1535f3b9..98ba9a393a 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<uint32_t>& masks, bool return_success = true,
+ const std::vector<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.
-uint32_t GenChunkMask(const std::vector<const FieldDescriptor*>& fields,
+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;
- uint32_t chunk_mask = 0;
+ 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<uint32_t>(1) << (index % 32);
+ chunk_mask |= static_cast<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(uint32_t n) {
+static int popcnt(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_) {
- uint32_t mask = 0;
+ 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.
-uint32_t CalcFieldNum(const FieldGenerator& generator,
+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);
- uint32_t tag = internal::WireFormatLite::MakeTag(
+ 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];
- uint32_t tag = internal::WireFormatLite::MakeTag(
+ 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(uint32_t) * field->containing_oneof()->index());
+ sizeof(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<uint32_t> masks_for_has_bits = RequiredFieldsBitMask();
+ const std::vector<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.
- uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_);
+ 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.
- uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_);
+ 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<uint32_t> MessageGenerator::RequiredFieldsBitMask() const {
+std::vector<ui32> MessageGenerator::RequiredFieldsBitMask() const {
const int array_size = HasBitsSize();
- std::vector<uint32_t> masks(array_size, 0);
+ std::vector<ui32> masks(array_size, 0);
for (auto field : FieldRange(descriptor_)) {
if (!field->is_required()) {
@@ -4230,7 +4230,7 @@ std::vector<uint32_t> MessageGenerator::RequiredFieldsBitMask() const {
}
const int has_bit_index = has_bit_indices_[field->index()];
- masks[has_bit_index / 32] |= static_cast<uint32_t>(1)
+ masks[has_bit_index / 32] |= static_cast<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<uint32_t> masks_for_has_bits = RequiredFieldsBitMask();
+ const std::vector<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.
- uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_);
+ 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 1e4e942d69..8bd87df416 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<uint32_t> RequiredFieldsBitMask() const;
+ std::vector<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 93d44864c3..d8c8739035 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(uint32_t field_number) {
+int TagSize(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,
- uint32_t table_size_log2);
+ ui32 table_size_log2);
} // namespace
@@ -152,7 +152,7 @@ TailCallTableInfo::TailCallTableInfo(const Descriptor* descriptor,
// byte 0 byte 1
// 1nnnnttt 0nnnnnnn
// ^^^^^^^ ^^^^^^^
- uint32_t tag = WireFormat::MakeTag(field);
+ 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:
- uint32_t idx = (tag >> 3) & (table_size - 1);
+ 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;
@@ -834,7 +834,7 @@ void ParseFunctionGenerator::GenerateFieldBody(
{{"put_field", StrCat("set_", FieldName(field))},
{"mutable_field", StrCat("mutable_", FieldName(field))}});
}
- uint32_t tag = WireFormatLite::MakeTag(field->number(), wiretype);
+ 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 uint32_t ExpectedTag(const FieldDescriptor* field,
- uint32_t* fallback_tag_ptr) {
- uint32_t expected_tag;
+static ui32 ExpectedTag(const FieldDescriptor* field,
+ ui32* fallback_tag_ptr) {
+ 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;
- uint32_t fallback_tag =
+ 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 ");
- uint32_t start_tag = WireFormatLite::MakeTag(
+ ui32 start_tag = WireFormatLite::MakeTag(
range->start, static_cast<WireFormatLite::WireType>(0));
- uint32_t end_tag = WireFormatLite::MakeTag(
+ 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();
- uint32_t fallback_tag = 0;
- uint32_t expected_tag = ExpectedTag(field, &fallback_tag);
+ ui32 fallback_tag = 0;
+ 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);
- uint32_t tag = WireFormatLite::MakeTag(field->number(), wiretype);
+ 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,
- uint32_t table_size_log2) {
+ ui32 table_size_log2) {
ParseCardinality card = //
field->is_packed() ? ParseCardinality::kPacked
: field->is_repeated() ? ParseCardinality::kRepeated
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 34c8fc488b..71eb82626f 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.
- uint32_t has_hasbits_required_mask;
+ 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/csharp/csharp_enum.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum.h
index e409c2e4b2..dcbfba36df 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum.h
@@ -63,4 +63,3 @@ class EnumGenerator : public SourceGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum_field.h
index e282d72390..b887a28734 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_enum_field.h
@@ -80,4 +80,3 @@ class EnumOneofFieldGenerator : public PrimitiveOneofFieldGenerator {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_field_base.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_field_base.h
index aa1184c423..154f67ae9c 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_field_base.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_field_base.h
@@ -108,4 +108,3 @@ class FieldGeneratorBase : public SourceGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_FIELD_BASE_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_map_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_map_field.h
index 9b5e214e6d..e8212498c9 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_map_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_map_field.h
@@ -72,4 +72,3 @@ class MapFieldGenerator : public FieldGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MAP_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_message_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_message_field.h
index 1436fe2008..1da8bea08d 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_message_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_message_field.h
@@ -90,4 +90,3 @@ class MessageOneofFieldGenerator : public MessageFieldGenerator {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_primitive_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_primitive_field.h
index a2c11050e2..f0dbfad791 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_primitive_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_primitive_field.h
@@ -94,4 +94,3 @@ class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h
index 2e265702fb..23d3c0daba 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h
@@ -76,4 +76,3 @@ class RepeatedEnumFieldGenerator : public FieldGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_ENUM_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h
index a2267adf3d..c584f2bd6f 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h
@@ -76,4 +76,3 @@ class RepeatedMessageFieldGenerator : public FieldGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_MESSAGE_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h
index d432f37b2f..36be81d069 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h
@@ -72,4 +72,3 @@ class RepeatedPrimitiveFieldGenerator : public FieldGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_PRIMITIVE_FIELD_H__
-
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
index 5938d5d1fd..9206cd3309 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
@@ -68,4 +68,3 @@ class SourceGeneratorBase {
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__
-
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 318c820198..9c32e1821b 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 91b6b4842e..73ef7ddfa4 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 a498388ade..161565a62d 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 5acc729c1d..487b43f13e 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 3cc9c24e90..b245106ab7 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 ab550761b1..a90dc71d0a 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 35f78fce9e..16ad9881c9 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 ac17bb77fd..6b4b058eba 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 bfaedeba9a..b448ae8930 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
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc b/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc
index fa3dffbdb6..0e8d1fe6e3 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)) {
- uint64 value = 0;
+ ui64 value = 0;
if (!io::Tokenizer::ParseInteger(input_->current().text,
- std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<i32>::max(),
&value)) {
AddError("Integer out of range.");
// We still return true because we did, in fact, parse an integer.
@@ -260,29 +260,27 @@ bool Parser::ConsumeInteger(int* output, const char* error) {
bool Parser::ConsumeSignedInteger(int* output, const char* error) {
bool is_negative = false;
- uint64_t max_value = std::numeric_limits<int32_t>::max();
+ ui64 max_value = std::numeric_limits<i32>::max();
if (TryConsume("-")) {
is_negative = true;
max_value += 1;
}
- uint64_t value = 0;
+ ui64 value = 0;
DO(ConsumeInteger64(max_value, &value, error));
if (is_negative) value *= -1;
*output = value;
return true;
}
-bool Parser::ConsumeInteger64(uint64_t max_value, uint64_t* output,
+bool Parser::ConsumeInteger64(ui64 max_value, ui64* output,
const char* error) {
if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
- uint64 parsed;
if (!io::Tokenizer::ParseInteger(input_->current().text, max_value,
- &parsed)) {
+ output)) {
AddError("Integer out of range.");
// We still return true because we did, in fact, parse an integer.
- parsed = 0;
+ *output = 0;
}
- *output = parsed;
input_->Next();
return true;
} else {
@@ -298,9 +296,9 @@ bool Parser::ConsumeNumber(double* output, const char* error) {
return true;
} else if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
// Also accept integers.
- uint64 value = 0;
+ ui64 value = 0;
if (!io::Tokenizer::ParseInteger(input_->current().text,
- std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<ui64>::max(),
&value)) {
AddError("Integer out of range.");
// We still return true because we did, in fact, parse a number.
@@ -829,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<int32_t>::max()
+ ? std::numeric_limits<i32>::max()
: FieldDescriptor::kMaxNumber + 1;
for (int i = 0; i < message->extension_range_size(); ++i) {
if (message->extension_range(i).end() == kMaxRangeSentinel) {
@@ -844,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<int32_t>::max()
+ ? std::numeric_limits<i32>::max()
: FieldDescriptor::kMaxNumber + 1;
for (int i = 0; i < message->reserved_range_size(); ++i) {
if (message->reserved_range(i).end() == kMaxRangeSentinel) {
@@ -1261,11 +1259,11 @@ bool Parser::ParseDefaultAssignment(
case FieldDescriptorProto::TYPE_SINT64:
case FieldDescriptorProto::TYPE_SFIXED32:
case FieldDescriptorProto::TYPE_SFIXED64: {
- uint64_t max_value = std::numeric_limits<int64_t>::max();
+ ui64 max_value = std::numeric_limits<i64>::max();
if (field->type() == FieldDescriptorProto::TYPE_INT32 ||
field->type() == FieldDescriptorProto::TYPE_SINT32 ||
field->type() == FieldDescriptorProto::TYPE_SFIXED32) {
- max_value = std::numeric_limits<int32_t>::max();
+ max_value = std::numeric_limits<i32>::max();
}
// These types can be negative.
@@ -1275,7 +1273,7 @@ bool Parser::ParseDefaultAssignment(
++max_value;
}
// Parse the integer to verify that it is not out-of-range.
- uint64_t value;
+ ui64 value;
DO(ConsumeInteger64(max_value, &value,
"Expected integer for field default value."));
// And stringify it again.
@@ -1287,10 +1285,10 @@ bool Parser::ParseDefaultAssignment(
case FieldDescriptorProto::TYPE_UINT64:
case FieldDescriptorProto::TYPE_FIXED32:
case FieldDescriptorProto::TYPE_FIXED64: {
- uint64_t max_value = std::numeric_limits<uint64_t>::max();
+ ui64 max_value = std::numeric_limits<ui64>::max();
if (field->type() == FieldDescriptorProto::TYPE_UINT32 ||
field->type() == FieldDescriptorProto::TYPE_FIXED32) {
- max_value = std::numeric_limits<uint32_t>::max();
+ max_value = std::numeric_limits<ui32>::max();
}
// Numeric, not negative.
@@ -1298,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.
- uint64_t value;
+ ui64 value;
DO(ConsumeInteger64(max_value, &value,
"Expected integer for field default value."));
// And stringify it again.
@@ -1530,17 +1528,17 @@ bool Parser::ParseOption(Message* options,
}
case io::Tokenizer::TYPE_INTEGER: {
- uint64_t value;
- uint64_t max_value =
+ ui64 value;
+ ui64 max_value =
is_negative
- ? static_cast<uint64_t>(std::numeric_limits<int64_t>::max()) + 1
- : std::numeric_limits<uint64_t>::max();
+ ? static_cast<ui64>(std::numeric_limits<i64>::max()) + 1
+ : std::numeric_limits<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<int64_t>(-value));
+ static_cast<i64>(-value));
} else {
value_location.AddPath(
UninterpretedOption::kPositiveIntValueFieldNumber);
@@ -2340,8 +2338,8 @@ bool Parser::ParsePackage(FileDescriptorProto* file,
}
bool Parser::ParseImport(RepeatedPtrField<TProtoStringType>* dependency,
- RepeatedField<int32_t>* public_dependency,
- RepeatedField<int32_t>* weak_dependency,
+ RepeatedField<i32>* public_dependency,
+ RepeatedField<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 ca42449a95..b7c487405b 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(uint64_t max_value, uint64_t* output,
+ bool ConsumeInteger64(ui64 max_value, 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<int32_t>* public_dependency,
- RepeatedField<int32_t>* weak_dependency,
+ RepeatedField<i32>* public_dependency,
+ RepeatedField<i32>* weak_dependency,
const LocationRecorder& root_location,
const FileDescriptorProto* containing_file);
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 d7f4aea2e6..cf849bb168 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_(uint64_t{0u}){}
+ , supported_features_(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_ = uint64_t{0u};
+supported_features_ = ui64{0u};
}
CodeGeneratorResponse::~CodeGeneratorResponse() {
@@ -1318,7 +1318,7 @@ void CodeGeneratorResponse::Clear() {
if (cached_has_bits & 0x00000001u) {
error_.ClearNonDefaultToEmpty();
}
- supported_features_ = uint64_t{0u};
+ supported_features_ = 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 3b198910a1..63d5f0b323 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_ = uint64_t{0u};
+ supported_features_ = 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 40bac12e40..2a7fa391fc 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 uint32_t kCRC32Table[256] = {
+static const 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 uint32_t kCRC32Table[256] = {
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d};
-static uint32_t ComputeCRC32(const TProtoStringType& buf) {
- uint32_t x = ~0U;
+static ui32 ComputeCRC32(const TProtoStringType& buf) {
+ 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();
- uint32_t dir_ofs = raw_output_->ByteCount();
+ 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();
- uint32_t crc32 = files_[i].crc32;
- uint32_t size = files_[i].size;
- uint32_t offset = files_[i].offset;
+ ui32 crc32 = files_[i].crc32;
+ ui32 size = files_[i].size;
+ 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
}
- uint32_t dir_len = output.ByteCount();
+ 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 a1ce179d89..2d8c0c67b5 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;
- uint32_t offset;
- uint32_t size;
- uint32_t crc32;
+ ui32 offset;
+ ui32 size;
+ ui32 crc32;
};
io::ZeroCopyOutputStream* raw_output_;