Backed out changeset 3797974f4ccf
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Mar 2020 19:49:15 -0700
changeset 13654b51e7317fdfc
parent 13653 7393d75c764e
child 13655 99fb2d227d8a
Backed out changeset 3797974f4ccf
src/joystick/windows/SDL_rawinputjoystick.c
     1.1 --- a/src/joystick/windows/SDL_rawinputjoystick.c	Fri Mar 20 19:48:26 2020 -0700
     1.2 +++ b/src/joystick/windows/SDL_rawinputjoystick.c	Fri Mar 20 19:49:15 2020 -0700
     1.3 @@ -240,7 +240,6 @@
     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 @@ -254,7 +253,7 @@
    1.12          return NULL;
    1.13      }
    1.14  
    1.15 -    type = SDL_GetJoystickGameControllerType("", device->vendor_id, device->product_id, -1, 0, 0, 0);
    1.16 +    SDL_GameControllerType 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 @@ -364,8 +363,6 @@
    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 @@ -375,7 +372,7 @@
    1.30              }
    1.31              --SDL_RAWINPUT_numjoysticks;
    1.32  
    1.33 -            joystick = device->joystick;
    1.34 +            SDL_Joystick *joystick = device->joystick;
    1.35              if (joystick) {
    1.36                  /* Detach from joystick */
    1.37                  RAWINPUT_JoystickClose(joystick);