Skip to content

Commit 201dbe4

Browse files
committed
Use correct integer types in touch
1 parent 31cbd4e commit 201dbe4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/sdl2/touch.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ pub use sys::touch as ll;
55
pub type Finger = ll::Finger;
66
pub type TouchDevice = ll::TouchDevice;
77

8-
pub fn get_num_touch_devices() -> isize {
9-
unsafe { ll::SDL_GetNumTouchDevices() as isize }
8+
pub fn get_num_touch_devices() -> i32 {
9+
unsafe { ll::SDL_GetNumTouchDevices() }
1010
}
1111

12-
pub fn get_touch_device(index: isize) -> TouchDevice {
13-
unsafe { ll::SDL_GetTouchDevice(index as i32) }
12+
pub fn get_touch_device(index: i32) -> TouchDevice {
13+
unsafe { ll::SDL_GetTouchDevice(index) }
1414
}
1515

16-
pub fn get_num_touch_fingers(touch: TouchDevice) -> isize {
17-
unsafe { ll::SDL_GetNumTouchFingers(touch) as isize }
16+
pub fn get_num_touch_fingers(touch: TouchDevice) -> i32 {
17+
unsafe { ll::SDL_GetNumTouchFingers(touch) }
1818
}
1919

20-
pub fn get_touch_finger(touch: TouchDevice, index: isize) -> Option<Finger> {
21-
let raw = unsafe { ll::SDL_GetTouchFinger(touch, index as i32) };
20+
pub fn get_touch_finger(touch: TouchDevice, index: i32) -> Option<Finger> {
21+
let raw = unsafe { ll::SDL_GetTouchFinger(touch, index) };
2222

2323
if raw == ptr::null() {
2424
None

0 commit comments

Comments
 (0)