diff src/haptic/darwin/SDL_syshaptic.c @ 2639:668fee3b268a gsoc2008_force_feedback

Casting for warnings. Fixed possible segfault.
author Edgar Simo <bobbens@gmail.com>
date Sun, 10 Aug 2008 19:53:58 +0000
parents 2f826c229d77
children e1e1be935178
line wrap: on
line diff
--- a/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 10 19:47:02 2008 +0000
+++ b/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 10 19:53:58 2008 +0000
@@ -162,6 +162,11 @@
    }
    /* IOServiceGetMatchingServices consumes dictionary. */
 
+   if (!iter) { /* No iterator. */
+      numhaptics = 0;
+      return 0;
+   }
+
    numhaptics = 0;
    while ((device = IOIteratorNext(iter)) != IO_OBJECT_NULL) {
 
@@ -459,7 +464,8 @@
 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;
 }