Fixed compile warnings
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Mar 2020 19:47:46 -0700
changeset 136523797974f4ccf
parent 13651 ca9c225103c4
child 13653 7393d75c764e
Fixed compile warnings
src/joystick/windows/SDL_rawinputjoystick.c
     1.1 --- a/src/joystick/windows/SDL_rawinputjoystick.c	Fri Mar 20 19:42:59 2020 -0700
     1.2 +++ b/src/joystick/windows/SDL_rawinputjoystick.c	Fri Mar 20 19:47:46 2020 -0700
     1.3 @@ -240,6 +240,7 @@
     1.4  static SDL_HIDAPI_DeviceDriver *
     1.5  RAWINPUT_GetDeviceDriver(SDL_RAWINPUT_Device *device)
     1.6  {
     1.7 +    SDL_GameControllerType type;
     1.8      int i;
     1.9  
    1.10      if (SDL_ShouldIgnoreJoystick(device->name, device->guid)) {
    1.11 @@ -253,7 +254,7 @@
    1.12          return NULL;
    1.13      }
    1.14  
    1.15 -    SDL_GameControllerType type = SDL_GetJoystickGameControllerType("", device->vendor_id, device->product_id, -1, 0, 0, 0);
    1.16 +    type = SDL_GetJoystickGameControllerType("", device->vendor_id, device->product_id, -1, 0, 0, 0);
    1.17  
    1.18      for (i = 0; i < SDL_arraysize(SDL_RAWINPUT_drivers); ++i) {
    1.19          SDL_HIDAPI_DeviceDriver *driver = SDL_RAWINPUT_drivers[i];
    1.20 @@ -363,6 +364,8 @@
    1.21  RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event)
    1.22  {
    1.23      SDL_RAWINPUT_Device *curr, *last;
    1.24 +    SDL_Joystick *joystick;
    1.25 +
    1.26      for (curr = SDL_RAWINPUT_devices, last = NULL; curr; last = curr, curr = curr->next) {
    1.27          if (curr == device) {
    1.28              if (last) {
    1.29 @@ -372,7 +375,7 @@
    1.30              }
    1.31              --SDL_RAWINPUT_numjoysticks;
    1.32  
    1.33 -            SDL_Joystick *joystick = device->joystick;
    1.34 +            joystick = device->joystick;
    1.35              if (joystick) {
    1.36                  /* Detach from joystick */
    1.37                  RAWINPUT_JoystickClose(joystick);