Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Casting for warnings.
Browse files Browse the repository at this point in the history
Fixed possible segfault.
  • Loading branch information
bobbens committed Aug 10, 2008
1 parent 23f46c0 commit 1c07910
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/haptic/darwin/SDL_syshaptic.c
Expand Up @@ -162,6 +162,11 @@ SDL_SYS_HapticInit(void)
}
/* IOServiceGetMatchingServices consumes dictionary. */

if (!iter) { /* No iterator. */
numhaptics = 0;
return 0;
}

numhaptics = 0;
while ((device = IOIteratorNext(iter)) != IO_OBJECT_NULL) {

Expand Down Expand Up @@ -459,7 +464,8 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
int
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
if (IOObjectIsEqualTo(haptic->hwdata->device, joystick->hwdata->ffservice))
if (IOObjectIsEqualTo((io_object_t) haptic->hwdata->device,
joystick->hwdata->ffservice))
return 1;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/darwin/SDL_sysjoystick.c
Expand Up @@ -649,7 +649,7 @@ SDL_SYS_JoystickInit(void)

/* We have to do some storage of the io_service_t for
* SDL_HapticOpenFromJoystick */
if (FFIsForceFeedback(device) == FF_OK) {
if (FFIsForceFeedback((io_service_t)device) == FF_OK) {
device->ffservice = ioHIDDeviceObject;
}
else {
Expand Down

0 comments on commit 1c07910

Please sign in to comment.