From 58652e57820176bcdd0c66214a7d729ca157b44a Mon Sep 17 00:00:00 2001 From: Johan Kool Date: Thu, 26 Feb 2015 13:19:14 +0800 Subject: [PATCH] Fix build warnings --- WYPopoverController/WYPopoverController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WYPopoverController/WYPopoverController.m b/WYPopoverController/WYPopoverController.m index 44244655..f0d27937 100644 --- a/WYPopoverController/WYPopoverController.m +++ b/WYPopoverController/WYPopoverController.m @@ -1691,7 +1691,7 @@ - (CGSize)topViewControllerContentSize { UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - result = CGSizeMake(320, UIDeviceOrientationIsLandscape(orientation) ? windowSize.width : windowSize.height); + result = CGSizeMake(320, UIInterfaceOrientationIsLandscape(orientation) ? windowSize.width : windowSize.height); } return result; @@ -1991,7 +1991,7 @@ - (CGAffineTransform)transformForArrowDirection:(WYPopoverArrowDirection)arrowDi CGSize containerViewSize = _backgroundView.frame.size; if (_backgroundView.arrowHeight > 0) { - if (UIDeviceOrientationIsLandscape(orientation)) { + if (UIInterfaceOrientationIsLandscape(orientation)) { containerViewSize.width = _backgroundView.frame.size.height; containerViewSize.height = _backgroundView.frame.size.width; } @@ -2860,6 +2860,8 @@ - (void)didChangeDeviceOrientation:(NSNotification *)notification { [_delegate popoverController:self willRepositionPopoverToRect:&anotherRect inView:&anotherInView]; +#pragma clang diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-pointer-compare" if (&anotherRect != NULL) { _rect = anotherRect; } @@ -2867,6 +2869,7 @@ - (void)didChangeDeviceOrientation:(NSNotification *)notification { if (&anotherInView != NULL) { _inView = anotherInView; } +#pragma GCC diagnostic pop } [self positionPopover:NO];