Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing compilation warnings #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions WYPopoverController/WYPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
if (testHits) {
return NO;
return nil;
}

UIView *view = [super hitTest:point withEvent:event];
Expand Down Expand Up @@ -1827,7 +1827,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;
Expand Down Expand Up @@ -2150,7 +2150,7 @@ - (CGAffineTransform)transformForArrowDirection:(WYPopoverArrowDirection)arrowDi

if (backgroundView.arrowHeight > 0)
{
if (UIDeviceOrientationIsLandscape(orientation)) {
if (UIInterfaceOrientationIsLandscape(orientation)) {
containerViewSize.width = backgroundView.frame.size.height;
containerViewSize.height = backgroundView.frame.size.width;
}
Expand Down Expand Up @@ -2935,7 +2935,8 @@ - (CGSize)sizeForRect:(CGRect)aRect
}

#pragma mark Inline functions

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static NSString* WYStringFromOrientation(NSInteger orientation) {
NSString *result = @"Unknown";

Expand All @@ -2958,6 +2959,7 @@ - (CGSize)sizeForRect:(CGRect)aRect

return result;
}
#pragma clang diagnostic pop

static float WYStatusBarHeight() {
UIInterfaceOrientation orienation = [[UIApplication sharedApplication] statusBarOrientation];
Expand All @@ -2967,7 +2969,7 @@ static float WYStatusBarHeight() {
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
statusBarHeight = statusBarFrame.size.height;

if (UIDeviceOrientationIsLandscape(orienation))
if (UIInterfaceOrientationIsLandscape(orienation))
{
statusBarHeight = statusBarFrame.size.width;
}
Expand Down Expand Up @@ -3096,12 +3098,12 @@ - (void)didChangeDeviceOrientation:(NSNotification *)notification

[delegate popoverController:self willRepositionPopoverToRect:&anotherRect inView:&anotherInView];

if (&anotherRect != NULL)
if (!CGRectIsNull(anotherRect))
{
rect = anotherRect;
}
if (&anotherInView != NULL)

if (anotherInView != NULL)
{
inView = anotherInView;
}
Expand Down