-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
…-gl-native into 5983-ignore-viewport-noops
&& _centerCoordinate.longitude == otherCamera.centerCoordinate.longitude | ||
&& _altitude == otherCamera.altitude | ||
&& _pitch == otherCamera.pitch && _heading == otherCamera.heading); | ||
NSAssert([otherCamera isKindOfClass:[self class]], @"must compare two cameras"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method takes an id, which implies you can pass in any object. Do other classes assert when you attempt to compare to something of a different class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. 5fba4e6
@@ -34,6 +34,14 @@ NS_INLINE mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBo | |||
MGLLatLngFromLocationCoordinate2D(coordinateBounds.ne)); | |||
} | |||
|
|||
NS_INLINE void MGLLocationCoordinatesFromCoordinateBounds(MGLCoordinateBounds coordinateBounds, CLLocationCoordinate2D *coordinates) { | |||
assert(sizeof(coordinates) == 4 * sizeof(CLLocationCoordinate2D)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use NSAssert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried, but can't do that in NS_INLINE
; it requires the existence of self
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, you want NSCAssert, because we're in a C function that has no access to self.
also migrate instances of `void (^)(void)` to `dispatch_block_t`
Work in progress towards fixing #5983. We may want to do some of this not just at the mobile bindings layer, but also in core for completeness.
/cc @1ec5 @friedbunny