From 33381d3d10852f9997251c7517c7805198dcf27c Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 7 Sep 2018 11:03:24 +0300 Subject: [PATCH] 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 65168ae4c..7f45be8cd 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -278,7 +278,7 @@ HIDAPI_InitializeDiscovery() if (SDL_HIDAPI_discovery.m_pUdevMonitor) { udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor); SDL_HIDAPI_discovery.m_nUdevFd = udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor); - SDL_HIDAPI_discovery.m_bCanGetNotifications = true; + SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_TRUE; } } @@ -329,6 +329,7 @@ HIDAPI_UpdateDiscovery() */ for (;;) { struct pollfd PollUdev; + struct udev_device *pUdevDevice; PollUdev.fd = SDL_HIDAPI_discovery.m_nUdevFd; PollUdev.events = POLLIN; @@ -336,9 +337,9 @@ HIDAPI_UpdateDiscovery() break; } - SDL_HIDAPI_discovery.m_bHaveDevicesChanged = true; + SDL_HIDAPI_discovery.m_bHaveDevicesChanged = SDL_TRUE; - struct udev_device *pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor); + pUdevDevice = udev_monitor_receive_device(SDL_HIDAPI_discovery.m_pUdevMonitor); if (pUdevDevice) { udev_device_unref(pUdevDevice); }