Fix the alignment computation inside switches which start at an unaligned pos. This affects both explicit and implicit align pads. The alignment offset is derived from the lowest 3 bits of the pointer to the protocol-data at the start of the switch. This is sufficient for correcting all alignments up to 8-byte alignment. As far as I know there is no bigger alignment than 8-byte for the X-protocol. Example: struct InputState, where the switch starts after two 1-byte fields, which is a 2 byte offset for 4-byte and 8-byte alignment. The previous problem can be demonstrated when adding a <pad align="4"/> at the end of case "key". (Or when finding a testcase which reports the case "valuator" not at the last position of the QueryDeviceState-reply. I didn't find such a testcase, so I have used the pad align as described above.) V2: patch modified in order to fix bugs which I found when working on the next issue: * xcb_padding_offset has to be set 0 when xcb_block_len is set 0 * xcb_padding_offset cannot be "const" therefore * for unpack and unserialize, the padding_offset must computed from _buffer instead of from the aux_var. V3: patch revised according to suggestion by Ran Benita: * only create and use xcb_padding_offset for switch Message-ID: <1410298000-24734-1-git-send-email-chris@demorecorder.com> Patch-Thread-Subject: [Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes Patch-Set: QueryDeviceState Patch-Number: libxcb 4/4 Patch-Version: V3 Signed-off-by: Christian Linhart <chris@DemoRecorder.com> Reviewed-By: Ran Benita <ran234@gmail.com> |
||
|---|---|---|
| doc | ||
| m4 | ||
| man | ||
| src | ||
| tests | ||
| tools | ||
| .autom4te.cfg | ||
| .gitignore | ||
| COPYING | ||
| Makefile.am | ||
| NEWS | ||
| README | ||
| autogen.sh | ||
| check-pc-requires | ||
| configure.ac | ||
| xcb-composite.pc.in | ||
| xcb-damage.pc.in | ||
| xcb-dpms.pc.in | ||
| xcb-dri2.pc.in | ||
| xcb-dri3.pc.in | ||
| xcb-glx.pc.in | ||
| xcb-present.pc.in | ||
| xcb-randr.pc.in | ||
| xcb-record.pc.in | ||
| xcb-render.pc.in | ||
| xcb-res.pc.in | ||
| xcb-screensaver.pc.in | ||
| xcb-shape.pc.in | ||
| xcb-shm.pc.in | ||
| xcb-sync.pc.in | ||
| xcb-xevie.pc.in | ||
| xcb-xf86dri.pc.in | ||
| xcb-xfixes.pc.in | ||
| xcb-xinerama.pc.in | ||
| xcb-xinput.pc.in | ||
| xcb-xkb.pc.in | ||
| xcb-xprint.pc.in | ||
| xcb-xselinux.pc.in | ||
| xcb-xtest.pc.in | ||
| xcb-xv.pc.in | ||
| xcb-xvmc.pc.in | ||
| xcb.pc.in | ||
About libxcb
============
libxcb provides an interface to the X Window System protocol, which
replaces the current Xlib interface. It has several advantages over
Xlib, including:
- size: small, simple library, and lower memory footprint
- latency hiding: batch several requests and wait for the replies later
- direct protocol access: interface and protocol correspond exactly
- proven thread support: transparently access XCB from multiple threads
- easy extension implementation: interfaces auto-generated from XML-XCB
Xlib can also use XCB as a transport layer, allowing software to make
requests and receive responses with both, which eases porting to XCB.
However, client programs, libraries, and toolkits will gain the most
benefit from a native XCB port.
Please report any issues you find to the freedesktop.org bug tracker,
at:
<https://bugs.freedesktop.org/enter_bug.cgi?product=XCB>
Discussion about XCB occurs on the XCB mailing list:
<mailto:xcb at lists.freedesktop.org>
<http://lists.freedesktop.org/mailman/listinfo/xcb>
You can obtain the latest development versions of XCB using GIT.
For anonymous checkouts, use:
git clone git://anongit.freedesktop.org/git/xcb/libxcb
For developers, use:
git clone git+ssh://git.freedesktop.org/git/xcb/libxcb