[Commits] SDL: hidapi/SDL_hidapijoystick.c: fix build in C90 mode:

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 7 01:03:37 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/70224e91e883
changeset: 12181:70224e91e883
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Fri Sep 07 11:03:24 2018 +0300
description:
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

diffstat:

 src/joystick/hidapi/SDL_hidapijoystick.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r a3c2b6e89522 -r 70224e91e883 src/joystick/hidapi/SDL_hidapijoystick.c
--- a/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Sep 07 10:47:50 2018 +0300
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c	Fri Sep 07 11:03:24 2018 +0300
@@ -278,7 +278,7 @@
         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 @@
          */
         for (;;) {
             struct pollfd PollUdev;
+            struct udev_device *pUdevDevice;
 
             PollUdev.fd = SDL_HIDAPI_discovery.m_nUdevFd;
             PollUdev.events = POLLIN;
@@ -336,9 +337,9 @@
                 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);
             }


More information about the commits mailing list