joystick axis mapping patch

Rob Crittenden <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
This removes the case requirements when writing a joystick mapping line.
It also prints a warning if an unknown mapping is provided.

rob
js.diff (text/plain, 1.5 KB)
Index: joystick.c
===================================================================
RCS file: /cvsroot/winex/dlls/winmm/joystick/joystick.c,v
retrieving revision 1.17
diff -u -r1.17 joystick.c
--- joystick.c	18 Feb 2004 22:27:45 -0000	1.17
+++ joystick.c	18 May 2004 15:18:48 -0000
@@ -280,17 +280,18 @@
 static JMAP get_map_val(char *p)
 {
     if (!p[0]) return JMAP_DISABLE;
-    if (!strcmp(p, "none")) return JMAP_DISABLE;
-    if (!strcmp(p, "X")) return JMAP_X;
-    if (!strcmp(p, "Y")) return JMAP_Y;
-    if (!strcmp(p, "Z")) return JMAP_Z;
-    if (!strcmp(p, "RX")) return JMAP_RX;
-    if (!strcmp(p, "RY")) return JMAP_RY;
-    if (!strcmp(p, "RZ")) return JMAP_RZ;
-    if (!strcmp(p, "slider")) return JMAP_SLIDER;
-    if (!strcmp(p, "hat")) return JMAP_HAT;
-    if (!strcmp(p, "POV")) return JMAP_HAT;
-    if (!strcmp(p, "ball")) return JMAP_BALL;
+    if (!strcasecmp(p, "none")) return JMAP_DISABLE;
+    if (!strcasecmp(p, "X")) return JMAP_X;
+    if (!strcasecmp(p, "Y")) return JMAP_Y;
+    if (!strcasecmp(p, "Z")) return JMAP_Z;
+    if (!strcasecmp(p, "RX")) return JMAP_RX;
+    if (!strcasecmp(p, "RY")) return JMAP_RY;
+    if (!strcasecmp(p, "RZ")) return JMAP_RZ;
+    if (!strcasecmp(p, "slider")) return JMAP_SLIDER;
+    if (!strcasecmp(p, "hat")) return JMAP_HAT;
+    if (!strcasecmp(p, "POV")) return JMAP_HAT;
+    if (!strcasecmp(p, "ball")) return JMAP_BALL;
+    WARN("Unknown joystick axis type: '%s'.\n", p);
     return JMAP_DISABLE;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.