A few minor changes to placate static analysis.

This commit is contained in:
Ryan C. Gordon
2019-06-14 18:23:51 -04:00
parent 4eb3c0c387
commit 90e2dc9891
3 changed files with 24 additions and 6 deletions

View File

@@ -424,7 +424,11 @@ void
Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
{
SDL_Mouse *mouse = SDL_GetMouse();
SDL_MouseID mouseID = mouse ? mouse->mouseID : 0;
if (!mouse) {
return;
}
SDL_MouseID mouseID = mouse->mouseID;
if ([event subtype] == NSEventSubtypeTouch) { /* this is a synthetic from the OS */
if (mouse->touch_mouse_events) {
mouseID = SDL_TOUCH_MOUSEID; /* Hint is set */

View File

@@ -894,7 +894,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
- (void)mouseDown:(NSEvent *)theEvent
{
const SDL_Mouse *mouse = SDL_GetMouse();
SDL_MouseID mouseID = mouse ? mouse->mouseID : 0;
if (!mouse) {
return;
}
SDL_MouseID mouseID = mouse->mouseID;
int button;
int clicks;
@@ -959,7 +963,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
- (void)mouseUp:(NSEvent *)theEvent
{
const SDL_Mouse *mouse = SDL_GetMouse();
SDL_MouseID mouseID = mouse ? mouse->mouseID : 0;
if (!mouse) {
return;
}
SDL_MouseID mouseID = mouse->mouseID;
int button;
int clicks;
@@ -1014,7 +1022,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
- (void)mouseMoved:(NSEvent *)theEvent
{
SDL_Mouse *mouse = SDL_GetMouse();
SDL_MouseID mouseID = mouse ? mouse->mouseID : 0;
if (!mouse) {
return;
}
SDL_MouseID mouseID = mouse->mouseID;
SDL_Window *window = _data->window;
NSPoint point;
int x, y;