From 2c85502ccb26bff62531cb96d78acd9003d3cd0b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 3 Apr 2013 11:34:21 -0400 Subject: [PATCH] Fixed compiler warnings. "leftFingerDown" doesn't need to be an SDL_FingerID. --- src/video/uikit/SDL_uikitview.h | 2 +- src/video/uikit/SDL_uikitview.m | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/uikit/SDL_uikitview.h b/src/video/uikit/SDL_uikitview.h index cd5aec450..ff8a7d2cf 100644 --- a/src/video/uikit/SDL_uikitview.h +++ b/src/video/uikit/SDL_uikitview.h @@ -37,7 +37,7 @@ #endif SDL_TouchID touchId; - SDL_FingerID leftFingerDown; + UITouch *leftFingerDown; #ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS UITouch *finger[MAX_SIMULTANEOUS_TOUCHES]; #endif diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index a5eca6c9d..82cce3cbf 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -94,7 +94,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event /* send mouse down event */ SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); - leftFingerDown = (SDL_FingerID)touch; + leftFingerDown = touch; } CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; @@ -102,7 +102,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event // FIXME: TODO: Using touch as the fingerId is potentially dangerous // It is also much more efficient than storing the UITouch pointer // and comparing it to the incoming event. - SDL_SendTouch(touchId, (SDL_FingerID)touch, + SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), SDL_TRUE, locationInView.x, locationInView.y, 1.0f); #else int i; @@ -125,10 +125,10 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event UITouch *touch = (UITouch*)[enumerator nextObject]; while(touch) { - if ((SDL_FingerID)touch == leftFingerDown) { + if (touch == leftFingerDown) { /* send mouse up */ SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); - leftFingerDown = 0; + leftFingerDown = nil; } CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; @@ -166,7 +166,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event UITouch *touch = (UITouch*)[enumerator nextObject]; while (touch) { - if ((SDL_FingerID)touch == leftFingerDown) { + if (touch == leftFingerDown) { CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO]; /* send moved event */