From 05a9206a4f14cca24a990d1320a19d01b9fefb28 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 5 Apr 2015 18:44:24 -0400 Subject: [PATCH] Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!). Fixes Bugzilla #2673. --- src/events/SDL_gesture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index 46a554635d32a..28b85add72759 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -184,7 +184,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) int index = -1; int i = 0; if (inTouch == NULL) { - if (SDL_numGestureTouches == 0) return -1; + if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered"); for (i = 0; i < SDL_numGestureTouches; i++) { inTouch = &SDL_gestureTouch[i]; index = SDL_AddDollarGesture_one(inTouch, path); @@ -206,7 +206,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) for (i = 0; i < SDL_numGestureTouches; i++) if (SDL_gestureTouch[i].id == touchId) touch = &SDL_gestureTouch[i]; - if (touch == NULL) return -1; + if (touch == NULL) return SDL_SetError("given touch id not found"); } while (1) {