hidapi/SDL_hidapijoystick.c: fix build in C90 mode:
authorOzkan Sezer <sezeroz@gmail.com>
Fri, 07 Sep 2018 11:03:24 +0300
changeset 1218170224e91e883
parent 12180 a3c2b6e89522
child 12182 c0d45b4dcfc9
hidapi/SDL_hidapijoystick.c: fix build in C90 mode:

src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_InitializeDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: (Each undeclared identifier is reported only once
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: for each function it appears in.)
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_UpdateDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:339: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:341: error: ISO C90 forbids mixed declarations and code
src/joystick/hidapi/SDL_hidapijoystick.c
     1.1 --- a/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Sep 07 10:47:50 2018 +0300
     1.2 +++ b/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Sep 07 11:03:24 2018 +0300
     1.3 @@ -278,7 +278,7 @@
     1.4          if (SDL_HIDAPI_discovery.m_pUdevMonitor) {
     1.5              udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor);
     1.6              SDL_HIDAPI_discovery.m_nUdevFd = udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor);
     1.7 -            SDL_HIDAPI_discovery.m_bCanGetNotifications = true;
     1.8 +            SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_TRUE;
     1.9          }
    1.10      }
    1.11  
    1.12 @@ -329,6 +329,7 @@
    1.13           */
    1.14          for (;;) {
    1.15              struct pollfd PollUdev;
    1.16 +            struct udev_device *pUdevDevice;
    1.17  
    1.18              PollUdev.fd = SDL_HIDAPI_discovery.m_nUdevFd;
    1.19              PollUdev.events = POLLIN;
    1.20 @@ -336,9 +337,9 @@
    1.21                  break;
    1.22              }
    1.23  
    1.24 -            SDL_HIDAPI_discovery.m_bHaveDevicesChanged = true;
    1.25 +            SDL_HIDAPI_discovery.m_bHaveDevicesChanged = SDL_TRUE;
    1.26  
    1.27 -            struct udev_device *pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor);
    1.28 +            pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor);
    1.29              if (pUdevDevice) {
    1.30                  udev_device_unref(pUdevDevice);
    1.31              }