Skip to content

Commit 4d0ba5f

Browse files
committed
Removed limits dependency
These aren't dynamic or platform specific, so they may as well be hard-coded.
1 parent c6b661f commit 4d0ba5f

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/XInput.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#error "Not a supported board! Must use Teensy 3.1/3.2, LC, 3.5, or 3.6"
4444
#endif
4545

46-
#include <limits>
47-
4846
// --------------------------------------------------------
4947
// XInput Button Maps |
5048
// (Matches ID to tx index with bitmask) |
@@ -114,10 +112,7 @@ struct XInputMap_Trigger {
114112
const uint8_t index;
115113
};
116114

117-
const XInputGamepad::Range XInputMap_Trigger::range = {
118-
std::numeric_limits<uint8_t>::min(), // 0
119-
std::numeric_limits<uint8_t>::max() // 255
120-
};
115+
const XInputGamepad::Range XInputMap_Trigger::range = { 0, 255 }; // uint8_t
121116

122117
static const XInputMap_Trigger Map_TriggerLeft(4);
123118
static const XInputMap_Trigger Map_TriggerRight(5);
@@ -145,10 +140,7 @@ struct XInputMap_Joystick {
145140
const uint8_t y_high;
146141
};
147142

148-
const XInputGamepad::Range XInputMap_Joystick::range = {
149-
std::numeric_limits<int16_t>::min(), // -32768
150-
std::numeric_limits<int16_t>::max() // 32767
151-
};
143+
const XInputGamepad::Range XInputMap_Joystick::range = { -32768, 32767 }; // int16_t
152144

153145
static const XInputMap_Joystick Map_JoystickLeft(6, 7, 8, 9);
154146
static const XInputMap_Joystick Map_JoystickRight(10, 11, 12, 13);

0 commit comments

Comments
 (0)