[PATCH joystick 1/2] Fix option type for option duplication

Peter Hutterer peter.hutterer at who-t.net
Sun Oct 30 21:41:10 PDT 2011


xf86OptionListDuplicate() duplicates an XF86Option list, not an InputOption
list.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/jstk_key.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/jstk_key.c b/src/jstk_key.c
index d699dcd..e842941 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -253,26 +253,26 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
     int rc;
     char name[512] = {0};
     InputAttributes *attrs = NULL;
-    InputOption *options;
     InputOption *iopts = NULL, *tmp;
     DeviceIntPtr dev;
+    XF86OptionPtr opts;
 
     /* duplicate option list, append to name */
-    options = xf86OptionListDuplicate(pInfo->options);
+    opts = xf86OptionListDuplicate(pInfo->options);
     strcpy(name, pInfo->name);
     strcat(name, " (keys)");
-    options = xf86ReplaceStrOption(options, "Name", name);
-    options = xf86ReplaceStrOption(options, "_source", "_driver/joystick");
+    opts = xf86ReplaceStrOption(opts, "Name", name);
+    opts = xf86ReplaceStrOption(opts, "_source", "_driver/joystick");
 
-    while(options)
+    while(opts)
     {
         tmp = calloc(1, sizeof(InputOption));
 
-        tmp->key = xf86OptionName(options);
-        tmp->value = xf86OptionValue(options);
+        tmp->key = xf86OptionName(opts);
+        tmp->value = xf86OptionValue(opts);
         tmp->next = iopts;
         iopts = tmp;
-        options = xf86NextOption(options);
+        opts = xf86NextOption(opts);
     }
 
     /* duplicate attribute list */
-- 
1.7.7



More information about the xorg-devel mailing list