Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
40ff94eb
Commit
40ff94eb
authored
May 27, 2016
by
Thomas Van Lenten
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1617 from thomasvl/more_warnings
Add -Woverriding-method-mismatch.
parents
86e8f1fd
38b9e746
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
32 deletions
+54
-32
GPBArray.m
objectivec/GPBArray.m
+36
-27
GPBDictionary.h
objectivec/GPBDictionary.h
+8
-0
GPBDictionary.m
objectivec/GPBDictionary.m
+0
-0
GPBMessage.m
objectivec/GPBMessage.m
+6
-5
project.pbxproj
objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj
+2
-0
project.pbxproj
objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
+2
-0
No files found.
objectivec/GPBArray.m
View file @
40ff94eb
...
...
@@ -164,15 +164,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
//% [super dealloc];
//%}
//%
//%- (BOOL)isEqual:(
GPB##NAME##Array *
)other {
//%- (BOOL)isEqual:(
id
)other {
//% if (self == other) {
//% return YES;
//% }
//% if (![other isKindOfClass:[GPB##NAME##Array class]]) {
//% return NO;
//% }
//% return (_count == other->_count
//% && memcmp(_values, other->_values, (_count * sizeof(TYPE))) == 0);
//% GPB##NAME##Array *otherArray = other;
//% return (_count == otherArray->_count
//% && memcmp(_values, otherArray->_values, (_count * sizeof(TYPE))) == 0);
//%}
//%
//%- (NSUInteger)hash {
...
...
@@ -374,15 +375,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBInt32Array
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBInt32Array
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
int32_t
)))
==
0
);
GPBInt32Array
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
int32_t
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -621,15 +623,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBUInt32Array
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBUInt32Array
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
uint32_t
)))
==
0
);
GPBUInt32Array
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
uint32_t
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -868,15 +871,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBInt64Array
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBInt64Array
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
int64_t
)))
==
0
);
GPBInt64Array
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
int64_t
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -1115,15 +1119,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBUInt64Array
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBUInt64Array
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
uint64_t
)))
==
0
);
GPBUInt64Array
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
uint64_t
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -1362,15 +1367,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBFloatArray
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBFloatArray
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
float
)))
==
0
);
GPBFloatArray
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
float
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -1609,15 +1615,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBDoubleArray
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBDoubleArray
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
double
)))
==
0
);
GPBDoubleArray
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
double
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -1856,15 +1863,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBBoolArray
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBBoolArray
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
BOOL
)))
==
0
);
GPBBoolArray
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
BOOL
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
@@ -2127,15 +2135,16 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
[
super
dealloc
];
}
-
(
BOOL
)
isEqual
:
(
GPBEnumArray
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
self
==
other
)
{
return
YES
;
}
if
(
!
[
other
isKindOfClass
:[
GPBEnumArray
class
]])
{
return
NO
;
}
return
(
_count
==
other
->
_count
&&
memcmp
(
_values
,
other
->
_values
,
(
_count
*
sizeof
(
int32_t
)))
==
0
);
GPBEnumArray
*
otherArray
=
other
;
return
(
_count
==
otherArray
->
_count
&&
memcmp
(
_values
,
otherArray
->
_values
,
(
_count
*
sizeof
(
int32_t
)))
==
0
);
}
-
(
NSUInteger
)
hash
{
...
...
objectivec/GPBDictionary.h
View file @
40ff94eb
...
...
@@ -39,6 +39,12 @@
NS_ASSUME_NONNULL_BEGIN
// Disable -Woverriding-method-mismatch until resolving the accidental conflict
// with NSObject's KVC category.
// https://github.com/google/protobuf/issues/1616 opened to resolve this.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverriding-method-mismatch"
//%PDDM-EXPAND DECLARE_DICTIONARIES()
// This block of code is generated, do not edit it directly.
...
...
@@ -2085,6 +2091,8 @@ NS_ASSUME_NONNULL_BEGIN
//%PDDM-EXPAND-END DECLARE_DICTIONARIES()
#pragma clang diagnostic pop
NS_ASSUME_NONNULL_END
//%PDDM-DEFINE DECLARE_DICTIONARIES()
...
...
objectivec/GPBDictionary.m
View file @
40ff94eb
This diff is collapsed.
Click to expand it.
objectivec/GPBMessage.m
View file @
40ff94eb
...
...
@@ -2563,7 +2563,7 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
#pragma mark - isEqual: & hash Support
-
(
BOOL
)
isEqual
:
(
GPBMessage
*
)
other
{
-
(
BOOL
)
isEqual
:
(
id
)
other
{
if
(
other
==
self
)
{
return
YES
;
}
...
...
@@ -2572,9 +2572,10 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
return
NO
;
}
GPBMessage
*
otherMsg
=
other
;
GPBDescriptor
*
descriptor
=
[[
self
class
]
descriptor
];
uint8_t
*
selfStorage
=
(
uint8_t
*
)
messageStorage_
;
uint8_t
*
otherStorage
=
(
uint8_t
*
)
other
->
messageStorage_
;
uint8_t
*
otherStorage
=
(
uint8_t
*
)
other
Msg
->
messageStorage_
;
for
(
GPBFieldDescriptor
*
field
in
descriptor
->
fields_
)
{
if
(
GPBFieldIsMapOrArray
(
field
))
{
...
...
@@ -2668,14 +2669,14 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
}
// for(fields)
// nil and empty are equal
if
(
extensionMap_
.
count
!=
0
||
other
->
extensionMap_
.
count
!=
0
)
{
if
(
!
[
extensionMap_
isEqual
:
other
->
extensionMap_
])
{
if
(
extensionMap_
.
count
!=
0
||
other
Msg
->
extensionMap_
.
count
!=
0
)
{
if
(
!
[
extensionMap_
isEqual
:
other
Msg
->
extensionMap_
])
{
return
NO
;
}
}
// nil and empty are equal
GPBUnknownFieldSet
*
otherUnknowns
=
other
->
unknownFields_
;
GPBUnknownFieldSet
*
otherUnknowns
=
other
Msg
->
unknownFields_
;
if
([
unknownFields_
countOfFields
]
!=
0
||
[
otherUnknowns
countOfFields
]
!=
0
)
{
if
(
!
[
unknownFields_
isEqual
:
otherUnknowns
])
{
...
...
objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj
View file @
40ff94eb
...
...
@@ -836,6 +836,7 @@
"-Wreserved-id-macro"
,
"-Wswitch-enum"
,
"-Wdirect-ivar-access"
,
"-Woverriding-method-mismatch"
,
);
};
name
=
Debug
;
...
...
@@ -892,6 +893,7 @@
"-Wreserved-id-macro"
,
"-Wswitch-enum"
,
"-Wdirect-ivar-access"
,
"-Woverriding-method-mismatch"
,
);
};
name
=
Release
;
...
...
objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
View file @
40ff94eb
...
...
@@ -999,6 +999,7 @@
"-Wreserved-id-macro"
,
"-Wswitch-enum"
,
"-Wdirect-ivar-access"
,
"-Woverriding-method-mismatch"
,
);
};
name
=
Debug
;
...
...
@@ -1056,6 +1057,7 @@
"-Wreserved-id-macro"
,
"-Wswitch-enum"
,
"-Wdirect-ivar-access"
,
"-Woverriding-method-mismatch"
,
);
};
name
=
Release
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment