@@ -100,11 +100,11 @@ + (instancetype)allocDescriptorForClass:(Class)messageClass
100
100
// Compute the unknown flags by this version of the runtime and then check the passed in flags
101
101
// (from the generated code) to detect when sources from a newer version are being used with an
102
102
// older runtime.
103
- GPBDescriptorInitializationFlags unknownFlags =
104
- ~( GPBDescriptorInitializationFlag_FieldsWithDefault |
105
- GPBDescriptorInitializationFlag_WireFormat | GPBDescriptorInitializationFlag_UsesClassRefs |
106
- GPBDescriptorInitializationFlag_Proto3OptionalKnown |
107
- GPBDescriptorInitializationFlag_ClosedEnumSupportKnown);
103
+ GPBDescriptorInitializationFlags unknownFlags = (GPBDescriptorInitializationFlags)(~(
104
+ GPBDescriptorInitializationFlag_FieldsWithDefault |
105
+ GPBDescriptorInitializationFlag_WireFormat | GPBDescriptorInitializationFlag_UsesClassRefs |
106
+ GPBDescriptorInitializationFlag_Proto3OptionalKnown |
107
+ GPBDescriptorInitializationFlag_ClosedEnumSupportKnown) );
108
108
if ((flags & unknownFlags) != 0 ) {
109
109
GPBRuntimeMatchFailure ();
110
110
}
@@ -144,10 +144,10 @@ + (instancetype)allocDescriptorForClass:(Class)messageClass
144
144
}
145
145
// No real value in checking all the fields individually, just check the combined flags at the
146
146
// end.
147
- GPBFieldFlags unknownFieldFlags =
148
- ~( GPBFieldRequired | GPBFieldRepeated | GPBFieldPacked | GPBFieldOptional |
149
- GPBFieldHasDefaultValue | GPBFieldClearHasIvarOnZero | GPBFieldTextFormatNameCustom |
150
- GPBFieldHasEnumDescriptor | GPBFieldMapKeyMask | GPBFieldClosedEnum);
147
+ GPBFieldFlags unknownFieldFlags = (GPBFieldFlags)(~(
148
+ GPBFieldRequired | GPBFieldRepeated | GPBFieldPacked | GPBFieldOptional |
149
+ GPBFieldHasDefaultValue | GPBFieldClearHasIvarOnZero | GPBFieldTextFormatNameCustom |
150
+ GPBFieldHasEnumDescriptor | GPBFieldMapKeyMask | GPBFieldClosedEnum) );
151
151
if ((mergedFieldFlags & unknownFieldFlags) != 0 ) {
152
152
GPBRuntimeMatchFailure ();
153
153
}
@@ -203,7 +203,8 @@ - (void)setupOneofs:(const char **)oneofNames
203
203
firstHasIndex : (int32_t )firstHasIndex {
204
204
NSCAssert (firstHasIndex < 0 , @" Should always be <0" );
205
205
NSMutableArray *oneofs = [[NSMutableArray alloc ] initWithCapacity: count];
206
- for (uint32_t i = 0 , hasIndex = firstHasIndex; i < count; ++i, --hasIndex) {
206
+ int32_t hasIndex = firstHasIndex;
207
+ for (uint32_t i = 0 ; i < count; ++i, --hasIndex) {
207
208
const char *name = oneofNames[i];
208
209
NSArray *fieldsForOneof = NewFieldsArrayForHasIndex (hasIndex, fields_);
209
210
NSCAssert (fieldsForOneof.count > 0 , @" No fields for this oneof? (%s :%d )" , name, hasIndex);
@@ -231,7 +232,7 @@ - (void)setupExtraTextInfo:(const char *)extraTextFormatInfo {
231
232
232
233
- (void )setupExtensionRanges : (const GPBExtensionRange *)ranges count : (int32_t )count {
233
234
extensionRanges_ = ranges;
234
- extensionRangesCount_ = count;
235
+ extensionRangesCount_ = ( uint32_t ) count;
235
236
}
236
237
237
238
- (void )setupContainingMessageClass : (Class )messageClass {
@@ -632,7 +633,7 @@ - (NSString *)textFormatName {
632
633
return nil ;
633
634
}
634
635
const uint8_t *extraTextFormatInfo = [extraInfoValue pointerValue ];
635
- return GPBDecodeTextFormatName (extraTextFormatInfo, GPBFieldNumber (self), self.name );
636
+ return GPBDecodeTextFormatName (extraTextFormatInfo, ( int32_t ) GPBFieldNumber (self), self.name );
636
637
}
637
638
638
639
// The logic here has to match SetCommonFieldVariables() from
@@ -714,7 +715,7 @@ + (instancetype)allocDescriptorForName:(NSString *)name
714
715
// (from the generated code) to detect when sources from a newer version are being used with an
715
716
// older runtime.
716
717
GPBEnumDescriptorInitializationFlags unknownFlags =
717
- ~(GPBEnumDescriptorInitializationFlag_IsClosed);
718
+ (GPBEnumDescriptorInitializationFlags)( ~(GPBEnumDescriptorInitializationFlag_IsClosed) );
718
719
if ((flags & unknownFlags) != 0 ) {
719
720
GPBRuntimeMatchFailure ();
720
721
}
@@ -927,8 +928,8 @@ - (instancetype)initWithExtensionDescription:(GPBExtensionDescription *)desc
927
928
// Compute the unknown options by this version of the runtime and then check the passed in
928
929
// descriptor's options (from the generated code) to detect when sources from a newer version are
929
930
// being used with an older runtime.
930
- GPBExtensionOptions unknownOptions =
931
- ~( GPBExtensionRepeated | GPBExtensionPacked | GPBExtensionSetWireFormat);
931
+ GPBExtensionOptions unknownOptions = (GPBExtensionOptions)(~(
932
+ GPBExtensionRepeated | GPBExtensionPacked | GPBExtensionSetWireFormat) );
932
933
if ((desc->options & unknownOptions) != 0 ) {
933
934
GPBRuntimeMatchFailure ();
934
935
}
@@ -996,7 +997,7 @@ - (const char *)singletonNameC {
996
997
}
997
998
998
999
- (uint32_t )fieldNumber {
999
- return description_->fieldNumber ;
1000
+ return ( uint32_t )( description_->fieldNumber ) ;
1000
1001
}
1001
1002
1002
1003
- (GPBDataType)dataType {
0 commit comments