@ -100,11 +100,11 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex, NSArray *allMessageField
/ / Compute the unknown flags by this version of the runtime and then check the passed in flags
/ / Compute the unknown flags by this version of the runtime and then check the passed in flags
/ / ( from the generated code ) to detect when sources from a newer version are being used with an
/ / ( from the generated code ) to detect when sources from a newer version are being used with an
/ / older runtime .
/ / older runtime .
GPBDescriptorInitializationFlags unknownFlags =
GPBDescriptorInitializationFlags unknownFlags = ( GPBDescriptorInitializationFlags ) ( ~ (
~ ( GPBDescriptorInitializationFlag_FieldsWithDefault |
GPBDescriptorInitializationFlag_FieldsWithDefault |
GPBDescriptorInitializationFlag_WireFormat | GPBDescriptorInitializationFlag_UsesClassRefs |
GPBDescriptorInitializationFlag_WireFormat | GPBDescriptorInitializationFlag_UsesClassRefs |
GPBDescriptorInitializationFlag_Proto3OptionalKnown |
GPBDescriptorInitializationFlag_Proto3OptionalKnown |
GPBDescriptorInitializationFlag_ClosedEnumSupportKnown ) ;
GPBDescriptorInitializationFlag_ClosedEnumSupportKnown ) ) ;
if ( ( flags & unknownFlags ) != 0 ) {
if ( ( flags & unknownFlags ) != 0 ) {
GPBRuntimeMatchFailure ( ) ;
GPBRuntimeMatchFailure ( ) ;
}
}
@ -144,10 +144,10 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex, NSArray *allMessageField
}
}
/ / No real value in checking all the fields individually , just check the combined flags at the
/ / No real value in checking all the fields individually , just check the combined flags at the
/ / end .
/ / end .
GPBFieldFlags unknownFieldFlags =
GPBFieldFlags unknownFieldFlags = ( GPBFieldFlags ) ( ~ (
~ ( GPBFieldRequired | GPBFieldRepeated | GPBFieldPacked | GPBFieldOptional |
GPBFieldRequired | GPBFieldRepeated | GPBFieldPacked | GPBFieldOptional |
GPBFieldHasDefaultValue | GPBFieldClearHasIvarOnZero | GPBFieldTextFormatNameCustom |
GPBFieldHasDefaultValue | GPBFieldClearHasIvarOnZero | GPBFieldTextFormatNameCustom |
GPBFieldHasEnumDescriptor | GPBFieldMapKeyMask | GPBFieldClosedEnum ) ;
GPBFieldHasEnumDescriptor | GPBFieldMapKeyMask | GPBFieldClosedEnum ) ) ;
if ( ( mergedFieldFlags & unknownFieldFlags ) != 0 ) {
if ( ( mergedFieldFlags & unknownFieldFlags ) != 0 ) {
GPBRuntimeMatchFailure ( ) ;
GPBRuntimeMatchFailure ( ) ;
}
}
@ -203,7 +203,8 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex, NSArray *allMessageField
firstHasIndex : ( int32_t ) firstHasIndex {
firstHasIndex : ( int32_t ) firstHasIndex {
NSCAssert ( firstHasIndex < 0 , @ "Should always be < 0 ") ;
NSCAssert ( firstHasIndex < 0 , @ "Should always be < 0 ") ;
NSMutableArray * oneofs = [ [ NSMutableArray alloc ] initWithCapacity : count ] ;
NSMutableArray * oneofs = [ [ NSMutableArray alloc ] initWithCapacity : count ] ;
for ( uint32_t i = 0 , hasIndex = firstHasIndex ; i < count ; + + i , - - hasIndex ) {
int32_t hasIndex = firstHasIndex ;
for ( uint32_t i = 0 ; i < count ; + + i , - - hasIndex ) {
const char * name = oneofNames [ i ] ;
const char * name = oneofNames [ i ] ;
NSArray * fieldsForOneof = NewFieldsArrayForHasIndex ( hasIndex , fields_ ) ;
NSArray * fieldsForOneof = NewFieldsArrayForHasIndex ( hasIndex , fields_ ) ;
NSCAssert ( fieldsForOneof . count > 0 , @ "No fields for this oneof ? ( %s:%d)", name, hasIndex);
NSCAssert ( fieldsForOneof . count > 0 , @ "No fields for this oneof ? ( %s:%d)", name, hasIndex);
@ -231,7 +232,7 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex, NSArray *allMessageField
- ( void ) setupExtensionRanges : ( const GPBExtensionRange * ) ranges count : ( int32_t ) count {
- ( void ) setupExtensionRanges : ( const GPBExtensionRange * ) ranges count : ( int32_t ) count {
extensionRanges_ = ranges ;
extensionRanges_ = ranges ;
extensionRangesCount_ = count ;
extensionRangesCount_ = ( uint32_t ) count ;
}
}
- ( void ) setupContainingMessageClass : ( Class ) messageClass {
- ( void ) setupContainingMessageClass : ( Class ) messageClass {
@ -632,7 +633,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
return nil ;
return nil ;
}
}
const uint8_t * extraTextFormatInfo = [ extraInfoValue pointerValue ] ;
const uint8_t * extraTextFormatInfo = [ extraInfoValue pointerValue ] ;
return GPBDecodeTextFormatName ( extraTextFormatInfo , GPBFieldNumber ( self ) , self . name ) ;
return GPBDecodeTextFormatName ( extraTextFormatInfo , ( int32_t ) GPBFieldNumber ( self ) , self . name ) ;
}
}
/ / The logic here has to match SetCommonFieldVariables ( ) from
/ / The logic here has to match SetCommonFieldVariables ( ) from
@ -714,7 +715,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
/ / ( from the generated code ) to detect when sources from a newer version are being used with an
/ / ( from the generated code ) to detect when sources from a newer version are being used with an
/ / older runtime .
/ / older runtime .
GPBEnumDescriptorInitializationFlags unknownFlags =
GPBEnumDescriptorInitializationFlags unknownFlags =
~ ( GPBEnumDescriptorInitializationFlag_IsClosed ) ;
( GPBEnumDescriptorInitializationFlags ) ( ~ ( GPBEnumDescriptorInitializationFlag_IsClosed ) ) ;
if ( ( flags & unknownFlags ) != 0 ) {
if ( ( flags & unknownFlags ) != 0 ) {
GPBRuntimeMatchFailure ( ) ;
GPBRuntimeMatchFailure ( ) ;
}
}
@ -927,8 +928,8 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
/ / Compute the unknown options by this version of the runtime and then check the passed in
/ / Compute the unknown options by this version of the runtime and then check the passed in
/ / descriptor ' s options ( from the generated code ) to detect when sources from a newer version are
/ / descriptor ' s options ( from the generated code ) to detect when sources from a newer version are
/ / being used with an older runtime .
/ / being used with an older runtime .
GPBExtensionOptions unknownOptions =
GPBExtensionOptions unknownOptions = ( GPBExtensionOptions ) ( ~ (
~ ( GPBExtensionRepeated | GPBExtensionPacked | GPBExtensionSetWireFormat ) ;
GPBExtensionRepeated | GPBExtensionPacked | GPBExtensionSetWireFormat ) ) ;
if ( ( desc - > options & unknownOptions ) != 0 ) {
if ( ( desc - > options & unknownOptions ) != 0 ) {
GPBRuntimeMatchFailure ( ) ;
GPBRuntimeMatchFailure ( ) ;
}
}
@ -996,7 +997,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
}
}
- ( uint32_t ) fieldNumber {
- ( uint32_t ) fieldNumber {
return description_ - > fieldNumber ;
return ( uint32_t ) ( description_ - > fieldNumber ) ;
}
}
- ( GPBDataType ) dataType {
- ( GPBDataType ) dataType {