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/compiler/objectivec | |
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/compiler/objectivec')
5 files changed, 19 insertions, 19 deletions
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. } |