Bug 4576: fix warning and compile
authorSylvain Becker <sylvain.becker@gmail.com>
Tue, 02 Apr 2019 17:57:27 +0200
changeset 1268416a389d01a4a
parent 12683 0dd4bae437a5
child 12685 b5ff77fd39f2
Bug 4576: fix warning and compile
src/events/SDL_touch.c
src/video/android/SDL_androidtouch.c
src/video/emscripten/SDL_emscriptenevents.c
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/events/SDL_touch.c	Tue Apr 02 17:23:55 2019 +0200
     1.2 +++ b/src/events/SDL_touch.c	Tue Apr 02 17:57:27 2019 +0200
     1.3 @@ -253,8 +253,8 @@
     1.4          if (window) {
     1.5              if (down) {
     1.6                  if (finger_touching == SDL_FALSE) {
     1.7 -                    int pos_x = x * window->w;
     1.8 -                    int pos_y = y * window->y;
     1.9 +                    int pos_x = (int)(x * (float)window->w);
    1.10 +                    int pos_y = (int)(y * (float)window->y);
    1.11                      finger_touching = SDL_TRUE;
    1.12                      first_finger = fingerid;
    1.13                      SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
    1.14 @@ -339,8 +339,8 @@
    1.15          SDL_Window *window = SDL_GetMouseFocus();
    1.16          if (window) {
    1.17              if (finger_touching == SDL_TRUE && first_finger == fingerid) {
    1.18 -                int pos_x = x * window->w;
    1.19 -                int pos_y = y * window->y;
    1.20 +                int pos_x = (int)(x * (float)window->w);
    1.21 +                int pos_y = (int)(y * (float)window->y);
    1.22                  SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
    1.23              }
    1.24          }
     2.1 --- a/src/video/android/SDL_androidtouch.c	Tue Apr 02 17:23:55 2019 +0200
     2.2 +++ b/src/video/android/SDL_androidtouch.c	Tue Apr 02 17:57:27 2019 +0200
     2.3 @@ -68,7 +68,6 @@
     2.4  {
     2.5      SDL_TouchID touchDeviceId = 0;
     2.6      SDL_FingerID fingerId = 0;
     2.7 -    int window_x, window_y;
     2.8  
     2.9      if (!window) {
    2.10          return;
     3.1 --- a/src/video/emscripten/SDL_emscriptenevents.c	Tue Apr 02 17:23:55 2019 +0200
     3.2 +++ b/src/video/emscripten/SDL_emscriptenevents.c	Tue Apr 02 17:57:27 2019 +0200
     3.3 @@ -431,7 +431,6 @@
     3.4  static EM_BOOL
     3.5  Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
     3.6  {
     3.7 -    SDL_WindowData *window_data = userData;
     3.8      int i;
     3.9      double client_w, client_h;
    3.10      int preventDefault = 0;
     4.1 --- a/src/video/windows/SDL_windowsevents.c	Tue Apr 02 17:23:55 2019 +0200
     4.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Apr 02 17:57:27 2019 +0200
     4.3 @@ -528,7 +528,7 @@
     4.4              SDL_Mouse *mouse = SDL_GetMouse();
     4.5              if (!mouse->relative_mode || mouse->relative_mode_warp) {
     4.6                  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) != MOUSEEVENTF_FROMTOUCH) {
     4.7 -                    WIN_CheckWParamMouseButtons(wParam, data, mouseID);
     4.8 +                    WIN_CheckWParamMouseButtons(wParam, data, 0);
     4.9                  }
    4.10              }
    4.11          }