Skip to content

Commit 0c00bbb

Browse files
committed
Merge pull request #79 from mapbox/1ec5-pedantry
Resolved pedantic warnings; fixed Retina images
2 parents 53dfb88 + 7770db3 commit 0c00bbb

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

SMCalloutView.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ - (UIView *)subtitleViewOrDefault {
122122

123123
- (SMCalloutBackgroundView *)backgroundView {
124124
// create our default background on first access only if it's nil, since you might have set your own background anyway.
125-
return _backgroundView ?: (_backgroundView = [self defaultBackgroundView]);
125+
return _backgroundView ? _backgroundView : (_backgroundView = [self defaultBackgroundView]);
126126
}
127127

128128
- (SMCalloutBackgroundView *)defaultBackgroundView {
@@ -160,7 +160,7 @@ - (CGFloat)leftAccessoryVerticalMargin {
160160
}
161161

162162
- (CGFloat)leftAccessoryHorizontalMargin {
163-
return MIN(self.leftAccessoryVerticalMargin, TITLE_HMARGIN);
163+
return fminf(self.leftAccessoryVerticalMargin, TITLE_HMARGIN);
164164
}
165165

166166
- (CGFloat)rightAccessoryVerticalMargin {
@@ -171,7 +171,7 @@ - (CGFloat)rightAccessoryVerticalMargin {
171171
}
172172

173173
- (CGFloat)rightAccessoryHorizontalMargin {
174-
return MIN(self.rightAccessoryVerticalMargin, TITLE_HMARGIN);
174+
return fminf(self.rightAccessoryVerticalMargin, TITLE_HMARGIN);
175175
}
176176

177177
- (CGFloat)innerContentMarginLeft {
@@ -250,7 +250,7 @@ - (CGSize)offsetToContainRect:(CGRect)innerRect inRect:(CGRect)outerRect {
250250
CGFloat nudgeLeft = fminf(0, CGRectGetMaxX(outerRect) - CGRectGetMaxX(innerRect));
251251
CGFloat nudgeTop = fmaxf(0, CGRectGetMinY(outerRect) - CGRectGetMinY(innerRect));
252252
CGFloat nudgeBottom = fminf(0, CGRectGetMaxY(outerRect) - CGRectGetMaxY(innerRect));
253-
return CGSizeMake(nudgeLeft ?: nudgeRight, nudgeTop ?: nudgeBottom);
253+
return CGSizeMake(nudgeLeft ? nudgeLeft : nudgeRight, nudgeTop ? nudgeTop : nudgeBottom);
254254
}
255255

256256
- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated {

0 commit comments

Comments
 (0)