AntiMicro / antimicro

[NOT maintained anymore] Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support
1.79k stars 202 forks source link

fix compilation with clang #280

Closed magiruuvelvet closed 3 years ago

magiruuvelvet commented 5 years ago

This patch addresses a compilation problem where a pointer is compared with greater than sign ? clang doesn't like that and throws an error, while gcc silently shallows this.

I figured this doesn't make any sense and that perhaps you mean to check if the pointer is not nullptr?

error: ordered comparison between pointer and zero ('QMap<SDL_JoystickID, InputDevice *> *'
      (aka 'QMap<int, InputDevice *> *') and 'int')
    if (joysticks > 0)
        ~~~~~~~~~ ^ ~
1 error generated.

After some testing I didn't noticed any changes in the behavior of the application and it continues working as before, just like when compiled with gcc.