[Commits] SDL: replace bool stuff in controller_type.h with SDL_bool.

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 28 07:01:29 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/9a334644da3e
changeset: 12252:9a334644da3e
user:      Ozkan Sezer <sezeroz at gmail.com>
date:      Fri Sep 28 17:01:24 2018 +0300
description:
replace bool stuff in controller_type.h with SDL_bool.

remove bool<->SDL_bool dance in SDL_joystick.c:SDL_IsJoystickSteamController()
after the controller_type.h change.

diffstat:

 src/joystick/SDL_joystick.c    |  2 +-
 src/joystick/controller_type.h |  3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 47246ea2f62c -r 9a334644da3e src/joystick/SDL_joystick.c
--- a/src/joystick/SDL_joystick.c	Fri Sep 28 14:01:40 2018 +0300
+++ b/src/joystick/SDL_joystick.c	Fri Sep 28 17:01:24 2018 +0300
@@ -1135,7 +1135,7 @@
 SDL_bool
 SDL_IsJoystickSteamController(Uint16 vendor, Uint16 product)
 {
-    return BIsSteamController(GuessControllerType(vendor, product)) ? SDL_TRUE : SDL_FALSE;
+    return BIsSteamController(GuessControllerType(vendor, product));
 }
 
 SDL_bool
diff -r 47246ea2f62c -r 9a334644da3e src/joystick/controller_type.h
--- a/src/joystick/controller_type.h	Fri Sep 28 14:01:40 2018 +0300
+++ b/src/joystick/controller_type.h	Fri Sep 28 17:01:24 2018 +0300
@@ -25,7 +25,6 @@
 #endif
 
 #ifndef __cplusplus
-typedef enum { false, true } bool;
 #define inline SDL_INLINE
 #endif
 
@@ -65,7 +64,7 @@
 	k_eControllertype_GenericMouse = 800,
 } EControllerType;
 
-static inline bool BIsSteamController( EControllerType eType )
+static inline SDL_bool BIsSteamController( EControllerType eType )
 {
 	return ( eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2 );
 }


More information about the commits mailing list