[xorg-x11-drv-vmmouse] Deal with input ABI 14 option types

Peter Hutterer whot at fedoraproject.org
Wed Nov 9 22:50:03 UTC 2011


commit 9b1097ff9fc1a828eb8e899c5ed4c8f006b88574
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Nov 10 08:50:07 2011 +1000

    Deal with input ABI 14 option types

 ...l-with-opaque-InputOption-types-in-ABI-14.patch |   89 ++++++++++++++++++++
 xorg-x11-drv-vmmouse.spec                          |    8 ++-
 2 files changed, 96 insertions(+), 1 deletions(-)
---
diff --git a/0001-Deal-with-opaque-InputOption-types-in-ABI-14.patch b/0001-Deal-with-opaque-InputOption-types-in-ABI-14.patch
new file mode 100644
index 0000000..ef4a765
--- /dev/null
+++ b/0001-Deal-with-opaque-InputOption-types-in-ABI-14.patch
@@ -0,0 +1,89 @@
+From 7aaf9f7c7aafda7561f6104fd9c1ff772ba61c6f Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Thu, 10 Nov 2011 08:07:08 +1000
+Subject: [PATCH] Deal with opaque InputOption types in ABI 14
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ src/vmmouse.c |   49 ++++++++++++++++++++++++++++++++++---------------
+ 1 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/src/vmmouse.c b/src/vmmouse.c
+index ad014ec..285ba26 100644
+--- a/src/vmmouse.c
++++ b/src/vmmouse.c
+@@ -228,11 +228,40 @@ static char reverseMap[32] = { 0,  4,  2,  6,  1,  5,  3,  7,
+ #define reverseBits(map, b)	(((b) & ~0x0f) | map[(b) & 0x0f])
+ 
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 14
++
++static InputOption*
++input_option_new(InputOption *list, char *key, char *value)
++{
++   InputOption *new;
++
++   new = calloc(1, sizeof(InputOption));
++   new->key = key;
++   new->value = value;
++   new->next = list;
++   return new;
++}
++
++static void
++input_option_free_list(InputOption **opts)
++{
++   InputOption *tmp = *opts;
++   while(*opts)
++   {
++      tmp = (*opts)->next;
++      free((*opts)->key);
++      free((*opts)->value);
++      free((*opts));
++      *opts = tmp;
++   }
++}
++#endif
++
+ static int
+ VMMouseInitPassthru(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ {
+    InputAttributes *attrs = NULL;
+-   InputOption *input_options = NULL, *tmp, *opts;
++   InputOption *input_options = NULL;
+    pointer options;
+    DeviceIntPtr dev;
+    int rc;
+@@ -241,25 +270,15 @@ VMMouseInitPassthru(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+    options = xf86ReplaceStrOption(options, "Driver", "mouse");
+ 
+    while(options) {
+-      tmp = calloc(1, sizeof(InputOption));
+-      tmp->key = xf86OptionName(options);
+-      tmp->value = xf86OptionValue(options);
+-      tmp->next = input_options;
+-      input_options = tmp;
++      input_options = input_option_new(input_options,
++                                       xf86OptionName(options),
++                                       xf86OptionValue(options));
+       options = xf86NextOption(options);
+    }
+ 
+    rc = NewInputDeviceRequest(input_options, attrs, &dev);
+ 
+-   opts = input_options;
+-   tmp = opts;
+-   while(opts) {
+-      tmp = opts->next;
+-      free(opts->key);
+-      free(opts->value);
+-      free(opts);
+-      opts = tmp;
+-   }
++   input_option_free_list(&input_options);
+ 
+    return rc;
+ }
+-- 
+1.7.7
+
diff --git a/xorg-x11-drv-vmmouse.spec b/xorg-x11-drv-vmmouse.spec
index 7c85511..7aa61be 100644
--- a/xorg-x11-drv-vmmouse.spec
+++ b/xorg-x11-drv-vmmouse.spec
@@ -8,7 +8,7 @@
 Summary:    Xorg X11 vmmouse input driver
 Name:	    xorg-x11-drv-vmmouse
 Version:    12.7.0
-Release:    3%{?gitdate:.%{gitdate}git%{gitversion}}%{dist}
+Release:    4%{?gitdate:.%{gitdate}git%{gitversion}}%{dist}
 URL:	    http://www.x.org
 License:    MIT
 Group:	    User Interface/X Hardware Support
@@ -23,6 +23,8 @@ Source0:    ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
 
 # 604660 - vmmouse_detect unexpected exit with status 0x000b
 Patch2:     vmmouse-12.6.9-iopl-revert.patch
+# Deal with input ABI 14
+Patch3:     0001-Deal-with-opaque-InputOption-types-in-ABI-14.patch
 
 # Yes, this is not the same as vmware.  Yes, this is intentional.
 ExclusiveArch: %{ix86} x86_64
@@ -40,6 +42,7 @@ X.Org X11 vmmouse input driver.
 %prep
 %setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
 %patch2 -p1 
+%patch3 -p1 
 
 %build
 autoreconf -v --install --force || exit 1
@@ -71,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT
 /lib/udev/rules.d/*.rules 
 
 %changelog
+* Thu Nov 10 2011 Peter Hutterer <peter.hutterer at redhat.com> 12.7.0-4
+- Deal with input ABI 14 option types
+
 * Wed Nov 09 2011 ajax <ajax at redhat.com> - 12.7.0-3
 - ABI rebuild
 


More information about the scm-commits mailing list