File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ impl GameController {
363
363
}
364
364
365
365
/// Return the joystick instance id of this controller
366
- pub fn instance_id ( & self ) -> i32 {
366
+ pub fn instance_id ( & self ) -> u32 {
367
367
let result = unsafe {
368
368
let joystick = sys:: SDL_GameControllerGetJoystick ( self . raw ) ;
369
369
sys:: SDL_JoystickInstanceID ( joystick)
@@ -373,7 +373,7 @@ impl GameController {
373
373
// Should only fail if the joystick is NULL.
374
374
panic ! ( get_error( ) )
375
375
} else {
376
- result
376
+ result as u32
377
377
}
378
378
}
379
379
Original file line number Diff line number Diff line change @@ -152,14 +152,14 @@ impl Joystick {
152
152
unsafe { sys:: SDL_JoystickGetAttached ( self . raw ) != sys:: SDL_bool :: SDL_FALSE }
153
153
}
154
154
155
- pub fn instance_id ( & self ) -> i32 {
155
+ pub fn instance_id ( & self ) -> u32 {
156
156
let result = unsafe { sys:: SDL_JoystickInstanceID ( self . raw ) } ;
157
157
158
158
if result < 0 {
159
159
// Should only fail if the joystick is NULL.
160
160
panic ! ( get_error( ) )
161
161
} else {
162
- result
162
+ result as u32
163
163
}
164
164
}
165
165
You can’t perform that action at this time.
0 commit comments