Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 05 Apr 2015 18:44:24 -0400
changeset 94562d6ec08030a0
parent 9455 b452e37e26d9
child 9457 9f2beba999b8
Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!).

Fixes Bugzilla #2673.
src/events/SDL_gesture.c
     1.1 --- a/src/events/SDL_gesture.c	Sun Apr 05 15:52:37 2015 -0400
     1.2 +++ b/src/events/SDL_gesture.c	Sun Apr 05 18:44:24 2015 -0400
     1.3 @@ -184,7 +184,7 @@
     1.4      int index = -1;
     1.5      int i = 0;
     1.6      if (inTouch == NULL) {
     1.7 -        if (SDL_numGestureTouches == 0) return -1;
     1.8 +        if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered");
     1.9          for (i = 0; i < SDL_numGestureTouches; i++) {
    1.10              inTouch = &SDL_gestureTouch[i];
    1.11              index = SDL_AddDollarGesture_one(inTouch, path);
    1.12 @@ -206,7 +206,7 @@
    1.13          for (i = 0; i < SDL_numGestureTouches; i++)
    1.14              if (SDL_gestureTouch[i].id == touchId)
    1.15                  touch = &SDL_gestureTouch[i];
    1.16 -        if (touch == NULL) return -1;
    1.17 +        if (touch == NULL) return SDL_SetError("given touch id not found");
    1.18      }
    1.19  
    1.20      while (1) {