From d846b0b059b4d867536b98aa29475a387aa09114 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Mon, 8 Jun 2015 16:24:57 -0400 Subject: Beta quality drop of Objective C Support. - Add more to the ObjC dir readme. - Merge the ExtensionField and ExtensionDescriptor to reduce overhead. - Fix an initialization race. - Clean up the Xcode schemes. - Remove the class/enum filter. - Remove some forced inline that were bloating things without proof of performance wins. - Rename some internal types to avoid conflicts with the well know types protos. - Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants. - Better document some possible future improvements. - Add missing support for parsing repeated primitive fields in packed or unpacked forms. - Improve -hash. - Add *Count for repeated and map<> fields to avoid auto create when checking for them being set. --- objectivec/google/protobuf/Any.pbobjc.m | 52 +- objectivec/google/protobuf/Api.pbobjc.h | 3 + objectivec/google/protobuf/Api.pbobjc.m | 151 ++- objectivec/google/protobuf/Descriptor.pbobjc.h | 30 + objectivec/google/protobuf/Descriptor.pbobjc.m | 1451 +++++++++++---------- objectivec/google/protobuf/Duration.pbobjc.m | 50 +- objectivec/google/protobuf/Empty.pbobjc.m | 40 +- objectivec/google/protobuf/FieldMask.pbobjc.h | 1 + objectivec/google/protobuf/FieldMask.pbobjc.m | 46 +- objectivec/google/protobuf/SourceContext.pbobjc.m | 44 +- objectivec/google/protobuf/Struct.pbobjc.h | 2 + objectivec/google/protobuf/Struct.pbobjc.m | 162 +-- objectivec/google/protobuf/Timestamp.pbobjc.m | 50 +- objectivec/google/protobuf/Type.pbobjc.h | 7 + objectivec/google/protobuf/Type.pbobjc.m | 334 ++--- objectivec/google/protobuf/Wrappers.pbobjc.m | 372 +++--- 16 files changed, 1503 insertions(+), 1292 deletions(-) (limited to 'objectivec/google') diff --git a/objectivec/google/protobuf/Any.pbobjc.m b/objectivec/google/protobuf/Any.pbobjc.m index 4db73cb9..b41102a4 100644 --- a/objectivec/google/protobuf/Any.pbobjc.m +++ b/objectivec/google/protobuf/Any.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBAnyRoot_FileDescriptor + static GPBFileDescriptor *GPBAnyRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -29,16 +32,16 @@ static GPBFileDescriptor *GPBAnyRoot_FileDescriptor(void) { @dynamic typeURL; @dynamic value; -typedef struct GPBAny_Storage { +typedef struct GPBAny__storage_ { uint32_t _has_storage_[1]; NSString *typeURL; NSData *value; -} GPBAny_Storage; +} GPBAny__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -46,10 +49,10 @@ typedef struct GPBAny_Storage { .number = GPBAny_FieldNumber_TypeURL, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom, - .type = GPBTypeString, - .offset = offsetof(GPBAny_Storage, typeURL), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBAny__storage_, typeURL), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -57,10 +60,10 @@ typedef struct GPBAny_Storage { .number = GPBAny_FieldNumber_Value, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeData, - .offset = offsetof(GPBAny_Storage, value), + .dataType = GPBDataTypeBytes, + .offset = offsetof(GPBAny__storage_, value), .defaultValue.valueData = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; @@ -69,20 +72,23 @@ typedef struct GPBAny_Storage { #else static const char *extraTextFormatInfo = "\001\001\004\241!!\000"; #endif // GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBAny class] - rootClass:[GPBAnyRoot class] - file:GPBAnyRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBAny_Storage) - wireFormat:NO - extraTextFormatInfo:extraTextFormatInfo]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBAny class] + rootClass:[GPBAnyRoot class] + file:GPBAnyRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBAny__storage_) + wireFormat:NO + extraTextFormatInfo:extraTextFormatInfo]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Api.pbobjc.h b/objectivec/google/protobuf/Api.pbobjc.h index 9e6fc850..061347be 100644 --- a/objectivec/google/protobuf/Api.pbobjc.h +++ b/objectivec/google/protobuf/Api.pbobjc.h @@ -45,10 +45,12 @@ typedef GPB_ENUM(GPBApi_FieldNumber) { // The methods of this api, in unspecified order. // |methodsArray| contains |GPBMethod| @property(nonatomic, readwrite, strong) NSMutableArray *methodsArray; +@property(nonatomic, readonly) NSUInteger methodsArray_Count; // Any metadata attached to the API. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; // A version string for this api. If specified, must have the form // `major-version.minor-version`, as in `1.10`. If the minor version @@ -113,6 +115,7 @@ typedef GPB_ENUM(GPBMethod_FieldNumber) { // Any metadata attached to the method. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; @end diff --git a/objectivec/google/protobuf/Api.pbobjc.m b/objectivec/google/protobuf/Api.pbobjc.m index 9416860a..c2be94ab 100644 --- a/objectivec/google/protobuf/Api.pbobjc.m +++ b/objectivec/google/protobuf/Api.pbobjc.m @@ -16,10 +16,8 @@ // about thread safety and initialization of registry. static GPBExtensionRegistry* registry = nil; if (!registry) { + GPBDebugCheckRuntimeVersion(); registry = [[GPBExtensionRegistry alloc] init]; - static GPBExtensionDescription descriptions[] = { - }; - #pragma unused (descriptions) [registry addExtensions:[GPBSourceContextRoot extensionRegistry]]; [registry addExtensions:[GPBTypeRoot extensionRegistry]]; } @@ -28,11 +26,14 @@ @end +#pragma mark - GPBApiRoot_FileDescriptor + static GPBFileDescriptor *GPBApiRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -44,24 +45,24 @@ static GPBFileDescriptor *GPBApiRoot_FileDescriptor(void) { @implementation GPBApi @dynamic name; -@dynamic methodsArray; -@dynamic optionsArray; +@dynamic methodsArray, methodsArray_Count; +@dynamic optionsArray, optionsArray_Count; @dynamic version; @dynamic hasSourceContext, sourceContext; -typedef struct GPBApi_Storage { +typedef struct GPBApi__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *methodsArray; NSMutableArray *optionsArray; NSString *version; GPBSourceContext *sourceContext; -} GPBApi_Storage; +} GPBApi__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -69,10 +70,10 @@ typedef struct GPBApi_Storage { .number = GPBApi_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBApi_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBApi__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -80,10 +81,10 @@ typedef struct GPBApi_Storage { .number = GPBApi_FieldNumber_MethodsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBApi_Storage, methodsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBApi__storage_, methodsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBMethod), + .dataTypeSpecific.className = GPBStringifySymbol(GPBMethod), .fieldOptions = NULL, }, { @@ -91,10 +92,10 @@ typedef struct GPBApi_Storage { .number = GPBApi_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBApi_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBApi__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, { @@ -102,10 +103,10 @@ typedef struct GPBApi_Storage { .number = GPBApi_FieldNumber_Version, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBApi_Storage, version), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBApi__storage_, version), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -113,26 +114,29 @@ typedef struct GPBApi_Storage { .number = GPBApi_FieldNumber_SourceContext, .hasIndex = 4, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBApi_Storage, sourceContext), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBApi__storage_, sourceContext), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBApi class] - rootClass:[GPBApiRoot class] - file:GPBApiRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBApi_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBApi class] + rootClass:[GPBApiRoot class] + file:GPBApiRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBApi__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -148,9 +152,9 @@ typedef struct GPBApi_Storage { @dynamic requestStreaming; @dynamic responseTypeURL; @dynamic responseStreaming; -@dynamic optionsArray; +@dynamic optionsArray, optionsArray_Count; -typedef struct GPBMethod_Storage { +typedef struct GPBMethod__storage_ { uint32_t _has_storage_[1]; BOOL requestStreaming; BOOL responseStreaming; @@ -158,12 +162,12 @@ typedef struct GPBMethod_Storage { NSString *requestTypeURL; NSString *responseTypeURL; NSMutableArray *optionsArray; -} GPBMethod_Storage; +} GPBMethod__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -171,10 +175,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBMethod_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethod__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -182,10 +186,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_RequestTypeURL, .hasIndex = 1, .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom, - .type = GPBTypeString, - .offset = offsetof(GPBMethod_Storage, requestTypeURL), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethod__storage_, requestTypeURL), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -193,10 +197,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_RequestStreaming, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBMethod_Storage, requestStreaming), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMethod__storage_, requestStreaming), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -204,10 +208,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_ResponseTypeURL, .hasIndex = 3, .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom, - .type = GPBTypeString, - .offset = offsetof(GPBMethod_Storage, responseTypeURL), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethod__storage_, responseTypeURL), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -215,10 +219,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_ResponseStreaming, .hasIndex = 4, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBMethod_Storage, responseStreaming), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMethod__storage_, responseStreaming), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -226,10 +230,10 @@ typedef struct GPBMethod_Storage { .number = GPBMethod_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBMethod_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBMethod__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, }; @@ -238,20 +242,23 @@ typedef struct GPBMethod_Storage { #else static const char *extraTextFormatInfo = "\002\002\007\244\241!!\000\004\010\244\241!!\000"; #endif // GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBMethod class] - rootClass:[GPBApiRoot class] - file:GPBApiRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBMethod_Storage) - wireFormat:NO - extraTextFormatInfo:extraTextFormatInfo]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMethod class] + rootClass:[GPBApiRoot class] + file:GPBApiRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBMethod__storage_) + wireFormat:NO + extraTextFormatInfo:extraTextFormatInfo]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.h b/objectivec/google/protobuf/Descriptor.pbobjc.h index 5a53abbc..e0106534 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.h +++ b/objectivec/google/protobuf/Descriptor.pbobjc.h @@ -152,6 +152,7 @@ typedef GPB_ENUM(GPBFileDescriptorSet_FieldNumber) { // |fileArray| contains |GPBFileDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *fileArray; +@property(nonatomic, readonly) NSUInteger fileArray_Count; @end @@ -186,26 +187,33 @@ typedef GPB_ENUM(GPBFileDescriptorProto_FieldNumber) { // Names of files imported by this file. // |dependencyArray| contains |NSString| @property(nonatomic, readwrite, strong) NSMutableArray *dependencyArray; +@property(nonatomic, readonly) NSUInteger dependencyArray_Count; // Indexes of the public imported files in the dependency list above. @property(nonatomic, readwrite, strong) GPBInt32Array *publicDependencyArray; +@property(nonatomic, readonly) NSUInteger publicDependencyArray_Count; // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. @property(nonatomic, readwrite, strong) GPBInt32Array *weakDependencyArray; +@property(nonatomic, readonly) NSUInteger weakDependencyArray_Count; // All top-level definitions in this file. // |messageTypeArray| contains |GPBDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *messageTypeArray; +@property(nonatomic, readonly) NSUInteger messageTypeArray_Count; // |enumTypeArray| contains |GPBEnumDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *enumTypeArray; +@property(nonatomic, readonly) NSUInteger enumTypeArray_Count; // |serviceArray| contains |GPBServiceDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *serviceArray; +@property(nonatomic, readonly) NSUInteger serviceArray_Count; // |extensionArray| contains |GPBFieldDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *extensionArray; +@property(nonatomic, readonly) NSUInteger extensionArray_Count; @property(nonatomic, readwrite) BOOL hasOptions; @property(nonatomic, readwrite, strong) GPBFileOptions *options; @@ -247,32 +255,40 @@ typedef GPB_ENUM(GPBDescriptorProto_FieldNumber) { // |fieldArray| contains |GPBFieldDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *fieldArray; +@property(nonatomic, readonly) NSUInteger fieldArray_Count; // |extensionArray| contains |GPBFieldDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *extensionArray; +@property(nonatomic, readonly) NSUInteger extensionArray_Count; // |nestedTypeArray| contains |GPBDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *nestedTypeArray; +@property(nonatomic, readonly) NSUInteger nestedTypeArray_Count; // |enumTypeArray| contains |GPBEnumDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *enumTypeArray; +@property(nonatomic, readonly) NSUInteger enumTypeArray_Count; // |extensionRangeArray| contains |GPBDescriptorProto_ExtensionRange| @property(nonatomic, readwrite, strong) NSMutableArray *extensionRangeArray; +@property(nonatomic, readonly) NSUInteger extensionRangeArray_Count; // |oneofDeclArray| contains |GPBOneofDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *oneofDeclArray; +@property(nonatomic, readonly) NSUInteger oneofDeclArray_Count; @property(nonatomic, readwrite) BOOL hasOptions; @property(nonatomic, readwrite, strong) GPBMessageOptions *options; // |reservedRangeArray| contains |GPBDescriptorProto_ReservedRange| @property(nonatomic, readwrite, strong) NSMutableArray *reservedRangeArray; +@property(nonatomic, readonly) NSUInteger reservedRangeArray_Count; // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. // |reservedNameArray| contains |NSString| @property(nonatomic, readwrite, strong) NSMutableArray *reservedNameArray; +@property(nonatomic, readonly) NSUInteger reservedNameArray_Count; @end @@ -407,6 +423,7 @@ typedef GPB_ENUM(GPBEnumDescriptorProto_FieldNumber) { // |valueArray| contains |GPBEnumValueDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *valueArray; +@property(nonatomic, readonly) NSUInteger valueArray_Count; @property(nonatomic, readwrite) BOOL hasOptions; @property(nonatomic, readwrite, strong) GPBEnumOptions *options; @@ -451,6 +468,7 @@ typedef GPB_ENUM(GPBServiceDescriptorProto_FieldNumber) { // |methodArray| contains |GPBMethodDescriptorProto| @property(nonatomic, readwrite, strong) NSMutableArray *methodArray; +@property(nonatomic, readonly) NSUInteger methodArray_Count; @property(nonatomic, readwrite) BOOL hasOptions; @property(nonatomic, readwrite, strong) GPBServiceOptions *options; @@ -617,6 +635,7 @@ typedef GPB_ENUM(GPBFileOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -693,6 +712,7 @@ typedef GPB_ENUM(GPBMessageOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -782,6 +802,7 @@ typedef GPB_ENUM(GPBFieldOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -810,6 +831,7 @@ typedef GPB_ENUM(GPBEnumOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -832,6 +854,7 @@ typedef GPB_ENUM(GPBEnumValueOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -854,6 +877,7 @@ typedef GPB_ENUM(GPBServiceOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -876,6 +900,7 @@ typedef GPB_ENUM(GPBMethodOptions_FieldNumber) { // The parser stores options it doesn't recognize here. See above. // |uninterpretedOptionArray| contains |GPBUninterpretedOption| @property(nonatomic, readwrite, strong) NSMutableArray *uninterpretedOptionArray; +@property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count; @end @@ -901,6 +926,7 @@ typedef GPB_ENUM(GPBUninterpretedOption_FieldNumber) { // |nameArray| contains |GPBUninterpretedOption_NamePart| @property(nonatomic, readwrite, strong) NSMutableArray *nameArray; +@property(nonatomic, readonly) NSUInteger nameArray_Count; // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. @@ -1001,6 +1027,7 @@ typedef GPB_ENUM(GPBSourceCodeInfo_FieldNumber) { // be recorded in the future. // |locationArray| contains |GPBSourceCodeInfo_Location| @property(nonatomic, readwrite, strong) NSMutableArray *locationArray; +@property(nonatomic, readonly) NSUInteger locationArray_Count; @end @@ -1040,6 +1067,7 @@ typedef GPB_ENUM(GPBSourceCodeInfo_Location_FieldNumber) { // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). @property(nonatomic, readwrite, strong) GPBInt32Array *pathArray; +@property(nonatomic, readonly) NSUInteger pathArray_Count; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. @@ -1047,6 +1075,7 @@ typedef GPB_ENUM(GPBSourceCodeInfo_Location_FieldNumber) { // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. @property(nonatomic, readwrite, strong) GPBInt32Array *spanArray; +@property(nonatomic, readonly) NSUInteger spanArray_Count; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be @@ -1103,6 +1132,7 @@ typedef GPB_ENUM(GPBSourceCodeInfo_Location_FieldNumber) { // |leadingDetachedCommentsArray| contains |NSString| @property(nonatomic, readwrite, strong) NSMutableArray *leadingDetachedCommentsArray; +@property(nonatomic, readonly) NSUInteger leadingDetachedCommentsArray_Count; @end diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.m b/objectivec/google/protobuf/Descriptor.pbobjc.m index 7f1bdd49..8c535b9a 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.m +++ b/objectivec/google/protobuf/Descriptor.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBDescriptorRoot_FileDescriptor + static GPBFileDescriptor *GPBDescriptorRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto2]; } @@ -26,17 +29,17 @@ static GPBFileDescriptor *GPBDescriptorRoot_FileDescriptor(void) { @implementation GPBFileDescriptorSet -@dynamic fileArray; +@dynamic fileArray, fileArray_Count; -typedef struct GPBFileDescriptorSet_Storage { +typedef struct GPBFileDescriptorSet__storage_ { uint32_t _has_storage_[1]; NSMutableArray *fileArray; -} GPBFileDescriptorSet_Storage; +} GPBFileDescriptorSet__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -44,26 +47,29 @@ typedef struct GPBFileDescriptorSet_Storage { .number = GPBFileDescriptorSet_FieldNumber_FileArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorSet_Storage, fileArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorSet__storage_, fileArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFileDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFileDescriptorProto), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFileDescriptorSet class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBFileDescriptorSet_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFileDescriptorSet class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBFileDescriptorSet__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -76,18 +82,18 @@ typedef struct GPBFileDescriptorSet_Storage { @dynamic hasName, name; @dynamic hasPackage, package; -@dynamic dependencyArray; -@dynamic publicDependencyArray; -@dynamic weakDependencyArray; -@dynamic messageTypeArray; -@dynamic enumTypeArray; -@dynamic serviceArray; -@dynamic extensionArray; +@dynamic dependencyArray, dependencyArray_Count; +@dynamic publicDependencyArray, publicDependencyArray_Count; +@dynamic weakDependencyArray, weakDependencyArray_Count; +@dynamic messageTypeArray, messageTypeArray_Count; +@dynamic enumTypeArray, enumTypeArray_Count; +@dynamic serviceArray, serviceArray_Count; +@dynamic extensionArray, extensionArray_Count; @dynamic hasOptions, options; @dynamic hasSourceCodeInfo, sourceCodeInfo; @dynamic hasSyntax, syntax; -typedef struct GPBFileDescriptorProto_Storage { +typedef struct GPBFileDescriptorProto__storage_ { uint32_t _has_storage_[1]; NSString *name; NSString *package; @@ -101,12 +107,12 @@ typedef struct GPBFileDescriptorProto_Storage { GPBInt32Array *publicDependencyArray; GPBInt32Array *weakDependencyArray; NSString *syntax; -} GPBFileDescriptorProto_Storage; +} GPBFileDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -114,10 +120,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -125,10 +131,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_Package, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileDescriptorProto_Storage, package), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileDescriptorProto__storage_, package), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -136,10 +142,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_DependencyArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeString, - .offset = offsetof(GPBFileDescriptorProto_Storage, dependencyArray), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileDescriptorProto__storage_, dependencyArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -147,10 +153,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_MessageTypeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, messageTypeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, messageTypeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBDescriptorProto), .fieldOptions = NULL, }, { @@ -158,10 +164,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_EnumTypeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, enumTypeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, enumTypeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumDescriptorProto), .fieldOptions = NULL, }, { @@ -169,10 +175,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_ServiceArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, serviceArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, serviceArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBServiceDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBServiceDescriptorProto), .fieldOptions = NULL, }, { @@ -180,10 +186,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_ExtensionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, extensionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, extensionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), .fieldOptions = NULL, }, { @@ -191,10 +197,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_Options, .hasIndex = 9, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFileOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFileOptions), .fieldOptions = NULL, }, { @@ -202,10 +208,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_SourceCodeInfo, .hasIndex = 10, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileDescriptorProto_Storage, sourceCodeInfo), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileDescriptorProto__storage_, sourceCodeInfo), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBSourceCodeInfo), + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceCodeInfo), .fieldOptions = NULL, }, { @@ -213,10 +219,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_PublicDependencyArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeInt32, - .offset = offsetof(GPBFileDescriptorProto_Storage, publicDependencyArray), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBFileDescriptorProto__storage_, publicDependencyArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -224,10 +230,10 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_WeakDependencyArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeInt32, - .offset = offsetof(GPBFileDescriptorProto_Storage, weakDependencyArray), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBFileDescriptorProto__storage_, weakDependencyArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -235,26 +241,29 @@ typedef struct GPBFileDescriptorProto_Storage { .number = GPBFileDescriptorProto_FieldNumber_Syntax, .hasIndex = 11, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileDescriptorProto_Storage, syntax), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileDescriptorProto__storage_, syntax), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFileDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBFileDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFileDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBFileDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -266,17 +275,17 @@ typedef struct GPBFileDescriptorProto_Storage { @implementation GPBDescriptorProto @dynamic hasName, name; -@dynamic fieldArray; -@dynamic extensionArray; -@dynamic nestedTypeArray; -@dynamic enumTypeArray; -@dynamic extensionRangeArray; -@dynamic oneofDeclArray; +@dynamic fieldArray, fieldArray_Count; +@dynamic extensionArray, extensionArray_Count; +@dynamic nestedTypeArray, nestedTypeArray_Count; +@dynamic enumTypeArray, enumTypeArray_Count; +@dynamic extensionRangeArray, extensionRangeArray_Count; +@dynamic oneofDeclArray, oneofDeclArray_Count; @dynamic hasOptions, options; -@dynamic reservedRangeArray; -@dynamic reservedNameArray; +@dynamic reservedRangeArray, reservedRangeArray_Count; +@dynamic reservedNameArray, reservedNameArray_Count; -typedef struct GPBDescriptorProto_Storage { +typedef struct GPBDescriptorProto__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *fieldArray; @@ -288,12 +297,12 @@ typedef struct GPBDescriptorProto_Storage { NSMutableArray *oneofDeclArray; NSMutableArray *reservedRangeArray; NSMutableArray *reservedNameArray; -} GPBDescriptorProto_Storage; +} GPBDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -301,10 +310,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -312,10 +321,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_FieldArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, fieldArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, fieldArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), .fieldOptions = NULL, }, { @@ -323,10 +332,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_NestedTypeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, nestedTypeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, nestedTypeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBDescriptorProto), .fieldOptions = NULL, }, { @@ -334,10 +343,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_EnumTypeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, enumTypeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, enumTypeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumDescriptorProto), .fieldOptions = NULL, }, { @@ -345,10 +354,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_ExtensionRangeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, extensionRangeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, extensionRangeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBDescriptorProto_ExtensionRange), + .dataTypeSpecific.className = GPBStringifySymbol(GPBDescriptorProto_ExtensionRange), .fieldOptions = NULL, }, { @@ -356,10 +365,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_ExtensionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, extensionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, extensionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFieldDescriptorProto), .fieldOptions = NULL, }, { @@ -367,10 +376,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_Options, .hasIndex = 7, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBMessageOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBMessageOptions), .fieldOptions = NULL, }, { @@ -378,10 +387,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_OneofDeclArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, oneofDeclArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, oneofDeclArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOneofDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOneofDescriptorProto), .fieldOptions = NULL, }, { @@ -389,10 +398,10 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_ReservedRangeArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBDescriptorProto_Storage, reservedRangeArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBDescriptorProto__storage_, reservedRangeArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBDescriptorProto_ReservedRange), + .dataTypeSpecific.className = GPBStringifySymbol(GPBDescriptorProto_ReservedRange), .fieldOptions = NULL, }, { @@ -400,26 +409,29 @@ typedef struct GPBDescriptorProto_Storage { .number = GPBDescriptorProto_FieldNumber_ReservedNameArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeString, - .offset = offsetof(GPBDescriptorProto_Storage, reservedNameArray), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBDescriptorProto__storage_, reservedNameArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -433,16 +445,16 @@ typedef struct GPBDescriptorProto_Storage { @dynamic hasStart, start; @dynamic hasEnd, end; -typedef struct GPBDescriptorProto_ExtensionRange_Storage { +typedef struct GPBDescriptorProto_ExtensionRange__storage_ { uint32_t _has_storage_[1]; int32_t start; int32_t end; -} GPBDescriptorProto_ExtensionRange_Storage; +} GPBDescriptorProto_ExtensionRange__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -450,10 +462,10 @@ typedef struct GPBDescriptorProto_ExtensionRange_Storage { .number = GPBDescriptorProto_ExtensionRange_FieldNumber_Start, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBDescriptorProto_ExtensionRange_Storage, start), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBDescriptorProto_ExtensionRange__storage_, start), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -461,26 +473,29 @@ typedef struct GPBDescriptorProto_ExtensionRange_Storage { .number = GPBDescriptorProto_ExtensionRange_FieldNumber_End, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBDescriptorProto_ExtensionRange_Storage, end), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBDescriptorProto_ExtensionRange__storage_, end), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto_ExtensionRange class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBDescriptorProto_ExtensionRange_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto_ExtensionRange class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBDescriptorProto_ExtensionRange__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -494,16 +509,16 @@ typedef struct GPBDescriptorProto_ExtensionRange_Storage { @dynamic hasStart, start; @dynamic hasEnd, end; -typedef struct GPBDescriptorProto_ReservedRange_Storage { +typedef struct GPBDescriptorProto_ReservedRange__storage_ { uint32_t _has_storage_[1]; int32_t start; int32_t end; -} GPBDescriptorProto_ReservedRange_Storage; +} GPBDescriptorProto_ReservedRange__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -511,10 +526,10 @@ typedef struct GPBDescriptorProto_ReservedRange_Storage { .number = GPBDescriptorProto_ReservedRange_FieldNumber_Start, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBDescriptorProto_ReservedRange_Storage, start), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBDescriptorProto_ReservedRange__storage_, start), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -522,26 +537,29 @@ typedef struct GPBDescriptorProto_ReservedRange_Storage { .number = GPBDescriptorProto_ReservedRange_FieldNumber_End, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBDescriptorProto_ReservedRange_Storage, end), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBDescriptorProto_ReservedRange__storage_, end), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto_ReservedRange class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBDescriptorProto_ReservedRange_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDescriptorProto_ReservedRange class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBDescriptorProto_ReservedRange__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -562,7 +580,7 @@ typedef struct GPBDescriptorProto_ReservedRange_Storage { @dynamic hasOneofIndex, oneofIndex; @dynamic hasOptions, options; -typedef struct GPBFieldDescriptorProto_Storage { +typedef struct GPBFieldDescriptorProto__storage_ { uint32_t _has_storage_[1]; int32_t number; GPBFieldDescriptorProto_Label label; @@ -573,12 +591,12 @@ typedef struct GPBFieldDescriptorProto_Storage { NSString *typeName; NSString *defaultValue; GPBFieldOptions *options; -} GPBFieldDescriptorProto_Storage; +} GPBFieldDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -586,10 +604,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFieldDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -597,10 +615,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Extendee, .hasIndex = 5, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFieldDescriptorProto_Storage, extendee), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldDescriptorProto__storage_, extendee), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -608,10 +626,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Number, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBFieldDescriptorProto_Storage, number), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBFieldDescriptorProto__storage_, number), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -619,10 +637,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Label, .hasIndex = 2, .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBFieldDescriptorProto_Storage, label), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBFieldDescriptorProto__storage_, label), .defaultValue.valueEnum = GPBFieldDescriptorProto_Label_LabelOptional, - .typeSpecific.enumDescFunc = GPBFieldDescriptorProto_Label_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBFieldDescriptorProto_Label_EnumDescriptor, .fieldOptions = NULL, }, { @@ -630,10 +648,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Type, .hasIndex = 3, .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBFieldDescriptorProto_Storage, type), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBFieldDescriptorProto__storage_, type), .defaultValue.valueEnum = GPBFieldDescriptorProto_Type_TypeDouble, - .typeSpecific.enumDescFunc = GPBFieldDescriptorProto_Type_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBFieldDescriptorProto_Type_EnumDescriptor, .fieldOptions = NULL, }, { @@ -641,10 +659,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_TypeName, .hasIndex = 4, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFieldDescriptorProto_Storage, typeName), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldDescriptorProto__storage_, typeName), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -652,10 +670,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_DefaultValue, .hasIndex = 6, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFieldDescriptorProto_Storage, defaultValue), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldDescriptorProto__storage_, defaultValue), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -663,10 +681,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_Options, .hasIndex = 8, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBFieldDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFieldDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBFieldOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBFieldOptions), .fieldOptions = NULL, }, { @@ -674,10 +692,10 @@ typedef struct GPBFieldDescriptorProto_Storage { .number = GPBFieldDescriptorProto_FieldNumber_OneofIndex, .hasIndex = 7, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBFieldDescriptorProto_Storage, oneofIndex), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBFieldDescriptorProto__storage_, oneofIndex), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; @@ -685,19 +703,22 @@ typedef struct GPBFieldDescriptorProto_Storage { { .enumDescriptorFunc = GPBFieldDescriptorProto_Type_EnumDescriptor }, { .enumDescriptorFunc = GPBFieldDescriptorProto_Label_EnumDescriptor }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFieldDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:enums - enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBFieldDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFieldDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:enums + enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBFieldDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -798,15 +819,15 @@ BOOL GPBFieldDescriptorProto_Label_IsValidValue(int32_t value__) { @dynamic hasName, name; -typedef struct GPBOneofDescriptorProto_Storage { +typedef struct GPBOneofDescriptorProto__storage_ { uint32_t _has_storage_[1]; NSString *name; -} GPBOneofDescriptorProto_Storage; +} GPBOneofDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -814,26 +835,29 @@ typedef struct GPBOneofDescriptorProto_Storage { .number = GPBOneofDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBOneofDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBOneofDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBOneofDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBOneofDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBOneofDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBOneofDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -845,20 +869,20 @@ typedef struct GPBOneofDescriptorProto_Storage { @implementation GPBEnumDescriptorProto @dynamic hasName, name; -@dynamic valueArray; +@dynamic valueArray, valueArray_Count; @dynamic hasOptions, options; -typedef struct GPBEnumDescriptorProto_Storage { +typedef struct GPBEnumDescriptorProto__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *valueArray; GPBEnumOptions *options; -} GPBEnumDescriptorProto_Storage; +} GPBEnumDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -866,10 +890,10 @@ typedef struct GPBEnumDescriptorProto_Storage { .number = GPBEnumDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBEnumDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBEnumDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -877,10 +901,10 @@ typedef struct GPBEnumDescriptorProto_Storage { .number = GPBEnumDescriptorProto_FieldNumber_ValueArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumDescriptorProto_Storage, valueArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumDescriptorProto__storage_, valueArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumValueDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumValueDescriptorProto), .fieldOptions = NULL, }, { @@ -888,26 +912,29 @@ typedef struct GPBEnumDescriptorProto_Storage { .number = GPBEnumDescriptorProto_FieldNumber_Options, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumOptions), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnumDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEnumDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEnumDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -922,17 +949,17 @@ typedef struct GPBEnumDescriptorProto_Storage { @dynamic hasNumber, number; @dynamic hasOptions, options; -typedef struct GPBEnumValueDescriptorProto_Storage { +typedef struct GPBEnumValueDescriptorProto__storage_ { uint32_t _has_storage_[1]; int32_t number; NSString *name; GPBEnumValueOptions *options; -} GPBEnumValueDescriptorProto_Storage; +} GPBEnumValueDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -940,10 +967,10 @@ typedef struct GPBEnumValueDescriptorProto_Storage { .number = GPBEnumValueDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBEnumValueDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBEnumValueDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -951,10 +978,10 @@ typedef struct GPBEnumValueDescriptorProto_Storage { .number = GPBEnumValueDescriptorProto_FieldNumber_Number, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBEnumValueDescriptorProto_Storage, number), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBEnumValueDescriptorProto__storage_, number), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -962,26 +989,29 @@ typedef struct GPBEnumValueDescriptorProto_Storage { .number = GPBEnumValueDescriptorProto_FieldNumber_Options, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumValueDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumValueDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumValueOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumValueOptions), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnumValueDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEnumValueDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumValueDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEnumValueDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -993,20 +1023,20 @@ typedef struct GPBEnumValueDescriptorProto_Storage { @implementation GPBServiceDescriptorProto @dynamic hasName, name; -@dynamic methodArray; +@dynamic methodArray, methodArray_Count; @dynamic hasOptions, options; -typedef struct GPBServiceDescriptorProto_Storage { +typedef struct GPBServiceDescriptorProto__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *methodArray; GPBServiceOptions *options; -} GPBServiceDescriptorProto_Storage; +} GPBServiceDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1014,10 +1044,10 @@ typedef struct GPBServiceDescriptorProto_Storage { .number = GPBServiceDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBServiceDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBServiceDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1025,10 +1055,10 @@ typedef struct GPBServiceDescriptorProto_Storage { .number = GPBServiceDescriptorProto_FieldNumber_MethodArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBServiceDescriptorProto_Storage, methodArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBServiceDescriptorProto__storage_, methodArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBMethodDescriptorProto), + .dataTypeSpecific.className = GPBStringifySymbol(GPBMethodDescriptorProto), .fieldOptions = NULL, }, { @@ -1036,26 +1066,29 @@ typedef struct GPBServiceDescriptorProto_Storage { .number = GPBServiceDescriptorProto_FieldNumber_Options, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBServiceDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBServiceDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBServiceOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBServiceOptions), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBServiceDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBServiceDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBServiceDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBServiceDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1073,7 +1106,7 @@ typedef struct GPBServiceDescriptorProto_Storage { @dynamic hasClientStreaming, clientStreaming; @dynamic hasServerStreaming, serverStreaming; -typedef struct GPBMethodDescriptorProto_Storage { +typedef struct GPBMethodDescriptorProto__storage_ { uint32_t _has_storage_[1]; BOOL clientStreaming; BOOL serverStreaming; @@ -1081,12 +1114,12 @@ typedef struct GPBMethodDescriptorProto_Storage { NSString *inputType; NSString *outputType; GPBMethodOptions *options; -} GPBMethodDescriptorProto_Storage; +} GPBMethodDescriptorProto__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1094,10 +1127,10 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBMethodDescriptorProto_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethodDescriptorProto__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1105,10 +1138,10 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_InputType, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBMethodDescriptorProto_Storage, inputType), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethodDescriptorProto__storage_, inputType), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1116,10 +1149,10 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_OutputType, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBMethodDescriptorProto_Storage, outputType), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBMethodDescriptorProto__storage_, outputType), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1127,10 +1160,10 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_Options, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBMethodDescriptorProto_Storage, options), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBMethodDescriptorProto__storage_, options), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBMethodOptions), + .dataTypeSpecific.className = GPBStringifySymbol(GPBMethodOptions), .fieldOptions = NULL, }, { @@ -1138,10 +1171,10 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_ClientStreaming, .hasIndex = 4, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMethodDescriptorProto_Storage, clientStreaming), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMethodDescriptorProto__storage_, clientStreaming), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1149,26 +1182,29 @@ typedef struct GPBMethodDescriptorProto_Storage { .number = GPBMethodDescriptorProto_FieldNumber_ServerStreaming, .hasIndex = 5, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMethodDescriptorProto_Storage, serverStreaming), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMethodDescriptorProto__storage_, serverStreaming), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBMethodDescriptorProto class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBMethodDescriptorProto_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMethodDescriptorProto class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBMethodDescriptorProto__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1193,9 +1229,9 @@ typedef struct GPBMethodDescriptorProto_Storage { @dynamic hasCcEnableArenas, ccEnableArenas; @dynamic hasObjcClassPrefix, objcClassPrefix; @dynamic hasCsharpNamespace, csharpNamespace; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBFileOptions_Storage { +typedef struct GPBFileOptions__storage_ { uint32_t _has_storage_[1]; BOOL javaMultipleFiles; BOOL ccGenericServices; @@ -1212,12 +1248,12 @@ typedef struct GPBFileOptions_Storage { NSString *objcClassPrefix; NSString *csharpNamespace; NSMutableArray *uninterpretedOptionArray; -} GPBFileOptions_Storage; +} GPBFileOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1225,10 +1261,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaPackage, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileOptions_Storage, javaPackage), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileOptions__storage_, javaPackage), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1236,10 +1272,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaOuterClassname, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileOptions_Storage, javaOuterClassname), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileOptions__storage_, javaOuterClassname), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1247,10 +1283,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_OptimizeFor, .hasIndex = 5, .flags = GPBFieldOptional | GPBFieldHasDefaultValue | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBFileOptions_Storage, optimizeFor), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBFileOptions__storage_, optimizeFor), .defaultValue.valueEnum = GPBFileOptions_OptimizeMode_Speed, - .typeSpecific.enumDescFunc = GPBFileOptions_OptimizeMode_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBFileOptions_OptimizeMode_EnumDescriptor, .fieldOptions = NULL, }, { @@ -1258,10 +1294,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaMultipleFiles, .hasIndex = 2, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, javaMultipleFiles), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, javaMultipleFiles), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1269,10 +1305,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_GoPackage, .hasIndex = 6, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileOptions_Storage, goPackage), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileOptions__storage_, goPackage), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1280,10 +1316,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_CcGenericServices, .hasIndex = 7, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, ccGenericServices), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, ccGenericServices), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1291,10 +1327,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaGenericServices, .hasIndex = 8, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, javaGenericServices), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, javaGenericServices), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1302,10 +1338,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_PyGenericServices, .hasIndex = 9, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, pyGenericServices), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, pyGenericServices), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1313,10 +1349,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaGenerateEqualsAndHash, .hasIndex = 3, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, javaGenerateEqualsAndHash), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, javaGenerateEqualsAndHash), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1324,10 +1360,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_Deprecated, .hasIndex = 10, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1335,10 +1371,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_JavaStringCheckUtf8, .hasIndex = 4, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, javaStringCheckUtf8), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, javaStringCheckUtf8), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1346,10 +1382,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_CcEnableArenas, .hasIndex = 11, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFileOptions_Storage, ccEnableArenas), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFileOptions__storage_, ccEnableArenas), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1357,10 +1393,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_ObjcClassPrefix, .hasIndex = 12, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileOptions_Storage, objcClassPrefix), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileOptions__storage_, objcClassPrefix), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1368,10 +1404,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_CsharpNamespace, .hasIndex = 13, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBFileOptions_Storage, csharpNamespace), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFileOptions__storage_, csharpNamespace), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1379,10 +1415,10 @@ typedef struct GPBFileOptions_Storage { .number = GPBFileOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFileOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFileOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; @@ -1392,19 +1428,22 @@ typedef struct GPBFileOptions_Storage { static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFileOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:enums - enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBFileOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFileOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:enums + enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBFileOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1448,21 +1487,21 @@ BOOL GPBFileOptions_OptimizeMode_IsValidValue(int32_t value__) { @dynamic hasNoStandardDescriptorAccessor, noStandardDescriptorAccessor; @dynamic hasDeprecated, deprecated; @dynamic hasMapEntry, mapEntry; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBMessageOptions_Storage { +typedef struct GPBMessageOptions__storage_ { uint32_t _has_storage_[1]; BOOL messageSetWireFormat; BOOL noStandardDescriptorAccessor; BOOL deprecated; BOOL mapEntry; NSMutableArray *uninterpretedOptionArray; -} GPBMessageOptions_Storage; +} GPBMessageOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1470,10 +1509,10 @@ typedef struct GPBMessageOptions_Storage { .number = GPBMessageOptions_FieldNumber_MessageSetWireFormat, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMessageOptions_Storage, messageSetWireFormat), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMessageOptions__storage_, messageSetWireFormat), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1481,10 +1520,10 @@ typedef struct GPBMessageOptions_Storage { .number = GPBMessageOptions_FieldNumber_NoStandardDescriptorAccessor, .hasIndex = 1, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMessageOptions_Storage, noStandardDescriptorAccessor), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMessageOptions__storage_, noStandardDescriptorAccessor), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1492,10 +1531,10 @@ typedef struct GPBMessageOptions_Storage { .number = GPBMessageOptions_FieldNumber_Deprecated, .hasIndex = 2, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMessageOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMessageOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1503,10 +1542,10 @@ typedef struct GPBMessageOptions_Storage { .number = GPBMessageOptions_FieldNumber_MapEntry, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBMessageOptions_Storage, mapEntry), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMessageOptions__storage_, mapEntry), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1514,29 +1553,32 @@ typedef struct GPBMessageOptions_Storage { .number = GPBMessageOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBMessageOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBMessageOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBMessageOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBMessageOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMessageOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBMessageOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1553,9 +1595,9 @@ typedef struct GPBMessageOptions_Storage { @dynamic hasLazy, lazy; @dynamic hasDeprecated, deprecated; @dynamic hasWeak, weak; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBFieldOptions_Storage { +typedef struct GPBFieldOptions__storage_ { uint32_t _has_storage_[1]; BOOL packed; BOOL deprecated; @@ -1564,12 +1606,12 @@ typedef struct GPBFieldOptions_Storage { GPBFieldOptions_CType ctype; GPBFieldOptions_JSType jstype; NSMutableArray *uninterpretedOptionArray; -} GPBFieldOptions_Storage; +} GPBFieldOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1577,10 +1619,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Ctype, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasDefaultValue | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBFieldOptions_Storage, ctype), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBFieldOptions__storage_, ctype), .defaultValue.valueEnum = GPBFieldOptions_CType_String, - .typeSpecific.enumDescFunc = GPBFieldOptions_CType_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBFieldOptions_CType_EnumDescriptor, .fieldOptions = NULL, }, { @@ -1588,10 +1630,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Packed, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBFieldOptions_Storage, packed), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFieldOptions__storage_, packed), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1599,10 +1641,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Deprecated, .hasIndex = 4, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFieldOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFieldOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1610,10 +1652,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Lazy, .hasIndex = 3, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFieldOptions_Storage, lazy), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFieldOptions__storage_, lazy), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1621,10 +1663,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Jstype, .hasIndex = 2, .flags = GPBFieldOptional | GPBFieldHasDefaultValue | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBFieldOptions_Storage, jstype), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBFieldOptions__storage_, jstype), .defaultValue.valueEnum = GPBFieldOptions_JSType_JsNormal, - .typeSpecific.enumDescFunc = GPBFieldOptions_JSType_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBFieldOptions_JSType_EnumDescriptor, .fieldOptions = NULL, }, { @@ -1632,10 +1674,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_Weak, .hasIndex = 5, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBFieldOptions_Storage, weak), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBFieldOptions__storage_, weak), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1643,10 +1685,10 @@ typedef struct GPBFieldOptions_Storage { .number = GPBFieldOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBFieldOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBFieldOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; @@ -1657,19 +1699,22 @@ typedef struct GPBFieldOptions_Storage { static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFieldOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:enums - enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBFieldOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFieldOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:enums + enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBFieldOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1740,19 +1785,19 @@ BOOL GPBFieldOptions_JSType_IsValidValue(int32_t value__) { @dynamic hasAllowAlias, allowAlias; @dynamic hasDeprecated, deprecated; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBEnumOptions_Storage { +typedef struct GPBEnumOptions__storage_ { uint32_t _has_storage_[1]; BOOL allowAlias; BOOL deprecated; NSMutableArray *uninterpretedOptionArray; -} GPBEnumOptions_Storage; +} GPBEnumOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1760,10 +1805,10 @@ typedef struct GPBEnumOptions_Storage { .number = GPBEnumOptions_FieldNumber_AllowAlias, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBEnumOptions_Storage, allowAlias), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBEnumOptions__storage_, allowAlias), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1771,10 +1816,10 @@ typedef struct GPBEnumOptions_Storage { .number = GPBEnumOptions_FieldNumber_Deprecated, .hasIndex = 1, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBEnumOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBEnumOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1782,29 +1827,32 @@ typedef struct GPBEnumOptions_Storage { .number = GPBEnumOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnumOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBEnumOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBEnumOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1816,18 +1864,18 @@ typedef struct GPBEnumOptions_Storage { @implementation GPBEnumValueOptions @dynamic hasDeprecated, deprecated; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBEnumValueOptions_Storage { +typedef struct GPBEnumValueOptions__storage_ { uint32_t _has_storage_[1]; BOOL deprecated; NSMutableArray *uninterpretedOptionArray; -} GPBEnumValueOptions_Storage; +} GPBEnumValueOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1835,10 +1883,10 @@ typedef struct GPBEnumValueOptions_Storage { .number = GPBEnumValueOptions_FieldNumber_Deprecated, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBEnumValueOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBEnumValueOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1846,29 +1894,32 @@ typedef struct GPBEnumValueOptions_Storage { .number = GPBEnumValueOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumValueOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumValueOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnumValueOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBEnumValueOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumValueOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBEnumValueOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1880,18 +1931,18 @@ typedef struct GPBEnumValueOptions_Storage { @implementation GPBServiceOptions @dynamic hasDeprecated, deprecated; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBServiceOptions_Storage { +typedef struct GPBServiceOptions__storage_ { uint32_t _has_storage_[1]; BOOL deprecated; NSMutableArray *uninterpretedOptionArray; -} GPBServiceOptions_Storage; +} GPBServiceOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1899,10 +1950,10 @@ typedef struct GPBServiceOptions_Storage { .number = GPBServiceOptions_FieldNumber_Deprecated, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBServiceOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBServiceOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1910,29 +1961,32 @@ typedef struct GPBServiceOptions_Storage { .number = GPBServiceOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBServiceOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBServiceOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBServiceOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBServiceOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBServiceOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBServiceOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -1944,18 +1998,18 @@ typedef struct GPBServiceOptions_Storage { @implementation GPBMethodOptions @dynamic hasDeprecated, deprecated; -@dynamic uninterpretedOptionArray; +@dynamic uninterpretedOptionArray, uninterpretedOptionArray_Count; -typedef struct GPBMethodOptions_Storage { +typedef struct GPBMethodOptions__storage_ { uint32_t _has_storage_[1]; BOOL deprecated; NSMutableArray *uninterpretedOptionArray; -} GPBMethodOptions_Storage; +} GPBMethodOptions__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -1963,10 +2017,10 @@ typedef struct GPBMethodOptions_Storage { .number = GPBMethodOptions_FieldNumber_Deprecated, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasDefaultValue, - .type = GPBTypeBool, - .offset = offsetof(GPBMethodOptions_Storage, deprecated), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBMethodOptions__storage_, deprecated), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -1974,29 +2028,32 @@ typedef struct GPBMethodOptions_Storage { .number = GPBMethodOptions_FieldNumber_UninterpretedOptionArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBMethodOptions_Storage, uninterpretedOptionArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBMethodOptions__storage_, uninterpretedOptionArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption), .fieldOptions = NULL, }, }; static GPBExtensionRange ranges[] = { { .start = 1000, .end = 536870912 }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBMethodOptions class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:ranges - rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) - storageSize:sizeof(GPBMethodOptions_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMethodOptions class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:ranges + rangeCount:sizeof(ranges) / sizeof(GPBExtensionRange) + storageSize:sizeof(GPBMethodOptions__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -2007,7 +2064,7 @@ typedef struct GPBMethodOptions_Storage { @implementation GPBUninterpretedOption -@dynamic nameArray; +@dynamic nameArray, nameArray_Count; @dynamic hasIdentifierValue, identifierValue; @dynamic hasPositiveIntValue, positiveIntValue; @dynamic hasNegativeIntValue, negativeIntValue; @@ -2015,7 +2072,7 @@ typedef struct GPBMethodOptions_Storage { @dynamic hasStringValue, stringValue; @dynamic hasAggregateValue, aggregateValue; -typedef struct GPBUninterpretedOption_Storage { +typedef struct GPBUninterpretedOption__storage_ { uint32_t _has_storage_[1]; NSMutableArray *nameArray; NSString *identifierValue; @@ -2024,12 +2081,12 @@ typedef struct GPBUninterpretedOption_Storage { uint64_t positiveIntValue; int64_t negativeIntValue; double doubleValue; -} GPBUninterpretedOption_Storage; +} GPBUninterpretedOption__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -2037,10 +2094,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_NameArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBUninterpretedOption_Storage, nameArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBUninterpretedOption__storage_, nameArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption_NamePart), + .dataTypeSpecific.className = GPBStringifySymbol(GPBUninterpretedOption_NamePart), .fieldOptions = NULL, }, { @@ -2048,10 +2105,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_IdentifierValue, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBUninterpretedOption_Storage, identifierValue), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBUninterpretedOption__storage_, identifierValue), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2059,10 +2116,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_PositiveIntValue, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeUInt64, - .offset = offsetof(GPBUninterpretedOption_Storage, positiveIntValue), + .dataType = GPBDataTypeUInt64, + .offset = offsetof(GPBUninterpretedOption__storage_, positiveIntValue), .defaultValue.valueUInt64 = 0ULL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2070,10 +2127,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_NegativeIntValue, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeInt64, - .offset = offsetof(GPBUninterpretedOption_Storage, negativeIntValue), + .dataType = GPBDataTypeInt64, + .offset = offsetof(GPBUninterpretedOption__storage_, negativeIntValue), .defaultValue.valueInt64 = 0LL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2081,10 +2138,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_DoubleValue, .hasIndex = 4, .flags = GPBFieldOptional, - .type = GPBTypeDouble, - .offset = offsetof(GPBUninterpretedOption_Storage, doubleValue), + .dataType = GPBDataTypeDouble, + .offset = offsetof(GPBUninterpretedOption__storage_, doubleValue), .defaultValue.valueDouble = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2092,10 +2149,10 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_StringValue, .hasIndex = 5, .flags = GPBFieldOptional, - .type = GPBTypeData, - .offset = offsetof(GPBUninterpretedOption_Storage, stringValue), + .dataType = GPBDataTypeBytes, + .offset = offsetof(GPBUninterpretedOption__storage_, stringValue), .defaultValue.valueData = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2103,26 +2160,29 @@ typedef struct GPBUninterpretedOption_Storage { .number = GPBUninterpretedOption_FieldNumber_AggregateValue, .hasIndex = 6, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBUninterpretedOption_Storage, aggregateValue), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBUninterpretedOption__storage_, aggregateValue), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBUninterpretedOption class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBUninterpretedOption_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUninterpretedOption class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBUninterpretedOption__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -2136,16 +2196,16 @@ typedef struct GPBUninterpretedOption_Storage { @dynamic hasNamePart, namePart; @dynamic hasIsExtension, isExtension; -typedef struct GPBUninterpretedOption_NamePart_Storage { +typedef struct GPBUninterpretedOption_NamePart__storage_ { uint32_t _has_storage_[1]; BOOL isExtension; NSString *namePart; -} GPBUninterpretedOption_NamePart_Storage; +} GPBUninterpretedOption_NamePart__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -2153,10 +2213,10 @@ typedef struct GPBUninterpretedOption_NamePart_Storage { .number = GPBUninterpretedOption_NamePart_FieldNumber_NamePart, .hasIndex = 0, .flags = GPBFieldRequired, - .type = GPBTypeString, - .offset = offsetof(GPBUninterpretedOption_NamePart_Storage, namePart), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBUninterpretedOption_NamePart__storage_, namePart), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2164,26 +2224,29 @@ typedef struct GPBUninterpretedOption_NamePart_Storage { .number = GPBUninterpretedOption_NamePart_FieldNumber_IsExtension, .hasIndex = 1, .flags = GPBFieldRequired, - .type = GPBTypeBool, - .offset = offsetof(GPBUninterpretedOption_NamePart_Storage, isExtension), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBUninterpretedOption_NamePart__storage_, isExtension), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBUninterpretedOption_NamePart class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBUninterpretedOption_NamePart_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUninterpretedOption_NamePart class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBUninterpretedOption_NamePart__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -2194,17 +2257,17 @@ typedef struct GPBUninterpretedOption_NamePart_Storage { @implementation GPBSourceCodeInfo -@dynamic locationArray; +@dynamic locationArray, locationArray_Count; -typedef struct GPBSourceCodeInfo_Storage { +typedef struct GPBSourceCodeInfo__storage_ { uint32_t _has_storage_[1]; NSMutableArray *locationArray; -} GPBSourceCodeInfo_Storage; +} GPBSourceCodeInfo__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -2212,26 +2275,29 @@ typedef struct GPBSourceCodeInfo_Storage { .number = GPBSourceCodeInfo_FieldNumber_LocationArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBSourceCodeInfo_Storage, locationArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBSourceCodeInfo__storage_, locationArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBSourceCodeInfo_Location), + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceCodeInfo_Location), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBSourceCodeInfo class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBSourceCodeInfo_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBSourceCodeInfo class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBSourceCodeInfo__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -2242,25 +2308,25 @@ typedef struct GPBSourceCodeInfo_Storage { @implementation GPBSourceCodeInfo_Location -@dynamic pathArray; -@dynamic spanArray; +@dynamic pathArray, pathArray_Count; +@dynamic spanArray, spanArray_Count; @dynamic hasLeadingComments, leadingComments; @dynamic hasTrailingComments, trailingComments; -@dynamic leadingDetachedCommentsArray; +@dynamic leadingDetachedCommentsArray, leadingDetachedCommentsArray_Count; -typedef struct GPBSourceCodeInfo_Location_Storage { +typedef struct GPBSourceCodeInfo_Location__storage_ { uint32_t _has_storage_[1]; GPBInt32Array *pathArray; GPBInt32Array *spanArray; NSString *leadingComments; NSString *trailingComments; NSMutableArray *leadingDetachedCommentsArray; -} GPBSourceCodeInfo_Location_Storage; +} GPBSourceCodeInfo_Location__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -2268,10 +2334,10 @@ typedef struct GPBSourceCodeInfo_Location_Storage { .number = GPBSourceCodeInfo_Location_FieldNumber_PathArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated | GPBFieldPacked, - .type = GPBTypeInt32, - .offset = offsetof(GPBSourceCodeInfo_Location_Storage, pathArray), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBSourceCodeInfo_Location__storage_, pathArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, #if GPBOBJC_INCLUDE_FIELD_OPTIONS .fieldOptions = "\000\000\000\002\020\001", #else @@ -2283,10 +2349,10 @@ typedef struct GPBSourceCodeInfo_Location_Storage { .number = GPBSourceCodeInfo_Location_FieldNumber_SpanArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated | GPBFieldPacked, - .type = GPBTypeInt32, - .offset = offsetof(GPBSourceCodeInfo_Location_Storage, spanArray), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBSourceCodeInfo_Location__storage_, spanArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, #if GPBOBJC_INCLUDE_FIELD_OPTIONS .fieldOptions = "\000\000\000\002\020\001", #else @@ -2298,10 +2364,10 @@ typedef struct GPBSourceCodeInfo_Location_Storage { .number = GPBSourceCodeInfo_Location_FieldNumber_LeadingComments, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBSourceCodeInfo_Location_Storage, leadingComments), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBSourceCodeInfo_Location__storage_, leadingComments), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2309,10 +2375,10 @@ typedef struct GPBSourceCodeInfo_Location_Storage { .number = GPBSourceCodeInfo_Location_FieldNumber_TrailingComments, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBSourceCodeInfo_Location_Storage, trailingComments), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBSourceCodeInfo_Location__storage_, trailingComments), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -2320,26 +2386,29 @@ typedef struct GPBSourceCodeInfo_Location_Storage { .number = GPBSourceCodeInfo_Location_FieldNumber_LeadingDetachedCommentsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeString, - .offset = offsetof(GPBSourceCodeInfo_Location_Storage, leadingDetachedCommentsArray), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBSourceCodeInfo_Location__storage_, leadingDetachedCommentsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBSourceCodeInfo_Location class] - rootClass:[GPBDescriptorRoot class] - file:GPBDescriptorRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBSourceCodeInfo_Location_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBSourceCodeInfo_Location class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBSourceCodeInfo_Location__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Duration.pbobjc.m b/objectivec/google/protobuf/Duration.pbobjc.m index 4db030f4..e4fd4951 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.m +++ b/objectivec/google/protobuf/Duration.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBDurationRoot_FileDescriptor + static GPBFileDescriptor *GPBDurationRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -29,16 +32,16 @@ static GPBFileDescriptor *GPBDurationRoot_FileDescriptor(void) { @dynamic seconds; @dynamic nanos; -typedef struct GPBDuration_Storage { +typedef struct GPBDuration__storage_ { uint32_t _has_storage_[1]; int32_t nanos; int64_t seconds; -} GPBDuration_Storage; +} GPBDuration__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -46,10 +49,10 @@ typedef struct GPBDuration_Storage { .number = GPBDuration_FieldNumber_Seconds, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt64, - .offset = offsetof(GPBDuration_Storage, seconds), + .dataType = GPBDataTypeInt64, + .offset = offsetof(GPBDuration__storage_, seconds), .defaultValue.valueInt64 = 0LL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -57,26 +60,29 @@ typedef struct GPBDuration_Storage { .number = GPBDuration_FieldNumber_Nanos, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBDuration_Storage, nanos), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBDuration__storage_, nanos), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDuration class] - rootClass:[GPBDurationRoot class] - file:GPBDurationRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBDuration_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDuration class] + rootClass:[GPBDurationRoot class] + file:GPBDurationRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBDuration__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Empty.pbobjc.m b/objectivec/google/protobuf/Empty.pbobjc.m index 619fe905..17f0c1ac 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.m +++ b/objectivec/google/protobuf/Empty.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBEmptyRoot_FileDescriptor + static GPBFileDescriptor *GPBEmptyRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -27,30 +30,31 @@ static GPBFileDescriptor *GPBEmptyRoot_FileDescriptor(void) { @implementation GPBEmpty -typedef struct GPBEmpty_Storage { +typedef struct GPBEmpty__storage_ { uint32_t _has_storage_[0]; -} GPBEmpty_Storage; +} GPBEmpty__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEmpty class] - rootClass:[GPBEmptyRoot class] - file:GPBEmptyRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEmpty_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEmpty class] + rootClass:[GPBEmptyRoot class] + file:GPBEmptyRoot_FileDescriptor() + fields:NULL + fieldCount:0 + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEmpty__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.h b/objectivec/google/protobuf/FieldMask.pbobjc.h index ac6f03d2..f9b26fa2 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.h +++ b/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -152,6 +152,7 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { // The set of field mask paths. // |pathsArray| contains |NSString| @property(nonatomic, readwrite, strong) NSMutableArray *pathsArray; +@property(nonatomic, readonly) NSUInteger pathsArray_Count; @end diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.m b/objectivec/google/protobuf/FieldMask.pbobjc.m index e37ac6c2..f9684f51 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.m +++ b/objectivec/google/protobuf/FieldMask.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBFieldMaskRoot_FileDescriptor + static GPBFileDescriptor *GPBFieldMaskRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -26,17 +29,17 @@ static GPBFileDescriptor *GPBFieldMaskRoot_FileDescriptor(void) { @implementation GPBFieldMask -@dynamic pathsArray; +@dynamic pathsArray, pathsArray_Count; -typedef struct GPBFieldMask_Storage { +typedef struct GPBFieldMask__storage_ { uint32_t _has_storage_[1]; NSMutableArray *pathsArray; -} GPBFieldMask_Storage; +} GPBFieldMask__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -44,26 +47,29 @@ typedef struct GPBFieldMask_Storage { .number = GPBFieldMask_FieldNumber_PathsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeString, - .offset = offsetof(GPBFieldMask_Storage, pathsArray), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldMask__storage_, pathsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFieldMask class] - rootClass:[GPBFieldMaskRoot class] - file:GPBFieldMaskRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBFieldMask_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFieldMask class] + rootClass:[GPBFieldMaskRoot class] + file:GPBFieldMaskRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBFieldMask__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/SourceContext.pbobjc.m b/objectivec/google/protobuf/SourceContext.pbobjc.m index 271f9243..ac1827fc 100644 --- a/objectivec/google/protobuf/SourceContext.pbobjc.m +++ b/objectivec/google/protobuf/SourceContext.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBSourceContextRoot_FileDescriptor + static GPBFileDescriptor *GPBSourceContextRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -28,15 +31,15 @@ static GPBFileDescriptor *GPBSourceContextRoot_FileDescriptor(void) { @dynamic fileName; -typedef struct GPBSourceContext_Storage { +typedef struct GPBSourceContext__storage_ { uint32_t _has_storage_[1]; NSString *fileName; -} GPBSourceContext_Storage; +} GPBSourceContext__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -44,26 +47,29 @@ typedef struct GPBSourceContext_Storage { .number = GPBSourceContext_FieldNumber_FileName, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBSourceContext_Storage, fileName), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBSourceContext__storage_, fileName), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBSourceContext class] - rootClass:[GPBSourceContextRoot class] - file:GPBSourceContextRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBSourceContext_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBSourceContext class] + rootClass:[GPBSourceContextRoot class] + file:GPBSourceContextRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBSourceContext__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Struct.pbobjc.h b/objectivec/google/protobuf/Struct.pbobjc.h index f55af82b..45456955 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.h +++ b/objectivec/google/protobuf/Struct.pbobjc.h @@ -57,6 +57,7 @@ typedef GPB_ENUM(GPBStruct_FieldNumber) { // Map of dynamically typed values. // |fields| values are |GPBValue| @property(nonatomic, readwrite, strong) NSMutableDictionary *fields; +@property(nonatomic, readonly) NSUInteger fields_Count; @end @@ -126,6 +127,7 @@ typedef GPB_ENUM(GPBListValue_FieldNumber) { // Repeated field of dynamically typed values. // |valuesArray| contains |GPBValue| @property(nonatomic, readwrite, strong) NSMutableArray *valuesArray; +@property(nonatomic, readonly) NSUInteger valuesArray_Count; @end diff --git a/objectivec/google/protobuf/Struct.pbobjc.m b/objectivec/google/protobuf/Struct.pbobjc.m index e5a8b547..14b8f271 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.m +++ b/objectivec/google/protobuf/Struct.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBStructRoot_FileDescriptor + static GPBFileDescriptor *GPBStructRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -51,17 +54,17 @@ BOOL GPBNullValue_IsValidValue(int32_t value__) { @implementation GPBStruct -@dynamic fields; +@dynamic fields, fields_Count; -typedef struct GPBStruct_Storage { +typedef struct GPBStruct__storage_ { uint32_t _has_storage_[1]; NSMutableDictionary *fields; -} GPBStruct_Storage; +} GPBStruct__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -69,26 +72,29 @@ typedef struct GPBStruct_Storage { .number = GPBStruct_FieldNumber_Fields, .hasIndex = GPBNoHasBit, .flags = GPBFieldMapKeyString, - .type = GPBTypeMessage, - .offset = offsetof(GPBStruct_Storage, fields), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBStruct__storage_, fields), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBValue), + .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBStruct class] - rootClass:[GPBStructRoot class] - file:GPBStructRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBStruct_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBStruct class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBStruct__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -107,7 +113,7 @@ typedef struct GPBStruct_Storage { @dynamic structValue; @dynamic listValue; -typedef struct GPBValue_Storage { +typedef struct GPBValue__storage_ { uint32_t _has_storage_[2]; BOOL boolValue; GPBNullValue nullValue; @@ -115,12 +121,12 @@ typedef struct GPBValue_Storage { GPBStruct *structValue; GPBListValue *listValue; double numberValue; -} GPBValue_Storage; +} GPBValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageOneofDescription oneofs[] = { { @@ -134,10 +140,10 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_NullValue, .hasIndex = -1, .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBValue_Storage, nullValue), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBValue__storage_, nullValue), .defaultValue.valueEnum = GPBNullValue_NullValue, - .typeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, .fieldOptions = NULL, }, { @@ -145,10 +151,10 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_NumberValue, .hasIndex = -1, .flags = GPBFieldOptional, - .type = GPBTypeDouble, - .offset = offsetof(GPBValue_Storage, numberValue), + .dataType = GPBDataTypeDouble, + .offset = offsetof(GPBValue__storage_, numberValue), .defaultValue.valueDouble = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -156,10 +162,10 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_StringValue, .hasIndex = -1, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBValue_Storage, stringValue), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBValue__storage_, stringValue), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -167,10 +173,10 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_BoolValue, .hasIndex = -1, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBValue_Storage, boolValue), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBValue__storage_, boolValue), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -178,10 +184,10 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_StructValue, .hasIndex = -1, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBValue_Storage, structValue), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBValue__storage_, structValue), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBStruct), + .dataTypeSpecific.className = GPBStringifySymbol(GPBStruct), .fieldOptions = NULL, }, { @@ -189,26 +195,29 @@ typedef struct GPBValue_Storage { .number = GPBValue_FieldNumber_ListValue, .hasIndex = -1, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBValue_Storage, listValue), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBValue__storage_, listValue), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBListValue), + .dataTypeSpecific.className = GPBStringifySymbol(GPBListValue), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBValue class] - rootClass:[GPBStructRoot class] - file:GPBStructRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:oneofs - oneofCount:sizeof(oneofs) / sizeof(GPBMessageOneofDescription) - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBValue class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:oneofs + oneofCount:sizeof(oneofs) / sizeof(GPBMessageOneofDescription) + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -218,7 +227,7 @@ typedef struct GPBValue_Storage { int32_t GPBValue_NullValue_RawValue(GPBValue *message) { GPBDescriptor *descriptor = [GPBValue descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; - return GPBGetInt32IvarWithField(message, field); + return GPBGetMessageInt32Field(message, field); } void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) { @@ -236,17 +245,17 @@ void GPBValue_ClearKindOneOfCase(GPBValue *message) { @implementation GPBListValue -@dynamic valuesArray; +@dynamic valuesArray, valuesArray_Count; -typedef struct GPBListValue_Storage { +typedef struct GPBListValue__storage_ { uint32_t _has_storage_[1]; NSMutableArray *valuesArray; -} GPBListValue_Storage; +} GPBListValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -254,26 +263,29 @@ typedef struct GPBListValue_Storage { .number = GPBListValue_FieldNumber_ValuesArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBListValue_Storage, valuesArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBListValue__storage_, valuesArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBValue), + .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBListValue class] - rootClass:[GPBStructRoot class] - file:GPBStructRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBListValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBListValue class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBListValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.m b/objectivec/google/protobuf/Timestamp.pbobjc.m index 197dff48..a206f159 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.m +++ b/objectivec/google/protobuf/Timestamp.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBTimestampRoot_FileDescriptor + static GPBFileDescriptor *GPBTimestampRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -29,16 +32,16 @@ static GPBFileDescriptor *GPBTimestampRoot_FileDescriptor(void) { @dynamic seconds; @dynamic nanos; -typedef struct GPBTimestamp_Storage { +typedef struct GPBTimestamp__storage_ { uint32_t _has_storage_[1]; int32_t nanos; int64_t seconds; -} GPBTimestamp_Storage; +} GPBTimestamp__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -46,10 +49,10 @@ typedef struct GPBTimestamp_Storage { .number = GPBTimestamp_FieldNumber_Seconds, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt64, - .offset = offsetof(GPBTimestamp_Storage, seconds), + .dataType = GPBDataTypeInt64, + .offset = offsetof(GPBTimestamp__storage_, seconds), .defaultValue.valueInt64 = 0LL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -57,26 +60,29 @@ typedef struct GPBTimestamp_Storage { .number = GPBTimestamp_FieldNumber_Nanos, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBTimestamp_Storage, nanos), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBTimestamp__storage_, nanos), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBTimestamp class] - rootClass:[GPBTimestampRoot class] - file:GPBTimestampRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBTimestamp_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBTimestamp class] + rootClass:[GPBTimestampRoot class] + file:GPBTimestampRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBTimestamp__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Type.pbobjc.h b/objectivec/google/protobuf/Type.pbobjc.h index 652a33a7..e3b6229f 100644 --- a/objectivec/google/protobuf/Type.pbobjc.h +++ b/objectivec/google/protobuf/Type.pbobjc.h @@ -132,15 +132,18 @@ typedef GPB_ENUM(GPBType_FieldNumber) { // The list of fields. // |fieldsArray| contains |GPBField| @property(nonatomic, readwrite, strong) NSMutableArray *fieldsArray; +@property(nonatomic, readonly) NSUInteger fieldsArray_Count; // The list of oneof definitions. // The list of oneofs declared in this Type // |oneofsArray| contains |NSString| @property(nonatomic, readwrite, strong) NSMutableArray *oneofsArray; +@property(nonatomic, readonly) NSUInteger oneofsArray_Count; // The proto options. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; // The source context. @property(nonatomic, readwrite) BOOL hasSourceContext; @@ -189,6 +192,7 @@ typedef GPB_ENUM(GPBField_FieldNumber) { // The proto options. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; @end @@ -216,10 +220,12 @@ typedef GPB_ENUM(GPBEnum_FieldNumber) { // Enum value definitions. // |enumvalueArray| contains |GPBEnumValue| @property(nonatomic, readwrite, strong) NSMutableArray *enumvalueArray; +@property(nonatomic, readonly) NSUInteger enumvalueArray_Count; // Proto options for the enum type. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; // The source context. @property(nonatomic, readwrite) BOOL hasSourceContext; @@ -247,6 +253,7 @@ typedef GPB_ENUM(GPBEnumValue_FieldNumber) { // Proto options for the enum value. // |optionsArray| contains |GPBOption| @property(nonatomic, readwrite, strong) NSMutableArray *optionsArray; +@property(nonatomic, readonly) NSUInteger optionsArray_Count; @end diff --git a/objectivec/google/protobuf/Type.pbobjc.m b/objectivec/google/protobuf/Type.pbobjc.m index 182370c8..5a2ce282 100644 --- a/objectivec/google/protobuf/Type.pbobjc.m +++ b/objectivec/google/protobuf/Type.pbobjc.m @@ -16,10 +16,8 @@ // about thread safety and initialization of registry. static GPBExtensionRegistry* registry = nil; if (!registry) { + GPBDebugCheckRuntimeVersion(); registry = [[GPBExtensionRegistry alloc] init]; - static GPBExtensionDescription descriptions[] = { - }; - #pragma unused (descriptions) [registry addExtensions:[GPBAnyRoot extensionRegistry]]; [registry addExtensions:[GPBSourceContextRoot extensionRegistry]]; } @@ -28,11 +26,14 @@ @end +#pragma mark - GPBTypeRoot_FileDescriptor + static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -44,24 +45,24 @@ static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) { @implementation GPBType @dynamic name; -@dynamic fieldsArray; -@dynamic oneofsArray; -@dynamic optionsArray; +@dynamic fieldsArray, fieldsArray_Count; +@dynamic oneofsArray, oneofsArray_Count; +@dynamic optionsArray, optionsArray_Count; @dynamic hasSourceContext, sourceContext; -typedef struct GPBType_Storage { +typedef struct GPBType__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *fieldsArray; NSMutableArray *oneofsArray; NSMutableArray *optionsArray; GPBSourceContext *sourceContext; -} GPBType_Storage; +} GPBType__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -69,10 +70,10 @@ typedef struct GPBType_Storage { .number = GPBType_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBType_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBType__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -80,10 +81,10 @@ typedef struct GPBType_Storage { .number = GPBType_FieldNumber_FieldsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBType_Storage, fieldsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBType__storage_, fieldsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBField), + .dataTypeSpecific.className = GPBStringifySymbol(GPBField), .fieldOptions = NULL, }, { @@ -91,10 +92,10 @@ typedef struct GPBType_Storage { .number = GPBType_FieldNumber_OneofsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeString, - .offset = offsetof(GPBType_Storage, oneofsArray), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBType__storage_, oneofsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -102,10 +103,10 @@ typedef struct GPBType_Storage { .number = GPBType_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBType_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBType__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, { @@ -113,26 +114,29 @@ typedef struct GPBType_Storage { .number = GPBType_FieldNumber_SourceContext, .hasIndex = 4, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBType_Storage, sourceContext), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBType__storage_, sourceContext), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBType class] - rootClass:[GPBTypeRoot class] - file:GPBTypeRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBType_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBType class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBType__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -150,9 +154,9 @@ typedef struct GPBType_Storage { @dynamic typeURL; @dynamic oneofIndex; @dynamic packed; -@dynamic optionsArray; +@dynamic optionsArray, optionsArray_Count; -typedef struct GPBField_Storage { +typedef struct GPBField__storage_ { uint32_t _has_storage_[1]; BOOL packed; GPBField_Kind kind; @@ -162,12 +166,12 @@ typedef struct GPBField_Storage { NSString *name; NSString *typeURL; NSMutableArray *optionsArray; -} GPBField_Storage; +} GPBField__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -175,10 +179,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_Kind, .hasIndex = 0, .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBField_Storage, kind), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBField__storage_, kind), .defaultValue.valueEnum = GPBField_Kind_TypeUnknown, - .typeSpecific.enumDescFunc = GPBField_Kind_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBField_Kind_EnumDescriptor, .fieldOptions = NULL, }, { @@ -186,10 +190,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_Cardinality, .hasIndex = 1, .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(GPBField_Storage, cardinality), + .dataType = GPBDataTypeEnum, + .offset = offsetof(GPBField__storage_, cardinality), .defaultValue.valueEnum = GPBField_Cardinality_CardinalityUnknown, - .typeSpecific.enumDescFunc = GPBField_Cardinality_EnumDescriptor, + .dataTypeSpecific.enumDescFunc = GPBField_Cardinality_EnumDescriptor, .fieldOptions = NULL, }, { @@ -197,10 +201,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_Number, .hasIndex = 2, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBField_Storage, number), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBField__storage_, number), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -208,10 +212,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_Name, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBField_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBField__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -219,10 +223,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_TypeURL, .hasIndex = 4, .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom, - .type = GPBTypeString, - .offset = offsetof(GPBField_Storage, typeURL), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBField__storage_, typeURL), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -230,10 +234,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_OneofIndex, .hasIndex = 5, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBField_Storage, oneofIndex), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBField__storage_, oneofIndex), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -241,10 +245,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_Packed, .hasIndex = 6, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBField_Storage, packed), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBField__storage_, packed), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -252,10 +256,10 @@ typedef struct GPBField_Storage { .number = GPBField_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBField_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBField__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, }; @@ -268,20 +272,23 @@ typedef struct GPBField_Storage { #else static const char *extraTextFormatInfo = "\001\006\004\241!!\000"; #endif // GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBField class] - rootClass:[GPBTypeRoot class] - file:GPBTypeRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:enums - enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBField_Storage) - wireFormat:NO - extraTextFormatInfo:extraTextFormatInfo]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBField class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:enums + enumCount:sizeof(enums) / sizeof(GPBMessageEnumDescription) + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBField__storage_) + wireFormat:NO + extraTextFormatInfo:extraTextFormatInfo]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -291,7 +298,7 @@ typedef struct GPBField_Storage { int32_t GPBField_Kind_RawValue(GPBField *message) { GPBDescriptor *descriptor = [GPBField descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind]; - return GPBGetInt32IvarWithField(message, field); + return GPBGetMessageInt32Field(message, field); } void SetGPBField_Kind_RawValue(GPBField *message, int32_t value) { @@ -303,7 +310,7 @@ void SetGPBField_Kind_RawValue(GPBField *message, int32_t value) { int32_t GPBField_Cardinality_RawValue(GPBField *message) { GPBDescriptor *descriptor = [GPBField descriptor]; GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality]; - return GPBGetInt32IvarWithField(message, field); + return GPBGetMessageInt32Field(message, field); } void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value) { @@ -407,22 +414,22 @@ BOOL GPBField_Cardinality_IsValidValue(int32_t value__) { @implementation GPBEnum @dynamic name; -@dynamic enumvalueArray; -@dynamic optionsArray; +@dynamic enumvalueArray, enumvalueArray_Count; +@dynamic optionsArray, optionsArray_Count; @dynamic hasSourceContext, sourceContext; -typedef struct GPBEnum_Storage { +typedef struct GPBEnum__storage_ { uint32_t _has_storage_[1]; NSString *name; NSMutableArray *enumvalueArray; NSMutableArray *optionsArray; GPBSourceContext *sourceContext; -} GPBEnum_Storage; +} GPBEnum__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -430,10 +437,10 @@ typedef struct GPBEnum_Storage { .number = GPBEnum_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBEnum_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBEnum__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -441,10 +448,10 @@ typedef struct GPBEnum_Storage { .number = GPBEnum_FieldNumber_EnumvalueArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnum_Storage, enumvalueArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnum__storage_, enumvalueArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBEnumValue), + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumValue), .fieldOptions = NULL, }, { @@ -452,10 +459,10 @@ typedef struct GPBEnum_Storage { .number = GPBEnum_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnum_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnum__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, { @@ -463,26 +470,29 @@ typedef struct GPBEnum_Storage { .number = GPBEnum_FieldNumber_SourceContext, .hasIndex = 3, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnum_Storage, sourceContext), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnum__storage_, sourceContext), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnum class] - rootClass:[GPBTypeRoot class] - file:GPBTypeRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEnum_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnum class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEnum__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -495,19 +505,19 @@ typedef struct GPBEnum_Storage { @dynamic name; @dynamic number; -@dynamic optionsArray; +@dynamic optionsArray, optionsArray_Count; -typedef struct GPBEnumValue_Storage { +typedef struct GPBEnumValue__storage_ { uint32_t _has_storage_[1]; int32_t number; NSString *name; NSMutableArray *optionsArray; -} GPBEnumValue_Storage; +} GPBEnumValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -515,10 +525,10 @@ typedef struct GPBEnumValue_Storage { .number = GPBEnumValue_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBEnumValue_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBEnumValue__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -526,10 +536,10 @@ typedef struct GPBEnumValue_Storage { .number = GPBEnumValue_FieldNumber_Number, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBEnumValue_Storage, number), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBEnumValue__storage_, number), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -537,26 +547,29 @@ typedef struct GPBEnumValue_Storage { .number = GPBEnumValue_FieldNumber_OptionsArray, .hasIndex = GPBNoHasBit, .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(GPBEnumValue_Storage, optionsArray), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBEnumValue__storage_, optionsArray), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBOption), + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBEnumValue class] - rootClass:[GPBTypeRoot class] - file:GPBTypeRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBEnumValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumValue class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBEnumValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -570,16 +583,16 @@ typedef struct GPBEnumValue_Storage { @dynamic name; @dynamic hasValue, value; -typedef struct GPBOption_Storage { +typedef struct GPBOption__storage_ { uint32_t _has_storage_[1]; NSString *name; GPBAny *value; -} GPBOption_Storage; +} GPBOption__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -587,10 +600,10 @@ typedef struct GPBOption_Storage { .number = GPBOption_FieldNumber_Name, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBOption_Storage, name), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBOption__storage_, name), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, { @@ -598,26 +611,29 @@ typedef struct GPBOption_Storage { .number = GPBOption_FieldNumber_Value, .hasIndex = 1, .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(GPBOption_Storage, value), + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBOption__storage_, value), .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(GPBAny), + .dataTypeSpecific.className = GPBStringifySymbol(GPBAny), .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBOption class] - rootClass:[GPBTypeRoot class] - file:GPBTypeRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBOption_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBOption class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBOption__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.m b/objectivec/google/protobuf/Wrappers.pbobjc.m index 6c342850..0403b464 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.m +++ b/objectivec/google/protobuf/Wrappers.pbobjc.m @@ -11,11 +11,14 @@ @end +#pragma mark - GPBWrappersRoot_FileDescriptor + static GPBFileDescriptor *GPBWrappersRoot_FileDescriptor(void) { // This is called by +initialize so there is no need to worry // about thread safety of the singleton. static GPBFileDescriptor *descriptor = NULL; if (!descriptor) { + GPBDebugCheckRuntimeVersion(); descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" syntax:GPBFileSyntaxProto3]; } @@ -28,15 +31,15 @@ static GPBFileDescriptor *GPBWrappersRoot_FileDescriptor(void) { @dynamic value; -typedef struct GPBDoubleValue_Storage { +typedef struct GPBDoubleValue__storage_ { uint32_t _has_storage_[1]; double value; -} GPBDoubleValue_Storage; +} GPBDoubleValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -44,26 +47,29 @@ typedef struct GPBDoubleValue_Storage { .number = GPBDoubleValue_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeDouble, - .offset = offsetof(GPBDoubleValue_Storage, value), + .dataType = GPBDataTypeDouble, + .offset = offsetof(GPBDoubleValue__storage_, value), .defaultValue.valueDouble = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBDoubleValue class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBDoubleValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDoubleValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBDoubleValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -76,15 +82,15 @@ typedef struct GPBDoubleValue_Storage { @dynamic value; -typedef struct GPBFloatValue_Storage { +typedef struct GPBFloatValue__storage_ { uint32_t _has_storage_[1]; float value; -} GPBFloatValue_Storage; +} GPBFloatValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -92,26 +98,29 @@ typedef struct GPBFloatValue_Storage { .number = GPBFloatValue_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeFloat, - .offset = offsetof(GPBFloatValue_Storage, value), + .dataType = GPBDataTypeFloat, + .offset = offsetof(GPBFloatValue__storage_, value), .defaultValue.valueFloat = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBFloatValue class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBFloatValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFloatValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBFloatValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -124,15 +133,15 @@ typedef struct GPBFloatValue_Storage { @dynamic value; -typedef struct GPBInt64Value_Storage { +typedef struct GPBInt64Value__storage_ { uint32_t _has_storage_[1]; int64_t value; -} GPBInt64Value_Storage; +} GPBInt64Value__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -140,26 +149,29 @@ typedef struct GPBInt64Value_Storage { .number = GPBInt64Value_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt64, - .offset = offsetof(GPBInt64Value_Storage, value), + .dataType = GPBDataTypeInt64, + .offset = offsetof(GPBInt64Value__storage_, value), .defaultValue.valueInt64 = 0LL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBInt64Value class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBInt64Value_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBInt64Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBInt64Value__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -172,15 +184,15 @@ typedef struct GPBInt64Value_Storage { @dynamic value; -typedef struct GPBUInt64Value_Storage { +typedef struct GPBUInt64Value__storage_ { uint32_t _has_storage_[1]; uint64_t value; -} GPBUInt64Value_Storage; +} GPBUInt64Value__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -188,26 +200,29 @@ typedef struct GPBUInt64Value_Storage { .number = GPBUInt64Value_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeUInt64, - .offset = offsetof(GPBUInt64Value_Storage, value), + .dataType = GPBDataTypeUInt64, + .offset = offsetof(GPBUInt64Value__storage_, value), .defaultValue.valueUInt64 = 0ULL, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBUInt64Value class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBUInt64Value_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUInt64Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBUInt64Value__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -220,15 +235,15 @@ typedef struct GPBUInt64Value_Storage { @dynamic value; -typedef struct GPBInt32Value_Storage { +typedef struct GPBInt32Value__storage_ { uint32_t _has_storage_[1]; int32_t value; -} GPBInt32Value_Storage; +} GPBInt32Value__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -236,26 +251,29 @@ typedef struct GPBInt32Value_Storage { .number = GPBInt32Value_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(GPBInt32Value_Storage, value), + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBInt32Value__storage_, value), .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBInt32Value class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBInt32Value_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBInt32Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBInt32Value__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -268,15 +286,15 @@ typedef struct GPBInt32Value_Storage { @dynamic value; -typedef struct GPBUInt32Value_Storage { +typedef struct GPBUInt32Value__storage_ { uint32_t _has_storage_[1]; uint32_t value; -} GPBUInt32Value_Storage; +} GPBUInt32Value__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -284,26 +302,29 @@ typedef struct GPBUInt32Value_Storage { .number = GPBUInt32Value_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeUInt32, - .offset = offsetof(GPBUInt32Value_Storage, value), + .dataType = GPBDataTypeUInt32, + .offset = offsetof(GPBUInt32Value__storage_, value), .defaultValue.valueUInt32 = 0U, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBUInt32Value class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBUInt32Value_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUInt32Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBUInt32Value__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -316,15 +337,15 @@ typedef struct GPBUInt32Value_Storage { @dynamic value; -typedef struct GPBBoolValue_Storage { +typedef struct GPBBoolValue__storage_ { uint32_t _has_storage_[1]; BOOL value; -} GPBBoolValue_Storage; +} GPBBoolValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -332,26 +353,29 @@ typedef struct GPBBoolValue_Storage { .number = GPBBoolValue_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(GPBBoolValue_Storage, value), + .dataType = GPBDataTypeBool, + .offset = offsetof(GPBBoolValue__storage_, value), .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBBoolValue class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBBoolValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBBoolValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBBoolValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -364,15 +388,15 @@ typedef struct GPBBoolValue_Storage { @dynamic value; -typedef struct GPBStringValue_Storage { +typedef struct GPBStringValue__storage_ { uint32_t _has_storage_[1]; NSString *value; -} GPBStringValue_Storage; +} GPBStringValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -380,26 +404,29 @@ typedef struct GPBStringValue_Storage { .number = GPBStringValue_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(GPBStringValue_Storage, value), + .dataType = GPBDataTypeString, + .offset = offsetof(GPBStringValue__storage_, value), .defaultValue.valueString = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBStringValue class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBStringValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBStringValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBStringValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } @@ -412,15 +439,15 @@ typedef struct GPBStringValue_Storage { @dynamic value; -typedef struct GPBBytesValue_Storage { +typedef struct GPBBytesValue__storage_ { uint32_t _has_storage_[1]; NSData *value; -} GPBBytesValue_Storage; +} GPBBytesValue__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; + static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { { @@ -428,26 +455,29 @@ typedef struct GPBBytesValue_Storage { .number = GPBBytesValue_FieldNumber_Value, .hasIndex = 0, .flags = GPBFieldOptional, - .type = GPBTypeData, - .offset = offsetof(GPBBytesValue_Storage, value), + .dataType = GPBDataTypeBytes, + .offset = offsetof(GPBBytesValue__storage_, value), .defaultValue.valueData = nil, - .typeSpecific.className = NULL, + .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, }; - descriptor = [GPBDescriptor allocDescriptorForClass:[GPBBytesValue class] - rootClass:[GPBWrappersRoot class] - file:GPBWrappersRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(GPBBytesValue_Storage) - wireFormat:NO]; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBBytesValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBBytesValue__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; } return descriptor; } -- cgit v1.2.3