[90818] trunk/dports/x11/xorg-libXi
jeremyhu at macports.org
jeremyhu at macports.org
Wed Mar 14 19:41:06 PDT 2012
Revision: 90818
https://trac.macports.org/changeset/90818
Author: jeremyhu at macports.org
Date: 2012-03-14 19:41:03 -0700 (Wed, 14 Mar 2012)
Log Message:
-----------
libXi: Fix a padding issue on x86_64
Modified Paths:
--------------
trunk/dports/x11/xorg-libXi/Portfile
Added Paths:
-----------
trunk/dports/x11/xorg-libXi/files/
trunk/dports/x11/xorg-libXi/files/0001-Fix-wrong-button-label-and-mask-copy-on-OS-X.patch
Modified: trunk/dports/x11/xorg-libXi/Portfile
===================================================================
--- trunk/dports/x11/xorg-libXi/Portfile 2012-03-15 01:58:46 UTC (rev 90817)
+++ trunk/dports/x11/xorg-libXi/Portfile 2012-03-15 02:41:03 UTC (rev 90818)
@@ -4,6 +4,7 @@
name xorg-libXi
version 1.6.0
+revision 1
categories x11 devel
license X11
maintainers jeremyhu openmaintainer
@@ -26,6 +27,10 @@
depends_lib port:xorg-libXext \
port:xorg-inputproto
+patchfiles \
+ 0001-Fix-wrong-button-label-and-mask-copy-on-OS-X.patch
+patch.pre_args -p1
+
configure.args \
--without-asciidoc \
--without-xmlto \
Added: trunk/dports/x11/xorg-libXi/files/0001-Fix-wrong-button-label-and-mask-copy-on-OS-X.patch
===================================================================
--- trunk/dports/x11/xorg-libXi/files/0001-Fix-wrong-button-label-and-mask-copy-on-OS-X.patch (rev 0)
+++ trunk/dports/x11/xorg-libXi/files/0001-Fix-wrong-button-label-and-mask-copy-on-OS-X.patch 2012-03-15 02:41:03 UTC (rev 90818)
@@ -0,0 +1,58 @@
+From 424e207118e1604864308999a263f9bd3dc2285e Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Thu, 15 Mar 2012 12:06:31 +1000
+Subject: [PATCH] Fix wrong button label and mask copy on OS X
+
+Regression introduced in c1a5a70b51f12dedf354102217c7cd4247ed3a4b.
+
+If double-padding is applied, the length of the mask on the wire may be
+smaller than libXi's mask_len. When copying, only the wire length must be
+copied, with the remainder set to 0.
+When advancing to the button labels, the wire length matters, not libXi's
+internal length.
+
+Reported-by: Jeremy Huddleston <jeremyhu at apple.com>
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ src/XExtInt.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git libXi-1.6.0/src/XExtInt.c libXi-1.6.0/src/XExtInt.c
+index 89c0894..0c64f9a 100644
+--- libXi-1.6.0/src/XExtInt.c
++++ libXi-1.6.0/src/XExtInt.c
+@@ -1610,12 +1610,14 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses)
+ int struct_size;
+ int state_size;
+ int labels_size;
++ int wire_mask_size;
+
+ cls_wire = (xXIButtonInfo*)any_wire;
+ sizeXIButtonClassType(cls_wire->num_buttons,
+ &struct_size, &state_size,
+ &labels_size);
+ cls_lib = next_block(&ptr_lib, struct_size);
++ wire_mask_size = ((cls_wire->num_buttons + 7)/8 + 3)/4 * 4;
+
+ cls_lib->type = cls_wire->type;
+ cls_lib->sourceid = cls_wire->sourceid;
+@@ -1623,10 +1625,14 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses)
+ cls_lib->state.mask_len = state_size;
+ cls_lib->state.mask = next_block(&ptr_lib, state_size);
+ memcpy(cls_lib->state.mask, &cls_wire[1],
+- cls_lib->state.mask_len);
++ wire_mask_size);
++ if (state_size != wire_mask_size)
++ memset(&cls_lib->state.mask[wire_mask_size], 0,
++ state_size - wire_mask_size);
+
+ cls_lib->labels = next_block(&ptr_lib, labels_size);
+- atoms =(uint32_t*)((char*)&cls_wire[1] + cls_lib->state.mask_len);
++
++ atoms =(uint32_t*)((char*)&cls_wire[1] + wire_mask_size);
+ for (j = 0; j < cls_lib->num_buttons; j++)
+ cls_lib->labels[j] = *atoms++;
+
+--
+1.7.9.2
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120314/cb05d654/attachment.html>
More information about the macports-changes
mailing list