Skip to content

Commit

Permalink
fix analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
racarone committed Feb 1, 2016
1 parent c850535 commit 05e6b6c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sparrow/src/Classes/SPButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@implementation SPButton
{
SPTexture *_upState;
SPTexture *__nonnull _upState;
SPTexture *_downState;
SPTexture *_disabledState;

Expand Down Expand Up @@ -221,7 +221,7 @@ - (void)onTouch:(SPTouchEvent *)touchEvent

#pragma mark Private

- (void)setStateTexture:(SPTexture *)texture
- (void)setStateTexture:(SPTexture * _Nonnull)texture
{
_body.texture = texture ?: _upState;
}
Expand Down
2 changes: 1 addition & 1 deletion sparrow/src/Classes/SPFrameBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)present;

/// Draws the framebuffer to an image.
- (UIImage *)drawToImageInRegion:(SPRectangle *)region;
- (UIImage *)drawToImageInRegion:(nullable SPRectangle *)region;

/// Returns the framebuffer's drawable object or nil if this a texture based framebuffer.
@property (nonatomic, readonly, nullable) id drawable;
Expand Down
25 changes: 18 additions & 7 deletions sparrow/src/Classes/SPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ - (void)updateViewPort:(BOOL)forceUpdate
SPEvent *resizeEvent = [[SPResizeEvent alloc] initWithType:SPEventTypeResize
width:newWidth height:newHeight];
[_stage broadcastEvent:resizeEvent];
[resizeEvent release];
}
}
}
Expand Down Expand Up @@ -517,6 +518,8 @@ - (void)loadView

- (void)viewDidLoad
{
[super viewDidLoad];

if (!_overlayView)
{
_overlayView = [[SPOverlayView alloc] initWithFrame:_internalView.frame];
Expand Down Expand Up @@ -628,16 +631,23 @@ - (void)processTouchEvent:(UIEvent *)event
touch.previousGlobalY = previousLocation.y * yConversion;
touch.tapCount = (int)uiTouch.tapCount;
touch.phase = (SPTouchPhase)uiTouch.phase;
#pragma clang diagnostic push
#pragma ide diagnostic ignored "UnavailableInDeploymentTarget"
if ([uiTouch respondsToSelector:@selector(force)] && uiTouch.maximumPossibleForce > 0) {
touch.touchID = (size_t)uiTouch;

#pragma clang diagnostic push
#pragma ide diagnostic ignored "UnavailableInDeploymentTarget"

if ([uiTouch respondsToSelector:@selector(force)] &&
uiTouch.maximumPossibleForce > 0)
{
touch.forceFactor = uiTouch.force / uiTouch.maximumPossibleForce;
} else {
}
else
{
touch.forceFactor = 0;
}
#pragma clang diagnostic pop
touch.touchID = (size_t)uiTouch;

#pragma clang diagnostic pop
[_touchProcessor enqueueTouch:touch];
}

Expand Down Expand Up @@ -706,6 +716,7 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interf
SPEvent *resizeEvent = [[SPResizeEvent alloc] initWithType:SPEventTypeResize
width:newWidth height:newHeight animationTime:duration];
[_stage broadcastEvent:resizeEvent];
[resizeEvent release];
}
}

Expand Down

0 comments on commit 05e6b6c

Please sign in to comment.