src/haptic/windows/SDL_dinputhaptic.c
changeset 10885 4528f2a99fb7
parent 10819 bab110e44dcb
child 11811 5d94cb6b24d3
     1.1 --- a/src/haptic/windows/SDL_dinputhaptic.c	Mon Feb 13 16:59:02 2017 -0500
     1.2 +++ b/src/haptic/windows/SDL_dinputhaptic.c	Mon Feb 13 17:00:46 2017 -0500
     1.3 @@ -59,15 +59,6 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 - * Checks to see if two GUID are the same.
     1.8 - */
     1.9 -static int
    1.10 -DI_GUIDIsSame(const GUID * a, const GUID * b)
    1.11 -{
    1.12 -    return (SDL_memcmp(a, b, sizeof (GUID)) == 0);
    1.13 -}
    1.14 -
    1.15 -/*
    1.16   * Callback to find the haptic devices.
    1.17   */
    1.18  static BOOL CALLBACK
    1.19 @@ -219,17 +210,17 @@
    1.20      if ((dev->dwType & DIDFT_AXIS) && (dev->dwFlags & DIDOI_FFACTUATOR)) {
    1.21          const GUID *guid = &dev->guidType;
    1.22          DWORD offset = 0;
    1.23 -        if (DI_GUIDIsSame(guid, &GUID_XAxis)) {
    1.24 +        if (WIN_IsEqualGUID(guid, &GUID_XAxis)) {
    1.25              offset = DIJOFS_X;
    1.26 -        } else if (DI_GUIDIsSame(guid, &GUID_YAxis)) {
    1.27 +        } else if (WIN_IsEqualGUID(guid, &GUID_YAxis)) {
    1.28              offset = DIJOFS_Y;
    1.29 -        } else if (DI_GUIDIsSame(guid, &GUID_ZAxis)) {
    1.30 +        } else if (WIN_IsEqualGUID(guid, &GUID_ZAxis)) {
    1.31              offset = DIJOFS_Z;
    1.32 -        } else if (DI_GUIDIsSame(guid, &GUID_RxAxis)) {
    1.33 +        } else if (WIN_IsEqualGUID(guid, &GUID_RxAxis)) {
    1.34              offset = DIJOFS_RX;
    1.35 -        } else if (DI_GUIDIsSame(guid, &GUID_RyAxis)) {
    1.36 +        } else if (WIN_IsEqualGUID(guid, &GUID_RyAxis)) {
    1.37              offset = DIJOFS_RY;
    1.38 -        } else if (DI_GUIDIsSame(guid, &GUID_RzAxis)) {
    1.39 +        } else if (WIN_IsEqualGUID(guid, &GUID_RzAxis)) {
    1.40              offset = DIJOFS_RZ;
    1.41          } else {
    1.42              return DIENUM_CONTINUE;   /* can't use this, go on. */
    1.43 @@ -251,7 +242,7 @@
    1.44   * Callback to get all supported effects.
    1.45   */
    1.46  #define EFFECT_TEST(e,s)               \
    1.47 -if (DI_GUIDIsSame(&pei->guid, &(e)))   \
    1.48 +if (WIN_IsEqualGUID(&pei->guid, &(e)))   \
    1.49     haptic->supported |= (s)
    1.50  static BOOL CALLBACK
    1.51  DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
    1.52 @@ -481,7 +472,7 @@
    1.53          return 0;
    1.54      }
    1.55  
    1.56 -    return DI_GUIDIsSame(&hap_instance.guidInstance, &joy_instance.guidInstance);
    1.57 +    return WIN_IsEqualGUID(&hap_instance.guidInstance, &joy_instance.guidInstance);
    1.58  }
    1.59  
    1.60  int
    1.61 @@ -500,7 +491,7 @@
    1.62  
    1.63      /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
    1.64      for (item = SDL_hapticlist; item != NULL; item = item->next) {
    1.65 -        if (!item->bXInputHaptic && DI_GUIDIsSame(&item->instance.guidInstance, &joy_instance.guidInstance)) {
    1.66 +        if (!item->bXInputHaptic && WIN_IsEqualGUID(&item->instance.guidInstance, &joy_instance.guidInstance)) {
    1.67              haptic->index = index;
    1.68              return SDL_DINPUT_HapticOpenFromDevice(haptic, joystick->hwdata->InputDevice, SDL_TRUE);
    1.69          }