Commit f28c7fe8a54149046ba90d3e95a19df679e505b9

Ryan C. Gordon 2013-10-20T16:03:11

Backed out hg changeset add2dbe99fe2. REFGUID is apparently a const type.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/haptic/windows/SDL_syshaptic.c b/src/haptic/windows/SDL_syshaptic.c
index fa03afe..e8867bc 100644
--- a/src/haptic/windows/SDL_syshaptic.c
+++ b/src/haptic/windows/SDL_syshaptic.c
@@ -1204,13 +1204,10 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
                         SDL_HapticEffect * base)
 {
     HRESULT ret;
-    REFGUID type = NULL;
+    REFGUID type = SDL_SYS_HapticEffectType(base);
 
-    if (!haptic->hwdata->bXInputHaptic) {
-        type = SDL_SYS_HapticEffectType(base);
-        if (type == NULL) {
-            goto err_hweffect;
-        }
+    if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) {
+        goto err_hweffect;
     }
 
     /* Alloc the effect. */