From arnau at debian.org Wed Oct 1 03:06:47 2014 From: arnau at debian.org (Arnaud Fontaine) Date: Wed, 01 Oct 2014 19:06:47 +0900 Subject: [Xcb] [ANNOUNCE] xcb-util-keysyms 0.4.0 Message-ID: <87oatwp0i0.fsf@duckcorp.org> xcb-util-keysyms 0.4.0 is now available. git tag 0.4.0 Changelog ========= Arnaud Fontaine (3): Pick-up changes in m4 submodule as it's better to have all util repos at same m4 level. Remove old/outdated documentation crufts. Release 0.4.0 Bastien Dejean (1): Duplicate keycodes are unnecessary Michael Stapelberg (1): autogen.sh: verify that git submodules are initialized Uli Schlachter (1): Fix handling of error connections Download ======== http://xcb.freedesktop.org/dist/xcb-util-keysyms-0.4.0.tar.bz2 md5: 1022293083eec9e62d5659261c29e367 sha1: ff02ee8ac22c53848af50c0a6a6b00feb002c1cb sha256: 0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9 http://xcb.freedesktop.org/dist/xcb-util-keysyms-0.4.0.tar.gz md5: 2decde7b02b4b3bde99a02c17b64d5dc sha1: e5c5baf3c07e8578c0553ddf1d718dfb07adca42 sha256: 0807cf078fbe38489a41d755095c58239e1b67299f14460dec2ec811e96caa96 -- Arnaud Fontaine -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From perezmeyer at gmail.com Thu Oct 2 14:54:19 2014 From: perezmeyer at gmail.com (Lisandro =?UTF-8?Q?Dami=C3=A1n?= Nicanor =?UTF-8?Q?P=C3=A9rez?= Meyer) Date: Thu, 02 Oct 2014 18:54:19 -0300 Subject: [Xcb] Bug#758588: Please consider provinding a backport for Wheezy or allowing me to do so In-Reply-To: <20140819005338.GN1999@mraw.org> References: <20140819002952.4579.81528.reportbug@luna.lisandropm.com.ar> <20140819005338.GN1999@mraw.org> Message-ID: <3295198.zo7lhBD94e@luna> On Tuesday 19 August 2014 02:53:38 Cyril Brulebois wrote: [snip] > I'm no longer maintaining the X stack but anyway: I think it'd be a good > idea to keep your packaging changes in a debian/wheezy-backports branch > if you're going to handle the backports. I'm attaching the diff for the backport, I can push it to the debian/wheezy- backports if you want. Note that I added myself as Uploader for the backport (but just for it!) Please tell me if I can proceed with the upload. Kinds regards, Lisandro. -- "With great power comes great responsibility." Peter Parker's uncle. Lisandro Dami?n Nicanor P?rez Meyer http://perezmeyer.com.ar/ http://perezmeyer.blogspot.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: backport.patch Type: text/x-patch Size: 1059 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part. URL: From psychon at znc.in Fri Oct 3 14:55:39 2014 From: psychon at znc.in (Uli Schlachter) Date: Fri, 03 Oct 2014 23:55:39 +0200 Subject: [Xcb] [PATCH] Move internal/private dependencies to Requires.private In-Reply-To: <54184098.30600@znc.in> References: <1409878000-6575-1-git-send-email-emil.l.velikov@gmail.com> <54184098.30600@znc.in> Message-ID: <542F1B5B.3050202@znc.in> Hi, Am 16.09.2014 um 15:52 schrieb Uli Schlachter: > Am 05.09.2014 um 02:46 schrieb Emil Velikov: >> Program using the xcb sub-modules has indirect compile and runtime >> dependency of core xcb. To ensure this out we currently list xcb in >> the Requires field of the pkg-config files. While this provides all >> the required dependencies for successful compilation this causes >> over-linking and hides potential linking miss-use against the xcb modules. >> >> By moving to Requires.private we retain the compilation and runtime >> compatibility and avoids any runtime problems. >> >> Cc: Keith Packard >> Cc: Alan Coopersmith >> References: http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq >> References: https://wiki.mageia.org/en/Overlinking_issues_in_packaging >> References: http://err.no/personal/blog/2008/Mar/25 >> Signed-off-by: Emil Velikov >> --- > > I don't have the time to look at this too closely (thesis deadline...), but the > idea and the earlier discussion somewhere on this list sound good. If someone > asks pkg-config for xcb-renderutil, they should just get that library and not > all of its dependencies. > > If no one objects (Ran?), I'll push this in a couple of days based on Julien's > review. "A couple of days", he said... Anyway, pushed (with R-b) as commit 382d306d6c44a9. > Cheers, > Uli Still cheers, Uli >> >> Hello gents, >> >> Please keep me in the CC list as I'm not subscribed to the list >> >> -Emil >> >> check-pc-requires | 4 ++-- >> xcb-composite.pc.in | 2 +- >> xcb-damage.pc.in | 2 +- >> xcb-dpms.pc.in | 2 +- >> xcb-dri2.pc.in | 2 +- >> xcb-dri3.pc.in | 2 +- >> xcb-glx.pc.in | 2 +- >> xcb-present.pc.in | 2 +- >> xcb-randr.pc.in | 2 +- >> xcb-record.pc.in | 2 +- >> xcb-render.pc.in | 2 +- >> xcb-res.pc.in | 2 +- >> xcb-screensaver.pc.in | 2 +- >> xcb-shape.pc.in | 2 +- >> xcb-shm.pc.in | 2 +- >> xcb-sync.pc.in | 2 +- >> xcb-xevie.pc.in | 2 +- >> xcb-xf86dri.pc.in | 2 +- >> xcb-xfixes.pc.in | 2 +- >> xcb-xinerama.pc.in | 2 +- >> xcb-xinput.pc.in | 2 +- >> xcb-xkb.pc.in | 2 +- >> xcb-xprint.pc.in | 2 +- >> xcb-xselinux.pc.in | 2 +- >> xcb-xtest.pc.in | 2 +- >> xcb-xv.pc.in | 2 +- >> xcb-xvmc.pc.in | 2 +- >> 27 files changed, 28 insertions(+), 28 deletions(-) >> >> diff --git a/check-pc-requires b/check-pc-requires >> index 0fd9c65..063356f 100755 >> --- a/check-pc-requires >> +++ b/check-pc-requires >> @@ -23,7 +23,7 @@ for inc in src/*.h; do >> included=`grep '# *include' $inc | >> sed -e 's/[^<"]*[<"]//' -e 's/[>"]//' | >> grep -v 'xcb.h\|xproto.h'` >> - requires=`grep '^Requires:' $pcin` >> + requires=`grep '^Requires.private:' $pcin` >> missing="" >> for i in $included; do >> ibase=`basename $i .h` >> @@ -58,7 +58,7 @@ for inc in src/*.h; do >> *) >> if [ "$fix" = "y" ]; then >> echo $package adding dependency on $missing >> - sed -i '/^Requires:/s/$/ '"$missing"'/' $pcin >> + sed -i '/^Requires.private:/s/$/ '"$missing"'/' $pcin >> else >> echo $package missing $missing >> status=1 >> diff --git a/xcb-composite.pc.in b/xcb-composite.pc.in >> index 02d49b0..b9b74c2 100644 >> --- a/xcb-composite.pc.in >> +++ b/xcb-composite.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Composite >> Description: XCB Composite Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-xfixes >> +Requires.private: xcb xcb-xfixes >> Libs: -L${libdir} -lxcb-composite >> Cflags: -I${includedir} >> diff --git a/xcb-damage.pc.in b/xcb-damage.pc.in >> index c4bc599..3fb46b7 100644 >> --- a/xcb-damage.pc.in >> +++ b/xcb-damage.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Damage >> Description: XCB Damage Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-xfixes >> +Requires.private: xcb xcb-xfixes >> Libs: -L${libdir} -lxcb-damage >> Cflags: -I${includedir} >> diff --git a/xcb-dpms.pc.in b/xcb-dpms.pc.in >> index 838a054..281861c 100644 >> --- a/xcb-dpms.pc.in >> +++ b/xcb-dpms.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB DPMS >> Description: XCB DPMS Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-dpms >> Cflags: -I${includedir} >> diff --git a/xcb-dri2.pc.in b/xcb-dri2.pc.in >> index a9944df..fdb188b 100644 >> --- a/xcb-dri2.pc.in >> +++ b/xcb-dri2.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB DRI2 >> Description: XCB DRI2 Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-dri2 >> Cflags: -I${includedir} >> diff --git a/xcb-dri3.pc.in b/xcb-dri3.pc.in >> index 0eb7390..befe11e 100644 >> --- a/xcb-dri3.pc.in >> +++ b/xcb-dri3.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB DRI3 >> Description: XCB DRI3 Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-dri3 >> Cflags: -I${includedir} >> diff --git a/xcb-glx.pc.in b/xcb-glx.pc.in >> index bbd4126..79805ef 100644 >> --- a/xcb-glx.pc.in >> +++ b/xcb-glx.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB GLX >> Description: XCB GLX Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-glx >> Cflags: -I${includedir} >> diff --git a/xcb-present.pc.in b/xcb-present.pc.in >> index e2eccc4..2e0cff8 100644 >> --- a/xcb-present.pc.in >> +++ b/xcb-present.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Present >> Description: XCB Present Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-randr xcb-xfixes xcb-sync >> +Requires.private: xcb xcb-randr xcb-xfixes xcb-sync >> Libs: -L${libdir} -lxcb-present >> Cflags: -I${includedir} >> diff --git a/xcb-randr.pc.in b/xcb-randr.pc.in >> index 09c3d12..4c0de13 100644 >> --- a/xcb-randr.pc.in >> +++ b/xcb-randr.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB RandR >> Description: XCB RandR Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-render >> +Requires.private: xcb xcb-render >> Libs: -L${libdir} -lxcb-randr >> Cflags: -I${includedir} >> diff --git a/xcb-record.pc.in b/xcb-record.pc.in >> index 689f098..b441c9a 100644 >> --- a/xcb-record.pc.in >> +++ b/xcb-record.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Record >> Description: XCB Record Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-record >> Cflags: -I${includedir} >> diff --git a/xcb-render.pc.in b/xcb-render.pc.in >> index c3b050a..9ad543e 100644 >> --- a/xcb-render.pc.in >> +++ b/xcb-render.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Render >> Description: XCB Render Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-render >> Cflags: -I${includedir} >> diff --git a/xcb-res.pc.in b/xcb-res.pc.in >> index 62dbab6..1f2889d 100644 >> --- a/xcb-res.pc.in >> +++ b/xcb-res.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Res >> Description: XCB X-Resource Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-res >> Cflags: -I${includedir} >> diff --git a/xcb-screensaver.pc.in b/xcb-screensaver.pc.in >> index ba3f8ec..1209b20 100644 >> --- a/xcb-screensaver.pc.in >> +++ b/xcb-screensaver.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Screensaver >> Description: XCB Screensaver Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-screensaver >> Cflags: -I${includedir} >> diff --git a/xcb-shape.pc.in b/xcb-shape.pc.in >> index 880204d..09637b4 100644 >> --- a/xcb-shape.pc.in >> +++ b/xcb-shape.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Shape >> Description: XCB Shape Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-shape >> Cflags: -I${includedir} >> diff --git a/xcb-shm.pc.in b/xcb-shm.pc.in >> index 9256bf0..47c193b 100644 >> --- a/xcb-shm.pc.in >> +++ b/xcb-shm.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Shm >> Description: XCB Shm Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-shm >> Cflags: -I${includedir} >> diff --git a/xcb-sync.pc.in b/xcb-sync.pc.in >> index ead76d1..7a4c315 100644 >> --- a/xcb-sync.pc.in >> +++ b/xcb-sync.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Sync >> Description: XCB Sync Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-sync >> Cflags: -I${includedir} >> diff --git a/xcb-xevie.pc.in b/xcb-xevie.pc.in >> index 0aa3e02..dc4fee4 100644 >> --- a/xcb-xevie.pc.in >> +++ b/xcb-xevie.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Xevie >> Description: XCB Xevie Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xevie >> Cflags: -I${includedir} >> diff --git a/xcb-xf86dri.pc.in b/xcb-xf86dri.pc.in >> index f3f2980..87c93d5 100644 >> --- a/xcb-xf86dri.pc.in >> +++ b/xcb-xf86dri.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XFree86-DRI >> Description: XCB XFree86-DRI Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xf86dri >> Cflags: -I${includedir} >> diff --git a/xcb-xfixes.pc.in b/xcb-xfixes.pc.in >> index 93eafda..2ebb9cf 100644 >> --- a/xcb-xfixes.pc.in >> +++ b/xcb-xfixes.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XFixes >> Description: XCB XFixes Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-render xcb-shape >> +Requires.private: xcb xcb-render xcb-shape >> Libs: -L${libdir} -lxcb-xfixes >> Cflags: -I${includedir} >> diff --git a/xcb-xinerama.pc.in b/xcb-xinerama.pc.in >> index c4775f9..abc3012 100644 >> --- a/xcb-xinerama.pc.in >> +++ b/xcb-xinerama.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Xinerama >> Description: XCB Xinerama Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xinerama >> Cflags: -I${includedir} >> diff --git a/xcb-xinput.pc.in b/xcb-xinput.pc.in >> index ff34ab4..1f1bb27 100644 >> --- a/xcb-xinput.pc.in >> +++ b/xcb-xinput.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XInput >> Description: XCB XInput Extension (EXPERIMENTAL) >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-xfixes >> +Requires.private: xcb xcb-xfixes >> Libs: -L${libdir} -lxcb-xinput >> Cflags: -I${includedir} >> diff --git a/xcb-xkb.pc.in b/xcb-xkb.pc.in >> index 6ed0035..d5b1bad 100644 >> --- a/xcb-xkb.pc.in >> +++ b/xcb-xkb.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XKB >> Description: XCB Keyboard Extension (EXPERIMENTAL) >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xkb >> Cflags: -I${includedir} >> diff --git a/xcb-xprint.pc.in b/xcb-xprint.pc.in >> index b5275d5..7ac65f6 100644 >> --- a/xcb-xprint.pc.in >> +++ b/xcb-xprint.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Xprint >> Description: XCB Xprint Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xprint >> Cflags: -I${includedir} >> diff --git a/xcb-xselinux.pc.in b/xcb-xselinux.pc.in >> index 6a71f73..0f86a93 100644 >> --- a/xcb-xselinux.pc.in >> +++ b/xcb-xselinux.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB SELinux >> Description: XCB SELinux Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xselinux >> Cflags: -I${includedir} >> diff --git a/xcb-xtest.pc.in b/xcb-xtest.pc.in >> index 886c4dc..9961152 100644 >> --- a/xcb-xtest.pc.in >> +++ b/xcb-xtest.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XTEST >> Description: XCB XTEST Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb >> +Requires.private: xcb >> Libs: -L${libdir} -lxcb-xtest >> Cflags: -I${includedir} >> diff --git a/xcb-xv.pc.in b/xcb-xv.pc.in >> index f447613..f31de1a 100644 >> --- a/xcb-xv.pc.in >> +++ b/xcb-xv.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB Xv >> Description: XCB Xv Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-shm >> +Requires.private: xcb xcb-shm >> Libs: -L${libdir} -lxcb-xv >> Cflags: -I${includedir} >> diff --git a/xcb-xvmc.pc.in b/xcb-xvmc.pc.in >> index 95bf4ef..93c51a9 100644 >> --- a/xcb-xvmc.pc.in >> +++ b/xcb-xvmc.pc.in >> @@ -6,6 +6,6 @@ includedir=@includedir@ >> Name: XCB XvMC >> Description: XCB XvMC Extension >> Version: @PACKAGE_VERSION@ >> -Requires: xcb xcb-xv >> +Requires.private: xcb xcb-xv >> Libs: -L${libdir} -lxcb-xvmc >> Cflags: -I${includedir} >> > > -- ?Cold. Cold. Cold. Cold. Cold. Cold. Cold. Cold. Cold. Cold.? ? Anna From ftpmaster at ftp-master.debian.org Mon Oct 6 07:29:42 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Mon, 06 Oct 2014 14:29:42 +0000 Subject: [Xcb] Processing of libxcb_1.10-3~bpo70+1_amd64.changes Message-ID: libxcb_1.10-3~bpo70+1_amd64.changes uploaded successfully to localhost along with the files: libxcb_1.10-3~bpo70+1.dsc libxcb_1.10-3~bpo70+1.diff.gz libxcb1_1.10-3~bpo70+1_amd64.deb libxcb1-udeb_1.10-3~bpo70+1_amd64.udeb libxcb1-dev_1.10-3~bpo70+1_amd64.deb libxcb1-dbg_1.10-3~bpo70+1_amd64.deb libxcb-doc_1.10-3~bpo70+1_all.deb libxcb-composite0_1.10-3~bpo70+1_amd64.deb libxcb-composite0-dev_1.10-3~bpo70+1_amd64.deb libxcb-composite0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-damage0_1.10-3~bpo70+1_amd64.deb libxcb-damage0-dev_1.10-3~bpo70+1_amd64.deb libxcb-damage0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dpms0_1.10-3~bpo70+1_amd64.deb libxcb-dpms0-dev_1.10-3~bpo70+1_amd64.deb libxcb-dpms0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-glx0_1.10-3~bpo70+1_amd64.deb libxcb-glx0-dev_1.10-3~bpo70+1_amd64.deb libxcb-glx0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-randr0_1.10-3~bpo70+1_amd64.deb libxcb-randr0-dev_1.10-3~bpo70+1_amd64.deb libxcb-randr0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-record0_1.10-3~bpo70+1_amd64.deb libxcb-record0-dev_1.10-3~bpo70+1_amd64.deb libxcb-record0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-render0_1.10-3~bpo70+1_amd64.deb libxcb-render0-dev_1.10-3~bpo70+1_amd64.deb libxcb-render0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-res0_1.10-3~bpo70+1_amd64.deb libxcb-res0-dev_1.10-3~bpo70+1_amd64.deb libxcb-res0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0-dev_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-shape0_1.10-3~bpo70+1_amd64.deb libxcb-shape0-dev_1.10-3~bpo70+1_amd64.deb libxcb-shape0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-shm0_1.10-3~bpo70+1_amd64.deb libxcb-shm0-dev_1.10-3~bpo70+1_amd64.deb libxcb-shm0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-sync1_1.10-3~bpo70+1_amd64.deb libxcb-sync-dev_1.10-3~bpo70+1_amd64.deb libxcb-sync1-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xevie0_1.10-3~bpo70+1_amd64.deb libxcb-xevie0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xevie0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xprint0_1.10-3~bpo70+1_amd64.deb libxcb-xprint0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xprint0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xtest0_1.10-3~bpo70+1_amd64.deb libxcb-xtest0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xtest0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xv0_1.10-3~bpo70+1_amd64.deb libxcb-xv0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xv0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0-dev_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-present0_1.10-3~bpo70+1_amd64.deb libxcb-present-dev_1.10-3~bpo70+1_amd64.deb libxcb-present0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dri3-0_1.10-3~bpo70+1_amd64.deb libxcb-dri3-dev_1.10-3~bpo70+1_amd64.deb libxcb-dri3-0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xkb1_1.10-3~bpo70+1_amd64.deb libxcb-xkb-dev_1.10-3~bpo70+1_amd64.deb libxcb-xkb1-dbg_1.10-3~bpo70+1_amd64.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Mon Oct 6 08:21:42 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Mon, 06 Oct 2014 15:21:42 +0000 Subject: [Xcb] libxcb_1.10-3~bpo70+1_amd64.changes is NEW Message-ID: binary:libxcb-composite0-dev is NEW. binary:libxcb-doc is NEW. binary:libxcb-dri2-0-dev is NEW. binary:libxcb-dpms0-dev is NEW. binary:libxcb-xfixes0-dev is NEW. binary:libxcb-xtest0-dev is NEW. binary:libxcb-xfixes0 is NEW. binary:libxcb-xvmc0 is NEW. binary:libxcb1-dev is NEW. binary:libxcb-dri3-0-dbg is NEW. binary:libxcb-record0-dev is NEW. binary:libxcb-randr0-dev is NEW. binary:libxcb1-dbg is NEW. binary:libxcb-present0-dbg is NEW. binary:libxcb-shm0-dev is NEW. binary:libxcb-xv0-dbg is NEW. binary:libxcb-xprint0 is NEW. binary:libxcb-render0 is NEW. binary:libxcb-render0-dev is NEW. binary:libxcb-damage0-dev is NEW. binary:libxcb-shape0-dev is NEW. binary:libxcb-xtest0 is NEW. binary:libxcb-present-dev is NEW. binary:libxcb-present0 is NEW. binary:libxcb-shm0 is NEW. binary:libxcb-xprint0-dbg is NEW. binary:libxcb-xkb1 is NEW. binary:libxcb-sync1 is NEW. binary:libxcb-res0 is NEW. binary:libxcb-screensaver0 is NEW. binary:libxcb-xinerama0-dbg is NEW. binary:libxcb-xevie0-dbg is NEW. binary:libxcb-res0-dev is NEW. binary:libxcb-randr0-dbg is NEW. binary:libxcb-randr0 is NEW. binary:libxcb-composite0 is NEW. binary:libxcb1 is NEW. binary:libxcb-xevie0 is NEW. binary:libxcb-glx0 is NEW. binary:libxcb-shape0-dbg is NEW. binary:libxcb-xprint0-dev is NEW. binary:libxcb-dri2-0-dbg is NEW. binary:libxcb-screensaver0-dbg is NEW. binary:libxcb-xkb-dev is NEW. binary:libxcb-xinerama0 is NEW. binary:libxcb-xinerama0-dev is NEW. binary:libxcb-xvmc0-dev is NEW. binary:libxcb-composite0-dbg is NEW. binary:libxcb-shm0-dbg is NEW. binary:libxcb-record0-dbg is NEW. binary:libxcb-damage0 is NEW. binary:libxcb-dri3-dev is NEW. binary:libxcb-xtest0-dbg is NEW. binary:libxcb-xkb1-dbg is NEW. binary:libxcb-sync1-dbg is NEW. binary:libxcb-damage0-dbg is NEW. binary:libxcb-screensaver0-dev is NEW. binary:libxcb-record0 is NEW. binary:libxcb-xf86dri0 is NEW. binary:libxcb-dpms0-dbg is NEW. binary:libxcb-xfixes0-dbg is NEW. binary:libxcb-dri2-0 is NEW. binary:libxcb-glx0-dev is NEW. binary:libxcb-glx0-dbg is NEW. binary:libxcb-xv0 is NEW. binary:libxcb-xevie0-dev is NEW. binary:libxcb-render0-dbg is NEW. binary:libxcb-xv0-dev is NEW. binary:libxcb-sync-dev is NEW. binary:libxcb-xf86dri0-dbg is NEW. binary:libxcb-res0-dbg is NEW. binary:libxcb-dpms0 is NEW. binary:libxcb-shape0 is NEW. binary:libxcb1-udeb is NEW. binary:libxcb-xvmc0-dbg is NEW. binary:libxcb-dri3-0 is NEW. binary:libxcb-xf86dri0-dev is NEW. source:libxcb is NEW. Your package has been put into the NEW queue, which requires manual action from the ftpteam to process. The upload was otherwise valid (it had a good OpenPGP signature and file hashes are valid), so please be patient. Packages are routinely processed through to the archive, and do feel free to browse the NEW queue[1]. If there is an issue with the upload, you will recieve an email from a member of the ftpteam. If you have any questions, you may reply to this email. [1]: https://ftp-master.debian.org/new.html From ftpmaster at ftp-master.debian.org Thu Oct 9 06:08:49 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 09 Oct 2014 13:08:49 +0000 Subject: [Xcb] Processing of libxcb_1.10-3~bpo70+1_amd64.changes Message-ID: libxcb_1.10-3~bpo70+1_amd64.changes uploaded successfully to localhost along with the files: libxcb_1.10-3~bpo70+1.dsc libxcb_1.10-3~bpo70+1.diff.gz libxcb1_1.10-3~bpo70+1_amd64.deb libxcb1-udeb_1.10-3~bpo70+1_amd64.udeb libxcb1-dev_1.10-3~bpo70+1_amd64.deb libxcb1-dbg_1.10-3~bpo70+1_amd64.deb libxcb-doc_1.10-3~bpo70+1_all.deb libxcb-composite0_1.10-3~bpo70+1_amd64.deb libxcb-composite0-dev_1.10-3~bpo70+1_amd64.deb libxcb-composite0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-damage0_1.10-3~bpo70+1_amd64.deb libxcb-damage0-dev_1.10-3~bpo70+1_amd64.deb libxcb-damage0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dpms0_1.10-3~bpo70+1_amd64.deb libxcb-dpms0-dev_1.10-3~bpo70+1_amd64.deb libxcb-dpms0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-glx0_1.10-3~bpo70+1_amd64.deb libxcb-glx0-dev_1.10-3~bpo70+1_amd64.deb libxcb-glx0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-randr0_1.10-3~bpo70+1_amd64.deb libxcb-randr0-dev_1.10-3~bpo70+1_amd64.deb libxcb-randr0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-record0_1.10-3~bpo70+1_amd64.deb libxcb-record0-dev_1.10-3~bpo70+1_amd64.deb libxcb-record0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-render0_1.10-3~bpo70+1_amd64.deb libxcb-render0-dev_1.10-3~bpo70+1_amd64.deb libxcb-render0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-res0_1.10-3~bpo70+1_amd64.deb libxcb-res0-dev_1.10-3~bpo70+1_amd64.deb libxcb-res0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0-dev_1.10-3~bpo70+1_amd64.deb libxcb-screensaver0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-shape0_1.10-3~bpo70+1_amd64.deb libxcb-shape0-dev_1.10-3~bpo70+1_amd64.deb libxcb-shape0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-shm0_1.10-3~bpo70+1_amd64.deb libxcb-shm0-dev_1.10-3~bpo70+1_amd64.deb libxcb-shm0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-sync1_1.10-3~bpo70+1_amd64.deb libxcb-sync-dev_1.10-3~bpo70+1_amd64.deb libxcb-sync1-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xevie0_1.10-3~bpo70+1_amd64.deb libxcb-xevie0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xevie0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xf86dri0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xfixes0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xinerama0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xprint0_1.10-3~bpo70+1_amd64.deb libxcb-xprint0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xprint0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xtest0_1.10-3~bpo70+1_amd64.deb libxcb-xtest0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xtest0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xv0_1.10-3~bpo70+1_amd64.deb libxcb-xv0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xv0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0-dev_1.10-3~bpo70+1_amd64.deb libxcb-xvmc0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0-dev_1.10-3~bpo70+1_amd64.deb libxcb-dri2-0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-present0_1.10-3~bpo70+1_amd64.deb libxcb-present-dev_1.10-3~bpo70+1_amd64.deb libxcb-present0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-dri3-0_1.10-3~bpo70+1_amd64.deb libxcb-dri3-dev_1.10-3~bpo70+1_amd64.deb libxcb-dri3-0-dbg_1.10-3~bpo70+1_amd64.deb libxcb-xkb1_1.10-3~bpo70+1_amd64.deb libxcb-xkb-dev_1.10-3~bpo70+1_amd64.deb libxcb-xkb1-dbg_1.10-3~bpo70+1_amd64.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Thu Oct 9 06:19:58 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 09 Oct 2014 13:19:58 +0000 Subject: [Xcb] libxcb_1.10-3~bpo70+1_amd64.changes is NEW Message-ID: binary:libxcb-composite0-dev is NEW. binary:libxcb-doc is NEW. binary:libxcb-dri2-0-dev is NEW. binary:libxcb-dpms0-dev is NEW. binary:libxcb-xfixes0-dev is NEW. binary:libxcb-xtest0-dev is NEW. binary:libxcb-xfixes0 is NEW. binary:libxcb-xvmc0 is NEW. binary:libxcb1-dev is NEW. binary:libxcb-dri3-0-dbg is NEW. binary:libxcb-record0-dev is NEW. binary:libxcb-randr0-dev is NEW. binary:libxcb1-dbg is NEW. binary:libxcb-present0-dbg is NEW. binary:libxcb-shm0-dev is NEW. binary:libxcb-xv0-dbg is NEW. binary:libxcb-xprint0 is NEW. binary:libxcb-render0 is NEW. binary:libxcb-render0-dev is NEW. binary:libxcb-damage0-dev is NEW. binary:libxcb-shape0-dev is NEW. binary:libxcb-xtest0 is NEW. binary:libxcb-present-dev is NEW. binary:libxcb-present0 is NEW. binary:libxcb-shm0 is NEW. binary:libxcb-xprint0-dbg is NEW. binary:libxcb-xkb1 is NEW. binary:libxcb-sync1 is NEW. binary:libxcb-res0 is NEW. binary:libxcb-screensaver0 is NEW. binary:libxcb-xinerama0-dbg is NEW. binary:libxcb-xevie0-dbg is NEW. binary:libxcb-res0-dev is NEW. binary:libxcb-randr0-dbg is NEW. binary:libxcb-randr0 is NEW. binary:libxcb-composite0 is NEW. binary:libxcb1 is NEW. binary:libxcb-xevie0 is NEW. binary:libxcb-glx0 is NEW. binary:libxcb-shape0-dbg is NEW. binary:libxcb-xprint0-dev is NEW. binary:libxcb-dri2-0-dbg is NEW. binary:libxcb-screensaver0-dbg is NEW. binary:libxcb-xkb-dev is NEW. binary:libxcb-xinerama0 is NEW. binary:libxcb-xinerama0-dev is NEW. binary:libxcb-xvmc0-dev is NEW. binary:libxcb-composite0-dbg is NEW. binary:libxcb-shm0-dbg is NEW. binary:libxcb-record0-dbg is NEW. binary:libxcb-damage0 is NEW. binary:libxcb-dri3-dev is NEW. binary:libxcb-xtest0-dbg is NEW. binary:libxcb-xkb1-dbg is NEW. binary:libxcb-sync1-dbg is NEW. binary:libxcb-damage0-dbg is NEW. binary:libxcb-screensaver0-dev is NEW. binary:libxcb-record0 is NEW. binary:libxcb-xf86dri0 is NEW. binary:libxcb-dpms0-dbg is NEW. binary:libxcb-xfixes0-dbg is NEW. binary:libxcb-dri2-0 is NEW. binary:libxcb-glx0-dev is NEW. binary:libxcb-glx0-dbg is NEW. binary:libxcb-xv0 is NEW. binary:libxcb-xevie0-dev is NEW. binary:libxcb-render0-dbg is NEW. binary:libxcb-xv0-dev is NEW. binary:libxcb-sync-dev is NEW. binary:libxcb-xf86dri0-dbg is NEW. binary:libxcb-res0-dbg is NEW. binary:libxcb-dpms0 is NEW. binary:libxcb-shape0 is NEW. binary:libxcb1-udeb is NEW. binary:libxcb-xvmc0-dbg is NEW. binary:libxcb-dri3-0 is NEW. binary:libxcb-xf86dri0-dev is NEW. source:libxcb is NEW. Your package has been put into the NEW queue, which requires manual action from the ftpteam to process. The upload was otherwise valid (it had a good OpenPGP signature and file hashes are valid), so please be patient. Packages are routinely processed through to the archive, and do feel free to browse the NEW queue[1]. If there is an issue with the upload, you will recieve an email from a member of the ftpteam. If you have any questions, you may reply to this email. [1]: https://ftp-master.debian.org/new.html From debian-backports at lists.debian.org Thu Oct 9 06:00:20 2014 From: debian-backports at lists.debian.org (Alexander Wirt) Date: Thu, 09 Oct 2014 13:00:20 +0000 Subject: [Xcb] libxcb_1.10-3~bpo70+1_amd64.changes REJECTED Message-ID: Changes since stable missing in changes file. See contribution docs for details. === Please feel free to respond to this email if you don't understand why your files were rejected, or if you upload new files which address our concerns. From ftpmaster at ftp-master.debian.org Thu Oct 9 10:00:37 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 09 Oct 2014 17:00:37 +0000 Subject: [Xcb] libxcb_1.10-3~bpo70+1_amd64.changes ACCEPTED into wheezy-backports, wheezy-backports Message-ID: Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Mon, 06 Oct 2014 11:05:17 -0300 Source: libxcb Binary: libxcb1 libxcb1-udeb libxcb1-dev libxcb1-dbg libxcb-doc libxcb-composite0 libxcb-composite0-dev libxcb-composite0-dbg libxcb-damage0 libxcb-damage0-dev libxcb-damage0-dbg libxcb-dpms0 libxcb-dpms0-dev libxcb-dpms0-dbg libxcb-glx0 libxcb-glx0-dev libxcb-glx0-dbg libxcb-randr0 libxcb-randr0-dev libxcb-randr0-dbg libxcb-record0 libxcb-record0-dev libxcb-record0-dbg libxcb-render0 libxcb-render0-dev libxcb-render0-dbg libxcb-res0 libxcb-res0-dev libxcb-res0-dbg libxcb-screensaver0 libxcb-screensaver0-dev libxcb-screensaver0-dbg libxcb-shape0 libxcb-shape0-dev libxcb-shape0-dbg libxcb-shm0 libxcb-shm0-dev libxcb-shm0-dbg libxcb-sync1 libxcb-sync-dev libxcb-sync1-dbg libxcb-xevie0 libxcb-xevie0-dev libxcb-xevie0-dbg libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xf86dri0-dbg libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xfixes0-dbg libxcb-xinerama0 libxcb-xinerama0-dev libxcb-xinerama0-dbg libxcb-xprint0 libxcb-xprint0-dev libxcb-xprint0-dbg libxcb-xtest0 libxcb-xtest0-dev libxcb-xtest0-dbg libxcb-xv0 libxcb-xv0-dev libxcb-xv0-dbg libxcb-xvmc0 libxcb-xvmc0-dev libxcb-xvmc0-dbg libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri2-0-dbg libxcb-present0 libxcb-present-dev libxcb-present0-dbg libxcb-dri3-0 libxcb-dri3-dev libxcb-dri3-0-dbg libxcb-xkb1 libxcb-xkb-dev libxcb-xkb1-dbg Architecture: source amd64 all Version: 1.10-3~bpo70+1 Distribution: wheezy-backports Urgency: medium Maintainer: XCB Developers Changed-By: Lisandro Dami?n Nicanor P?rez Meyer Description: libxcb-composite0 - X C Binding, composite extension libxcb-composite0-dbg - X C Binding, composite extension, debugging symbols libxcb-composite0-dev - X C Binding, composite extension, development files libxcb-damage0 - X C Binding, damage extension libxcb-damage0-dbg - X C Binding, damage extension, debugging symbols libxcb-damage0-dev - X C Binding, damage extension, development files libxcb-doc - X C Binding, development documentation libxcb-dpms0 - X C Binding, dpms extension libxcb-dpms0-dbg - X C Binding, dpms extension, debugging symbols libxcb-dpms0-dev - X C Binding, dpms extension, development files libxcb-dri2-0 - X C Binding, dri2 extension libxcb-dri2-0-dbg - X C Binding, dri2 extension, debugging symbols libxcb-dri2-0-dev - X C Binding, dri2 extension, development files libxcb-dri3-0 - X C Binding, dri3 extension libxcb-dri3-0-dbg - X C Binding, dri3 extension, debugging symbols libxcb-dri3-dev - X C Binding, dri3 extension, development files libxcb-glx0 - X C Binding, glx extension libxcb-glx0-dbg - X C Binding, glx extension, debugging symbols libxcb-glx0-dev - X C Binding, glx extension, development files libxcb-present-dev - X C Binding, present extension, development files libxcb-present0 - X C Binding, present extension libxcb-present0-dbg - X C Binding, present extension, debugging symbols libxcb-randr0 - X C Binding, randr extension libxcb-randr0-dbg - X C Binding, randr extension, debugging symbols libxcb-randr0-dev - X C Binding, randr extension, development files libxcb-record0 - X C Binding, record extension libxcb-record0-dbg - X C Binding, record extension, debugging symbols libxcb-record0-dev - X C Binding, record extension, development files libxcb-render0 - X C Binding, render extension libxcb-render0-dbg - X C Binding, render extension, debugging symbols libxcb-render0-dev - X C Binding, render extension, development files libxcb-res0 - X C Binding, res extension libxcb-res0-dbg - X C Binding, res extension, debugging symbols libxcb-res0-dev - X C Binding, res extension, development files libxcb-screensaver0 - X C Binding, screensaver extension libxcb-screensaver0-dbg - X C Binding, screensaver extension, debugging symbols libxcb-screensaver0-dev - X C Binding, screensaver extension, development files libxcb-shape0 - X C Binding, shape extension libxcb-shape0-dbg - X C Binding, shape extension, debugging symbols libxcb-shape0-dev - X C Binding, shape extension, development files libxcb-shm0 - X C Binding, shm extension libxcb-shm0-dbg - X C Binding, shm extension, debugging symbols libxcb-shm0-dev - X C Binding, shm extension, development files libxcb-sync-dev - X C Binding, sync extension, development files libxcb-sync1 - X C Binding, sync extension libxcb-sync1-dbg - X C Binding, sync extension, debugging symbols libxcb-xevie0 - X C Binding, xevie extension libxcb-xevie0-dbg - X C Binding, xevie extension, debugging symbols libxcb-xevie0-dev - X C Binding, xevie extension, development files libxcb-xf86dri0 - X C Binding, xf86dri extension libxcb-xf86dri0-dbg - X C Binding, xf86dri extension, debugging symbols libxcb-xf86dri0-dev - X C Binding, xf86dri extension, development files libxcb-xfixes0 - X C Binding, xfixes extension libxcb-xfixes0-dbg - X C Binding, xfixes extension, debugging symbols libxcb-xfixes0-dev - X C Binding, xfixes extension, development files libxcb-xinerama0 - X C Binding, xinerama extension libxcb-xinerama0-dbg - X C Binding, xinerama extension, debugging symbols libxcb-xinerama0-dev - X C Binding, xinerama extension, development files libxcb-xkb-dev - X C Binding, XKEYBOARD extension, development files libxcb-xkb1 - X C Binding, XKEYBOARD extension libxcb-xkb1-dbg - X C Binding, XKEYBOARD extension, debugging symbols libxcb-xprint0 - X C Binding, xprint extension libxcb-xprint0-dbg - X C Binding, xprint extension, debugging symbols libxcb-xprint0-dev - X C Binding, xprint extension, development files libxcb-xtest0 - X C Binding, xtest extension libxcb-xtest0-dbg - X C Binding, xtest extension, debugging symbols libxcb-xtest0-dev - X C Binding, xtest extension, development files libxcb-xv0 - X C Binding, xv extension libxcb-xv0-dbg - X C Binding, xv extension, debugging symbols libxcb-xv0-dev - X C Binding, xv extension, development files libxcb-xvmc0 - X C Binding, xvmc extension libxcb-xvmc0-dbg - X C Binding, xvmc extension, debugging symbols libxcb-xvmc0-dev - X C Binding, xvmc extension, development files libxcb1 - X C Binding libxcb1-dbg - X C Binding, debugging symbols libxcb1-dev - X C Binding, development files libxcb1-udeb - X C Binding (udeb) Closes: 657538 662113 710344 718701 722688 733590 758588 Changes: libxcb (1.10-3~bpo70+1) wheezy-backports; urgency=medium . * Upload to Wheezy-backports (Closes: #758588). * Add myself as uploader for the Wheezy backports. . libxcb (1.10-3) unstable; urgency=medium . * Add missing dependencies to libxcb-present-dev. Thanks, Michel D?nzer! . libxcb (1.10-2) unstable; urgency=medium . * Add conflicts/replaces for sync dev package name change (closes: #733590) * Pack generic events with 64bit types (as in the present extension) so the fake full_sequence field doesn't introduce unexpected padding (pulled from upstream git). . libxcb (1.10-1) unstable; urgency=low . * New upstream release. . [ Michele Cane ] * Bump dependency to xcb-proto and python-xcbgen >= 1.10 (closes: #662113). . [ Julien Cristau ] * Re-enable kfreebsd-amd64 tests, #712196 was fixed in libc. * Add new packages for the XKEYBOARD (closes: #718701), DRI3 and Present extensions. * Rename libxcb-sync0 for SONAME bump. The -dev package is now libxcb-sync-dev (but the old name is still provided as a virtual package). * Add randr 1.4 symbols. * Add xres 1.2 symbols. * Add xfixes 5 symbols. * Add mit-shm 1.2 symbols. * Bump libxcb1 symbols and shlibs for fd passing and event queues APIs. . libxcb (1.9.1-3.1) unstable; urgency=low . * Non-maintainer upload. * Fix "FTBFS when $HOME does not exist: /install-sh: No such file or directory": apply upstream fix to configure.ac, taken from http://cgit.freedesktop.org/xcb/libxcb/commit/?id=50fb3a6312dd0b6b613fc886ffd6827952d1e286 (Closes: #722688) * debian/control: remove Cyril Brulebois from Uploaders on his request. (Cf. #722688) . libxcb (1.9.1-3) unstable; urgency=low . * Revert #711599 workaround now that check is fixed. * Don't run make check on kfreebsd-amd64 because of #712196. * Remove unused DEB_*_GNU_TYPE variables from d/rules. * Turns out check.pc's not quite right yet (#712140). Work around that, too. . libxcb (1.9.1-2) unstable; urgency=low . * Add DRI2 1.4 symbols (added in xcb-proto 1.8). Fixes FTBFS. * Bump shlibs. . libxcb (1.9.1-1) unstable; urgency=low . * New upstream release. * Work around #711599 by adding -lm -lrt explicitly to the tests linker flags. * Remove all-local rule from tests/Makefile.am to fix build with new automake (closes: #710344). Thanks, Marc Deslauriers! * Delete test-driver on clean. Apparently new automake gives us yet more cruft in the source tree. * libxcb1 Breaks alsa-utils (<< 1.0.24.2-5) to avoid leaving alsamixer broken during partial upgrades (closes: #657538). Checksums-Sha1: ba274f84943a2a89710f04cdb4e60a83bb5c52dd 6346 libxcb_1.10-3~bpo70+1.dsc 2059549b3074531cdef0a798477df51106692836 25300 libxcb_1.10-3~bpo70+1.diff.gz b5086777c2a0d014de9d415ae4984e98c61390c3 53022 libxcb1_1.10-3~bpo70+1_amd64.deb 1815ef64a7e01ba5c5c30352d93b3c2b8b4840c2 33658 libxcb1-udeb_1.10-3~bpo70+1_amd64.udeb c114e6781636f087920dcaab637b727b382ca8e7 107046 libxcb1-dev_1.10-3~bpo70+1_amd64.deb 541a52de1be54b1afb2ca9db3025258b147d3645 138148 libxcb1-dbg_1.10-3~bpo70+1_amd64.deb b9a598a60ab0a1520c6e881c8f1ba5c216c5b99c 5353644 libxcb-doc_1.10-3~bpo70+1_all.deb 6e3b56ee990193bcdd57b72b07ea03370b1a92c5 11460 libxcb-composite0_1.10-3~bpo70+1_amd64.deb 1224524417856d1ab1a2213f63d157a3189fb709 12306 libxcb-composite0-dev_1.10-3~bpo70+1_amd64.deb a3cf35e34e8e7272965021f7181b225bf7a0c88b 15176 libxcb-composite0-dbg_1.10-3~bpo70+1_amd64.deb 6c02c410973eaa87f98b092e16f5acd48dfc4c81 11102 libxcb-damage0_1.10-3~bpo70+1_amd64.deb 37f878e66235b1971c28b1d9f6a9f9a2f2491720 12036 libxcb-damage0-dev_1.10-3~bpo70+1_amd64.deb 093a2fb590d104ade4030999ad24ae9833c92946 13942 libxcb-damage0-dbg_1.10-3~bpo70+1_amd64.deb 866fbd942bde811453238d3a7f2280471507f6fd 11404 libxcb-dpms0_1.10-3~bpo70+1_amd64.deb 63164f7356d94fa31a78a9a1e64ffa954dec6141 12176 libxcb-dpms0-dev_1.10-3~bpo70+1_amd64.deb aa3b2dde6fb361c75107497eead39754f7a11967 14410 libxcb-dpms0-dbg_1.10-3~bpo70+1_amd64.deb cf337890893484baafb52b733c67614e61f66fce 33370 libxcb-glx0_1.10-3~bpo70+1_amd64.deb 7c4c702fe40b378ebdd0b4067349ec1e2f65adc7 50252 libxcb-glx0-dev_1.10-3~bpo70+1_amd64.deb b394a8f4b7f022d91309ba971614a2c1e8fb8b00 72672 libxcb-glx0-dbg_1.10-3~bpo70+1_amd64.deb 3a352c88da7b0e459da8f507fca68242bd4f31f9 24424 libxcb-randr0_1.10-3~bpo70+1_amd64.deb ca50098e6114a72f8457c69b1df0b157c6ea5534 33722 libxcb-randr0-dev_1.10-3~bpo70+1_amd64.deb 9ebfbe4c6944c126a806686c1bbfea7967b37c8f 46150 libxcb-randr0-dbg_1.10-3~bpo70+1_amd64.deb 82ae8a6850508ef1aea1a047daf51815c5cb6ea4 13202 libxcb-record0_1.10-3~bpo70+1_amd64.deb af6c8cceac5ac28bd3893222e834f56da8137291 15146 libxcb-record0-dev_1.10-3~bpo70+1_amd64.deb 6952d919a68f4c8dbb8fe4f48d3c07cb07f03908 18740 libxcb-record0-dbg_1.10-3~bpo70+1_amd64.deb dc983d664cfda762016d27d224964e099904cf18 19798 libxcb-render0_1.10-3~bpo70+1_amd64.deb 11fb7e8f5f94f5d2b7e0632d2a8e11b0d7b9a74f 27240 libxcb-render0-dev_1.10-3~bpo70+1_amd64.deb 1348c80495fdbd3239d5497eb937f7583ef44afe 36484 libxcb-render0-dbg_1.10-3~bpo70+1_amd64.deb 8656f2c38b0f35f962b9ca4adc4762205828622c 13150 libxcb-res0_1.10-3~bpo70+1_amd64.deb e928f28cf4bf22182d6d71287fe1fd8479cbd8a9 14940 libxcb-res0-dev_1.10-3~bpo70+1_amd64.deb 0ab80731e2f4f7f250437944ed1cbebf16df05a6 17682 libxcb-res0-dbg_1.10-3~bpo70+1_amd64.deb e06327bcb50f3e20511b440588d9f13422b5426f 11446 libxcb-screensaver0_1.10-3~bpo70+1_amd64.deb 1dc94f0b171a2b125402982ab15ca53292fe3d35 12460 libxcb-screensaver0-dev_1.10-3~bpo70+1_amd64.deb 189664c48a617c667909544d5d1f9095cb388721 14908 libxcb-screensaver0-dbg_1.10-3~bpo70+1_amd64.deb 1abb96cbf9c64f41b1c7fccfb56ba19bf05f8858 12212 libxcb-shape0_1.10-3~bpo70+1_amd64.deb 370605e9169cc0773bb2d2e47dfccddc822f5ae4 14236 libxcb-shape0-dev_1.10-3~bpo70+1_amd64.deb ef939f43c26805f8821b38527e0d16fc62bac9c4 17312 libxcb-shape0-dbg_1.10-3~bpo70+1_amd64.deb 0637c2171c45f98484b35e7b70f377b0a783e93f 11964 libxcb-shm0_1.10-3~bpo70+1_amd64.deb 59549b19912765d4010d0c18b0973cf7de90225b 13662 libxcb-shm0-dev_1.10-3~bpo70+1_amd64.deb 9bf7d2880722c4d9bb3a6e769c6e816fa102a3da 16716 libxcb-shm0-dbg_1.10-3~bpo70+1_amd64.deb 0ba72c4510bd109e814cc67991efae53251beb2f 15636 libxcb-sync1_1.10-3~bpo70+1_amd64.deb d39041e3c7f9d321a8227a26ca9f044416be051b 18910 libxcb-sync-dev_1.10-3~bpo70+1_amd64.deb 6bdd3776623f2557351f66c94352eb550a942033 25590 libxcb-sync1-dbg_1.10-3~bpo70+1_amd64.deb e4cde46e1a03415f6f7ea2300a8947b245bdd488 11368 libxcb-xevie0_1.10-3~bpo70+1_amd64.deb 43bdd2c4581669bc1775f59e20903b58bc9e8867 12324 libxcb-xevie0-dev_1.10-3~bpo70+1_amd64.deb 1ed0cb94479cbfa0b1fcda7ebb3bd66f7e780a19 14584 libxcb-xevie0-dbg_1.10-3~bpo70+1_amd64.deb 5eeba21fa61f662020513e03c4d502a0b829d0dd 13330 libxcb-xf86dri0_1.10-3~bpo70+1_amd64.deb b956244620594052665c1f3cf7c0a51f6b73a062 15210 libxcb-xf86dri0-dev_1.10-3~bpo70+1_amd64.deb dc52dd6111d400faad20b44d4058056806cfbd0d 19084 libxcb-xf86dri0-dbg_1.10-3~bpo70+1_amd64.deb e3a05d920b996da511008422fe779035f52a070d 16244 libxcb-xfixes0_1.10-3~bpo70+1_amd64.deb 7276ea5ed0a25e2fffbd06859df72e5ac1dbaea4 21050 libxcb-xfixes0-dev_1.10-3~bpo70+1_amd64.deb 72012a1a105a9e1750bc910a84c750c7a17195f2 27948 libxcb-xfixes0-dbg_1.10-3~bpo70+1_amd64.deb 74c47a370aaf43c8995e0035fcdbb98d199b3119 11602 libxcb-xinerama0_1.10-3~bpo70+1_amd64.deb 5fdcf7474c203d8719afb10efc1b372dcbb9f84c 12706 libxcb-xinerama0-dev_1.10-3~bpo70+1_amd64.deb c1e6d29a922e18377e6f60caf4c19017fc6de4a9 14966 libxcb-xinerama0-dbg_1.10-3~bpo70+1_amd64.deb 7f9c97316d583fd3bdce51007e54d46b979632d0 17842 libxcb-xprint0_1.10-3~bpo70+1_amd64.deb 453a05ef7714b6d62ca155b37ec94505078e1869 22104 libxcb-xprint0-dev_1.10-3~bpo70+1_amd64.deb 2b3558d98878c3765c68984529ba741cab88d16b 29632 libxcb-xprint0-dbg_1.10-3~bpo70+1_amd64.deb 6dabd5550dc7ea41d2b29e99f472983103a8153b 11116 libxcb-xtest0_1.10-3~bpo70+1_amd64.deb 21fa3b6cf0958ed3977788ae68e8524e9a6c51a8 11636 libxcb-xtest0-dev_1.10-3~bpo70+1_amd64.deb 9e3e2aa9e6e9b24f2652175ab99764db06d6a451 13988 libxcb-xtest0-dbg_1.10-3~bpo70+1_amd64.deb c63c60965e7b0e5da478b06e4ff7dbf3eb8713f7 16770 libxcb-xv0_1.10-3~bpo70+1_amd64.deb 4242c9ac2e282a38d2ea4721ff68114ecc54f141 21314 libxcb-xv0-dev_1.10-3~bpo70+1_amd64.deb e2250a24b20fa85c187c54a56eeadf8ba336d1a9 28698 libxcb-xv0-dbg_1.10-3~bpo70+1_amd64.deb 180b3d78dd3db5c04ec4e3a5b7d3ea9d02e623d5 12946 libxcb-xvmc0_1.10-3~bpo70+1_amd64.deb a345899dbcbad23df4169034c30360197db6c7fc 15002 libxcb-xvmc0-dev_1.10-3~bpo70+1_amd64.deb 26c4c25d590e299544168c1499c8943649d5c3eb 18412 libxcb-xvmc0-dbg_1.10-3~bpo70+1_amd64.deb 886c2b9e6118228e81d1aac040bae9fd643f6ded 13806 libxcb-dri2-0_1.10-3~bpo70+1_amd64.deb e4f56e710b924f5faa83007db5ac44c4b81cfc62 16692 libxcb-dri2-0-dev_1.10-3~bpo70+1_amd64.deb 69411b6708db0ccd6128fd7c9b84ad0b29726da1 20740 libxcb-dri2-0-dbg_1.10-3~bpo70+1_amd64.deb fff39bb2e2be0cb1368d1ae21a2e5fcfc396d878 11742 libxcb-present0_1.10-3~bpo70+1_amd64.deb f35ad83dfd0735b448f4938218d782b193057ed3 13714 libxcb-present-dev_1.10-3~bpo70+1_amd64.deb 2fb893330a6bb54ae73405c05fd3c6035cdeab53 15668 libxcb-present0-dbg_1.10-3~bpo70+1_amd64.deb 73f3c48a5a3bb8f0e74a04e1a7464c20035ead4e 11572 libxcb-dri3-0_1.10-3~bpo70+1_amd64.deb b7fb64d72ed20cc92a999bad26b447d4de481af3 12492 libxcb-dri3-dev_1.10-3~bpo70+1_amd64.deb 31be0f1cce616e663bfdab22a6cbda57de601510 15128 libxcb-dri3-0-dbg_1.10-3~bpo70+1_amd64.deb 2fe7065c327f881ede6086050fa16f0125d9c3fa 43596 libxcb-xkb1_1.10-3~bpo70+1_amd64.deb f64f26e4c91df7b5e7cccba94e65c938e52e1eaa 66384 libxcb-xkb-dev_1.10-3~bpo70+1_amd64.deb 1619cb1f70c3b5f3d1e7e85dd0bf6ab73d38d1fe 90518 libxcb-xkb1-dbg_1.10-3~bpo70+1_amd64.deb Checksums-Sha256: f9972b23a9d97d320b6842268c83a131ca878c003435533281ae3d6c64f09a28 6346 libxcb_1.10-3~bpo70+1.dsc a1b4aa3f17ebd69feb7a7ad2d3753be46a5a30c41f3c83e8afaab4b0b5f35c71 25300 libxcb_1.10-3~bpo70+1.diff.gz d6a548fe9b70ecdb0e802fea5635e957ad021eef232ba23c5e0b7c34c09da6b8 53022 libxcb1_1.10-3~bpo70+1_amd64.deb 0eda60351841079228fdbf8e1df7f09431a29046440fa8351c2092296c0c66b0 33658 libxcb1-udeb_1.10-3~bpo70+1_amd64.udeb 159010b02d46a9a7c3c6624ef8f41f1ad751582c4daf6172f928763ce782dc20 107046 libxcb1-dev_1.10-3~bpo70+1_amd64.deb b06db888192c0419e0a3f2a09bfbe81d6295d8ec4df20c1838f875d8e9cd1ba4 138148 libxcb1-dbg_1.10-3~bpo70+1_amd64.deb 1b77c9399a16aaef96a51628668622914c5e35caaa9221962259577d889c986d 5353644 libxcb-doc_1.10-3~bpo70+1_all.deb bf7b35b287fd68f962865d5dd2de21e8f629c02eab16addb421d6efb168d10ad 11460 libxcb-composite0_1.10-3~bpo70+1_amd64.deb ed4277de567e63a7418bedd7a6ce99ba8bd3331b3fb512e2f09c06ed954580fa 12306 libxcb-composite0-dev_1.10-3~bpo70+1_amd64.deb 1564ecb805e3ffda20964127b7044a53d569e6cd2351258eedd76ede44944b3f 15176 libxcb-composite0-dbg_1.10-3~bpo70+1_amd64.deb 34db8b4be2a5300864580219ebc2c871c4477c95b9e5ebb18b7d2a3cec4f5991 11102 libxcb-damage0_1.10-3~bpo70+1_amd64.deb 2f3977eca85dbb89bd631050caf69b039c878fd3a19498de82dfed42d43a0519 12036 libxcb-damage0-dev_1.10-3~bpo70+1_amd64.deb 7682a1ce7016db122052b648241013742eb53348e8a9af2afcec5beeac7a4de4 13942 libxcb-damage0-dbg_1.10-3~bpo70+1_amd64.deb 5b26dcbb1e149eabc5c5a821ba44d99bd82630451ce7050d97cbdf2143a14127 11404 libxcb-dpms0_1.10-3~bpo70+1_amd64.deb e19372479d3f28a807f4db8c66abbec01b336ea025977bb71bdc7cf27171f056 12176 libxcb-dpms0-dev_1.10-3~bpo70+1_amd64.deb 509fdbd0104ca158015491a649c5c14d7155ae987a52f2fcc438e3280921e5cd 14410 libxcb-dpms0-dbg_1.10-3~bpo70+1_amd64.deb a2f6df90510158ef12162f2af955d73e8d5e6414d729c16de31c9dfcde0e41b0 33370 libxcb-glx0_1.10-3~bpo70+1_amd64.deb 3e4ab8d37a37109cad5a1e871f323a932f0eef3a5ff3cc593922425d9d1b93d2 50252 libxcb-glx0-dev_1.10-3~bpo70+1_amd64.deb a81b3d1945cf4f0861f14865df76e705baace8b4b79606034b9d8dd30e2a4cd7 72672 libxcb-glx0-dbg_1.10-3~bpo70+1_amd64.deb e39f2c3cd2ef3f012a9021606adb3356e493ad7645184463e0b6bdcf1a134864 24424 libxcb-randr0_1.10-3~bpo70+1_amd64.deb 69110bb5fb122c4698956c2309579d7e822e4252fff788f7e8acfff2735daf00 33722 libxcb-randr0-dev_1.10-3~bpo70+1_amd64.deb 0eb8a7306011cb0859e4c443e71acc8dcec1fc49862ae331040157df9510bb1a 46150 libxcb-randr0-dbg_1.10-3~bpo70+1_amd64.deb 5891eaa313cd1b6a5510b0e15261ec56fc01ce7be8720b4667d8c745531636f8 13202 libxcb-record0_1.10-3~bpo70+1_amd64.deb 4b633365185aee1347cc87b57fd382af71ee8695a23154004809b725c3d9780a 15146 libxcb-record0-dev_1.10-3~bpo70+1_amd64.deb 01a8aafbfdb34af103d189fcdd43d32ff7d026380fab9f98302944615768475c 18740 libxcb-record0-dbg_1.10-3~bpo70+1_amd64.deb 26e5279940bbdd534e011d9242bf2bdefa60a2cdee2aeca608dcadf0a4343f21 19798 libxcb-render0_1.10-3~bpo70+1_amd64.deb 0519298b83f2b7daa7b78742d8c8109d2c3bb42f49b0faedd8688a4c1f485094 27240 libxcb-render0-dev_1.10-3~bpo70+1_amd64.deb 9048dd45d90f14f1d8a23c1a4ef09c7d9002fa9117afe9f0b60368d9233a6c00 36484 libxcb-render0-dbg_1.10-3~bpo70+1_amd64.deb 4eb6a114b00c1bf1abe4d56acdebd2876a900df59eb9a77241e28a6d0f0adebc 13150 libxcb-res0_1.10-3~bpo70+1_amd64.deb 87b7656c0139ccadb16f11d2ee7fb9edcc41e8bb794ea581c93aa00409d82b08 14940 libxcb-res0-dev_1.10-3~bpo70+1_amd64.deb 4d771bb79afd629067b1db97c1c5d8975e6abbcbda7d3eb060bebc4ef5965c3d 17682 libxcb-res0-dbg_1.10-3~bpo70+1_amd64.deb 8344ee247d860d49a81294f33b46652d457aa47fe80e22b43c61c9f7e7d99387 11446 libxcb-screensaver0_1.10-3~bpo70+1_amd64.deb 8a493bf3e0ed0b035fbfc35761ee7347a5f1406cbf6c63939cb9189c2e176242 12460 libxcb-screensaver0-dev_1.10-3~bpo70+1_amd64.deb 1803e0120c93c79facc98ba563a27f399685e6a7a1538fe6866caa1a95f68eba 14908 libxcb-screensaver0-dbg_1.10-3~bpo70+1_amd64.deb 1e80b06389f7ca2b2cff61d44ca14e6f306eda2072e69c66cab969dd09431daa 12212 libxcb-shape0_1.10-3~bpo70+1_amd64.deb c1128ee82f60ebf7e01570480190482cb0f1e0817710430495bf346e3ee77ecd 14236 libxcb-shape0-dev_1.10-3~bpo70+1_amd64.deb 3b083bd9ac1c48812eb91f5a6bbcc6a7bb9dde6644b51a97b424815e7ece9d25 17312 libxcb-shape0-dbg_1.10-3~bpo70+1_amd64.deb e8f9103445979162c855cbd199677d6bd5c659370541fafe95c6dbb5ce925a3c 11964 libxcb-shm0_1.10-3~bpo70+1_amd64.deb 20d61033bbbc5d21d5bf2ea5bc86a05ef910bd43b7464e26c5c67b5ded2d76a0 13662 libxcb-shm0-dev_1.10-3~bpo70+1_amd64.deb 9fbe26c42c678436abd66f61de425e968a0164bbedbd943a5b1223845545bd66 16716 libxcb-shm0-dbg_1.10-3~bpo70+1_amd64.deb ddb98889f2286113589cbf4442856f5e8071af04acc6389a32cab4f9048082e7 15636 libxcb-sync1_1.10-3~bpo70+1_amd64.deb 910b634e7afe4ea7345bb93b1737958f0625fcecfdd0f49302bd9dafb75155f1 18910 libxcb-sync-dev_1.10-3~bpo70+1_amd64.deb 1801cbd7349ff5c4d6e5c412c9e20811bd1c81d5400d330124cce88f23a6e404 25590 libxcb-sync1-dbg_1.10-3~bpo70+1_amd64.deb 952834e14c59e3be834a563605bbbe915b1450532f480d78ffea3ccbfdc7453b 11368 libxcb-xevie0_1.10-3~bpo70+1_amd64.deb 006cca577db5f7e0215dc1863e22bc92900c1127b351a22803781c3072e8a5b5 12324 libxcb-xevie0-dev_1.10-3~bpo70+1_amd64.deb 71b92b02e8e0f19ed508eae6ccee9813d28fe7180daf338113d9c30879da6b62 14584 libxcb-xevie0-dbg_1.10-3~bpo70+1_amd64.deb 786173a86cc12a8a5bdbdc8bbc1eb1ae6f80aa3dbaf34ef0b5c2a2d961fbb843 13330 libxcb-xf86dri0_1.10-3~bpo70+1_amd64.deb a9e08e9d149f37bdc4c06df52b660fb3b6ea691eef35efcb196c51a8b67842ac 15210 libxcb-xf86dri0-dev_1.10-3~bpo70+1_amd64.deb cc64e280fc68ece0675bf1facfa771e399e156f55dbd3f68d285cebc47eb3f2f 19084 libxcb-xf86dri0-dbg_1.10-3~bpo70+1_amd64.deb f10a6d528b4aeac9e8d7302c9d81319a3818192572cd167d06382437ed1fe896 16244 libxcb-xfixes0_1.10-3~bpo70+1_amd64.deb 31cc1fbbac21af857017a2dc5b2782c55630d4e48ebf4086da43182e3f295733 21050 libxcb-xfixes0-dev_1.10-3~bpo70+1_amd64.deb c697058071044f6708e96c96e2afbe809c7549f8aa5f28fed5ee6005ce4a6be1 27948 libxcb-xfixes0-dbg_1.10-3~bpo70+1_amd64.deb 0d5a56cc8139fc4f1f2726de4dc676dea80be5d07d6574b53b975fbcd51a4708 11602 libxcb-xinerama0_1.10-3~bpo70+1_amd64.deb ba3c0afe78a701ed903d1ad1ff2e4ae04fa5c3c94b6e7e0b5dfcf1cfcd2d0887 12706 libxcb-xinerama0-dev_1.10-3~bpo70+1_amd64.deb fad40d889fb9dea37c57c2385042903a6812c52b5503bc19f38907598cbfb688 14966 libxcb-xinerama0-dbg_1.10-3~bpo70+1_amd64.deb 34cdd33a51b0ec046140b728c96d821efd2e22e22f332a70e3f43db6b8789f06 17842 libxcb-xprint0_1.10-3~bpo70+1_amd64.deb f88c6164d431ef56893d49d700d69326a22e4973ea4cfed5b68e7a1cbb6c6572 22104 libxcb-xprint0-dev_1.10-3~bpo70+1_amd64.deb e6da37cf895d8ba4382d4a969c88419ebfd6c722c43034a3b087caaf7adf72b4 29632 libxcb-xprint0-dbg_1.10-3~bpo70+1_amd64.deb 68d20f0ef7a38c6e27af35d258a84892e74cc5b69b2944835f018b018ec8875f 11116 libxcb-xtest0_1.10-3~bpo70+1_amd64.deb cb6e8f0eb467f556b94829bafdb2b3fe59ef7cedd0ee20391bc11e12ac51a2c7 11636 libxcb-xtest0-dev_1.10-3~bpo70+1_amd64.deb 0b16d4e102b56681a1fa3dc274919e31ee756e84e36c41a2627dec87061d0298 13988 libxcb-xtest0-dbg_1.10-3~bpo70+1_amd64.deb 966f3bf83392f25c1ba49c027ed28f5ab585e3e2dd468d35da3e5b31ead6df72 16770 libxcb-xv0_1.10-3~bpo70+1_amd64.deb 2f95278a0c4f5a1111a87cec74156a5fbd6f026159e61d241b4b554c02898ab1 21314 libxcb-xv0-dev_1.10-3~bpo70+1_amd64.deb a4317a6954d032b08d78a10af725693aed55654b605555b2088e3fb13de3a44e 28698 libxcb-xv0-dbg_1.10-3~bpo70+1_amd64.deb 321e2354f88d0ce5b68997ef7e039319fbcd1bbe5322a010fd772240c16a8f46 12946 libxcb-xvmc0_1.10-3~bpo70+1_amd64.deb 735c87ed5f6c6bafb0443fafb6ab249ca5d956ffa8459ae28e6e33484a609219 15002 libxcb-xvmc0-dev_1.10-3~bpo70+1_amd64.deb f667e4d1009fd612cf1c40116fa8e9d092aafad4b0c8038d65b045fd1485fe52 18412 libxcb-xvmc0-dbg_1.10-3~bpo70+1_amd64.deb bca22f99ceedcf767bb8a0ba0304c9883dbf639f6ddd2ba1a002b370e291ed8b 13806 libxcb-dri2-0_1.10-3~bpo70+1_amd64.deb 60226d682421b8cbefa999269136c6cb82ac0e7b823be3569a7aa4366c62e02d 16692 libxcb-dri2-0-dev_1.10-3~bpo70+1_amd64.deb 613d0ff555e381f3329ea0c290da192bdfd73dca60b3012888c7133a5b5d77e8 20740 libxcb-dri2-0-dbg_1.10-3~bpo70+1_amd64.deb 1581fc852f08c94100a0f4f6e2ea9fb50c08f9a20a83d8089e0afc955557e138 11742 libxcb-present0_1.10-3~bpo70+1_amd64.deb db3ebc67d1b63239ba58c97176bdccdca32794b982c84c2c231dd722eeabecde 13714 libxcb-present-dev_1.10-3~bpo70+1_amd64.deb a01bd51fbb521c74ea3daf9f706a9aedb204b48932e4f23c74b8f447dcbc958f 15668 libxcb-present0-dbg_1.10-3~bpo70+1_amd64.deb ed33d840bb748f253ca1a8ebb69bc23841130354806ec941c05804947927dca5 11572 libxcb-dri3-0_1.10-3~bpo70+1_amd64.deb 04ca8fd4742bf40cb733c1bc39b69445e4524883a2b6f0da6d208c7df58a8733 12492 libxcb-dri3-dev_1.10-3~bpo70+1_amd64.deb f3dad42792518c9ec06822729cceaccb20701987b01a8848297afa9df4a3493a 15128 libxcb-dri3-0-dbg_1.10-3~bpo70+1_amd64.deb 53434f797175fc14eea31392188af9f9b7b0eedb747a76fcaa966a4aa7cc387d 43596 libxcb-xkb1_1.10-3~bpo70+1_amd64.deb 66c402313b4a805d5d7f34800a79e39637dda70a0c9f2470922149a4106f0913 66384 libxcb-xkb-dev_1.10-3~bpo70+1_amd64.deb 9c34452d4cb80f148f813bd41046c037a9ea092de89d7309d8b11e0e68da0c97 90518 libxcb-xkb1-dbg_1.10-3~bpo70+1_amd64.deb Files: f75ae3c662e2233a4207565c4e6bea1f 6346 libdevel optional libxcb_1.10-3~bpo70+1.dsc f99e157f8a49cccc730493f1a877f902 25300 libdevel optional libxcb_1.10-3~bpo70+1.diff.gz 7f9d3dbfdf1ca045b41a4be006d9edca 53022 libs optional libxcb1_1.10-3~bpo70+1_amd64.deb 0c6bdf831e8c0a61dd80c0979420b653 33658 debian-installer optional libxcb1-udeb_1.10-3~bpo70+1_amd64.udeb c62f509df92bbf0e4d9e6e5ffa0824f1 107046 libdevel optional libxcb1-dev_1.10-3~bpo70+1_amd64.deb e4a2dcdb011e7c331750109916768291 138148 debug extra libxcb1-dbg_1.10-3~bpo70+1_amd64.deb 75362d01bbf79b22994ebf5862b71f60 5353644 doc optional libxcb-doc_1.10-3~bpo70+1_all.deb e3fb4b55c13026c52f1613da31a77f2b 11460 libs optional libxcb-composite0_1.10-3~bpo70+1_amd64.deb b3b0565fa925c10cd8b492d32069f424 12306 libdevel optional libxcb-composite0-dev_1.10-3~bpo70+1_amd64.deb f27ff926859f9ce6c64a7eaec8526fa1 15176 debug extra libxcb-composite0-dbg_1.10-3~bpo70+1_amd64.deb 9c1c5490071f690298a0c2de9d8f3bf0 11102 libs optional libxcb-damage0_1.10-3~bpo70+1_amd64.deb f6d943ebc0f2d5283f703c2c0b80cfe7 12036 libdevel optional libxcb-damage0-dev_1.10-3~bpo70+1_amd64.deb 65bcbca80758dd07f9789ed1507175ba 13942 debug extra libxcb-damage0-dbg_1.10-3~bpo70+1_amd64.deb f266c3cb4f6903a4845f84c5602386b5 11404 libs optional libxcb-dpms0_1.10-3~bpo70+1_amd64.deb 1a8909b602c03440c96bf7f3955e971b 12176 libdevel optional libxcb-dpms0-dev_1.10-3~bpo70+1_amd64.deb 6f2e6c4cab3a4d75727dcfe7c3dcd80b 14410 debug extra libxcb-dpms0-dbg_1.10-3~bpo70+1_amd64.deb e511129a469754eb2b0900bc10f1cd31 33370 libs optional libxcb-glx0_1.10-3~bpo70+1_amd64.deb 28f1c909029620e4de29cd9bdc98d34a 50252 libdevel optional libxcb-glx0-dev_1.10-3~bpo70+1_amd64.deb 1908c04853bee37b87ae3e611e14be0a 72672 debug extra libxcb-glx0-dbg_1.10-3~bpo70+1_amd64.deb b68fd31d3a47ee02cb6aa0880d4d65fe 24424 libs optional libxcb-randr0_1.10-3~bpo70+1_amd64.deb bdffd8b73591917b43453c4cd7e45d4c 33722 libdevel optional libxcb-randr0-dev_1.10-3~bpo70+1_amd64.deb 05de4b9f6b57f1533b611c6a013041ff 46150 debug extra libxcb-randr0-dbg_1.10-3~bpo70+1_amd64.deb 4a86c667683c9b9333e233aa5413b0ec 13202 libs optional libxcb-record0_1.10-3~bpo70+1_amd64.deb 24150463febe1beac6bc9c95bd9f4946 15146 libdevel optional libxcb-record0-dev_1.10-3~bpo70+1_amd64.deb d36557ef705d4d589eaa4450e324fced 18740 debug extra libxcb-record0-dbg_1.10-3~bpo70+1_amd64.deb 51f9746d8ca8cf62e77d7c40e43cd9d4 19798 libs optional libxcb-render0_1.10-3~bpo70+1_amd64.deb fc12ccd19a608f95d83c459d6bfaff30 27240 libdevel optional libxcb-render0-dev_1.10-3~bpo70+1_amd64.deb 64029477773914a5af98fa1096791aba 36484 debug extra libxcb-render0-dbg_1.10-3~bpo70+1_amd64.deb 545e0c30b19d2a0e47cf06511b2cf5b8 13150 libs optional libxcb-res0_1.10-3~bpo70+1_amd64.deb 7311c2b8c19e1750f0fc47c9c57e5c58 14940 libdevel optional libxcb-res0-dev_1.10-3~bpo70+1_amd64.deb 5d683fbb1ae33769f230cfd3bfa826fa 17682 debug extra libxcb-res0-dbg_1.10-3~bpo70+1_amd64.deb 2e519f313e113ea972bdc65cc65b447c 11446 libs optional libxcb-screensaver0_1.10-3~bpo70+1_amd64.deb 696c699586484f3fbdb488005b7797fc 12460 libdevel optional libxcb-screensaver0-dev_1.10-3~bpo70+1_amd64.deb 9c655a054c04f230311c682478476667 14908 debug extra libxcb-screensaver0-dbg_1.10-3~bpo70+1_amd64.deb b15fab077457cf2f3d8b1804c938e28d 12212 libs optional libxcb-shape0_1.10-3~bpo70+1_amd64.deb b1507b43e6077d037a601d8bbd3b5a70 14236 libdevel optional libxcb-shape0-dev_1.10-3~bpo70+1_amd64.deb b9f64306026911c2d63a0d32d39ee055 17312 debug extra libxcb-shape0-dbg_1.10-3~bpo70+1_amd64.deb ef31d217eb4f4210c28cb580be76479a 11964 libs optional libxcb-shm0_1.10-3~bpo70+1_amd64.deb 05f94e48fef1269a50da9b97faff5b0c 13662 libdevel optional libxcb-shm0-dev_1.10-3~bpo70+1_amd64.deb 83fa8b0769af49aabc0247daaffc6838 16716 debug extra libxcb-shm0-dbg_1.10-3~bpo70+1_amd64.deb 9483a81fc22d298758ee58d17ac9dc01 15636 libs optional libxcb-sync1_1.10-3~bpo70+1_amd64.deb a34b3484d7181a900c507319a62309c7 18910 libdevel optional libxcb-sync-dev_1.10-3~bpo70+1_amd64.deb cb9f778df2057786ef3b52c21837c3b1 25590 debug extra libxcb-sync1-dbg_1.10-3~bpo70+1_amd64.deb 7907213daedfc8a959c54fac00e303b7 11368 libs optional libxcb-xevie0_1.10-3~bpo70+1_amd64.deb 35f574b3e67bebc04e8585bdb18c8adb 12324 libdevel optional libxcb-xevie0-dev_1.10-3~bpo70+1_amd64.deb 81e7537f18c8f60754b34ed30b7d7ef1 14584 debug extra libxcb-xevie0-dbg_1.10-3~bpo70+1_amd64.deb a42941bf16efdac09a578c16fead91ba 13330 libs optional libxcb-xf86dri0_1.10-3~bpo70+1_amd64.deb 52afd61734857d14a8f8d77633afc5d0 15210 libdevel optional libxcb-xf86dri0-dev_1.10-3~bpo70+1_amd64.deb 3e00cf54397beca5c30138ed8cbeb7bd 19084 debug extra libxcb-xf86dri0-dbg_1.10-3~bpo70+1_amd64.deb 364f250908eb1710210dcc738cceca7e 16244 libs optional libxcb-xfixes0_1.10-3~bpo70+1_amd64.deb 466e0c4c622e6dbd962132e4ace61892 21050 libdevel optional libxcb-xfixes0-dev_1.10-3~bpo70+1_amd64.deb 3bf053acd8b0ca3d5a8f8d344b2d95e0 27948 debug extra libxcb-xfixes0-dbg_1.10-3~bpo70+1_amd64.deb 3b0a5a409b2ae9ca302d6015594005a5 11602 libs optional libxcb-xinerama0_1.10-3~bpo70+1_amd64.deb 1de9dcd737edbce6081c136130116471 12706 libdevel optional libxcb-xinerama0-dev_1.10-3~bpo70+1_amd64.deb 09e3f26710ebb8920e84c139fb4d09fa 14966 debug extra libxcb-xinerama0-dbg_1.10-3~bpo70+1_amd64.deb cad05bed3c97e5b60c7dcad5dfdda012 17842 libs optional libxcb-xprint0_1.10-3~bpo70+1_amd64.deb 072d0176a39de8b210e3c59d9c9a51d3 22104 libdevel optional libxcb-xprint0-dev_1.10-3~bpo70+1_amd64.deb fa5d18fb3efd590e6f01a313fa0d5dc9 29632 debug extra libxcb-xprint0-dbg_1.10-3~bpo70+1_amd64.deb 5ee0380812732333f33cefb56db4d509 11116 libs optional libxcb-xtest0_1.10-3~bpo70+1_amd64.deb 3fd390e95a22c11caadeb84e8a590edc 11636 libdevel optional libxcb-xtest0-dev_1.10-3~bpo70+1_amd64.deb e6bb159fbd41c0a1106f3ad99d225cfe 13988 debug extra libxcb-xtest0-dbg_1.10-3~bpo70+1_amd64.deb b9047450f434013f8dc001c910d8989d 16770 libs optional libxcb-xv0_1.10-3~bpo70+1_amd64.deb beac689984728d22325fa6745f5471a6 21314 libdevel optional libxcb-xv0-dev_1.10-3~bpo70+1_amd64.deb e75aeaf204e6f9cf4e5e140c45775c0a 28698 debug extra libxcb-xv0-dbg_1.10-3~bpo70+1_amd64.deb 1e3fd07f61f012982ba8170034984b5b 12946 libs optional libxcb-xvmc0_1.10-3~bpo70+1_amd64.deb 75400ad13264c023625ee1afeb184bbe 15002 libdevel optional libxcb-xvmc0-dev_1.10-3~bpo70+1_amd64.deb d04897cfd88a43527449363404eb0cb4 18412 debug extra libxcb-xvmc0-dbg_1.10-3~bpo70+1_amd64.deb dc7636e10f7f432784e63414afa14dd6 13806 libs optional libxcb-dri2-0_1.10-3~bpo70+1_amd64.deb 2e40be16837b2a20085cae55e01cec10 16692 libdevel optional libxcb-dri2-0-dev_1.10-3~bpo70+1_amd64.deb f3a8e9847fef70285463b6f189638362 20740 debug extra libxcb-dri2-0-dbg_1.10-3~bpo70+1_amd64.deb 88c1a28d4f88f70e5c8844588004374d 11742 libs optional libxcb-present0_1.10-3~bpo70+1_amd64.deb 6ab3a27cdfbab3aa9e601b775ee0d46e 13714 libdevel optional libxcb-present-dev_1.10-3~bpo70+1_amd64.deb 2eec1d3f81747a31fe718953c776c509 15668 debug extra libxcb-present0-dbg_1.10-3~bpo70+1_amd64.deb 04fede6b0960a7abe095130ddb603544 11572 libs optional libxcb-dri3-0_1.10-3~bpo70+1_amd64.deb 416824152eabe3c75ef03c258e29779e 12492 libdevel optional libxcb-dri3-dev_1.10-3~bpo70+1_amd64.deb fbf717a71c9955aaf5e56151b7d559ca 15128 debug extra libxcb-dri3-0-dbg_1.10-3~bpo70+1_amd64.deb 5cdbed24e35fb1a8fe0546f568d10174 43596 libs optional libxcb-xkb1_1.10-3~bpo70+1_amd64.deb 301886c093f4865e6da6209c65d31c41 66384 libdevel optional libxcb-xkb-dev_1.10-3~bpo70+1_amd64.deb c0be49f15d73a1df375a029d6defd03d 90518 debug extra libxcb-xkb1-dbg_1.10-3~bpo70+1_amd64.deb Package-Type: udeb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUMsSJAAoJEKtkX0BihqfQ6j0QAJ4prM/0BTdjbJRWJOLFxGWT fO2DOj4icKXB3tPUMz8MpJG7aWfBnePhxC//209s3BVjHrju6YWDD7YjKHtCWu2w aI+lZh5m5K+KCilIYKdFnRfBkc47Q4HaGabHarIxluDejUJHkSysvgyGMQCaq8ox MyJ1IbMW2WIMWab+f0lC4l9XfIPaoRsLPl7R62NSMbVCd4LIDEaBh7sF26h0Lv22 Go3yRuPNJmDNy8Zl8hiemdh4OEWQQF4UfL4K+ZyolwiyvPHI6nVS3xDKSYigyYgp 3MiVZ9uX2He4oWsEIWk1b4F7g8turoqR7O4zV/26a/68ftCU+FlZ25kYemCdPmGc WSabg8eaG+JeR8pU94bxBLibGGuEUqf8M2eJPYKujRQSZkVuxWNOh2YlJ57ihqNZ cf51stKrEJdphTrHy/iwCg+i42eupdn94tHkqaI+3XBCXZXVrnApPK7T7RjSuPWg cU4vIfMX+uokDugUapn4oo3BFEtpOZFfPEsE637z4TxI16mhQ6z/Wt4MHYRLd7Ut yChILSbIevRJZXfTf6yYg+QlyjJoDHj7xW4l2WcaQQIjIpg5VRKtTfRgnLHEvs3D 8gA2CO/LvEYvkfSpVGBfopwhaR17RVCszsQwTFj7CIDSa4wJJGlp/YmOKQ2zUYVm a6M+nvGoHpPlipavc78Q =2IZ8 -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From ftpmaster at ftp-master.debian.org Thu Oct 9 15:12:16 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 09 Oct 2014 22:12:16 +0000 Subject: [Xcb] Processing of xcb-proto_1.10-1~bpo70+1_amd64.changes Message-ID: xcb-proto_1.10-1~bpo70+1_amd64.changes uploaded successfully to localhost along with the files: xcb-proto_1.10-1~bpo70+1.dsc xcb-proto_1.10-1~bpo70+1.diff.gz xcb-proto_1.10-1~bpo70+1_all.deb python-xcbgen_1.10-1~bpo70+1_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Thu Oct 9 15:20:08 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Thu, 09 Oct 2014 22:20:08 +0000 Subject: [Xcb] xcb-proto_1.10-1~bpo70+1_amd64.changes is NEW Message-ID: binary:xcb-proto is NEW. binary:python-xcbgen is NEW. source:xcb-proto is NEW. Your package has been put into the NEW queue, which requires manual action from the ftpteam to process. The upload was otherwise valid (it had a good OpenPGP signature and file hashes are valid), so please be patient. Packages are routinely processed through to the archive, and do feel free to browse the NEW queue[1]. If there is an issue with the upload, you will recieve an email from a member of the ftpteam. If you have any questions, you may reply to this email. [1]: https://ftp-master.debian.org/new.html From ran234 at gmail.com Sun Oct 12 09:02:04 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 19:02:04 +0300 Subject: [Xcb] [PATCH libxcb 4/4 V3] generator: fix align-pads for switches which start at unaligned pos In-Reply-To: <20140910171025.GA24512@ran> References: <20140909214037.GA6714@ran> <1410298000-24734-1-git-send-email-chris@demorecorder.com> <20140910171025.GA24512@ran> Message-ID: <20141012160204.GA3477@ran> On Wed, Sep 10, 2014 at 08:10:25PM +0300, Ran Benita wrote: > On Tue, Sep 09, 2014 at 11:26:40PM +0200, Christian Linhart wrote: > > From: Christian Linhart > > > > 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 > > 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 > > It's always unfortunate when c_client.py becomes even more obscure.. But > this looks good to me now: Maybe as a follow-up (after this is merged) we can make this even a bit simpler, by unconditionally generating the `xcb_padding_offset` declaration, and using it freely, but just making sure it is initialized to 0 when `not is_switch`. Anything to reduce the massive amounts of guess-why-I'm-here if-else's in the current generator... Ran > Reviewed-by: Ran Benita > > > --- > > src/c_client.py | 26 +++++++++++++++++++++----- > > 1 file changed, 21 insertions(+), 5 deletions(-) > > > > diff --git a/src/c_client.py b/src/c_client.py > > index 1d1bbf6..0a1f877 100644 > > --- a/src/c_client.py > > +++ b/src/c_client.py > > @@ -653,17 +653,23 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): > > for p in param_fields: > > if not p.type.fixed_size(): > > add_param(params, (p.c_field_const_type, '*', p.c_field_name)) > > > > return (param_fields, wire_fields, params) > > # get_serialize_params() > > > > -def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > > +def _c_serialize_helper_insert_padding(context, code_lines, space, postpone, is_case_or_bitcase): > > code_lines.append('%s /* insert padding */' % space) > > - code_lines.append('%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) > > + if is_case_or_bitcase: > > + code_lines.append( > > + '%s xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);' > > + % space) > > + else: > > + code_lines.append( > > + '%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) > > # code_lines.append('%s printf("automatically inserting padding: %%%%d\\n", xcb_pad);' % space) > > code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) > > > > if not postpone: > > code_lines.append('%s if (0 != xcb_pad) {' % space) > > > > if 'serialize' == context: > > @@ -673,14 +679,16 @@ def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > > elif context in ('unserialize', 'unpack', 'sizeof'): > > code_lines.append('%s xcb_tmp += xcb_pad;' % space) > > > > code_lines.append('%s xcb_pad = 0;' % space) > > code_lines.append('%s }' % space) > > > > code_lines.append('%s xcb_block_len = 0;' % space) > > + if is_case_or_bitcase: > > + code_lines.append('%s xcb_padding_offset = 0;' % space) > > > > # keep tracking of xcb_parts entries for serialize > > return 1 > > # _c_serialize_helper_insert_padding() > > > > def _c_serialize_helper_switch(context, self, complex_name, > > code_lines, temp_vars, > > @@ -1001,21 +1009,23 @@ def _c_serialize_helper_fields(context, self, > > > > # fields with variable size > > else: > > if field.type.is_pad: > > # Variable length pad is > > code_lines.append('%s xcb_align_to = %d;' % (space, field.type.align)) > > count += _c_serialize_helper_insert_padding(context, code_lines, space, > > - self.c_var_followed_by_fixed_fields) > > + self.c_var_followed_by_fixed_fields, > > + is_case_or_bitcase) > > continue > > else: > > # switch/bitcase: always calculate padding before and after variable sized fields > > if need_padding or is_case_or_bitcase: > > count += _c_serialize_helper_insert_padding(context, code_lines, space, > > - self.c_var_followed_by_fixed_fields) > > + self.c_var_followed_by_fixed_fields, > > + is_case_or_bitcase) > > > > value, length = _c_serialize_helper_fields_variable_size(context, self, field, > > code_lines, temp_vars, > > space, prefix) > > prev_field_was_variable = True > > > > # save (un)serialization C code > > @@ -1096,15 +1106,15 @@ def _c_serialize_helper(context, complex_type, > > code_lines.append('%s xcb_buffer_len += xcb_block_len;' % space) > > code_lines.append('%s xcb_block_len = 0;' % space) > > > > count += _c_serialize_helper_fields(context, self, > > code_lines, temp_vars, > > space, prefix, False) > > # "final padding" > > - count += _c_serialize_helper_insert_padding(context, code_lines, space, False) > > + count += _c_serialize_helper_insert_padding(context, code_lines, space, False, self.is_switch) > > > > return count > > # _c_serialize_helper() > > > > def _c_serialize(context, self): > > """ > > depending on the context variable, generate _serialize(), _unserialize(), _unpack(), or _sizeof() > > @@ -1166,14 +1176,16 @@ def _c_serialize(context, self): > > _c(' unsigned int xcb_out_pad = -sizeof(%s) & 3;', self.c_type) > > _c(' unsigned int xcb_buffer_len = sizeof(%s) + xcb_out_pad;', self.c_type) > > _c(' unsigned int xcb_align_to = 0;') > > else: > > _c(' char *xcb_out = *_buffer;') > > _c(' unsigned int xcb_buffer_len = 0;') > > _c(' unsigned int xcb_align_to = 0;') > > + if self.is_switch: > > + _c(' unsigned int xcb_padding_offset = ((size_t)xcb_out) & 7;') > > prefix = [('_aux', '->', self)] > > aux_ptr = 'xcb_out' > > > > elif context in ('unserialize', 'unpack'): > > _c(' char *xcb_tmp = (char *)_buffer;') > > if not self.is_switch: > > if not self.c_var_followed_by_fixed_fields: > > @@ -1189,14 +1201,16 @@ def _c_serialize(context, self): > > aux_var = '(*_aux)' # unserialize: double pointer (!) > > prefix = [(aux_var, '->', self)] > > aux_ptr = '*_aux' > > _c(' unsigned int xcb_buffer_len = 0;') > > _c(' unsigned int xcb_block_len = 0;') > > _c(' unsigned int xcb_pad = 0;') > > _c(' unsigned int xcb_align_to = 0;') > > + if self.is_switch: > > + _c(' unsigned int xcb_padding_offset = ((size_t)_buffer) & 7;') > > > > elif 'sizeof' == context: > > param_names = [p[2] for p in params] > > if self.is_switch: > > # switch: call _unpack() > > _c(' %s _aux;', self.c_type) > > _c(' return %s(%s, &_aux);', self.c_unpack_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > > @@ -1206,14 +1220,16 @@ def _c_serialize(context, self): > > # special case: call _unserialize() > > _c(' return %s(%s, NULL);', self.c_unserialize_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > > _c('}') > > return > > else: > > _c(' char *xcb_tmp = (char *)_buffer;') > > prefix = [('_aux', '->', self)] > > + if self.is_switch: > > + _c(' unsigned int xcb_padding_offset = 0;') > > > > count = _c_serialize_helper(context, self, code_lines, temp_vars, prefix=prefix) > > # update variable size fields (only important for context=='serialize' > > variable_size_fields = count > > if 'serialize' == context: > > temp_vars.append(' unsigned int xcb_pad = 0;') > > temp_vars.append(' char xcb_pad0[3] = {0, 0, 0};') > > -- > > 2.0.1 > > > > _______________________________________________ > > Xcb mailing list > > Xcb at lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 09:33:45 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 19:33:45 +0300 Subject: [Xcb] [PATCH libxcb 2/3] generator: support lists of structs which contain a switch In-Reply-To: <1408653356-21191-2-git-send-email-chris@demorecorder.com> References: <53F655AE.5000300@DemoRecorder.com> <1408653356-21191-2-git-send-email-chris@demorecorder.com> Message-ID: <20141012163345.GA6364@ran> Mentioning a request which needs this in the commit message would be nice! On Thu, Aug 21, 2014 at 10:35:55PM +0200, Christian Linhart wrote: > This essentially requires to have a correct sizeof-function > for the struct. > This in turn requires a sizeof-function for the switch, too. > > Making a sizeof-function for the switch is triggered by > replacing "elif" by "if" in the first change of this patch. > This way, c_need_sizeof is also set to True for switches if appropriate. > > The _c_serialize_helper_switch_field function has to support > the context "sizeof": > This is done in the second change of this patch > > The third change of this patch fixes an alignment error: > It does not make sense to base the padding on the struct-type > which is generated for switch because this struct does not > represent the protocol. Rather it is the output of deserialization. > ( The implicit padding for var-sized fields has other issues, IMHO, > but I am not touching these now...) > > The effect on the generated code for the current xml-files > is as follows: > * several additional sizeof-functions are generated > * the fix of the alignment error only changes one place > in the XKB-extension for the GetKbdByName-reply. > This is no problem because that reply in its current form > is broken/unfinished anyways. > > Note: > This patch also fixes a problem in the generator when > a fixed-size list is the last field of a case or bitcase. > > --- > src/c_client.py | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index fa59fff..1ed486c 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -354,15 +354,16 @@ def _c_type_setup(self, name, postfix): > if field.type.is_list and not field.type.member.fixed_size(): > field.c_pointer = '*' > > if field.type.is_switch: > field.c_pointer = '*' > field.c_field_const_type = 'const ' + field.c_field_type > self.c_need_aux = True > - elif not field.type.fixed_size() and not field.type.is_case_or_bitcase: > + > + if not field.type.fixed_size() and not field.type.is_case_or_bitcase: > self.c_need_sizeof = True The switches are internal, they can not be used directly e.g. by another extension module, right? I wish we could generate them only when needed, or make them static so the compiler can prune them. Right now most sizeof()'s are just dead .text. But this one doesn't add too many, so OK. Second, how hard would it be to make the above condition positive? (i.e. this or that or that). > > field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t > field.c_iterator_name = _n(name + (field.field_name, 'iterator')) # xcb_container_field_iterator > field.c_accessor_name = _n(name + (field.field_name,)) # xcb_container_field > field.c_length_name = _n(name + (field.field_name, 'length')) # xcb_container_field_length > field.c_end_name = _n(name + (field.field_name, 'end')) # xcb_container_field_end > @@ -766,14 +767,18 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr > # call _serialize()/_unpack() to determine the actual size > if 'serialize' == context: > length = "%s(&%s, %s&%s%s)" % (field.type.c_serialize_name, c_switch_variable, > c_field_names, prefix_str, field.c_field_name) > elif context in ('unserialize', 'unpack'): > length = "%s(xcb_tmp, %s&%s%s)" % (field.type.c_unpack_name, > c_field_names, prefix_str, field.c_field_name) > + elif 'sizeof' == context: > + #remove trailing ", " from c_field_names because it will be used at end of arglist > + my_c_field_names = c_field_names[:-2] > + length = "%s( xcb_tmp, %s )" % ( field.type.c_sizeof_name, my_c_field_names ) > > return length > # _c_serialize_helper_switch_field() > > def _c_serialize_helper_list_field(context, self, field, > code_lines, temp_vars, > space, prefix): > @@ -1042,15 +1047,20 @@ def _c_serialize_helper_fields(context, self, > > if 'serialize' == context: > if '' != length: > code_lines.append('%s xcb_parts[xcb_parts_idx].iov_len = %s;' % (space, length)) > code_lines.append('%s xcb_parts_idx++;' % space) > count += 1 > > - code_lines.append('%s xcb_align_to = ALIGNOF(%s);' % (space, 'char' if field.c_field_type == 'void' else field.c_field_type)) > + code_lines.append( > + '%s xcb_align_to = ALIGNOF(%s);' > + % (space, > + 'char' > + if field.c_field_type == 'void' or field.type.is_switch > + else field.c_field_type)) Right, using the type doesn't make sense. Would be better as a separate commit though! (Also, maybe extract the if-else to a variable?) Anyway, looks good to me: Reviewed-by: Ran Benita > > need_padding = True > if self.c_var_followed_by_fixed_fields: > need_padding = False > > return count > # _c_serialize_helper_fields() > -- > 2.0.1 > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 09:38:19 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 19:38:19 +0300 Subject: [Xcb] [PATCH libxcb 4/4 V3] generator: fix align-pads for switches which start at unaligned pos In-Reply-To: <20141012160204.GA3477@ran> References: <20140909214037.GA6714@ran> <1410298000-24734-1-git-send-email-chris@demorecorder.com> <20140910171025.GA24512@ran> <20141012160204.GA3477@ran> Message-ID: <20141012163819.GA6556@ran> On Sun, Oct 12, 2014 at 07:02:04PM +0300, Ran Benita wrote: > On Wed, Sep 10, 2014 at 08:10:25PM +0300, Ran Benita wrote: > > On Tue, Sep 09, 2014 at 11:26:40PM +0200, Christian Linhart wrote: > > > From: Christian Linhart > > > > > > 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 > > > 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 > > > > It's always unfortunate when c_client.py becomes even more obscure.. But > > this looks good to me now: > > Maybe as a follow-up (after this is merged) we can make this even a bit > simpler, by unconditionally generating the `xcb_padding_offset` > declaration, and using it freely, but just making sure it is initialized > to 0 when `not is_switch`. > > Anything to reduce the massive amounts of guess-why-I'm-here if-else's in > the current generator... Oops, that was the previous version, and what I asked to change :) Before I looked mostly at the generated files, now I looked more at the generator. So conflict of interest :) Anyway, disregard this comment - a cleaner file is probably better. Ran > Ran > > > Reviewed-by: Ran Benita > > > > > --- > > > src/c_client.py | 26 +++++++++++++++++++++----- > > > 1 file changed, 21 insertions(+), 5 deletions(-) > > > > > > diff --git a/src/c_client.py b/src/c_client.py > > > index 1d1bbf6..0a1f877 100644 > > > --- a/src/c_client.py > > > +++ b/src/c_client.py > > > @@ -653,17 +653,23 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): > > > for p in param_fields: > > > if not p.type.fixed_size(): > > > add_param(params, (p.c_field_const_type, '*', p.c_field_name)) > > > > > > return (param_fields, wire_fields, params) > > > # get_serialize_params() > > > > > > -def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > > > +def _c_serialize_helper_insert_padding(context, code_lines, space, postpone, is_case_or_bitcase): > > > code_lines.append('%s /* insert padding */' % space) > > > - code_lines.append('%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) > > > + if is_case_or_bitcase: > > > + code_lines.append( > > > + '%s xcb_pad = -(xcb_block_len + xcb_padding_offset) & (xcb_align_to - 1);' > > > + % space) > > > + else: > > > + code_lines.append( > > > + '%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) > > > # code_lines.append('%s printf("automatically inserting padding: %%%%d\\n", xcb_pad);' % space) > > > code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) > > > > > > if not postpone: > > > code_lines.append('%s if (0 != xcb_pad) {' % space) > > > > > > if 'serialize' == context: > > > @@ -673,14 +679,16 @@ def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > > > elif context in ('unserialize', 'unpack', 'sizeof'): > > > code_lines.append('%s xcb_tmp += xcb_pad;' % space) > > > > > > code_lines.append('%s xcb_pad = 0;' % space) > > > code_lines.append('%s }' % space) > > > > > > code_lines.append('%s xcb_block_len = 0;' % space) > > > + if is_case_or_bitcase: > > > + code_lines.append('%s xcb_padding_offset = 0;' % space) > > > > > > # keep tracking of xcb_parts entries for serialize > > > return 1 > > > # _c_serialize_helper_insert_padding() > > > > > > def _c_serialize_helper_switch(context, self, complex_name, > > > code_lines, temp_vars, > > > @@ -1001,21 +1009,23 @@ def _c_serialize_helper_fields(context, self, > > > > > > # fields with variable size > > > else: > > > if field.type.is_pad: > > > # Variable length pad is > > > code_lines.append('%s xcb_align_to = %d;' % (space, field.type.align)) > > > count += _c_serialize_helper_insert_padding(context, code_lines, space, > > > - self.c_var_followed_by_fixed_fields) > > > + self.c_var_followed_by_fixed_fields, > > > + is_case_or_bitcase) > > > continue > > > else: > > > # switch/bitcase: always calculate padding before and after variable sized fields > > > if need_padding or is_case_or_bitcase: > > > count += _c_serialize_helper_insert_padding(context, code_lines, space, > > > - self.c_var_followed_by_fixed_fields) > > > + self.c_var_followed_by_fixed_fields, > > > + is_case_or_bitcase) > > > > > > value, length = _c_serialize_helper_fields_variable_size(context, self, field, > > > code_lines, temp_vars, > > > space, prefix) > > > prev_field_was_variable = True > > > > > > # save (un)serialization C code > > > @@ -1096,15 +1106,15 @@ def _c_serialize_helper(context, complex_type, > > > code_lines.append('%s xcb_buffer_len += xcb_block_len;' % space) > > > code_lines.append('%s xcb_block_len = 0;' % space) > > > > > > count += _c_serialize_helper_fields(context, self, > > > code_lines, temp_vars, > > > space, prefix, False) > > > # "final padding" > > > - count += _c_serialize_helper_insert_padding(context, code_lines, space, False) > > > + count += _c_serialize_helper_insert_padding(context, code_lines, space, False, self.is_switch) > > > > > > return count > > > # _c_serialize_helper() > > > > > > def _c_serialize(context, self): > > > """ > > > depending on the context variable, generate _serialize(), _unserialize(), _unpack(), or _sizeof() > > > @@ -1166,14 +1176,16 @@ def _c_serialize(context, self): > > > _c(' unsigned int xcb_out_pad = -sizeof(%s) & 3;', self.c_type) > > > _c(' unsigned int xcb_buffer_len = sizeof(%s) + xcb_out_pad;', self.c_type) > > > _c(' unsigned int xcb_align_to = 0;') > > > else: > > > _c(' char *xcb_out = *_buffer;') > > > _c(' unsigned int xcb_buffer_len = 0;') > > > _c(' unsigned int xcb_align_to = 0;') > > > + if self.is_switch: > > > + _c(' unsigned int xcb_padding_offset = ((size_t)xcb_out) & 7;') > > > prefix = [('_aux', '->', self)] > > > aux_ptr = 'xcb_out' > > > > > > elif context in ('unserialize', 'unpack'): > > > _c(' char *xcb_tmp = (char *)_buffer;') > > > if not self.is_switch: > > > if not self.c_var_followed_by_fixed_fields: > > > @@ -1189,14 +1201,16 @@ def _c_serialize(context, self): > > > aux_var = '(*_aux)' # unserialize: double pointer (!) > > > prefix = [(aux_var, '->', self)] > > > aux_ptr = '*_aux' > > > _c(' unsigned int xcb_buffer_len = 0;') > > > _c(' unsigned int xcb_block_len = 0;') > > > _c(' unsigned int xcb_pad = 0;') > > > _c(' unsigned int xcb_align_to = 0;') > > > + if self.is_switch: > > > + _c(' unsigned int xcb_padding_offset = ((size_t)_buffer) & 7;') > > > > > > elif 'sizeof' == context: > > > param_names = [p[2] for p in params] > > > if self.is_switch: > > > # switch: call _unpack() > > > _c(' %s _aux;', self.c_type) > > > _c(' return %s(%s, &_aux);', self.c_unpack_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > > > @@ -1206,14 +1220,16 @@ def _c_serialize(context, self): > > > # special case: call _unserialize() > > > _c(' return %s(%s, NULL);', self.c_unserialize_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > > > _c('}') > > > return > > > else: > > > _c(' char *xcb_tmp = (char *)_buffer;') > > > prefix = [('_aux', '->', self)] > > > + if self.is_switch: > > > + _c(' unsigned int xcb_padding_offset = 0;') > > > > > > count = _c_serialize_helper(context, self, code_lines, temp_vars, prefix=prefix) > > > # update variable size fields (only important for context=='serialize' > > > variable_size_fields = count > > > if 'serialize' == context: > > > temp_vars.append(' unsigned int xcb_pad = 0;') > > > temp_vars.append(' char xcb_pad0[3] = {0, 0, 0};') > > > -- > > > 2.0.1 > > > > > > _______________________________________________ > > > Xcb mailing list > > > Xcb at lists.freedesktop.org > > > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 11:07:22 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:07:22 +0300 Subject: [Xcb] [PATCH libxcb 1/6] generator: fix absname for fields with only accessor function In-Reply-To: <1409743361-466-1-git-send-email-chris@demorecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> Message-ID: <20141012180722.GA8240@ran> On Wed, Sep 03, 2014 at 01:22:36PM +0200, Christian Linhart wrote: > Fix _c_helper_absolute_name for fields which cannot be accessed > as a struct/union member but which can be accessed by an > accessor function. > > The fix calls the accessor function in these cases. > > Example: > > > > len > > > > > > > The sumof-expression ( ) refers to mylist1 > which is only acessible by an accessor function. > > Previously, sumof was only used inside bitcases, > where such lists are accessible by members of the > deserialized parent struct. > (there is a difference between deserialization of switches > and structs.) > --- > src/c_client.py | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 9216c7f..488f0e6 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -430,24 +430,50 @@ def _c_type_setup(self, name, postfix): > def _c_helper_absolute_name(prefix, field=None): This function is strange; most of the time it generates complete garbage (e.g. `foo->...->`) which is subsequently ignored. So it is called for no reason many times. > """ > turn prefix, which is a list of tuples (name, separator, Type obj) into a string > representing a valid name in C (based on the context) > if field is not None, append the field name as well > """ > prefix_str = '' > + last_sep ='' > for name, sep, obj in prefix: > + if '' != last_sep: > + prefix_str += last_sep > prefix_str += name > if '' == sep: (This can never happen. I have a patch to remove this). > sep = '->' > if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase > (obj.is_switch and len(obj.parents)>1)): > sep = '.' > - prefix_str += sep > + last_sep = sep > + > + prefix_str_without_lastsep = prefix_str > + prefix_str += last_sep > + > if field is not None: > prefix_str += _cpp(field.field_name) > + > + > + if ( This is a formidable list of conditions. Are all of them needed? Can this be extracted to a function `field_needs_accessor` or something like that? > + field != None With `None` it is customary to write `field is None`, `field is not None`. > + and hasattr(field, 'c_accessor_name') > + and field.parent != None > + and field.parent.is_container > + and not field.parent.is_switch > + and not field.parent.is_case_or_bitcase > + and ( #the following conditions are taken from _c_accessors() > + ( field.type.is_list and not field.type.fixed_size() ) > + or > + ( field.prev_varsized_field is not None > + or not field.type.fixed_size() This says `or` but the parens make it look like it should be `and`? > + ) > + ) > + ): > + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; I'm not entirely convinced that this should be in this function - or the function should be renamed. Is the above the correct thing to do in all of the callsites? Sorry for having more questions than answers; it is not for lack of trying.. Ran > + > return prefix_str > # _c_absolute_name > > def _c_helper_field_mapping(complex_type, prefix, flat=False): > """ > generate absolute names, based on prefix, for all fields starting from complex_type > if flat == True, nested complex types are not taken into account > -- > 2.0.1 > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 11:24:17 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:24:17 +0300 Subject: [Xcb] [PATCH libxcb 2/6] generator: fix absname for fields with only iterator function In-Reply-To: <1409743361-466-2-git-send-email-chris@demorecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-2-git-send-email-chris@demorecorder.com> Message-ID: <20141012182417.GB8240@ran> On Wed, Sep 03, 2014 at 01:22:37PM +0200, Christian Linhart wrote: > Fix _c_helper_absolute_name for fields which can only be > accessed with an iterator function. > These are lists with var-sized structs as members. This doesn't sound right. Does the caller know how to handle each iterator? Where it is used? I see that the code is reached, but this it doesn't seem to reach the generated output anywhere (with this libxcb+proto patchset), as opposed to the accessors in the `else` branch. So can we skip this patch? If not, why is it needed? Ran > --- > src/c_client.py | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 488f0e6..35c975f 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -464,15 +464,20 @@ def _c_helper_absolute_name(prefix, field=None): > ( field.type.is_list and not field.type.fixed_size() ) > or > ( field.prev_varsized_field is not None > or not field.type.fixed_size() > ) > ) > ): > - prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > + if field.type.is_list and not field.type.member.fixed_size(): > + #only accessible by iterator > + prefix_str = field.c_iterator_name + "(" + prefix_str_without_lastsep + ")"; > + else: > + #only accessible by access function > + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > > return prefix_str > # _c_absolute_name > > def _c_helper_field_mapping(complex_type, prefix, flat=False): > """ > generate absolute names, based on prefix, for all fields starting from complex_type > -- > 2.0.1 > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 11:39:06 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:39:06 +0300 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <5406F80F.4020002@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> Message-ID: <20141012183906.GC8240@ran> On Wed, Sep 03, 2014 at 01:14:23PM +0200, Christian Linhart wrote: > Hi all, > > In this thread I'll post patches which make the ListInputDevice reply work. > > This has also required some changes in the generator: > * generate calls to accessor function or iterator function instead of > a struct-member access for fields which can only be accessed with > accessor function or iterator respectively. > > * make sumof more flexible. Especially support a nested expression which is evaluated > in the scope of each list-element which is iterated to compute sumof. > Example: > > num_class_info > xcb_sumof() is this: int xcb_sumof(uint8_t *list, int len) { int i, s = 0; for(i=0; i > Due to using switch-case, some structs have became obsolete. > (and due to using struct STR from xproto instead of DeviceName because these > are the same and the spec uses STR) > > This patchset contains two patches to remove these obsolete structs. > You may reject these patches due to API-compatibility concerns. > On the other hand, probably nobody has used the structs for request ListInputDevice > anyways before because this request/reply didn't work anyways in the previous form. I think we can break xinput, it is not declared stable yet and is disabled by default. However, it appears like some projects already use it: http://git.enlightenment.org/legacy/ecore.git/tree/src/lib/ecore_x/xcb/ecore_xcb_input.c So I'm not sure... > > You can also get these patches at the following git-repo: > http://infra-srv1.demorecorder.com/git/free-sw/xcb/listinputdevices-sumof-20140903-2/proto > http://infra-srv1.demorecorder.com/git/free-sw/xcb/listinputdevices-sumof-20140903-2/libxcb > > Chris > > > P.S.: The patches are based on the following patches which are not > yet in the official repo: > * my patches from the the Thread > "[Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes" > * my patch in the email > "[Xcb] [PATCH libxcb] no typename for nested structs" > > ( you can get those also at > http://infra-srv1.demorecorder.com/git/free-sw/xcb/20140903-1/proto > http://infra-srv1.demorecorder.com/git/free-sw/xcb/20140903-1/libxcb ) > > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From ran234 at gmail.com Sun Oct 12 11:58:02 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:02 +0300 Subject: [Xcb] [PATCH libxcb 00/18] Small improvements to the generator Message-ID: <1413140300-20075-1-git-send-email-ran234@gmail.com> Some things I've noticed while reading c_client.py. There are some trivial conflicts with Christian's patches. Ran Benita (18): c_client.py: remove unneeded call to get_serialize_params() c_client.py: simplify maximum expression c_client.py: fix pyflakes errors c_client.py: use print as a function for python3 compatibility c_client.py: use comprehensions instead of map/filter c_client.py: fix indentation c_client.py: use "foo".join() instead of reduce c_client.py: no need to compare bools to True/False c_client.py: remove end-of-function comments c_client.py: use pattern matching with enumerate() c_client.py: don't generate useless empty /** < */ comments c_client.py: don't add /* */ before references to 'S' c_client.py: use C99 initializers instead of comments c_client.py: remove commented debug statements c_client.py: simplify _c_reply_has_fds() c_client.py: spell out keyword arguments in c_request() for clarity c_client.py: remove duplicated `cookie_type` argument for requests c_client.py: make condition easier to follow in _c_complex() src/c_client.py | 231 +++++++++++++++++++++++--------------------------------- 1 file changed, 94 insertions(+), 137 deletions(-) -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:03 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:03 +0300 Subject: [Xcb] [PATCH libxcb 01/18] c_client.py: remove unneeded call to get_serialize_params() In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-2-git-send-email-ran234@gmail.com> The results are not used, and the function doesn't have side effects. Signed-off-by: Ran Benita --- src/c_client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/c_client.py b/src/c_client.py index 87f268b..51edda7 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -739,7 +739,6 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr handle switch by calling _serialize() or _unpack(), depending on context """ # switch is handled by this function as a special case - param_fields, wire_fields, params = get_serialize_params(context, self) field_mapping = _c_helper_field_mapping(self, prefix) prefix_str = _c_helper_absolute_name(prefix) -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:04 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:04 +0300 Subject: [Xcb] [PATCH libxcb 02/18] c_client.py: simplify maximum expression In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-3-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 51edda7..f3405b1 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1122,8 +1122,7 @@ def _c_serialize(context, self): if not field.type.fixed_size() or self.is_switch: variable_size_fields += 1 # determine maxtypelen - for p in params: - maxtypelen = max(maxtypelen, len(p[0]) + len(p[1])) + maxtypelen = max(len(p[0]) + len(p[1]) for p in params) # write to .c/.h indent = ' '*(len(func_name)+2) -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:05 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:05 +0300 Subject: [Xcb] [PATCH libxcb 03/18] c_client.py: fix pyflakes errors In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-4-git-send-email-ran234@gmail.com> c_client.py:2: 'from xml.etree.cElementTree import *' used; unable to detect undefined names c_client.py:3: 'basename' imported but unused c_client.py:9: 'time' imported but unused c_client.py:1437: local variable 'list_obj' is assigned to but never used c_client.py:1745: local variable 'varfield' is assigned to but never used c_client.py:2050: local variable 'length' is assigned to but never used c_client.py:2416: local variable 'R_obj' is assigned to but never used c_client.py:2441: local variable 'S_obj' is assigned to but never used Signed-off-by: Ran Benita --- src/c_client.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index f3405b1..5860fb5 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1,12 +1,9 @@ #!/usr/bin/env python -from xml.etree.cElementTree import * -from os.path import basename from functools import reduce import getopt import os import sys import errno -import time import re # Jump to the bottom of this file for the main routine @@ -1434,7 +1431,6 @@ def _c_accessor_get_expr(expr, field_mapping): return c_name elif expr.op == 'sumof': # locate the referenced list object - list_obj = expr.lenfield_type field = None for f in expr.lenfield_parent.fields: if f.field_name == expr.lenfield_name: @@ -1739,10 +1735,8 @@ def _c_complex(self, force_packed = False): struct_fields = [] maxtypelen = 0 - varfield = None for field in self.fields: if not field.type.fixed_size() and not self.is_switch and not self.is_union: - varfield = field.c_field_name continue if field.wire: struct_fields.append(field) @@ -2047,7 +2041,6 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f else: list_length = _c_accessor_get_expr(field.type.expr, None) - length = '' _c(" xcb_parts[%d].iov_len = 0;" % count) _c(" xcb_tmp = (char *)%s;", field.c_field_name) _c(" for(i=0; i<%s; i++) {" % list_length) @@ -2412,8 +2405,6 @@ def _man_request(self, name, cookie_type, void, aux): # 'R': parents[0] is always the 'toplevel' container type params.append(('const %s *\\fIreply\\fP' % parents[0].c_type, parents[0])) fields.update(_c_helper_field_mapping(parents[0], [('R', '->', parents[0])], flat=True)) - # auxiliary object for 'R' parameters - R_obj = parents[0] if switch_obj is not None: # now look where the fields are defined that are needed to evaluate @@ -2437,9 +2428,6 @@ def _man_request(self, name, cookie_type, void, aux): prefix.append((p.name[-1], '.', p)) fields.update(_c_helper_field_mapping(p, prefix, flat=True)) - # auxiliary object for 'S' parameter - S_obj = parents[1] - if list.member.fixed_size(): idx = 1 if switch_obj is not None else 0 f.write('.HP\n') -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:06 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:06 +0300 Subject: [Xcb] [PATCH libxcb 04/18] c_client.py: use print as a function for python3 compatibility In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-5-git-send-email-ran234@gmail.com> This works for all python>=2.6, which is what configure requires. Signed-off-by: Ran Benita --- src/c_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 5860fb5..63bb7d6 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function from functools import reduce import getopt import os @@ -2335,8 +2336,7 @@ def _man_request(self, name, cookie_type, void, aux): for field in b.type.fields: _c_complex_field(self, field, space) if b.type.has_name: - print >> sys.stderr, 'ERROR: New unhandled documentation case' - pass + print('ERROR: New unhandled documentation case\n', file=sys.stderr) f.write('} \\fB%s\\fP;\n' % self.reply.c_type) f.write('.fi\n') @@ -2668,7 +2668,7 @@ def _man_event(self, name): spacing = ' ' * (maxtypelen - len(field.c_field_type)) f.write('%s %s%s \\fI%s\\fP%s;\n' % (space, field.c_field_type, spacing, field.c_field_name, field.c_subscript)) else: - print >> sys.stderr, 'ERROR: New unhandled documentation case' + print('ERROR: New unhandled documentation case', file=sys.stderr) if not self.is_switch: for field in struct_fields: @@ -2681,7 +2681,7 @@ def _man_event(self, name): for field in b.type.fields: _c_complex_field(self, field, space) if b.type.has_name: - print >> sys.stderr, 'ERROR: New unhandled documentation case' + print('ERROR: New unhandled documentation case', file=sys.stderr) pass f.write('} \\fB%s\\fP;\n' % self.c_type) -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:07 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:07 +0300 Subject: [Xcb] [PATCH libxcb 05/18] c_client.py: use comprehensions instead of map/filter In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-6-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 63bb7d6..fa37772 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -544,7 +544,7 @@ def get_expr_fields(self): prefix.append(('', '', self)) all_fields = _c_helper_resolve_field_names (prefix) - resolved_fields_names = list(filter(lambda x: x in all_fields.keys(), unresolved_fields_names)) + resolved_fields_names = [x for x in unresolved_fields_names if x in all_fields] if len(unresolved_fields_names) != len(resolved_fields_names): raise Exception("could not resolve all fields for %s" % self.name) @@ -783,8 +783,8 @@ def _c_serialize_helper_list_field(context, self, field, param_names = [p[2] for p in params] expr_fields_names = [f.field_name for f in get_expr_fields(field.type)] - resolved = list(filter(lambda x: x in param_names, expr_fields_names)) - unresolved = list(filter(lambda x: x not in param_names, expr_fields_names)) + resolved = [x for x in expr_fields_names if x in param_names] + unresolved = [x for x in expr_fields_names if x not in param_names] field_mapping = {} for r in resolved: @@ -797,8 +797,8 @@ def _c_serialize_helper_list_field(context, self, field, field.c_field_name) field_mapping.update(_c_helper_resolve_field_names(prefix)) - resolved += list(filter(lambda x: x in field_mapping, unresolved)) - unresolved = list(filter(lambda x: x not in field_mapping, unresolved)) + resolved += [x for x in unresolved if x in field_mapping] + unresolved = [x for x in unresolved if x not in field_mapping] if len(unresolved)>0: raise Exception('could not resolve the length fields required for list %s' % field.c_field_name) @@ -1131,7 +1131,7 @@ def _c_serialize(context, self): param_str.append("%s%s%s %s%s /**< */" % (indent, typespec, spacing, pointerspec, field_name)) # insert function name param_str[0] = "%s (%s" % (func_name, param_str[0].strip()) - param_str = list(map(lambda x: "%s," % x, param_str)) + param_str = ["%s," % x for x in param_str] for s in param_str[:-1]: _hc(s) _h("%s);" % param_str[-1].rstrip(',')) @@ -1210,7 +1210,7 @@ def _c_serialize(context, self): if not (self.is_switch or self.c_var_followed_by_fixed_fields): # look if we have to declare an '_aux' variable at all - if len(list(filter(lambda x: x.find('_aux')!=-1, code_lines)))>0: + if any('_aux' in x for x in code_lines): if not self.c_var_followed_by_fixed_fields: _c(' const %s *_aux = (%s *)_buffer;', self.c_type, self.c_type) else: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:08 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:08 +0300 Subject: [Xcb] [PATCH libxcb 06/18] c_client.py: fix indentation In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-7-git-send-email-ran234@gmail.com> (Also remove unnecessary parens around the condition). Signed-off-by: Ran Benita --- src/c_client.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index fa37772..7f768e0 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1516,14 +1516,13 @@ def _c_accessors_list(self, field): ''' def get_align_pad(field): - prev = field.prev_varsized_field - prev_prev = field.prev_varsized_field.prev_varsized_field - - if (prev.type.is_pad and prev.type.align > 0 and prev_prev is not None): - return (prev_prev, '((-prev.index) & (%d - 1))' % prev.type.align) - else: - return (prev, None) + prev = field.prev_varsized_field + prev_prev = field.prev_varsized_field.prev_varsized_field + if prev.type.is_pad and prev.type.align > 0 and prev_prev is not None: + return (prev_prev, '((-prev.index) & (%d - 1))' % prev.type.align) + else: + return (prev, None) list = field.type c_type = self.c_type -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:09 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:09 +0300 Subject: [Xcb] [PATCH libxcb 07/18] c_client.py: use "foo".join() instead of reduce In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-8-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 7f768e0..7051e44 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1,6 +1,5 @@ #!/usr/bin/env python from __future__ import print_function -from functools import reduce import getopt import os import sys @@ -846,7 +845,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) else: scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] - typename = reduce(lambda x,y: "%s.%s" % (x, y), scoped_name) + typename = ".".join(scoped_name) code_lines.append('%s /* %s.%s */' % (space, typename, field.c_field_name)) abs_field_name = _c_helper_absolute_name(prefix, field) @@ -1181,12 +1180,12 @@ def _c_serialize(context, self): if self.is_switch: # switch: call _unpack() _c(' %s _aux;', self.c_type) - _c(' return %s(%s, &_aux);', self.c_unpack_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) + _c(' return %s(%s, &_aux);', self.c_unpack_name, ", ".join(param_names)) _c('}') return elif self.c_var_followed_by_fixed_fields: # special case: call _unserialize() - _c(' return %s(%s, NULL);', self.c_unserialize_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) + _c(' return %s(%s, NULL);', self.c_unserialize_name, ", ".join(param_names)) _c('}') return else: @@ -2013,7 +2012,7 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f serialize_args = get_serialize_params(context, type_obj, c_field_name, aux_var)[2] - return reduce(lambda x,y: "%s, %s" % (x,y), [a[2] for a in serialize_args]) + return ", ".join(a[2] for a in serialize_args) # calls in order to free dyn. all. memory free_calls = [] -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:10 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:10 +0300 Subject: [Xcb] [PATCH libxcb 08/18] c_client.py: no need to compare bools to True/False In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-9-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 7051e44..3310db1 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -457,7 +457,7 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): else: bitcase_prefix = prefix - if (True==flat and not b.type.has_name) or False==flat: + if (flat and not b.type.has_name) or not flat: all_fields.update(_c_helper_field_mapping(b.type, bitcase_prefix, flat)) else: for f in complex_type.fields: @@ -466,7 +466,7 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): raise Exception("field name %s has been registered before" % f.field_name) all_fields[f.field_name] = (fname, f) - if f.type.is_container and flat==False: + if f.type.is_container and not flat: if f.type.is_case_or_bitcase and not f.type.has_name: new_prefix = prefix elif f.type.is_switch and len(f.type.parents)>1: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:11 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:11 +0300 Subject: [Xcb] [PATCH libxcb 09/18] c_client.py: remove end-of-function comments In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-10-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 3310db1..0488ea5 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -421,7 +421,6 @@ def _c_type_setup(self, name, postfix): if not module.namespace.is_ext or self.name[:2] == module.namespace.prefix: finished_sizeof.append(self.c_sizeof_name) _c_serialize('sizeof', self) -# _c_type_setup() def _c_helper_absolute_name(prefix, field=None): """ @@ -441,7 +440,6 @@ def _c_helper_absolute_name(prefix, field=None): if field is not None: prefix_str += _cpp(field.field_name) return prefix_str -# _c_absolute_name def _c_helper_field_mapping(complex_type, prefix, flat=False): """ @@ -477,7 +475,6 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): all_fields.update(_c_helper_field_mapping(f.type, new_prefix, flat)) return all_fields -# _c_field_mapping() def _c_helper_resolve_field_names (prefix): """ @@ -498,7 +495,6 @@ def _c_helper_resolve_field_names (prefix): all_fields.update(_c_helper_field_mapping(obj, tmp_prefix, flat=True)) return all_fields -# _c_helper_resolve_field_names def get_expr_fields(self): """ @@ -549,7 +545,6 @@ def get_expr_fields(self): resolved_fields = [all_fields[n][1] for n in resolved_fields_names] return resolved_fields -# get_expr_fields() def resolve_expr_fields(complex_obj): """ @@ -572,7 +567,6 @@ def resolve_expr_fields(complex_obj): if e not in all_fields and e not in unresolved: unresolved.append(e) return unresolved -# resolve_expr_fields() def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): """ @@ -651,7 +645,6 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): add_param(params, (p.c_field_const_type, '*', p.c_field_name)) return (param_fields, wire_fields, params) -# get_serialize_params() def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): code_lines.append('%s /* insert padding */' % space) @@ -676,7 +669,6 @@ def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): # keep tracking of xcb_parts entries for serialize return 1 -# _c_serialize_helper_insert_padding() def _c_serialize_helper_switch(context, self, complex_name, code_lines, temp_vars, @@ -729,7 +721,6 @@ def _c_serialize_helper_switch(context, self, complex_name, # code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) return count -# _c_serialize_helper_switch def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, prefix): """ @@ -768,7 +759,6 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr c_field_names, prefix_str, field.c_field_name) return length -# _c_serialize_helper_switch_field() def _c_serialize_helper_list_field(context, self, field, code_lines, temp_vars, @@ -835,7 +825,6 @@ def _c_serialize_helper_list_field(context, self, field, code_lines.append('%s xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;' % space) return length -# _c_serialize_helper_list_field() def _c_serialize_helper_fields_fixed_size(context, self, field, code_lines, temp_vars, @@ -901,7 +890,6 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, length = '%d' % field.type.nmemb return (value, length) -# _c_serialize_helper_fields_fixed_size() def _c_serialize_helper_fields_variable_size(context, self, field, code_lines, temp_vars, @@ -954,7 +942,6 @@ def _c_serialize_helper_fields_variable_size(context, self, field, length = "%s(%s)" % (field.type.c_sizeof_name, var_field_name) return (value, length) -# _c_serialize_helper_fields_variable_size def _c_serialize_helper_fields(context, self, code_lines, temp_vars, @@ -1045,7 +1032,6 @@ def _c_serialize_helper_fields(context, self, need_padding = False return count -# _c_serialize_helper_fields() def _c_serialize_helper(context, complex_type, code_lines, temp_vars, @@ -1085,7 +1071,6 @@ def _c_serialize_helper(context, complex_type, count += _c_serialize_helper_insert_padding(context, code_lines, space, False) return count -# _c_serialize_helper() def _c_serialize(context, self): """ @@ -1281,7 +1266,6 @@ def _c_serialize(context, self): _c('') _c(' return xcb_buffer_len;') _c('}') -# _c_serialize() def _c_iterator_get_end(field, accum): ''' -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:12 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:12 +0300 Subject: [Xcb] [PATCH libxcb 10/18] c_client.py: use pattern matching with enumerate() In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-11-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 0488ea5..4c19722 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -483,8 +483,7 @@ def _c_helper_resolve_field_names (prefix): all_fields = {} tmp_prefix = [] # look for fields in the remaining containers - for idx, p in enumerate(prefix): - name, sep, obj = p + for (idx, (name, sep, obj)) in enumerate(prefix): if ''==sep: # sep can be preset in prefix, if not, make a sensible guess sep = '.' if (obj.is_switch or obj.is_case_or_bitcase) else '->' @@ -833,7 +832,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, if not self.is_case_or_bitcase: code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) else: - scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] + scoped_name = [obj.c_type if idx==0 else name for idx, (name, sep, obj) in enumerate(prefix)] typename = ".".join(scoped_name) code_lines.append('%s /* %s.%s */' % (space, typename, field.c_field_name)) @@ -1965,7 +1964,7 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f _c(' void *xcb_aux = 0;') - for idx, f in enumerate(serial_fields): + for idx, _ in enumerate(serial_fields): if aux: _c(' void *xcb_aux%d = 0;' % (idx)) if list_with_var_size_elems: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:13 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:13 +0300 Subject: [Xcb] [PATCH libxcb 11/18] c_client.py: don't generate useless empty /** < */ comments In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-12-git-send-email-ran234@gmail.com> (This does not change doxygen's output or warnings). Signed-off-by: Ran Benita --- src/c_client.py | 88 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 4c19722..c1839c7 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1111,7 +1111,7 @@ def _c_serialize(context, self): for p in params: typespec, pointerspec, field_name = p spacing = ' '*(maxtypelen-len(typespec)-len(pointerspec)) - param_str.append("%s%s%s %s%s /**< */" % (indent, typespec, spacing, pointerspec, field_name)) + param_str.append("%s%s%s %s%s" % (indent, typespec, spacing, pointerspec, field_name)) # insert function name param_str[0] = "%s (%s" % (func_name, param_str[0].strip()) param_str = ["%s," % x for x in param_str] @@ -1292,9 +1292,9 @@ def _c_iterator(self, name): _h(' * @brief %s', self.c_iterator_type) _h(' **/') _h('typedef struct %s {', self.c_iterator_type) - _h(' %s *data; /**< */', self.c_type) - _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) - _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) + _h(' %s *data;', self.c_type) + _h(' int%s rem;', ' ' * (len(self.c_type) - 2)) + _h(' int%s index;', ' ' * (len(self.c_type) - 2)) _h('} %s;', self.c_iterator_type) _h_setlevel(1) @@ -1310,8 +1310,8 @@ def _c_iterator(self, name): _h(' */') _c('') _hc('void') - _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type) - _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type) + _h('%s (%s *i);', self.c_next_name, self.c_iterator_type) + _c('%s (%s *i)', self.c_next_name, self.c_iterator_type) _c('{') if not self.fixed_size(): @@ -1351,8 +1351,8 @@ def _c_iterator(self, name): _h(' */') _c('') _hc('xcb_generic_iterator_t') - _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type) - _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type) + _h('%s (%s i);', self.c_end_name, self.c_iterator_type) + _c('%s (%s i)', self.c_end_name, self.c_iterator_type) _c('{') _c(' xcb_generic_iterator_t ret;') @@ -1457,8 +1457,8 @@ def _c_accessors_field(self, field): if field.type.is_simple: _hc('') _hc('%s', field.c_field_type) - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) + _h('%s (const %s *R);', field.c_accessor_name, c_type) + _c('%s (const %s *R)', field.c_accessor_name, c_type) _c('{') if field.prev_varsized_field is None: _c(' return (%s *) (R + 1);', field.c_field_type) @@ -1475,8 +1475,8 @@ def _c_accessors_field(self, field): return_type = '%s *' % field.c_field_type _hc(return_type) - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) + _h('%s (const %s *R);', field.c_accessor_name, c_type) + _c('%s (const %s *R)', field.c_accessor_name, c_type) _c('{') if field.prev_varsized_field is None: _c(' return (%s) (R + 1);', return_type) @@ -1562,8 +1562,8 @@ def _c_accessors_list(self, field): _hc('') _hc('%s *', field.c_field_type) - _h('%s (%s /**< */);', field.c_accessor_name, params[idx][0]) - _c('%s (%s /**< */)', field.c_accessor_name, params[idx][0]) + _h('%s (%s);', field.c_accessor_name, params[idx][0]) + _c('%s (%s)', field.c_accessor_name, params[idx][0]) _c('{') if switch_obj is not None: @@ -1586,14 +1586,14 @@ def _c_accessors_list(self, field): _hc('') _hc('int') if switch_obj is not None: - _hc('%s (const %s *R /**< */,', field.c_length_name, R_obj.c_type) + _hc('%s (const %s *R,', field.c_length_name, R_obj.c_type) spacing = ' '*(len(field.c_length_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S);', spacing, S_obj.c_type) + _c('%sconst %s *S)', spacing, S_obj.c_type) length = _c_accessor_get_expr(field.type.expr, fields) else: - _h('%s (const %s *R /**< */);', field.c_length_name, c_type) - _c('%s (const %s *R /**< */)', field.c_length_name, c_type) + _h('%s (const %s *R);', field.c_length_name, c_type) + _c('%s (const %s *R)', field.c_length_name, c_type) length = _c_accessor_get_expr(field.type.expr, fields) _c('{') _c(' return %s;', length) @@ -1603,13 +1603,13 @@ def _c_accessors_list(self, field): _hc('') _hc('xcb_generic_iterator_t') if switch_obj is not None: - _hc('%s (const %s *R /**< */,', field.c_end_name, R_obj.c_type) + _hc('%s (const %s *R,', field.c_end_name, R_obj.c_type) spacing = ' '*(len(field.c_end_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S);', spacing, S_obj.c_type) + _c('%sconst %s *S)', spacing, S_obj.c_type) else: - _h('%s (const %s *R /**< */);', field.c_end_name, c_type) - _c('%s (const %s *R /**< */)', field.c_end_name, c_type) + _h('%s (const %s *R);', field.c_end_name, c_type) + _c('%s (const %s *R)', field.c_end_name, c_type) _c('{') _c(' xcb_generic_iterator_t i;') @@ -1635,13 +1635,13 @@ def _c_accessors_list(self, field): _hc('') _hc('%s', field.c_iterator_type) if switch_obj is not None: - _hc('%s (const %s *R /**< */,', field.c_iterator_name, R_obj.c_type) + _hc('%s (const %s *R,', field.c_iterator_name, R_obj.c_type) spacing = ' '*(len(field.c_iterator_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S);', spacing, S_obj.c_type) + _c('%sconst %s *S)', spacing, S_obj.c_type) else: - _h('%s (const %s *R /**< */);', field.c_iterator_name, c_type) - _c('%s (const %s *R /**< */)', field.c_iterator_name, c_type) + _h('%s (const %s *R);', field.c_iterator_name, c_type) + _c('%s (const %s *R)', field.c_iterator_name, c_type) _c('{') _c(' %s i;', field.c_iterator_type) @@ -1736,10 +1736,10 @@ def _c_complex(self, force_packed = False): # necessary for unserialize to work (self.is_switch and field.type.is_switch)): spacing = ' ' * (maxtypelen - len(field.c_field_type)) - _h('%s %s%s %s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) + _h('%s %s%s %s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) else: spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) - _h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) + _h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) if not self.is_switch: for field in struct_fields: @@ -1916,9 +1916,9 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f spacing = ' ' * (maxtypelen - len('xcb_connection_t')) comma = ',' if len(param_fields) else ');' - _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) + _h('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) comma = ',' if len(param_fields) else ')' - _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) + _c('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) func_spacing = ' ' * (len(func_name) + 2) count = len(param_fields) @@ -1931,10 +1931,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f c_pointer = '*' spacing = ' ' * (maxtypelen - len(c_field_const_type)) comma = ',' if count else ');' - _h('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, + _h('%s%s%s %s%s%s', func_spacing, c_field_const_type, spacing, c_pointer, field.c_field_name, comma) comma = ',' if count else ')' - _c('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, + _c('%s%s%s %s%s%s', func_spacing, c_field_const_type, spacing, c_pointer, field.c_field_name, comma) count = 2 @@ -2132,10 +2132,10 @@ def _c_reply(self, name): _h(' */') _c('') _hc('%s *', self.c_reply_type) - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1) - _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type) - _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2) - _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2) + _hc('%s (xcb_connection_t%s *c,', self.c_reply_name, spacing1) + _hc('%s%s cookie,', spacing3, self.c_cookie_type) + _h('%sxcb_generic_error_t%s **e);', spacing3, spacing2) + _c('%sxcb_generic_error_t%s **e)', spacing3, spacing2) _c('{') if len(unserialize_fields)>0: @@ -2192,9 +2192,9 @@ def _c_reply_fds(self, name): _h(' */') _c('') _hc('int *') - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_fds_name, spacing1) - _h('%s%s *reply /**< */);', spacing3, self.c_reply_type) - _c('%s%s *reply /**< */)', spacing3, self.c_reply_type) + _hc('%s (xcb_connection_t%s *c,', self.c_reply_fds_name, spacing1) + _h('%s%s *reply);', spacing3, self.c_reply_type) + _c('%s%s *reply)', spacing3, self.c_reply_type) _c('{') _c(' return xcb_get_reply_fds(c, reply, sizeof(%s) + 4 * reply->length);', self.c_reply_type) @@ -2221,7 +2221,7 @@ def _c_cookie(self, name): _h(' * @brief %s', self.c_cookie_type) _h(' **/') _h('typedef struct %s {', self.c_cookie_type) - _h(' unsigned int sequence; /**< */') + _h(' unsigned int sequence;') _h('} %s;', self.c_cookie_type) def _man_request(self, name, cookie_type, void, aux): @@ -2304,7 +2304,7 @@ def _man_request(self, name, cookie_type, void, aux): else: spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) f.write('ELSE %s = %s\n' % (field.c_field_type, field.c_field_name)) - #_h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) + #_h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) if not self.is_switch: for field in struct_fields: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:14 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:14 +0300 Subject: [Xcb] [PATCH libxcb 12/18] c_client.py: don't add /* */ before references to 'S' In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-13-git-send-email-ran234@gmail.com> The name can be understood from the type of S already. For examples, look for 'S->' in xkb.c or xinput.c. Signed-off-by: Ran Benita --- src/c_client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index c1839c7..eab4006 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1541,8 +1541,7 @@ def _c_accessors_list(self, field): fields.update(_c_helper_field_mapping(toplevel_switch, [('S', '->', toplevel_switch)], flat=True)) # initialize prefix for everything "below" S - prefix_str = '/* %s */ S' % toplevel_switch.name[-1] - prefix = [(prefix_str, '->', toplevel_switch)] + prefix = [('S', '->', toplevel_switch)] # look for fields in the remaining containers for p in parents[2:] + [self]: @@ -2398,8 +2397,7 @@ def _man_request(self, name, cookie_type, void, aux): fields.update(_c_helper_field_mapping(toplevel_switch, [('S', '->', toplevel_switch)], flat=True)) # initialize prefix for everything "below" S - prefix_str = '/* %s */ S' % toplevel_switch.name[-1] - prefix = [(prefix_str, '->', toplevel_switch)] + prefix = [('S', '->', toplevel_switch)] # look for fields in the remaining containers for p in parents[2:] + [self]: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:15 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:15 +0300 Subject: [Xcb] [PATCH libxcb 13/18] c_client.py: use C99 initializers instead of comments In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-14-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index eab4006..1c77bb0 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1948,10 +1948,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f _c('{') _c(' static const xcb_protocol_request_t xcb_req = {') - _c(' /* count */ %d,', count) - _c(' /* ext */ %s,', func_ext_global) - _c(' /* opcode */ %s,', self.c_request_name.upper()) - _c(' /* isvoid */ %d', 1 if void else 0) + _c(' .count = %d,', count) + _c(' .ext = %s,', func_ext_global) + _c(' .opcode = %s,', self.c_request_name.upper()) + _c(' .isvoid = %d', 1 if void else 0) _c(' };') _c('') -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:16 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:16 +0300 Subject: [Xcb] [PATCH libxcb 14/18] c_client.py: remove commented debug statements In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-15-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 1c77bb0..686eca5 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -648,7 +648,6 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): code_lines.append('%s /* insert padding */' % space) code_lines.append('%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) -# code_lines.append('%s printf("automatically inserting padding: %%%%d\\n", xcb_pad);' % space) code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) if not postpone: @@ -1971,8 +1970,6 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f _c(' unsigned int xcb_tmp_len;') _c(' char *xcb_tmp;') _c('') - # simple request call tracing -# _c(' printf("in function %s\\n");' % func_name) # fixed size fields for field in wire_fields: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:17 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:17 +0300 Subject: [Xcb] [PATCH libxcb 15/18] c_client.py: simplify _c_reply_has_fds() In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-16-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 686eca5..d561e04 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -2165,10 +2165,7 @@ def _c_reply(self, name): _c('}') def _c_reply_has_fds(self): - for field in self.fields: - if field.isfd: - return True - return False + return any(field.isfd for field in self.fields) def _c_reply_fds(self, name): ''' -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:18 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:18 +0300 Subject: [Xcb] [PATCH libxcb 16/18] c_client.py: spell out keyword arguments in c_request() for clarity In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-17-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index d561e04..e22dc52 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -2749,11 +2749,11 @@ def c_request(self, name): _c_complex(self.reply) # Request prototypes has_fds = _c_reply_has_fds(self.reply) - _c_request_helper(self, name, self.c_cookie_type, False, True, False, has_fds) - _c_request_helper(self, name, self.c_cookie_type, False, False, False, has_fds) + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=False, reply_fds=has_fds) + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=False, reply_fds=has_fds) if self.c_need_aux: - _c_request_helper(self, name, self.c_cookie_type, False, True, True, has_fds) - _c_request_helper(self, name, self.c_cookie_type, False, False, True, has_fds) + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=True, reply_fs=has_fds) + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=True, reply_fs=has_fds) # Reply accessors _c_accessors(self.reply, name + ('reply',), name) _c_reply(self, name) @@ -2761,16 +2761,16 @@ def c_request(self, name): _c_reply_fds(self, name) else: # Request prototypes - _c_request_helper(self, name, 'xcb_void_cookie_t', True, False) - _c_request_helper(self, name, 'xcb_void_cookie_t', True, True) + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False) + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True) if self.c_need_aux: - _c_request_helper(self, name, 'xcb_void_cookie_t', True, False, True) - _c_request_helper(self, name, 'xcb_void_cookie_t', True, True, True) + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False, aux=True) + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True, aux=True) # We generate the manpage afterwards because _c_type_setup has been called. # TODO: what about aux helpers? cookie_type = self.c_cookie_type if self.reply else 'xcb_void_cookie_t' - _man_request(self, name, cookie_type, not self.reply, False) + _man_request(self, name, cookie_type, void=not self.reply, aux=False) def c_event(self, name): ''' -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:19 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:19 +0300 Subject: [Xcb] [PATCH libxcb 17/18] c_client.py: remove duplicated `cookie_type` argument for requests In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-18-git-send-email-ran234@gmail.com> It is implied already inside the function by the `void` argument. Signed-off-by: Ran Benita --- src/c_client.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index e22dc52..bb2de13 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1772,7 +1772,7 @@ def c_union(self, name): _c_complex(self) _c_iterator(self, name) -def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_fds=False): +def _c_request_helper(self, name, void, regular, aux=False, reply_fds=False): ''' Declares a request function. ''' @@ -1910,7 +1910,7 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f _h(' * placed in the event queue.') _h(' */') _c('') - _hc('%s', cookie_type) + _hc('%s', func_cookie) spacing = ' ' * (maxtypelen - len('xcb_connection_t')) comma = ',' if len(param_fields) else ');' @@ -2217,7 +2217,7 @@ def _c_cookie(self, name): _h(' unsigned int sequence;') _h('} %s;', self.c_cookie_type) -def _man_request(self, name, cookie_type, void, aux): +def _man_request(self, name, void, aux): param_fields = [f for f in self.fields if f.visible] func_name = self.c_request_name if not aux else self.c_aux_name @@ -2263,7 +2263,8 @@ def _man_request(self, name, cookie_type, void, aux): f.write('.SS Request function\n') f.write('.HP\n') base_func_name = self.c_request_name if not aux else self.c_aux_name - f.write('%s \\fB%s\\fP(xcb_connection_t\\ *\\fIconn\\fP, %s\n' % (cookie_type, base_func_name, prototype)) + func_cookie = 'xcb_void_cookie_t' if void else self.c_cookie_type + f.write('%s \\fB%s\\fP(xcb_connection_t\\ *\\fIconn\\fP, %s\n' % (func_cookie, base_func_name, prototype)) create_link('%s_%s' % (base_func_name, ('checked' if void else 'unchecked'))) if not void: f.write('.PP\n') @@ -2559,7 +2560,7 @@ def _man_request(self, name, cookie_type, void, aux): 'handle errors in the event loop instead, use ' '\\fI%s_unchecked\\fP. See \\fBxcb-requests(%s)\\fP for ' 'details.\n') % - (cookie_type, self.c_reply_name, base_func_name, section)) + (self.c_cookie_type, self.c_reply_name, base_func_name, section)) f.write('.SH ERRORS\n') if hasattr(self, "doc") and self.doc: for errtype, errtext in sorted(self.doc.errors.items()): @@ -2749,11 +2750,11 @@ def c_request(self, name): _c_complex(self.reply) # Request prototypes has_fds = _c_reply_has_fds(self.reply) - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=False, reply_fds=has_fds) - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=False, reply_fds=has_fds) + _c_request_helper(self, name, void=False, regular=True, aux=False, reply_fds=has_fds) + _c_request_helper(self, name, void=False, regular=False, aux=False, reply_fds=has_fds) if self.c_need_aux: - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=True, reply_fs=has_fds) - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=True, reply_fs=has_fds) + _c_request_helper(self, name, void=False, regular=True, aux=True, reply_fs=has_fds) + _c_request_helper(self, name, void=False, regular=False, aux=True, reply_fs=has_fds) # Reply accessors _c_accessors(self.reply, name + ('reply',), name) _c_reply(self, name) @@ -2761,16 +2762,15 @@ def c_request(self, name): _c_reply_fds(self, name) else: # Request prototypes - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False) - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True) + _c_request_helper(self, name, void=True, regular=False) + _c_request_helper(self, name, void=True, regular=True) if self.c_need_aux: - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False, aux=True) - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True, aux=True) + _c_request_helper(self, name, void=True, regular=False, aux=True) + _c_request_helper(self, name, void=True, regular=True, aux=True) # We generate the manpage afterwards because _c_type_setup has been called. # TODO: what about aux helpers? - cookie_type = self.c_cookie_type if self.reply else 'xcb_void_cookie_t' - _man_request(self, name, cookie_type, void=not self.reply, aux=False) + _man_request(self, name, void=not self.reply, aux=False) def c_event(self, name): ''' -- 2.1.2 From ran234 at gmail.com Sun Oct 12 11:58:20 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 21:58:20 +0300 Subject: [Xcb] [PATCH libxcb 18/18] c_client.py: make condition easier to follow in _c_complex() In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <1413140300-20075-19-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- src/c_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index bb2de13..d77c836 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1716,9 +1716,7 @@ def _c_complex(self, force_packed = False): maxtypelen = 0 for field in self.fields: - if not field.type.fixed_size() and not self.is_switch and not self.is_union: - continue - if field.wire: + if field.wire and (field.type.fixed_size() or self.is_switch or self.is_union): struct_fields.append(field) for field in struct_fields: -- 2.1.2 From ran234 at gmail.com Sun Oct 12 12:00:28 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 12 Oct 2014 22:00:28 +0300 Subject: [Xcb] [PATCH proto] xml-xcb.txt: mention that case/bitcase can have a name Message-ID: <1413140428-20262-1-git-send-email-ran234@gmail.com> Signed-off-by: Ran Benita --- doc/xml-xcb.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/xml-xcb.txt b/doc/xml-xcb.txt index 235958d..b038984 100644 --- a/doc/xml-xcb.txt +++ b/doc/xml-xcb.txt @@ -244,8 +244,8 @@ enum; the value is restricted to one of the constants named in the enum. instead for new protocol definitions. switch expression - bitcase expression(s), fields - case expression(s), fields + bitcase expression(s), fields + case expression(s), fields This element represents conditional inclusion of fields. It can be viewed -- 2.1.2 From remi at gentoo.org Sun Oct 12 13:40:09 2014 From: remi at gentoo.org (=?windows-1252?Q?R=E9mi_Cardona?=) Date: Sun, 12 Oct 2014 22:40:09 +0200 Subject: [Xcb] [PATCH libxcb 10/18] c_client.py: use pattern matching with enumerate() In-Reply-To: <1413140300-20075-11-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-11-git-send-email-ran234@gmail.com> Message-ID: <543AE729.9030602@gentoo.org> Le 12/10/2014 20:58, Ran Benita a ?crit : > @@ -483,8 +483,7 @@ def _c_helper_resolve_field_names (prefix): > all_fields = {} > tmp_prefix = [] > # look for fields in the remaining containers > - for idx, p in enumerate(prefix): > - name, sep, obj = p > + for (idx, (name, sep, obj)) in enumerate(prefix): The outer parenthesis can be dropped. > @@ -833,7 +832,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, > if not self.is_case_or_bitcase: > code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) > else: > - scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] > + scoped_name = [obj.c_type if idx==0 else name for idx, (name, sep, obj) in enumerate(prefix)] sep is unused, use _ instead (just like you did in the following chunk). Patch looks otherwise good. R?mi From remi at gentoo.org Sun Oct 12 13:54:34 2014 From: remi at gentoo.org (=?windows-1252?Q?R=E9mi_Cardona?=) Date: Sun, 12 Oct 2014 22:54:34 +0200 Subject: [Xcb] [PATCH libxcb 00/18] Small improvements to the generator In-Reply-To: <1413140300-20075-1-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> Message-ID: <543AEA8A.8000103@gentoo.org> While I can't vouch for any of the "business logic" of xcb's codegen, I can review the Python bits: Patch 1 through 16 are pythonically correct, so: Reviewed-by: R?mi Cardona (with a small nit for patch 10, see reply) Patch 11 touches Doxygen with which I'm no longer familiar, but it certainly looks OK. As for the last 2: Patch 18 is definitely not strictly identical to the previous code (though that does not mean it is wrong, just that someone else should look at it). Patch 17 is beyond my knowledge of xcb's internals. Cheers, R?mi From tapaswenipathak at gmail.com Sun Oct 12 21:47:19 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:17:19 +0530 Subject: [Xcb] [PATCH xpyb 00/10] Delete explicit comparison with NULL, fix coding style Message-ID: This patchset deletes explicit compariosn with NULL in C files of xpyb and a minor 3 space coding style issue in file conn.c if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. Tapasweni Pathak (10): conn.c: Delete explicit comparison with NULL error.c: Delete explicit comparison with NULL event.c: Delete explicit comparison with NULL except.c: Delete explicit comparison with NULL ext.c: Delete explicit comparison with NULL iter.c: Delete explicit comparison with NULL list.c: Delete explicit comparison with NULL module.c: Delete explicit comparison with NULL protobj.c: Delete explicit comparison with NULL conn.c: Add space before a line src/conn.c | 42 +++++++++++++++++++++--------------------- src/error.c | 4 ++-- src/event.c | 4 ++-- src/except.c | 8 ++++---- src/ext.c | 2 +- src/iter.c | 12 ++++++------ src/list.c | 10 +++++----- src/module.c | 16 ++++++++-------- src/protobj.c | 2 +- 9 files changed, 50 insertions(+), 50 deletions(-) -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:47:40 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:17:40 +0530 Subject: [Xcb] [PATCH xpyb 01/10] conn.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: <1ffbc159e70f58bb9156e3892f4b2f56c6145bed.1413175055.git.tapaswenipathak@gmail.com> if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in conn.c file. Signed-off-by: Tapasweni Pathak --- src/conn.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/conn.c b/src/conn.c index 1b21d17..e5958f0 100644 --- a/src/conn.c +++ b/src/conn.c @@ -14,7 +14,7 @@ int xpybConn_invalid(xpybConn *self) { - if (self->conn == NULL) { + if (!self->conn) { PyErr_SetString(xpybExcept_base, "Invalid connection."); return 1; } @@ -49,15 +49,15 @@ int xpybConn_init_struct(xpybConn *self, PyObject *core_type) { self->core = PyObject_CallFunctionObjArgs(core_type, self, NULL); - if (self->core == NULL) + if (!self->core) return -1; self->dict = PyDict_New(); - if (self->dict == NULL) + if (!self->dict) return -1; self->extcache = PyDict_New(); - if (self->extcache == NULL) + if (!self->extcache) return -1; self->wrapped = 0; @@ -78,7 +78,7 @@ xpybConn_init(xpybConn *self, PyObject *args, PyObject *kw) int authlen, fd = -1; /* Make sure core was set. */ - if (xpybModule_core == NULL) { + if (!xpybModule_core) { PyErr_SetString(xpybExcept_base, "No core protocol object has been set. Did you import xcb.xproto?"); return -1; } @@ -89,7 +89,7 @@ xpybConn_init(xpybConn *self, PyObject *args, PyObject *kw) return -1; /* Set up authorization */ - if (authstr != NULL) { + if (authstr) { if (xpyb_parse_auth(authstr, authlen, &auth) < 0) return -1; authptr = &auth; @@ -127,17 +127,17 @@ xpybConn_load_ext(xpybConn *self, PyObject *key) ext = (xpybExt *)PyDict_GetItem(self->extcache, key); Py_XINCREF(ext); - if (ext == NULL) { + if (!ext) { /* Look up the extension type in the global dictionary. */ type = PyDict_GetItem(xpybModule_extdict, key); - if (type == NULL) { + if (!type) { PyErr_SetString(xpybExcept_ext, "No extension found for that key."); return NULL; } /* Call the type object to get a new xcb.Extension object. */ ext = (xpybExt *)PyObject_CallFunctionObjArgs(type, self, key, NULL); - if (ext == NULL) + if (!ext) return NULL; /* Get the opcode and base numbers. */ @@ -166,7 +166,7 @@ xpybConn_setup_helper(xpybConn *self, xpybExt *ext, PyObject *events, PyObject * if (opcode >= self->events_len) { newlen = opcode + 1; newmem = realloc(self->events, newlen * sizeof(PyObject *)); - if (newmem == NULL) + if (!newmem) return -1; memset(newmem + self->events_len, 0, (newlen - self->events_len) * sizeof(PyObject *)); self->events = newmem; @@ -181,7 +181,7 @@ xpybConn_setup_helper(xpybConn *self, xpybExt *ext, PyObject *events, PyObject * if (opcode >= self->errors_len) { newlen = opcode + 1; newmem = realloc(self->errors, newlen * sizeof(PyObject *)); - if (newmem == NULL) + if (!newmem) return -1; memset(newmem + self->errors_len, 0, (newlen - self->errors_len) * sizeof(PyObject *)); self->errors = newmem; @@ -210,12 +210,12 @@ xpybConn_setup(xpybConn *self) ext = NULL; while (PyDict_Next(xpybModule_ext_events, &i, &key, &events)) { errors = PyDict_GetItem(xpybModule_ext_errors, key); - if (errors == NULL) + if (!errors) goto out; Py_XDECREF(ext); ext = xpybConn_load_ext(self, key); - if (ext == NULL) + if (!ext) goto out; if (ext->present) if (xpybConn_setup_helper(self, ext, events, errors) < 0) @@ -277,7 +277,7 @@ xpybConn_getattro(xpybConn *self, PyObject *obj) goto out2; Py_XINCREF(result = PyDict_GetItem(self->dict, obj)); - if (result != NULL || PyErr_Occurred()) + if (result || PyErr_Occurred()) return result; return xpybConn_type.tp_base->tp_getattro((PyObject *)self, obj); @@ -319,7 +319,7 @@ xpybConn_call(xpybConn *self, PyObject *args, PyObject *kw) /* Check our dictionary of cached values */ ext = xpybConn_load_ext(self, key); - if (ext != NULL && !ext->present) { + if (ext && !ext->present) { PyErr_SetString(xpybExcept_ext, "Extension not present on server."); Py_DECREF(ext); return NULL; @@ -363,7 +363,7 @@ static PyMemberDef xpybConn_members[] = { static PyObject * xpybConn_has_error(xpybConn *self, PyObject *args) { - if (self->conn == NULL) { + if (!self->conn) { PyErr_SetString(xpybExcept_base, "Invalid connection."); return NULL; } @@ -408,10 +408,10 @@ xpybConn_get_setup(xpybConn *self, PyObject *args) if (xpybConn_invalid(self)) return NULL; - if (self->setup == NULL) { + if (!self->setup) { s = xcb_get_setup(self->conn); shim = PyBuffer_FromMemory((void *)s, 8 + s->length * 4); - if (shim == NULL) + if (!shim) return NULL; type = (PyObject *)xpybModule_setup; self->setup = PyObject_CallFunctionObjArgs(type, shim, Py_False, NULL); @@ -432,7 +432,7 @@ xpybConn_wait_for_event(xpybConn *self, PyObject *args) data = xcb_wait_for_event(self->conn); - if (data == NULL) { + if (!data) { PyErr_SetString(PyExc_IOError, "I/O error on X server connection."); return NULL; } @@ -455,7 +455,7 @@ xpybConn_poll_for_event(xpybConn *self, PyObject *args) data = xcb_poll_for_event(self->conn); - if (data == NULL) { + if (!data) { if (xpybConn_invalid(self)) return NULL; else -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:48:00 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:18:00 +0530 Subject: [Xcb] [PATCH xpyb 02/10] error.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: <6de308c019548b3f6cf5b7f80c2f055740373d28.1413175055.git.tapaswenipathak@gmail.com> if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in error.c file. Signed-off-by: Tapasweni Pathak --- src/error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.c b/src/error.c index c51530b..f669485 100644 --- a/src/error.c +++ b/src/error.c @@ -24,11 +24,11 @@ xpybError_set(xpybConn *conn, xcb_generic_error_t *e) } shim = PyBuffer_FromMemory(e, sizeof(*e)); - if (shim == NULL) + if (!shim) return 1; error = PyObject_CallFunctionObjArgs(type, shim, NULL); - if (error != NULL) + if (error) PyErr_SetObject(except, error); Py_DECREF(shim); return 1; -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:48:22 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:18:22 +0530 Subject: [Xcb] [PATCH xpyb 03/10] event.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: <300cb8fc8bbd1338a0e1b09b9de96c664c94618a.1413175055.git.tapaswenipathak@gmail.com> if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in event.c file. Signed-off-by: Tapasweni Pathak --- src/event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event.c b/src/event.c index 2ab7eac..d166158 100644 --- a/src/event.c +++ b/src/event.c @@ -13,11 +13,11 @@ xpybEvent_create(xpybConn *conn, xcb_generic_event_t *e) unsigned char opcode = e->response_type & 0x7f; PyObject *shim, *event, *type = (PyObject *)&xpybEvent_type; - if (opcode < conn->events_len && conn->events[opcode] != NULL) + if (opcode < conn->events_len && conn->events[opcode]) type = conn->events[opcode]; shim = PyBuffer_FromMemory(e, sizeof(*e)); - if (shim == NULL) + if (!shim) return NULL; event = PyObject_CallFunctionObjArgs(type, shim, NULL); -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:48:49 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:18:49 +0530 Subject: [Xcb] [PATCH xpyb 04/10] except.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: <39111faacf86b56366d07f9e4d6ed86693db935b.1413175055.git.tapaswenipathak@gmail.com> if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in except.c file. Signed-off-by: Tapasweni Pathak --- src/except.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/except.c b/src/except.c index 3e9ed3f..4ec4d52 100644 --- a/src/except.c +++ b/src/except.c @@ -9,28 +9,28 @@ PyObject *xpybExcept_proto; int xpybExcept_modinit(PyObject *m) { xpybExcept_base = PyErr_NewException("xcb.Exception", NULL, NULL); - if (xpybExcept_base == NULL) + if (!xpybExcept_base) return -1; Py_INCREF(xpybExcept_base); if (PyModule_AddObject(m, "Exception", xpybExcept_base) < 0) return -1; xpybExcept_conn = PyErr_NewException("xcb.ConnectException", xpybExcept_base, NULL); - if (xpybExcept_conn == NULL) + if (!xpybExcept_conn) return -1; Py_INCREF(xpybExcept_conn); if (PyModule_AddObject(m, "ConnectException", xpybExcept_conn) < 0) return -1; xpybExcept_ext = PyErr_NewException("xcb.ExtensionException", xpybExcept_base, NULL); - if (xpybExcept_ext == NULL) + if (!xpybExcept_ext) return -1; Py_INCREF(xpybExcept_ext); if (PyModule_AddObject(m, "ExtensionException", xpybExcept_ext) < 0) return -1; xpybExcept_proto = PyErr_NewException("xcb.ProtocolException", xpybExcept_base, NULL); - if (xpybExcept_proto == NULL) + if (!xpybExcept_proto) return -1; Py_INCREF(xpybExcept_proto); if (PyModule_AddObject(m, "ProtocolException", xpybExcept_proto) < 0) -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:49:14 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:19:14 +0530 Subject: [Xcb] [PATCH xpyb 05/10] ext.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in ext.c file. Signed-off-by: Tapasweni Pathak --- src/ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext.c b/src/ext.c index 6475850..f693396 100644 --- a/src/ext.c +++ b/src/ext.c @@ -108,7 +108,7 @@ xpybExt_send_request(xpybExt *self, PyObject *args, PyObject *kw) return NULL; if (!request->is_void) - if (reply == NULL || !PyType_IsSubtype(reply, &xpybReply_type)) { + if (!reply || !PyType_IsSubtype(reply, &xpybReply_type)) { PyErr_SetString(xpybExcept_base, "Reply type missing or not derived from xcb.Reply."); return NULL; } -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:49:36 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:19:36 +0530 Subject: [Xcb] [PATCH xpyb 06/10] iter.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in iter.c file. Signed-off-by: Tapasweni Pathak --- src/iter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/iter.c b/src/iter.c index 5368f24..138a214 100644 --- a/src/iter.c +++ b/src/iter.c @@ -27,7 +27,7 @@ xpybIter_pop(xpybIter *self) cur = PyList_GET_ITEM(self->stack, self->top); item = PyIter_Next(cur); - if (item == NULL) { + if (!item) { if (PyErr_Occurred() || self->top < 1) return NULL; if (PyList_SetSlice(self->stack, self->top, self->top + 1, NULL) < 0) @@ -38,7 +38,7 @@ xpybIter_pop(xpybIter *self) if (PySequence_Check(item)) { next = PyObject_GetIter(item); - if (next == NULL) + if (!next) goto err1; if (PyList_Append(self->stack, next) < 0) goto err2; @@ -92,11 +92,11 @@ xpybIter_get(xpybIter *self) Py_CLEAR(self->stack); self->stack = PyList_New(1); - if (self->stack == NULL) + if (!self->stack) return NULL; iterator = PyObject_GetIter(self->list); - if (iterator == NULL) + if (!iterator) return NULL; PyList_SET_ITEM(self->stack, 0, iterator); @@ -113,12 +113,12 @@ xpybIter_next(xpybIter *self) Py_ssize_t i; tuple = PyTuple_New(self->groupsize); - if (tuple == NULL) + if (!tuple) return NULL; for (i = 0; i < self->groupsize; i++) { tmp = xpybIter_pop(self); - if (tmp == NULL) { + if (!tmp) { if (i > 0 && !PyErr_Occurred()) xpybIter_err(self); goto end; -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:49:53 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:19:53 +0530 Subject: [Xcb] [PATCH xpyb 07/10] list.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in list.c file. Signed-off-by: Tapasweni Pathak --- src/list.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/list.c b/src/list.c index 19b2551..0e2d478 100644 --- a/src/list.c +++ b/src/list.c @@ -61,7 +61,7 @@ xpybList_init(xpybList *self, PyObject *args, PyObject *kw) return -1; self->list = PyList_New(0); - if (self->list == NULL) + if (!self->list) return -1; if (PyObject_AsReadBuffer(parent, (const void **)&data, &datalen) < 0) @@ -77,21 +77,21 @@ xpybList_init(xpybList *self, PyObject *args, PyObject *kw) for (i = 0; i < length; i++) { if (PyString_CheckExact(type)) { obj = xpybList_build(type, length, data + cur); - if (obj == NULL) + if (!obj) return -1; cur += size; } else if (size > 0) { arglist = Py_BuildValue("(Onn)", parent, cur, size); obj = PyEval_CallObject(type, arglist); Py_DECREF(arglist); - if (obj == NULL) + if (!obj) return -1; cur += size; } else { arglist = Py_BuildValue("(On)", parent, cur); obj = PyEval_CallObject(type, arglist); Py_DECREF(arglist); - if (obj == NULL) + if (!obj) return -1; datalen = PySequence_Size(obj); if (datalen < 0) @@ -105,7 +105,7 @@ xpybList_init(xpybList *self, PyObject *args, PyObject *kw) } self->buf = PyBuffer_FromObject(parent, offset, cur - offset); - if (self->buf == NULL) + if (!self->buf) return -1; return 0; -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:50:14 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:20:14 +0530 Subject: [Xcb] [PATCH xpyb 08/10] module.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in module.c file. Signed-off-by: Tapasweni Pathak --- src/module.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/module.c b/src/module.c index 18f0228..8e3a650 100644 --- a/src/module.c +++ b/src/module.c @@ -42,7 +42,7 @@ xpyb_connect(PyObject *self, PyObject *args, PyObject *kw) { xpybConn *conn = PyObject_New(xpybConn, &xpybConn_type); - if (conn == NULL) + if (!conn) return NULL; if(xpybConn_init(conn, args, kw) < 0) @@ -59,7 +59,7 @@ xpyb_wrap(PyObject *self, PyObject *args) xpybConn *conn; /* Make sure core was set. */ - if (xpybModule_core == NULL) { + if (!xpybModule_core) { PyErr_SetString(xpybExcept_base, "No core protocol object has been set. Did you import xcb.xproto?"); return NULL; } @@ -102,7 +102,7 @@ xpyb_add_core(PyObject *self, PyObject *args) PyTypeObject *value, *setup; PyObject *events, *errors; - if (xpybModule_core != NULL) + if (xpybModule_core) Py_RETURN_NONE; if (!PyArg_ParseTuple(args, "O!O!O!O!", &PyType_Type, &value, &PyType_Type, &setup, @@ -161,7 +161,7 @@ xpyb_resize_obj(PyObject *self, PyObject *args) return NULL; buf = PyBuffer_FromObject(obj->buf, 0, size); - if (buf == NULL) + if (!buf) return NULL; Py_CLEAR(obj->buf); @@ -245,15 +245,15 @@ initxcb(void) { /* Create module object */ PyObject *m = Py_InitModule3("xcb", XCBMethods, "XCB Python Binding."); - if (m == NULL) + if (!m) return; /* Create other internal objects */ - if ((xpybModule_extdict = PyDict_New()) == NULL) + if (!(xpybModule_extdict = PyDict_New())) return; - if ((xpybModule_ext_events = PyDict_New()) == NULL) + if (!(xpybModule_ext_events = PyDict_New())) return; - if ((xpybModule_ext_errors = PyDict_New()) == NULL) + if (!(xpybModule_ext_errors = PyDict_New())) return; /* Add integer constants */ -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:50:31 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:20:31 +0530 Subject: [Xcb] [PATCH xpyb 09/10] protobj.c: Delete explicit comparison with NULL In-Reply-To: References: Message-ID: if (pointer == NULL) is functionally equivalent to if (!pointer). Using the second will make it a bit obvious that there is a pointer involved and not an integer or something. This patch deletes explicit comaprison with NULL in protobj.c file. Signed-off-by: Tapasweni Pathak --- src/protobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protobj.c b/src/protobj.c index f76f9af..34177d7 100644 --- a/src/protobj.c +++ b/src/protobj.c @@ -25,7 +25,7 @@ xpybProtobj_init(xpybProtobj *self, PyObject *args, PyObject *kw) return -1; self->buf = PyBuffer_FromObject(parent, offset, size); - if (self->buf == NULL) + if (!self->buf) return -1; return 0; -- 1.7.9.5 From tapaswenipathak at gmail.com Sun Oct 12 21:51:08 2014 From: tapaswenipathak at gmail.com (Tapasweni Pathak) Date: Mon, 13 Oct 2014 10:21:08 +0530 Subject: [Xcb] [PATCH xpyb 10/10] conn.c: Add space before a line In-Reply-To: References: Message-ID: This patch fixes coding style issue of four space indents in file conn.c Signed-off-by: Tapasweni Pathak --- src/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conn.c b/src/conn.c index e5958f0..786053c 100644 --- a/src/conn.c +++ b/src/conn.c @@ -56,7 +56,7 @@ xpybConn_init_struct(xpybConn *self, PyObject *core_type) if (!self->dict) return -1; - self->extcache = PyDict_New(); + self->extcache = PyDict_New(); if (!self->extcache) return -1; -- 1.7.9.5 From alan.coopersmith at oracle.com Sun Oct 12 22:53:22 2014 From: alan.coopersmith at oracle.com (Alan Coopersmith) Date: Sun, 12 Oct 2014 22:53:22 -0700 Subject: [Xcb] [PATCH xpyb 01/10] conn.c: Delete explicit comparison with NULL In-Reply-To: <1ffbc159e70f58bb9156e3892f4b2f56c6145bed.1413175055.git.tapaswenipathak@gmail.com> References: <1ffbc159e70f58bb9156e3892f4b2f56c6145bed.1413175055.git.tapaswenipathak@gmail.com> Message-ID: <543B68D2.1040601@oracle.com> On 10/12/14 09:47 PM, Tapasweni Pathak wrote: > if (pointer == NULL) is functionally equivalent to > if (!pointer). > > Using the second will make it a bit obvious that there is a > pointer involved and not an integer or something. Really? I find pointer == NULL to be obviously a pointer, and !value to suggest a boolean. Neither form suggests an integer or other type. -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc From chris at DemoRecorder.com Mon Oct 13 00:52:20 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 09:52:20 +0200 Subject: [Xcb] [PATCH proto] xml-xcb.txt: mention that case/bitcase can have a name In-Reply-To: <1413140428-20262-1-git-send-email-ran234@gmail.com> References: <1413140428-20262-1-git-send-email-ran234@gmail.com> Message-ID: <543B84B4.3080500@DemoRecorder.com> On 10/12/14 21:00, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > doc/xml-xcb.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/doc/xml-xcb.txt b/doc/xml-xcb.txt > index 235958d..b038984 100644 > --- a/doc/xml-xcb.txt > +++ b/doc/xml-xcb.txt > @@ -244,8 +244,8 @@ enum; the value is restricted to one of the constants named in the enum. > instead for new protocol definitions. > > switch expression > - bitcase expression(s), fields > - case expression(s), fields > + bitcase expression(s), fields > + case expression(s), fields > > > This element represents conditional inclusion of fields. It can be viewed Good that you noticed and fixing that. Thanks! Reviewed-by: Christian Linhart Chris From chris at DemoRecorder.com Mon Oct 13 00:53:57 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 09:53:57 +0200 Subject: [Xcb] [PATCH xpyb 10/10] conn.c: Add space before a line In-Reply-To: References: Message-ID: <543B8515.9070609@DemoRecorder.com> On 10/13/14 06:51, Tapasweni Pathak wrote: > This patch fixes coding style issue of four space indents in file conn.c > > Signed-off-by: Tapasweni Pathak > --- > src/conn.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/conn.c b/src/conn.c > index e5958f0..786053c 100644 > --- a/src/conn.c > +++ b/src/conn.c > @@ -56,7 +56,7 @@ xpybConn_init_struct(xpybConn *self, PyObject *core_type) > if (!self->dict) > return -1; > > - self->extcache = PyDict_New(); > + self->extcache = PyDict_New(); > if (!self->extcache) > return -1; > > -- > 1.7.9.5 Reviewed-by: Christian Linhart Chris > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Mon Oct 13 01:17:51 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 10:17:51 +0200 Subject: [Xcb] [PATCH xpyb 01/10] conn.c: Delete explicit comparison with NULL In-Reply-To: <543B68D2.1040601@oracle.com> References: <1ffbc159e70f58bb9156e3892f4b2f56c6145bed.1413175055.git.tapaswenipathak@gmail.com> <543B68D2.1040601@oracle.com> Message-ID: <543B8AAF.9050405@DemoRecorder.com> On 10/13/14 07:53, Alan Coopersmith wrote: > On 10/12/14 09:47 PM, Tapasweni Pathak wrote: >> if (pointer == NULL) is functionally equivalent to >> if (!pointer). >> >> Using the second will make it a bit obvious that there is a >> pointer involved and not an integer or something. > > Really? I find pointer == NULL to be obviously a pointer, and !value to > suggest a boolean. Neither form suggests an integer or other type. > Yes, NULL is definitely a pointer. It is usually defined as ((void*)0). Therefore using comparison with NULL is more explicit and a clear hint to a pointer. Using "!value" and "if ( value )" is a rather implicit abbreviation. (which is rather commonly used, so could be considered a valid idiom, and therefore feels more pointer-ish to some people, depending on what type of code they usually work with.) *** In essence it boils down to the topic "explicit vs short". I usually prefer explicit over short because: with explicit the compiler is more likely to generate errors if something is used the wrong way. ( I learned that by experience. In C it is not so much of an issue. But in C++ there is a real danger to shoot yourself in the foot by making too much implicit stuff, such as defining operator bool for class... But that's another story. ) So my personal opinion is not to merge those changes which remove the NULLs, i.e. patches 1-9. But I won't object if a majority votes for removing the NULLs. Chris From chris at DemoRecorder.com Mon Oct 13 01:57:35 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 10:57:35 +0200 Subject: [Xcb] [PATCH libxcb 2/3] generator: support lists of structs which contain a switch In-Reply-To: <20141012163345.GA6364@ran> References: <53F655AE.5000300@DemoRecorder.com> <1408653356-21191-2-git-send-email-chris@demorecorder.com> <20141012163345.GA6364@ran> Message-ID: <543B93FF.8020403@DemoRecorder.com> On 10/12/14 18:33, Ran Benita wrote: > Mentioning a request which needs this in the commit message would be > nice! The whole patchset is for getting the reply of request QueryDeviceState to work. So it is at least needed there. (and probably needed for more requests which I completed in the xml later. ) I guess I should mention such an example-request for each individual patch and not just in the start-message of a patch-thread, so that all of the info is in one place for reviewers. > > On Thu, Aug 21, 2014 at 10:35:55PM +0200, Christian Linhart wrote: >> This essentially requires to have a correct sizeof-function >> for the struct. >> This in turn requires a sizeof-function for the switch, too. >> >> Making a sizeof-function for the switch is triggered by >> replacing "elif" by "if" in the first change of this patch. >> This way, c_need_sizeof is also set to True for switches if appropriate. >> >> The _c_serialize_helper_switch_field function has to support >> the context "sizeof": >> This is done in the second change of this patch >> >> The third change of this patch fixes an alignment error: >> It does not make sense to base the padding on the struct-type >> which is generated for switch because this struct does not >> represent the protocol. Rather it is the output of deserialization. >> ( The implicit padding for var-sized fields has other issues, IMHO, >> but I am not touching these now...) >> >> The effect on the generated code for the current xml-files >> is as follows: >> * several additional sizeof-functions are generated >> * the fix of the alignment error only changes one place >> in the XKB-extension for the GetKbdByName-reply. >> This is no problem because that reply in its current form >> is broken/unfinished anyways. >> >> Note: >> This patch also fixes a problem in the generator when >> a fixed-size list is the last field of a case or bitcase. >> >> --- >> src/c_client.py | 14 ++++++++++++-- >> 1 file changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/src/c_client.py b/src/c_client.py >> index fa59fff..1ed486c 100644 >> --- a/src/c_client.py >> +++ b/src/c_client.py >> @@ -354,15 +354,16 @@ def _c_type_setup(self, name, postfix): >> if field.type.is_list and not field.type.member.fixed_size(): >> field.c_pointer = '*' >> >> if field.type.is_switch: >> field.c_pointer = '*' >> field.c_field_const_type = 'const ' + field.c_field_type >> self.c_need_aux = True >> - elif not field.type.fixed_size() and not field.type.is_case_or_bitcase: >> + >> + if not field.type.fixed_size() and not field.type.is_case_or_bitcase: >> self.c_need_sizeof = True > > The switches are internal, they can not be used directly e.g. by another > extension module, right? No necessarily. The sizeof function is not generated for the switch itself, but it is generated for a struct which contains the switch. Such a struct may be used in another extension module. Then that other extension module may need to access the sizeof function. ( So, optimizing that would require some global cross-module optimization logic in the generator. We probably want to avoid that complexity. :-) ) > I wish we could generate them only when needed, > or make them static so the compiler can prune them. > Right now most > sizeof()'s are just dead .text. But this one doesn't add too many, so OK. Good that the impact is within reason. > Second, how hard would it be to make the above condition positive? (i.e. > this or that or that). I did not change the condition from the original code in order not to break anything. Of course, one "not" can be removed by applying boolean algebra: "if not field.type.fixed_size() and not field.type.is_case_or_bitcase:" is equivalent to "if not (field.type.fixed_size() or field.type.is_case_or_bitcase):" Would that be preferable? Another option would be to define * a function named "variable_size" to the Type class in xcb/proto/xcbgen/xtypes.py: def variable_size(self): return not self.fixed_size() * a function which somehow is a positive test for something which is not a case or bitcase (and possibly excludes something more) but I am not sure whether that improves code readability because the reader needs to know how these new functions relate to their complementary counterparts... Anyways I digress now, I guess. :-) > >> >> field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t >> field.c_iterator_name = _n(name + (field.field_name, 'iterator')) # xcb_container_field_iterator >> field.c_accessor_name = _n(name + (field.field_name,)) # xcb_container_field >> field.c_length_name = _n(name + (field.field_name, 'length')) # xcb_container_field_length >> field.c_end_name = _n(name + (field.field_name, 'end')) # xcb_container_field_end >> @@ -766,14 +767,18 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr >> # call _serialize()/_unpack() to determine the actual size >> if 'serialize' == context: >> length = "%s(&%s, %s&%s%s)" % (field.type.c_serialize_name, c_switch_variable, >> c_field_names, prefix_str, field.c_field_name) >> elif context in ('unserialize', 'unpack'): >> length = "%s(xcb_tmp, %s&%s%s)" % (field.type.c_unpack_name, >> c_field_names, prefix_str, field.c_field_name) >> + elif 'sizeof' == context: >> + #remove trailing ", " from c_field_names because it will be used at end of arglist >> + my_c_field_names = c_field_names[:-2] >> + length = "%s( xcb_tmp, %s )" % ( field.type.c_sizeof_name, my_c_field_names ) >> >> return length >> # _c_serialize_helper_switch_field() >> >> def _c_serialize_helper_list_field(context, self, field, >> code_lines, temp_vars, >> space, prefix): >> @@ -1042,15 +1047,20 @@ def _c_serialize_helper_fields(context, self, >> >> if 'serialize' == context: >> if '' != length: >> code_lines.append('%s xcb_parts[xcb_parts_idx].iov_len = %s;' % (space, length)) >> code_lines.append('%s xcb_parts_idx++;' % space) >> count += 1 >> >> - code_lines.append('%s xcb_align_to = ALIGNOF(%s);' % (space, 'char' if field.c_field_type == 'void' else field.c_field_type)) >> + code_lines.append( >> + '%s xcb_align_to = ALIGNOF(%s);' >> + % (space, >> + 'char' >> + if field.c_field_type == 'void' or field.type.is_switch >> + else field.c_field_type)) > > Right, using the type doesn't make sense. Would be better as a separate > commit though! Thank you for that feedback. I'll try to separate my future changes in even smaller pieces. > (Also, maybe extract the if-else to a variable?) I'll put that on a TODO.list for a cleanup task. > > Anyway, looks good to me: > > Reviewed-by: Ran Benita Thank you for reviewing it! Chris > >> >> need_padding = True >> if self.c_var_followed_by_fixed_fields: >> need_padding = False >> >> return count >> # _c_serialize_helper_fields() >> -- >> 2.0.1 >> >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Mon Oct 13 02:59:20 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 11:59:20 +0200 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <20141012183906.GC8240@ran> References: <5406F80F.4020002@DemoRecorder.com> <20141012183906.GC8240@ran> Message-ID: <543BA278.3050406@DemoRecorder.com> On 10/12/14 20:39, Ran Benita wrote: > On Wed, Sep 03, 2014 at 01:14:23PM +0200, Christian Linhart wrote: [...] >> * make sumof more flexible. Especially support a nested expression which is evaluated >> in the scope of each list-element which is iterated to compute sumof. >> Example: >> >> num_class_info >> > > xcb_sumof() is this: > > int xcb_sumof(uint8_t *list, int len) > { > int i, s = 0; > for(i=0; i s += *list; > list++; > } > return s; > } > > So it assumes the list is of CARD8's - it is not polymorphic in any > way. It looks OK for the added sumof in this series, but I'm not sure it > matches the changes in the generator? The function xcb_sumof is not used anymore with my changes in the generator. Rather, an explicit for-loop is added before the expression that needs the sum. (with the help of several temporary variables). Generating that explicit code is easier than to make C do the needed polymorphic stuff. Here's an example: The sumof-code is between the comments /* sumof start */ and /* sumof end. Result is in xcb_pre_tmp_7 */. ==================== xcb_input_list_input_devices_infos_length (const xcb_input_list_input_devices_reply_t *R /**< */) { int xcb_pre_tmp_5; /* sumof length */ int xcb_pre_tmp_6; /* sumof loop counter */ int64_t xcb_pre_tmp_7; /* sumof sum */ const xcb_input_device_info_t* xcb_pre_tmp_8; /* sumof list ptr */ /* sumof start */ xcb_pre_tmp_5 = R->devices_len; xcb_pre_tmp_7 = 0; xcb_pre_tmp_8 = xcb_input_list_input_devices_devices(R); for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) { xcb_pre_tmp_7 += xcb_pre_tmp_8->num_class_info; xcb_pre_tmp_8++; } /* sumof end. Result is in xcb_pre_tmp_7 */ return xcb_pre_tmp_7; } ==================== So, the non-polymorphicness of function xcb_sumof is not an issue because this function is not used anymore. (but kept in there for compatibility reasons, for the case that some user-code uses it directly somewhere...) > >> >> Due to using switch-case, some structs have became obsolete. >> (and due to using struct STR from xproto instead of DeviceName because these >> are the same and the spec uses STR) >> >> This patchset contains two patches to remove these obsolete structs. >> You may reject these patches due to API-compatibility concerns. >> On the other hand, probably nobody has used the structs for request ListInputDevice >> anyways before because this request/reply didn't work anyways in the previous form. > > I think we can break xinput, it is not declared stable yet and is > disabled by default. However, it appears like some projects already use > it: > http://git.enlightenment.org/legacy/ecore.git/tree/src/lib/ecore_x/xcb/ecore_xcb_input.c > So I'm not sure... Hmmm. If we are not sure we shouldn't remove those structs. (better be safe than sorry where the safe alternative is OK, too) But, probably these structs should be marked as deprecated somehow. BTW, There are many more obsolete structs. ( primarily from my other changes where I use switch-case. ) I didn't generate patches for removing those because I wanted to wait for the discussion for this patchset. So I suggest the following procedure: * drop patches "proto 6/7" and "proto 7/7" now (I'll update my patch-repo accordingly. I'll send another message when that repo is updated. ) * after all my of patches are merged: mark all obsolete structs as deprecated: - with a comment? - or with a xml-attribute that is translated to some comment in the C-code, and possibly with some macro that expands to "__declspec( deprecated )" or "__attribute__(deprecated)" depending on the compiler used. What do you think? Chris From chris at DemoRecorder.com Mon Oct 13 04:11:45 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 13:11:45 +0200 Subject: [Xcb] [PATCH proto 06/10 V2] xinput: struct DeviceClass: full support In-Reply-To: <1409820801-43629-6-git-send-email-chris@demorecorder.com> References: <540827B6.6030600@DemoRecorder.com> <1409820801-43629-6-git-send-email-chris@demorecorder.com> Message-ID: <543BB371.4060102@DemoRecorder.com> replace uninterpreted_data by switch-case this is needed by struct XIDeviceInfo which is needed by reply XIQueryDevice. changes for V2 of this patch: * remove the pad after "sourceid" because that space is used by the first two bytes defined inside each case of the bit-case. ( noticed that problem by testing ) spec: http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n752 Note: The spec lists TOUCHCLASS.num_touches as a CARD16 but the XI2proto.h header and the xml use the type CARD8 for it. Is this a spec bug? code: http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n138 http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n117 --- src/xinput.xml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/src/xinput.xml b/src/xinput.xml index e5d0d39..e9ff19e 100644 --- a/src/xinput.xml +++ b/src/xinput.xml @@ -43,15 +43,14 @@ This requires enhancements to the xml-schema and generator such as union with selector. This will, e.g., be necessary for automatically generated byte-order conversion code, which will, e.g., be necessary for server-side xcb. This affects the following: * QueryDeviceState reply field "classes" ( structs InputState, ... ) -* struct XIDeviceInfo field "classes" ( structs DeviceClass, ... ) * SendExtensionEvent member "events" ***** xml and generator have to support of all members of a list This is needed for the following XI2-events ( and eventcopies thereof ) @@ -1723,24 +1722,64 @@ - - - - - len - 4 - - 8 - - + + type + + Key + + + num_keys + + + + Button + + + + + num_buttons + 31 + + 32 + + + + num_buttons + + + + Valuator + + + + + + + + + + + Scroll + + + + + + + + Touch + + + + -- 2.0.1 _______________________________________________ Xcb mailing list Xcb at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xcb From chris at DemoRecorder.com Mon Oct 13 06:33:23 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 15:33:23 +0200 Subject: [Xcb] [PATCH libxcb 1/6] generator: fix absname for fields with only accessor function In-Reply-To: <20141012180722.GA8240@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> Message-ID: <543BD4A3.1020606@DemoRecorder.com> On 10/12/14 20:07, Ran Benita wrote: > On Wed, Sep 03, 2014 at 01:22:36PM +0200, Christian Linhart wrote: >> Fix _c_helper_absolute_name for fields which cannot be accessed >> as a struct/union member but which can be accessed by an >> accessor function. >> >> The fix calls the accessor function in these cases. >> >> Example: >> >> >> >> len >> >> >> >> >> >> >> The sumof-expression ( ) refers to mylist1 >> which is only acessible by an accessor function. >> >> Previously, sumof was only used inside bitcases, >> where such lists are accessible by members of the >> deserialized parent struct. >> (there is a difference between deserialization of switches >> and structs.) >> --- >> src/c_client.py | 28 +++++++++++++++++++++++++++- >> 1 file changed, 27 insertions(+), 1 deletion(-) >> >> diff --git a/src/c_client.py b/src/c_client.py >> index 9216c7f..488f0e6 100644 >> --- a/src/c_client.py >> +++ b/src/c_client.py >> @@ -430,24 +430,50 @@ def _c_type_setup(self, name, postfix): >> def _c_helper_absolute_name(prefix, field=None): > > This function is strange; most of the time it generates complete garbage > (e.g. `foo->...->`) which is subsequently ignored. So it is called for > no reason many times. I do not understand the problem here, The output *is* used sometimes and that counts for the output. In most cases a symbol-resolution table is filled with all fields that are accessible starting from a given scope/type. For each field, the C-expression which accesses the field, is computed here. Of course, only a subset of that symbol-resolution table is used later. In that sense, most of the output is subsequently ignored. ( for example the function "_c_helper_field_mapping" builds such a table ) > >> """ >> turn prefix, which is a list of tuples (name, separator, Type obj) into a string >> representing a valid name in C (based on the context) >> if field is not None, append the field name as well >> """ >> prefix_str = '' >> + last_sep ='' >> for name, sep, obj in prefix: >> + if '' != last_sep: >> + prefix_str += last_sep >> prefix_str += name >> if '' == sep: > > (This can never happen. I have a patch to remove this). By quick analysis I can confirm that because the blank seps are already filled in _c_helper_resolve_field_names. How did you come to the conclusion that sep can never be the empty string here? Since this is old code not affected by my patch and since you didn't post your patch yet as far as I can tell, I suggest that you post your patch after this patchset has been merged into upstream. ( to avoid unnecessary merge-work ) Of course I could include that change in V2 of that patch but that way we would have two unrelated changes in one patch which is not good. > >> sep = '->' >> if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase >> (obj.is_switch and len(obj.parents)>1)): >> sep = '.' >> - prefix_str += sep >> + last_sep = sep >> + >> + prefix_str_without_lastsep = prefix_str >> + prefix_str += last_sep >> + >> if field is not None: >> prefix_str += _cpp(field.field_name) >> + >> + >> + if ( > > This is a formidable list of conditions. Are all of them needed? I think that yes they are all needed, but there may be a better alternative ( see below ). > Can > this be extracted to a function `field_needs_accessor` or something like > that? I have thought about that and came to the conclusion that there probably is an even better alternative than to encapsulate those conditions in a function: Probably it is better to set a flag at the place where it has already been decided that this field does not appear in a C-struct. ( or use the reverse semantic ) Then just use that flag here. That would have the advantage that these conditions need not be updated when something is changed somewhere else. Would it be OK to use this patch as it is now and that I post a simplification fix later, after this is merged to upstream? Or shall I submit V2 of this patch, with changes as I have suggested above? ( This will probably take some time ). > >> + field != None > > With `None` it is customary to write `field is None`, `field is not > None`. Yes, I am sorry for that. I have noticed that in the meantime. > >> + and hasattr(field, 'c_accessor_name') >> + and field.parent != None >> + and field.parent.is_container >> + and not field.parent.is_switch >> + and not field.parent.is_case_or_bitcase >> + and ( #the following conditions are taken from _c_accessors() >> + ( field.type.is_list and not field.type.fixed_size() ) >> + or >> + ( field.prev_varsized_field is not None >> + or not field.type.fixed_size() > > This says `or` but the parens make it look like it should be `and`? I have copied that condition from function _c_accessors and it is used like that there. The outer "or" combines the condition of an "if" and the condition of an "elif". Of course, boolean algebra would allow to remove the parentheses around the inner or. It is important that this is consistent with "_c_accessors". > >> + ) >> + ) >> + ): >> + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > > I'm not entirely convinced that this should be in this function - or the > function should be renamed. Renaming is a good idea for that function anyways. Even the existing version of that function does not compute an "absolute name" but computes a C-expression to access a specific field in the context defined by the "prefix" parameter. I suggest the following name: "_c_helper_field_access_expr" ( or something similar) > Is the above the correct thing to do in all > of the callsites? Good question. I am pretty sure that the answer is yes, because of the following: * The previous version of that function returned a C-expression that can also be used as an lvalue, i.e., C can assign something to it. * Due to my patches, the returned C-expression may be an rvalue in those cases where the old function returned something that cannot compile. ( i.e. these are the cases where the field does not occur in a C-struct) * So, the behavior only changes for those cases where the existing version of that function returns something that is not compilable. So, it doesn't break anything. * If, in those cases, the output of that function were somewhere inserted in the role of an lvalue, the C-compiler would complain. But the Compiler does not complain, which means that the resulting C-expression is only used as an rvalue. ( at least for all of our current xml-files. ) I hope that this explains it better. If you have more questions, please tell me and I'll be glad to answer them. > > Sorry for having more questions than answers; it is not for lack of > trying.. No problem. I wrote the change, so I have find the answers... :-) Chris > > Ran > >> + >> return prefix_str >> # _c_absolute_name >> >> def _c_helper_field_mapping(complex_type, prefix, flat=False): >> """ >> generate absolute names, based on prefix, for all fields starting from complex_type >> if flat == True, nested complex types are not taken into account >> -- >> 2.0.1 >> >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Mon Oct 13 06:51:50 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 15:51:50 +0200 Subject: [Xcb] [PATCH libxcb 2/6] generator: fix absname for fields with only iterator function In-Reply-To: <20141012182417.GB8240@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-2-git-send-email-chris@demorecorder.com> <20141012182417.GB8240@ran> Message-ID: <543BD8F6.7060205@DemoRecorder.com> On 10/12/14 20:24, Ran Benita wrote: > On Wed, Sep 03, 2014 at 01:22:37PM +0200, Christian Linhart wrote: >> Fix _c_helper_absolute_name for fields which can only be >> accessed with an iterator function. >> These are lists with var-sized structs as members. > > This doesn't sound right. Does the caller know how to handle each > iterator? Yes, but the caller has to find that out by itself, which is not ideal because it could lead to inconsistencies. Example is in patch "libxcb 6/6" of this patchset. I have thought about that when implementing it. An alternative would be to return meta-info in addition to the C-expression-string. That meta-info can tell the caller that this is an iterator. But that would change the caller interface of that function and required a lot of changes. Now I have a new idea which is cleaner: We could use two functions. 1. One function which returns meta-info, and that function will be used by the sumof code. 2. A compatibility-wrapper function which calls the first function but only returns the expression-string and throws an exception when this is an iterator, so it prevents that an iterator-access is inserted somewhere where it shouldn't. > Where it is used? I see that the code is reached, but this > it doesn't seem to reach the generated output anywhere (with this > libxcb+proto patchset), as opposed to the accessors in the `else` branch. It is used in sumof over lists with varsized members. As far as I can remember we do not have such lists in the xml with all of my changes. Therefore, it does not reach the generated output as you have observed. But I accidentally assumed for some time that we have such lists, so I implemented support for it, and also tested it. I thought that this feature might be useful some time in the future, so I have included it in that patchset. But I am OK with skipping it. If we skip this patch, we also have to skip patch "libxcb 6/6" of this patchset. What do you think: Skip it or improve it as outlined above? Chris > > So can we skip this patch? If not, why is it needed? > > Ran > >> --- >> src/c_client.py | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/src/c_client.py b/src/c_client.py >> index 488f0e6..35c975f 100644 >> --- a/src/c_client.py >> +++ b/src/c_client.py >> @@ -464,15 +464,20 @@ def _c_helper_absolute_name(prefix, field=None): >> ( field.type.is_list and not field.type.fixed_size() ) >> or >> ( field.prev_varsized_field is not None >> or not field.type.fixed_size() >> ) >> ) >> ): >> - prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; >> + if field.type.is_list and not field.type.member.fixed_size(): >> + #only accessible by iterator >> + prefix_str = field.c_iterator_name + "(" + prefix_str_without_lastsep + ")"; >> + else: >> + #only accessible by access function >> + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; >> >> return prefix_str >> # _c_absolute_name >> >> def _c_helper_field_mapping(complex_type, prefix, flat=False): >> """ >> generate absolute names, based on prefix, for all fields starting from complex_type >> -- >> 2.0.1 >> >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Mon Oct 13 08:09:40 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:09:40 +0200 Subject: [Xcb] [PATCH libxcb 01/18] c_client.py: remove unneeded call to get_serialize_params() In-Reply-To: <1413140300-20075-2-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-2-git-send-email-ran234@gmail.com> Message-ID: <543BEB34.1030800@DemoRecorder.com> On 10/12/14 20:58, Ran Benita wrote: > The results are not used, and the function doesn't have side effects. It is always good to remove unneeded code. Reviewed-by: Christian Linhart > > Signed-off-by: Ran Benita > --- > src/c_client.py | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 87f268b..51edda7 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -739,7 +739,6 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr > handle switch by calling _serialize() or _unpack(), depending on context > """ > # switch is handled by this function as a special case > - param_fields, wire_fields, params = get_serialize_params(context, self) > field_mapping = _c_helper_field_mapping(self, prefix) > prefix_str = _c_helper_absolute_name(prefix) > From chris at DemoRecorder.com Mon Oct 13 08:13:09 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:13:09 +0200 Subject: [Xcb] [PATCH libxcb 02/18] c_client.py: simplify maximum expression In-Reply-To: <1413140300-20075-3-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-3-git-send-email-ran234@gmail.com> Message-ID: <543BEC05.9030409@DemoRecorder.com> The code is nicer and more readable this way. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 51edda7..f3405b1 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1122,8 +1122,7 @@ def _c_serialize(context, self): > if not field.type.fixed_size() or self.is_switch: > variable_size_fields += 1 > # determine maxtypelen > - for p in params: > - maxtypelen = max(maxtypelen, len(p[0]) + len(p[1])) > + maxtypelen = max(len(p[0]) + len(p[1]) for p in params) > > # write to .c/.h > indent = ' '*(len(func_name)+2) From chris at DemoRecorder.com Mon Oct 13 08:30:54 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:30:54 +0200 Subject: [Xcb] [PATCH libxcb 06/18] c_client.py: fix indentation In-Reply-To: <1413140300-20075-7-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-7-git-send-email-ran234@gmail.com> Message-ID: <543BF02E.5020407@DemoRecorder.com> Nice cleanup. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > (Also remove unnecessary parens around the condition). > > Signed-off-by: Ran Benita > --- > src/c_client.py | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index fa37772..7f768e0 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1516,14 +1516,13 @@ def _c_accessors_list(self, field): > ''' > > def get_align_pad(field): > - prev = field.prev_varsized_field > - prev_prev = field.prev_varsized_field.prev_varsized_field > - > - if (prev.type.is_pad and prev.type.align > 0 and prev_prev is not None): > - return (prev_prev, '((-prev.index) & (%d - 1))' % prev.type.align) > - else: > - return (prev, None) > + prev = field.prev_varsized_field > + prev_prev = field.prev_varsized_field.prev_varsized_field > > + if prev.type.is_pad and prev.type.align > 0 and prev_prev is not None: > + return (prev_prev, '((-prev.index) & (%d - 1))' % prev.type.align) > + else: > + return (prev, None) > > list = field.type > c_type = self.c_type From chris at DemoRecorder.com Mon Oct 13 08:40:39 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:40:39 +0200 Subject: [Xcb] [PATCH libxcb 07/18] c_client.py: use "foo".join() instead of reduce In-Reply-To: <1413140300-20075-8-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-8-git-send-email-ran234@gmail.com> Message-ID: <543BF277.1040707@DemoRecorder.com> That's definitely simpler and easier to read. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 7f768e0..7051e44 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1,6 +1,5 @@ > #!/usr/bin/env python > from __future__ import print_function > -from functools import reduce > import getopt > import os > import sys > @@ -846,7 +845,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, > code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) > else: > scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] > - typename = reduce(lambda x,y: "%s.%s" % (x, y), scoped_name) > + typename = ".".join(scoped_name) > code_lines.append('%s /* %s.%s */' % (space, typename, field.c_field_name)) > > abs_field_name = _c_helper_absolute_name(prefix, field) > @@ -1181,12 +1180,12 @@ def _c_serialize(context, self): > if self.is_switch: > # switch: call _unpack() > _c(' %s _aux;', self.c_type) > - _c(' return %s(%s, &_aux);', self.c_unpack_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > + _c(' return %s(%s, &_aux);', self.c_unpack_name, ", ".join(param_names)) > _c('}') > return > elif self.c_var_followed_by_fixed_fields: > # special case: call _unserialize() > - _c(' return %s(%s, NULL);', self.c_unserialize_name, reduce(lambda x,y: "%s, %s" % (x, y), param_names)) > + _c(' return %s(%s, NULL);', self.c_unserialize_name, ", ".join(param_names)) > _c('}') > return > else: > @@ -2013,7 +2012,7 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > serialize_args = get_serialize_params(context, type_obj, > c_field_name, > aux_var)[2] > - return reduce(lambda x,y: "%s, %s" % (x,y), [a[2] for a in serialize_args]) > + return ", ".join(a[2] for a in serialize_args) > > # calls in order to free dyn. all. memory > free_calls = [] From chris at DemoRecorder.com Mon Oct 13 08:42:27 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:42:27 +0200 Subject: [Xcb] [PATCH libxcb 08/18] c_client.py: no need to compare bools to True/False In-Reply-To: <1413140300-20075-9-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-9-git-send-email-ran234@gmail.com> Message-ID: <543BF2E3.40208@DemoRecorder.com> Simpler and easier to read. That's good. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 7051e44..3310db1 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -457,7 +457,7 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): > else: > bitcase_prefix = prefix > > - if (True==flat and not b.type.has_name) or False==flat: > + if (flat and not b.type.has_name) or not flat: > all_fields.update(_c_helper_field_mapping(b.type, bitcase_prefix, flat)) > else: > for f in complex_type.fields: > @@ -466,7 +466,7 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): > raise Exception("field name %s has been registered before" % f.field_name) > > all_fields[f.field_name] = (fname, f) > - if f.type.is_container and flat==False: > + if f.type.is_container and not flat: > if f.type.is_case_or_bitcase and not f.type.has_name: > new_prefix = prefix > elif f.type.is_switch and len(f.type.parents)>1: From chris at DemoRecorder.com Mon Oct 13 08:44:47 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:44:47 +0200 Subject: [Xcb] [PATCH libxcb 09/18] c_client.py: remove end-of-function comments In-Reply-To: <1413140300-20075-10-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-10-git-send-email-ran234@gmail.com> Message-ID: <543BF36F.6070406@DemoRecorder.com> These comments are hard to keep consistent. ( and some were already inconsistent ) So I think removing them is good. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 16 ---------------- > 1 file changed, 16 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 3310db1..0488ea5 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -421,7 +421,6 @@ def _c_type_setup(self, name, postfix): > if not module.namespace.is_ext or self.name[:2] == module.namespace.prefix: > finished_sizeof.append(self.c_sizeof_name) > _c_serialize('sizeof', self) > -# _c_type_setup() > > def _c_helper_absolute_name(prefix, field=None): > """ > @@ -441,7 +440,6 @@ def _c_helper_absolute_name(prefix, field=None): > if field is not None: > prefix_str += _cpp(field.field_name) > return prefix_str > -# _c_absolute_name > > def _c_helper_field_mapping(complex_type, prefix, flat=False): > """ > @@ -477,7 +475,6 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): > all_fields.update(_c_helper_field_mapping(f.type, new_prefix, flat)) > > return all_fields > -# _c_field_mapping() > > def _c_helper_resolve_field_names (prefix): > """ > @@ -498,7 +495,6 @@ def _c_helper_resolve_field_names (prefix): > all_fields.update(_c_helper_field_mapping(obj, tmp_prefix, flat=True)) > > return all_fields > -# _c_helper_resolve_field_names > > def get_expr_fields(self): > """ > @@ -549,7 +545,6 @@ def get_expr_fields(self): > > resolved_fields = [all_fields[n][1] for n in resolved_fields_names] > return resolved_fields > -# get_expr_fields() > > def resolve_expr_fields(complex_obj): > """ > @@ -572,7 +567,6 @@ def resolve_expr_fields(complex_obj): > if e not in all_fields and e not in unresolved: > unresolved.append(e) > return unresolved > -# resolve_expr_fields() > > def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): > """ > @@ -651,7 +645,6 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): > add_param(params, (p.c_field_const_type, '*', p.c_field_name)) > > return (param_fields, wire_fields, params) > -# get_serialize_params() > > def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > code_lines.append('%s /* insert padding */' % space) > @@ -676,7 +669,6 @@ def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > > # keep tracking of xcb_parts entries for serialize > return 1 > -# _c_serialize_helper_insert_padding() > > def _c_serialize_helper_switch(context, self, complex_name, > code_lines, temp_vars, > @@ -729,7 +721,6 @@ def _c_serialize_helper_switch(context, self, complex_name, > # code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) > > return count > -# _c_serialize_helper_switch > > def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, prefix): > """ > @@ -768,7 +759,6 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr > c_field_names, prefix_str, field.c_field_name) > > return length > -# _c_serialize_helper_switch_field() > > def _c_serialize_helper_list_field(context, self, field, > code_lines, temp_vars, > @@ -835,7 +825,6 @@ def _c_serialize_helper_list_field(context, self, field, > code_lines.append('%s xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;' % space) > > return length > -# _c_serialize_helper_list_field() > > def _c_serialize_helper_fields_fixed_size(context, self, field, > code_lines, temp_vars, > @@ -901,7 +890,6 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, > length = '%d' % field.type.nmemb > > return (value, length) > -# _c_serialize_helper_fields_fixed_size() > > def _c_serialize_helper_fields_variable_size(context, self, field, > code_lines, temp_vars, > @@ -954,7 +942,6 @@ def _c_serialize_helper_fields_variable_size(context, self, field, > length = "%s(%s)" % (field.type.c_sizeof_name, var_field_name) > > return (value, length) > -# _c_serialize_helper_fields_variable_size > > def _c_serialize_helper_fields(context, self, > code_lines, temp_vars, > @@ -1045,7 +1032,6 @@ def _c_serialize_helper_fields(context, self, > need_padding = False > > return count > -# _c_serialize_helper_fields() > > def _c_serialize_helper(context, complex_type, > code_lines, temp_vars, > @@ -1085,7 +1071,6 @@ def _c_serialize_helper(context, complex_type, > count += _c_serialize_helper_insert_padding(context, code_lines, space, False) > > return count > -# _c_serialize_helper() > > def _c_serialize(context, self): > """ > @@ -1281,7 +1266,6 @@ def _c_serialize(context, self): > _c('') > _c(' return xcb_buffer_len;') > _c('}') > -# _c_serialize() > > def _c_iterator_get_end(field, accum): > ''' From chris at DemoRecorder.com Mon Oct 13 08:50:35 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 17:50:35 +0200 Subject: [Xcb] [PATCH libxcb 11/18] c_client.py: don't generate useless empty /** < */ comments In-Reply-To: <1413140300-20075-12-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-12-git-send-email-ran234@gmail.com> Message-ID: <543BF4CB.3020702@DemoRecorder.com> Some of these changes will be lots of work to merge with my pending changes. (trivial work, but lots of it) Therefore I suggest to skip this patch for now, and recreate it after my changes have been merged to upstream. Recreating this patch should be easy because it looks like global replace in the editor. Chris On 10/12/14 20:58, Ran Benita wrote: > (This does not change doxygen's output or warnings). > > Signed-off-by: Ran Benita > --- > src/c_client.py | 88 ++++++++++++++++++++++++++++----------------------------- > 1 file changed, 44 insertions(+), 44 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 4c19722..c1839c7 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1111,7 +1111,7 @@ def _c_serialize(context, self): > for p in params: > typespec, pointerspec, field_name = p > spacing = ' '*(maxtypelen-len(typespec)-len(pointerspec)) > - param_str.append("%s%s%s %s%s /**< */" % (indent, typespec, spacing, pointerspec, field_name)) > + param_str.append("%s%s%s %s%s" % (indent, typespec, spacing, pointerspec, field_name)) > # insert function name > param_str[0] = "%s (%s" % (func_name, param_str[0].strip()) > param_str = ["%s," % x for x in param_str] > @@ -1292,9 +1292,9 @@ def _c_iterator(self, name): > _h(' * @brief %s', self.c_iterator_type) > _h(' **/') > _h('typedef struct %s {', self.c_iterator_type) > - _h(' %s *data; /**< */', self.c_type) > - _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) > - _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) > + _h(' %s *data;', self.c_type) > + _h(' int%s rem;', ' ' * (len(self.c_type) - 2)) > + _h(' int%s index;', ' ' * (len(self.c_type) - 2)) > _h('} %s;', self.c_iterator_type) > > _h_setlevel(1) > @@ -1310,8 +1310,8 @@ def _c_iterator(self, name): > _h(' */') > _c('') > _hc('void') > - _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type) > - _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type) > + _h('%s (%s *i);', self.c_next_name, self.c_iterator_type) > + _c('%s (%s *i)', self.c_next_name, self.c_iterator_type) > _c('{') > > if not self.fixed_size(): > @@ -1351,8 +1351,8 @@ def _c_iterator(self, name): > _h(' */') > _c('') > _hc('xcb_generic_iterator_t') > - _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type) > - _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type) > + _h('%s (%s i);', self.c_end_name, self.c_iterator_type) > + _c('%s (%s i)', self.c_end_name, self.c_iterator_type) > _c('{') > _c(' xcb_generic_iterator_t ret;') > > @@ -1457,8 +1457,8 @@ def _c_accessors_field(self, field): > if field.type.is_simple: > _hc('') > _hc('%s', field.c_field_type) > - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) > - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) > + _h('%s (const %s *R);', field.c_accessor_name, c_type) > + _c('%s (const %s *R)', field.c_accessor_name, c_type) > _c('{') > if field.prev_varsized_field is None: > _c(' return (%s *) (R + 1);', field.c_field_type) > @@ -1475,8 +1475,8 @@ def _c_accessors_field(self, field): > return_type = '%s *' % field.c_field_type > > _hc(return_type) > - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) > - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) > + _h('%s (const %s *R);', field.c_accessor_name, c_type) > + _c('%s (const %s *R)', field.c_accessor_name, c_type) > _c('{') > if field.prev_varsized_field is None: > _c(' return (%s) (R + 1);', return_type) > @@ -1562,8 +1562,8 @@ def _c_accessors_list(self, field): > _hc('') > _hc('%s *', field.c_field_type) > > - _h('%s (%s /**< */);', field.c_accessor_name, params[idx][0]) > - _c('%s (%s /**< */)', field.c_accessor_name, params[idx][0]) > + _h('%s (%s);', field.c_accessor_name, params[idx][0]) > + _c('%s (%s)', field.c_accessor_name, params[idx][0]) > > _c('{') > if switch_obj is not None: > @@ -1586,14 +1586,14 @@ def _c_accessors_list(self, field): > _hc('') > _hc('int') > if switch_obj is not None: > - _hc('%s (const %s *R /**< */,', field.c_length_name, R_obj.c_type) > + _hc('%s (const %s *R,', field.c_length_name, R_obj.c_type) > spacing = ' '*(len(field.c_length_name)+2) > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > + _h('%sconst %s *S);', spacing, S_obj.c_type) > + _c('%sconst %s *S)', spacing, S_obj.c_type) > length = _c_accessor_get_expr(field.type.expr, fields) > else: > - _h('%s (const %s *R /**< */);', field.c_length_name, c_type) > - _c('%s (const %s *R /**< */)', field.c_length_name, c_type) > + _h('%s (const %s *R);', field.c_length_name, c_type) > + _c('%s (const %s *R)', field.c_length_name, c_type) > length = _c_accessor_get_expr(field.type.expr, fields) > _c('{') > _c(' return %s;', length) > @@ -1603,13 +1603,13 @@ def _c_accessors_list(self, field): > _hc('') > _hc('xcb_generic_iterator_t') > if switch_obj is not None: > - _hc('%s (const %s *R /**< */,', field.c_end_name, R_obj.c_type) > + _hc('%s (const %s *R,', field.c_end_name, R_obj.c_type) > spacing = ' '*(len(field.c_end_name)+2) > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > + _h('%sconst %s *S);', spacing, S_obj.c_type) > + _c('%sconst %s *S)', spacing, S_obj.c_type) > else: > - _h('%s (const %s *R /**< */);', field.c_end_name, c_type) > - _c('%s (const %s *R /**< */)', field.c_end_name, c_type) > + _h('%s (const %s *R);', field.c_end_name, c_type) > + _c('%s (const %s *R)', field.c_end_name, c_type) > _c('{') > _c(' xcb_generic_iterator_t i;') > > @@ -1635,13 +1635,13 @@ def _c_accessors_list(self, field): > _hc('') > _hc('%s', field.c_iterator_type) > if switch_obj is not None: > - _hc('%s (const %s *R /**< */,', field.c_iterator_name, R_obj.c_type) > + _hc('%s (const %s *R,', field.c_iterator_name, R_obj.c_type) > spacing = ' '*(len(field.c_iterator_name)+2) > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > + _h('%sconst %s *S);', spacing, S_obj.c_type) > + _c('%sconst %s *S)', spacing, S_obj.c_type) > else: > - _h('%s (const %s *R /**< */);', field.c_iterator_name, c_type) > - _c('%s (const %s *R /**< */)', field.c_iterator_name, c_type) > + _h('%s (const %s *R);', field.c_iterator_name, c_type) > + _c('%s (const %s *R)', field.c_iterator_name, c_type) > _c('{') > _c(' %s i;', field.c_iterator_type) > > @@ -1736,10 +1736,10 @@ def _c_complex(self, force_packed = False): > # necessary for unserialize to work > (self.is_switch and field.type.is_switch)): > spacing = ' ' * (maxtypelen - len(field.c_field_type)) > - _h('%s %s%s %s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > + _h('%s %s%s %s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > else: > spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) > - _h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > + _h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > if not self.is_switch: > for field in struct_fields: > @@ -1916,9 +1916,9 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > > spacing = ' ' * (maxtypelen - len('xcb_connection_t')) > comma = ',' if len(param_fields) else ');' > - _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) > + _h('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) > comma = ',' if len(param_fields) else ')' > - _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) > + _c('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) > > func_spacing = ' ' * (len(func_name) + 2) > count = len(param_fields) > @@ -1931,10 +1931,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > c_pointer = '*' > spacing = ' ' * (maxtypelen - len(c_field_const_type)) > comma = ',' if count else ');' > - _h('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, > + _h('%s%s%s %s%s%s', func_spacing, c_field_const_type, > spacing, c_pointer, field.c_field_name, comma) > comma = ',' if count else ')' > - _c('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, > + _c('%s%s%s %s%s%s', func_spacing, c_field_const_type, > spacing, c_pointer, field.c_field_name, comma) > > count = 2 > @@ -2132,10 +2132,10 @@ def _c_reply(self, name): > _h(' */') > _c('') > _hc('%s *', self.c_reply_type) > - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1) > - _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type) > - _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2) > - _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2) > + _hc('%s (xcb_connection_t%s *c,', self.c_reply_name, spacing1) > + _hc('%s%s cookie,', spacing3, self.c_cookie_type) > + _h('%sxcb_generic_error_t%s **e);', spacing3, spacing2) > + _c('%sxcb_generic_error_t%s **e)', spacing3, spacing2) > _c('{') > > if len(unserialize_fields)>0: > @@ -2192,9 +2192,9 @@ def _c_reply_fds(self, name): > _h(' */') > _c('') > _hc('int *') > - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_fds_name, spacing1) > - _h('%s%s *reply /**< */);', spacing3, self.c_reply_type) > - _c('%s%s *reply /**< */)', spacing3, self.c_reply_type) > + _hc('%s (xcb_connection_t%s *c,', self.c_reply_fds_name, spacing1) > + _h('%s%s *reply);', spacing3, self.c_reply_type) > + _c('%s%s *reply)', spacing3, self.c_reply_type) > _c('{') > > _c(' return xcb_get_reply_fds(c, reply, sizeof(%s) + 4 * reply->length);', self.c_reply_type) > @@ -2221,7 +2221,7 @@ def _c_cookie(self, name): > _h(' * @brief %s', self.c_cookie_type) > _h(' **/') > _h('typedef struct %s {', self.c_cookie_type) > - _h(' unsigned int sequence; /**< */') > + _h(' unsigned int sequence;') > _h('} %s;', self.c_cookie_type) > > def _man_request(self, name, cookie_type, void, aux): > @@ -2304,7 +2304,7 @@ def _man_request(self, name, cookie_type, void, aux): > else: > spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) > f.write('ELSE %s = %s\n' % (field.c_field_type, field.c_field_name)) > - #_h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > + #_h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > if not self.is_switch: > for field in struct_fields: From chris at DemoRecorder.com Mon Oct 13 09:02:02 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 13 Oct 2014 18:02:02 +0200 Subject: [Xcb] [PATCH libxcb 12/18] c_client.py: don't add /* */ before references to 'S' In-Reply-To: <1413140300-20075-13-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-13-git-send-email-ran234@gmail.com> Message-ID: <543BF77A.3050708@DemoRecorder.com> This removes only a comment in the output. So the C-code will generate the same binary. And it simplifies the generator which is good. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > The name can be understood from the type of S already. > > For examples, look for 'S->' in xkb.c or xinput.c. > > Signed-off-by: Ran Benita > --- > src/c_client.py | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index c1839c7..eab4006 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1541,8 +1541,7 @@ def _c_accessors_list(self, field): > fields.update(_c_helper_field_mapping(toplevel_switch, [('S', '->', toplevel_switch)], flat=True)) > > # initialize prefix for everything "below" S > - prefix_str = '/* %s */ S' % toplevel_switch.name[-1] > - prefix = [(prefix_str, '->', toplevel_switch)] > + prefix = [('S', '->', toplevel_switch)] > > # look for fields in the remaining containers > for p in parents[2:] + [self]: > @@ -2398,8 +2397,7 @@ def _man_request(self, name, cookie_type, void, aux): > fields.update(_c_helper_field_mapping(toplevel_switch, [('S', '->', toplevel_switch)], flat=True)) > > # initialize prefix for everything "below" S > - prefix_str = '/* %s */ S' % toplevel_switch.name[-1] > - prefix = [(prefix_str, '->', toplevel_switch)] > + prefix = [('S', '->', toplevel_switch)] > > # look for fields in the remaining containers > for p in parents[2:] + [self]: From ran234 at gmail.com Tue Oct 14 04:48:28 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 14 Oct 2014 14:48:28 +0300 Subject: [Xcb] [PATCH libxcb 00/18] Small improvements to the generator In-Reply-To: <543AEA8A.8000103@gentoo.org> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <543AEA8A.8000103@gentoo.org> Message-ID: <20141014114828.GA1444@ran> On Sun, Oct 12, 2014 at 10:54:34PM +0200, R?mi Cardona wrote: > While I can't vouch for any of the "business logic" of xcb's codegen, I > can review the Python bits: > > Patch 1 through 16 are pythonically correct, so: > Reviewed-by: R?mi Cardona > (with a small nit for patch 10, see reply) Thanks! > Patch 11 touches Doxygen with which I'm no longer familiar, but it > certainly looks OK. > > As for the last 2: > > Patch 18 is definitely not strictly identical to the previous code > (though that does not mean it is wrong, just that someone else should > look at it). I have made silly mistakes before, but I think it is equivalent, as in de morgan (just a bit easier to follow - hence the patch). Did I miss something? Ran > Patch 17 is beyond my knowledge of xcb's internals. > > Cheers, > > R?mi From ran234 at gmail.com Tue Oct 14 04:51:51 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 14 Oct 2014 14:51:51 +0300 Subject: [Xcb] [PATCH libxcb 11/18] c_client.py: don't generate useless empty /** < */ comments In-Reply-To: <543BF4CB.3020702@DemoRecorder.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-12-git-send-email-ran234@gmail.com> <543BF4CB.3020702@DemoRecorder.com> Message-ID: <20141014115151.GB1444@ran> Hi Chris, thanks for reviewing! On Mon, Oct 13, 2014 at 05:50:35PM +0200, Christian Linhart wrote: > Some of these changes will be lots of work to merge with my pending changes. > (trivial work, but lots of it) > > Therefore I suggest to skip this patch for now, > and recreate it after my changes have been merged to upstream. Sure, any of these can be skipped if they cause trouble. Easy conflicts though can be readily resolved by the one doing the merging. > Recreating this patch should be easy because it looks like global replace in the editor. Yep. Ran > Chris > > On 10/12/14 20:58, Ran Benita wrote: > > (This does not change doxygen's output or warnings). > > > > Signed-off-by: Ran Benita > > --- > > src/c_client.py | 88 ++++++++++++++++++++++++++++----------------------------- > > 1 file changed, 44 insertions(+), 44 deletions(-) > > > > diff --git a/src/c_client.py b/src/c_client.py > > index 4c19722..c1839c7 100644 > > --- a/src/c_client.py > > +++ b/src/c_client.py > > @@ -1111,7 +1111,7 @@ def _c_serialize(context, self): > > for p in params: > > typespec, pointerspec, field_name = p > > spacing = ' '*(maxtypelen-len(typespec)-len(pointerspec)) > > - param_str.append("%s%s%s %s%s /**< */" % (indent, typespec, spacing, pointerspec, field_name)) > > + param_str.append("%s%s%s %s%s" % (indent, typespec, spacing, pointerspec, field_name)) > > # insert function name > > param_str[0] = "%s (%s" % (func_name, param_str[0].strip()) > > param_str = ["%s," % x for x in param_str] > > @@ -1292,9 +1292,9 @@ def _c_iterator(self, name): > > _h(' * @brief %s', self.c_iterator_type) > > _h(' **/') > > _h('typedef struct %s {', self.c_iterator_type) > > - _h(' %s *data; /**< */', self.c_type) > > - _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) > > - _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) > > + _h(' %s *data;', self.c_type) > > + _h(' int%s rem;', ' ' * (len(self.c_type) - 2)) > > + _h(' int%s index;', ' ' * (len(self.c_type) - 2)) > > _h('} %s;', self.c_iterator_type) > > > > _h_setlevel(1) > > @@ -1310,8 +1310,8 @@ def _c_iterator(self, name): > > _h(' */') > > _c('') > > _hc('void') > > - _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type) > > - _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type) > > + _h('%s (%s *i);', self.c_next_name, self.c_iterator_type) > > + _c('%s (%s *i)', self.c_next_name, self.c_iterator_type) > > _c('{') > > > > if not self.fixed_size(): > > @@ -1351,8 +1351,8 @@ def _c_iterator(self, name): > > _h(' */') > > _c('') > > _hc('xcb_generic_iterator_t') > > - _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type) > > - _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type) > > + _h('%s (%s i);', self.c_end_name, self.c_iterator_type) > > + _c('%s (%s i)', self.c_end_name, self.c_iterator_type) > > _c('{') > > _c(' xcb_generic_iterator_t ret;') > > > > @@ -1457,8 +1457,8 @@ def _c_accessors_field(self, field): > > if field.type.is_simple: > > _hc('') > > _hc('%s', field.c_field_type) > > - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) > > - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) > > + _h('%s (const %s *R);', field.c_accessor_name, c_type) > > + _c('%s (const %s *R)', field.c_accessor_name, c_type) > > _c('{') > > if field.prev_varsized_field is None: > > _c(' return (%s *) (R + 1);', field.c_field_type) > > @@ -1475,8 +1475,8 @@ def _c_accessors_field(self, field): > > return_type = '%s *' % field.c_field_type > > > > _hc(return_type) > > - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) > > - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) > > + _h('%s (const %s *R);', field.c_accessor_name, c_type) > > + _c('%s (const %s *R)', field.c_accessor_name, c_type) > > _c('{') > > if field.prev_varsized_field is None: > > _c(' return (%s) (R + 1);', return_type) > > @@ -1562,8 +1562,8 @@ def _c_accessors_list(self, field): > > _hc('') > > _hc('%s *', field.c_field_type) > > > > - _h('%s (%s /**< */);', field.c_accessor_name, params[idx][0]) > > - _c('%s (%s /**< */)', field.c_accessor_name, params[idx][0]) > > + _h('%s (%s);', field.c_accessor_name, params[idx][0]) > > + _c('%s (%s)', field.c_accessor_name, params[idx][0]) > > > > _c('{') > > if switch_obj is not None: > > @@ -1586,14 +1586,14 @@ def _c_accessors_list(self, field): > > _hc('') > > _hc('int') > > if switch_obj is not None: > > - _hc('%s (const %s *R /**< */,', field.c_length_name, R_obj.c_type) > > + _hc('%s (const %s *R,', field.c_length_name, R_obj.c_type) > > spacing = ' '*(len(field.c_length_name)+2) > > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > > + _h('%sconst %s *S);', spacing, S_obj.c_type) > > + _c('%sconst %s *S)', spacing, S_obj.c_type) > > length = _c_accessor_get_expr(field.type.expr, fields) > > else: > > - _h('%s (const %s *R /**< */);', field.c_length_name, c_type) > > - _c('%s (const %s *R /**< */)', field.c_length_name, c_type) > > + _h('%s (const %s *R);', field.c_length_name, c_type) > > + _c('%s (const %s *R)', field.c_length_name, c_type) > > length = _c_accessor_get_expr(field.type.expr, fields) > > _c('{') > > _c(' return %s;', length) > > @@ -1603,13 +1603,13 @@ def _c_accessors_list(self, field): > > _hc('') > > _hc('xcb_generic_iterator_t') > > if switch_obj is not None: > > - _hc('%s (const %s *R /**< */,', field.c_end_name, R_obj.c_type) > > + _hc('%s (const %s *R,', field.c_end_name, R_obj.c_type) > > spacing = ' '*(len(field.c_end_name)+2) > > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > > + _h('%sconst %s *S);', spacing, S_obj.c_type) > > + _c('%sconst %s *S)', spacing, S_obj.c_type) > > else: > > - _h('%s (const %s *R /**< */);', field.c_end_name, c_type) > > - _c('%s (const %s *R /**< */)', field.c_end_name, c_type) > > + _h('%s (const %s *R);', field.c_end_name, c_type) > > + _c('%s (const %s *R)', field.c_end_name, c_type) > > _c('{') > > _c(' xcb_generic_iterator_t i;') > > > > @@ -1635,13 +1635,13 @@ def _c_accessors_list(self, field): > > _hc('') > > _hc('%s', field.c_iterator_type) > > if switch_obj is not None: > > - _hc('%s (const %s *R /**< */,', field.c_iterator_name, R_obj.c_type) > > + _hc('%s (const %s *R,', field.c_iterator_name, R_obj.c_type) > > spacing = ' '*(len(field.c_iterator_name)+2) > > - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) > > - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) > > + _h('%sconst %s *S);', spacing, S_obj.c_type) > > + _c('%sconst %s *S)', spacing, S_obj.c_type) > > else: > > - _h('%s (const %s *R /**< */);', field.c_iterator_name, c_type) > > - _c('%s (const %s *R /**< */)', field.c_iterator_name, c_type) > > + _h('%s (const %s *R);', field.c_iterator_name, c_type) > > + _c('%s (const %s *R)', field.c_iterator_name, c_type) > > _c('{') > > _c(' %s i;', field.c_iterator_type) > > > > @@ -1736,10 +1736,10 @@ def _c_complex(self, force_packed = False): > > # necessary for unserialize to work > > (self.is_switch and field.type.is_switch)): > > spacing = ' ' * (maxtypelen - len(field.c_field_type)) > > - _h('%s %s%s %s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > + _h('%s %s%s %s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > else: > > spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) > > - _h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > + _h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > > > if not self.is_switch: > > for field in struct_fields: > > @@ -1916,9 +1916,9 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > > > > spacing = ' ' * (maxtypelen - len('xcb_connection_t')) > > comma = ',' if len(param_fields) else ');' > > - _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) > > + _h('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) > > comma = ',' if len(param_fields) else ')' > > - _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) > > + _c('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) > > > > func_spacing = ' ' * (len(func_name) + 2) > > count = len(param_fields) > > @@ -1931,10 +1931,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > > c_pointer = '*' > > spacing = ' ' * (maxtypelen - len(c_field_const_type)) > > comma = ',' if count else ');' > > - _h('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, > > + _h('%s%s%s %s%s%s', func_spacing, c_field_const_type, > > spacing, c_pointer, field.c_field_name, comma) > > comma = ',' if count else ')' > > - _c('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, > > + _c('%s%s%s %s%s%s', func_spacing, c_field_const_type, > > spacing, c_pointer, field.c_field_name, comma) > > > > count = 2 > > @@ -2132,10 +2132,10 @@ def _c_reply(self, name): > > _h(' */') > > _c('') > > _hc('%s *', self.c_reply_type) > > - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1) > > - _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type) > > - _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2) > > - _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2) > > + _hc('%s (xcb_connection_t%s *c,', self.c_reply_name, spacing1) > > + _hc('%s%s cookie,', spacing3, self.c_cookie_type) > > + _h('%sxcb_generic_error_t%s **e);', spacing3, spacing2) > > + _c('%sxcb_generic_error_t%s **e)', spacing3, spacing2) > > _c('{') > > > > if len(unserialize_fields)>0: > > @@ -2192,9 +2192,9 @@ def _c_reply_fds(self, name): > > _h(' */') > > _c('') > > _hc('int *') > > - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_fds_name, spacing1) > > - _h('%s%s *reply /**< */);', spacing3, self.c_reply_type) > > - _c('%s%s *reply /**< */)', spacing3, self.c_reply_type) > > + _hc('%s (xcb_connection_t%s *c,', self.c_reply_fds_name, spacing1) > > + _h('%s%s *reply);', spacing3, self.c_reply_type) > > + _c('%s%s *reply)', spacing3, self.c_reply_type) > > _c('{') > > > > _c(' return xcb_get_reply_fds(c, reply, sizeof(%s) + 4 * reply->length);', self.c_reply_type) > > @@ -2221,7 +2221,7 @@ def _c_cookie(self, name): > > _h(' * @brief %s', self.c_cookie_type) > > _h(' **/') > > _h('typedef struct %s {', self.c_cookie_type) > > - _h(' unsigned int sequence; /**< */') > > + _h(' unsigned int sequence;') > > _h('} %s;', self.c_cookie_type) > > > > def _man_request(self, name, cookie_type, void, aux): > > @@ -2304,7 +2304,7 @@ def _man_request(self, name, cookie_type, void, aux): > > else: > > spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) > > f.write('ELSE %s = %s\n' % (field.c_field_type, field.c_field_name)) > > - #_h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > + #_h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) > > > > if not self.is_switch: > > for field in struct_fields: > From ran234 at gmail.com Tue Oct 14 05:18:42 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 14 Oct 2014 15:18:42 +0300 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <543BA278.3050406@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <20141012183906.GC8240@ran> <543BA278.3050406@DemoRecorder.com> Message-ID: <20141014121842.GC1444@ran> On Mon, Oct 13, 2014 at 11:59:20AM +0200, Christian Linhart wrote: > On 10/12/14 20:39, Ran Benita wrote: > > On Wed, Sep 03, 2014 at 01:14:23PM +0200, Christian Linhart wrote: > [...] > >> * make sumof more flexible. Especially support a nested expression which is evaluated > >> in the scope of each list-element which is iterated to compute sumof. > >> Example: > >> > >> num_class_info > >> > > > > xcb_sumof() is this: > > > > int xcb_sumof(uint8_t *list, int len) > > { > > int i, s = 0; > > for(i=0; i > s += *list; > > list++; > > } > > return s; > > } > > > > So it assumes the list is of CARD8's - it is not polymorphic in any > > way. It looks OK for the added sumof in this series, but I'm not sure it > > matches the changes in the generator? > > The function xcb_sumof is not used anymore with my changes in the generator. > Rather, an explicit for-loop is added before the expression that needs the sum. > (with the help of several temporary variables). > > Generating that explicit code is easier than to make C do the needed polymorphic stuff. Huh, shouldn't comment on a series before reading all of it! > Here's an example: > The sumof-code is between the comments /* sumof start */ and /* sumof end. Result is in xcb_pre_tmp_7 */. > > ==================== > xcb_input_list_input_devices_infos_length (const xcb_input_list_input_devices_reply_t *R /**< */) > { > int xcb_pre_tmp_5; /* sumof length */ > int xcb_pre_tmp_6; /* sumof loop counter */ > int64_t xcb_pre_tmp_7; /* sumof sum */ > const xcb_input_device_info_t* xcb_pre_tmp_8; /* sumof list ptr */ > /* sumof start */ > xcb_pre_tmp_5 = R->devices_len; > xcb_pre_tmp_7 = 0; > xcb_pre_tmp_8 = xcb_input_list_input_devices_devices(R); > for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) { > xcb_pre_tmp_7 += xcb_pre_tmp_8->num_class_info; > xcb_pre_tmp_8++; > } > /* sumof end. Result is in xcb_pre_tmp_7 */ > return xcb_pre_tmp_7; > } > ==================== > > So, the non-polymorphicness of function xcb_sumof is not an issue because this function is not used anymore. > (but kept in there for compatibility reasons, for the case that some user-code uses it directly somewhere...) Yes, this looks like the sanest (only?) way to handle this in C. Re. compatability, not sure if xcbext.h is considered API, but probably not a bad idea to keep it as it's very small. > >> Due to using switch-case, some structs have became obsolete. > >> (and due to using struct STR from xproto instead of DeviceName because these > >> are the same and the spec uses STR) > >> > >> This patchset contains two patches to remove these obsolete structs. > >> You may reject these patches due to API-compatibility concerns. > >> On the other hand, probably nobody has used the structs for request ListInputDevice > >> anyways before because this request/reply didn't work anyways in the previous form. > > > > I think we can break xinput, it is not declared stable yet and is > > disabled by default. However, it appears like some projects already use > > it: > > http://git.enlightenment.org/legacy/ecore.git/tree/src/lib/ecore_x/xcb/ecore_xcb_input.c > > So I'm not sure... > > Hmmm. If we are not sure we shouldn't remove those structs. > (better be safe than sorry where the safe alternative is OK, too) > But, probably these structs should be marked as deprecated somehow. > > BTW, There are many more obsolete structs. ( primarily from my other changes where I use switch-case. ) > I didn't generate patches for removing those because I wanted to wait for the discussion for this patchset. > > So I suggest the following procedure: > * drop patches "proto 6/7" and "proto 7/7" now > (I'll update my patch-repo accordingly. I'll send another message when that repo is updated. ) Yes, that will be the safe thing to do. Probably nobody's using them, especially if the request is broken. But we had some issues with xkb in the past.. > * after all my of patches are merged: > mark all obsolete structs as deprecated: > - with a comment? > - or with a xml-attribute that is translated to some comment in the C-code, > and possibly with some macro that expands to "__declspec( deprecated )" or "__attribute__(deprecated)" > depending on the compiler used. > > What do you think? Both sound OK to me. They can also be changed to typedefs maybe. Ran > Chris > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From ftpmaster at ftp-master.debian.org Tue Oct 14 06:07:51 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Tue, 14 Oct 2014 13:07:51 +0000 Subject: [Xcb] Processing of xcb-proto_1.10-1~bpo70+1_amd64.changes Message-ID: xcb-proto_1.10-1~bpo70+1_amd64.changes uploaded successfully to localhost along with the files: xcb-proto_1.10-1~bpo70+1.dsc xcb-proto_1.10-1~bpo70+1.diff.gz xcb-proto_1.10-1~bpo70+1_all.deb python-xcbgen_1.10-1~bpo70+1_all.deb Greetings, Your Debian queue daemon (running on host franck.debian.org) From ftpmaster at ftp-master.debian.org Tue Oct 14 06:21:04 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Tue, 14 Oct 2014 13:21:04 +0000 Subject: [Xcb] xcb-proto_1.10-1~bpo70+1_amd64.changes is NEW Message-ID: binary:xcb-proto is NEW. binary:python-xcbgen is NEW. source:xcb-proto is NEW. Your package has been put into the NEW queue, which requires manual action from the ftpteam to process. The upload was otherwise valid (it had a good OpenPGP signature and file hashes are valid), so please be patient. Packages are routinely processed through to the archive, and do feel free to browse the NEW queue[1]. If there is an issue with the upload, you will recieve an email from a member of the ftpteam. If you have any questions, you may reply to this email. [1]: https://ftp-master.debian.org/new.html From ran234 at gmail.com Tue Oct 14 06:24:38 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 14 Oct 2014 16:24:38 +0300 Subject: [Xcb] [PATCH libxcb 1/6] generator: fix absname for fields with only accessor function In-Reply-To: <543BD4A3.1020606@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> <543BD4A3.1020606@DemoRecorder.com> Message-ID: <20141014132438.GD1444@ran> On Mon, Oct 13, 2014 at 03:33:23PM +0200, Christian Linhart wrote: > On 10/12/14 20:07, Ran Benita wrote: > > On Wed, Sep 03, 2014 at 01:22:36PM +0200, Christian Linhart wrote: > >> Fix _c_helper_absolute_name for fields which cannot be accessed > >> as a struct/union member but which can be accessed by an > >> accessor function. > >> > >> The fix calls the accessor function in these cases. > >> > >> Example: > >> > >> > >> > >> len > >> > >> > >> > >> > >> > >> > >> The sumof-expression ( ) refers to mylist1 > >> which is only acessible by an accessor function. > >> > >> Previously, sumof was only used inside bitcases, > >> where such lists are accessible by members of the > >> deserialized parent struct. > >> (there is a difference between deserialization of switches > >> and structs.) > >> --- > >> src/c_client.py | 28 +++++++++++++++++++++++++++- > >> 1 file changed, 27 insertions(+), 1 deletion(-) > >> > >> diff --git a/src/c_client.py b/src/c_client.py > >> index 9216c7f..488f0e6 100644 > >> --- a/src/c_client.py > >> +++ b/src/c_client.py > >> @@ -430,24 +430,50 @@ def _c_type_setup(self, name, postfix): > >> def _c_helper_absolute_name(prefix, field=None): > > > > This function is strange; most of the time it generates complete garbage > > (e.g. `foo->...->`) which is subsequently ignored. So it is called for > > no reason many times. > I do not understand the problem here, Basically, "garbage in, garbage out". The problem is the "garbage in" part - it shouldn't happen in well-structured code... (of course this is well before this patchset). So that makes it hard to figure out what it *does*. This patch: http://lists.freedesktop.org/archives/xcb/2014-October/009939.html removes some garbage calls, but there are still a lot left. > The output *is* used sometimes and that counts for the output. > > In most cases a symbol-resolution table is filled with all fields > that are accessible starting from a given scope/type. > For each field, the C-expression which accesses the field, is computed here. > Of course, only a subset of that symbol-resolution table is used later. > In that sense, most of the output is subsequently ignored. Yes, that's ok. My problem is that some entires are nonsense! > ( for example the function "_c_helper_field_mapping" builds such a table ) > > > > >> """ > >> turn prefix, which is a list of tuples (name, separator, Type obj) into a string > >> representing a valid name in C (based on the context) > >> if field is not None, append the field name as well > >> """ > >> prefix_str = '' > >> + last_sep ='' > >> for name, sep, obj in prefix: > >> + if '' != last_sep: > >> + prefix_str += last_sep > >> prefix_str += name > >> if '' == sep: > > > > (This can never happen. I have a patch to remove this). > By quick analysis I can confirm that because the blank > seps are already filled in _c_helper_resolve_field_names. > > How did you come to the conclusion that sep can never be the empty string here? > > Since this is old code not affected by my patch > and since you didn't post your patch yet as far as I can tell, > I suggest that you post your patch after this patchset has been merged into upstream. > ( to avoid unnecessary merge-work ) > > Of course I could include that change in V2 of that patch but that way > we would have two unrelated changes in one patch which is not good. I looked over the callers, and saw that `sep` is never empty. I had a patch which added `assert sep != ''`. This worked on master, but failed on top of your patch set. It is probably more "GIGO" but I dropped it (but forgot to amend this comment). > > > >> sep = '->' > >> if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase > >> (obj.is_switch and len(obj.parents)>1)): > >> sep = '.' > >> - prefix_str += sep > >> + last_sep = sep > >> + > >> + prefix_str_without_lastsep = prefix_str > >> + prefix_str += last_sep > >> + > >> if field is not None: > >> prefix_str += _cpp(field.field_name) > >> + > >> + > >> + if ( > > > > This is a formidable list of conditions. Are all of them needed? > I think that yes they are all needed, but there may be a better alternative ( see below ). > > > Can > > this be extracted to a function `field_needs_accessor` or something like > > that? > > I have thought about that and came to the conclusion that there probably is an even better alternative > than to encapsulate those conditions in a function: > > Probably it is better to set a flag at the place where it has already been decided that this field > does not appear in a C-struct. ( or use the reverse semantic ) > Then just use that flag here. > That would have the advantage that these conditions need not be updated when something is changed somewhere else. I wouldn't advocate a state variable over a pure function. But if it is constant that's the same. > Would it be OK to use this patch as it is now > and that I post a simplification fix later, > after this is merged to upstream? > > Or shall I submit V2 of this patch, with changes as I have suggested above? > ( This will probably take some time ). I'll try to understand the given code. > > > >> + field != None > > > > With `None` it is customary to write `field is None`, `field is not > > None`. > Yes, I am sorry for that. > I have noticed that in the meantime. > > > > >> + and hasattr(field, 'c_accessor_name') > >> + and field.parent != None > >> + and field.parent.is_container > >> + and not field.parent.is_switch > >> + and not field.parent.is_case_or_bitcase > >> + and ( #the following conditions are taken from _c_accessors() > >> + ( field.type.is_list and not field.type.fixed_size() ) > >> + or > >> + ( field.prev_varsized_field is not None > >> + or not field.type.fixed_size() > > > > This says `or` but the parens make it look like it should be `and`? > I have copied that condition from function _c_accessors and it is used like that > there. The outer "or" combines the condition of an "if" and the condition of an "elif". > Of course, boolean algebra would allow to remove the parentheses around the inner or. > > It is important that this is consistent with "_c_accessors". OK, this just looked "suspicous", like the for loop described in this article: http://lwn.net/Articles/453685/ > > > > >> + ) > >> + ) > >> + ): > >> + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > > > > I'm not entirely convinced that this should be in this function - or the > > function should be renamed. > Renaming is a good idea for that function anyways. > Even the existing version of that function does not compute an "absolute name" but computes a C-expression > to access a specific field in the context defined by the "prefix" parameter. > > I suggest the following name: "_c_helper_field_access_expr" > ( or something similar) If this name is accurate, that would be a big improvement. > > Is the above the correct thing to do in all > > of the callsites? > Good question. > > I am pretty sure that the answer is yes, because of the following: > > * The previous version of that function returned a C-expression that can also be used as an lvalue, i.e., C can assign something to it. > > * Due to my patches, the returned C-expression may be an rvalue in those cases where the old function returned something that cannot compile. > ( i.e. these are the cases where the field does not occur in a C-struct) > > * So, the behavior only changes for those cases where the existing version of that function returns something that is not compilable. > So, it doesn't break anything. > > * If, in those cases, the output of that function were somewhere inserted in the role of an lvalue, > the C-compiler would complain. > But the Compiler does not complain, which means that the resulting C-expression is only used as an rvalue. > ( at least for all of our current xml-files. ) > > I hope that this explains it better. > > If you have more questions, please tell me and I'll be glad to answer them. > > > > > Sorry for having more questions than answers; it is not for lack of > > trying.. > No problem. > I wrote the change, so I have find the answers... :-) I will take another look. If someday you can simplify this, it would be nice :) I hate to say this, but you are paying off some technical debt left by a previous programmer whose code may be found with "git blame"... Ran > Chris > > > > > Ran > > > >> + > >> return prefix_str > >> # _c_absolute_name > >> > >> def _c_helper_field_mapping(complex_type, prefix, flat=False): > >> """ > >> generate absolute names, based on prefix, for all fields starting from complex_type > >> if flat == True, nested complex types are not taken into account > >> -- > >> 2.0.1 > >> > >> _______________________________________________ > >> Xcb mailing list > >> Xcb at lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/xcb > > > From ran234 at gmail.com Tue Oct 14 06:30:29 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 14 Oct 2014 16:30:29 +0300 Subject: [Xcb] [PATCH libxcb 2/6] generator: fix absname for fields with only iterator function In-Reply-To: <543BD8F6.7060205@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-2-git-send-email-chris@demorecorder.com> <20141012182417.GB8240@ran> <543BD8F6.7060205@DemoRecorder.com> Message-ID: <20141014133029.GE1444@ran> On Mon, Oct 13, 2014 at 03:51:50PM +0200, Christian Linhart wrote: > On 10/12/14 20:24, Ran Benita wrote: > > On Wed, Sep 03, 2014 at 01:22:37PM +0200, Christian Linhart wrote: > >> Fix _c_helper_absolute_name for fields which can only be > >> accessed with an iterator function. > >> These are lists with var-sized structs as members. > > > > This doesn't sound right. Does the caller know how to handle each > > iterator? > Yes, but the caller has to find that out by itself, > which is not ideal because it could lead to inconsistencies. > Example is in patch "libxcb 6/6" of this patchset. > > I have thought about that when implementing it. > An alternative would be to return meta-info in addition to the C-expression-string. > That meta-info can tell the caller that this is an iterator. > > But that would change the caller interface of that function > and required a lot of changes. > > Now I have a new idea which is cleaner: > We could use two functions. > 1. One function which returns meta-info, and that function will be used by the sumof code. > > 2. A compatibility-wrapper function which calls the first function > but only returns the expression-string > and throws an exception when this is an iterator, so it prevents > that an iterator-access is inserted somewhere where it shouldn't. > > > Where it is used? I see that the code is reached, but this > > it doesn't seem to reach the generated output anywhere (with this > > libxcb+proto patchset), as opposed to the accessors in the `else` branch. > It is used in sumof over lists with varsized members. > > As far as I can remember we do not have such lists in the xml with all of my changes. > Therefore, it does not reach the generated output as you have observed. > > But I accidentally assumed for some time that we have such lists, so I implemented support for it, and also tested it. > I thought that this feature might be useful some time in the future, so I have included it in that patchset. > > But I am OK with skipping it. > > If we skip this patch, we also have to skip patch "libxcb 6/6" of this patchset. > > What do you think: > Skip it or improve it as outlined above? That's easy - skip it :) If we find out eventually that it *is* needed by xinput or xkb, we can return to it. Ran > Chris > > > > > > > So can we skip this patch? If not, why is it needed? > > > > Ran > > > >> --- > >> src/c_client.py | 7 ++++++- > >> 1 file changed, 6 insertions(+), 1 deletion(-) > >> > >> diff --git a/src/c_client.py b/src/c_client.py > >> index 488f0e6..35c975f 100644 > >> --- a/src/c_client.py > >> +++ b/src/c_client.py > >> @@ -464,15 +464,20 @@ def _c_helper_absolute_name(prefix, field=None): > >> ( field.type.is_list and not field.type.fixed_size() ) > >> or > >> ( field.prev_varsized_field is not None > >> or not field.type.fixed_size() > >> ) > >> ) > >> ): > >> - prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > >> + if field.type.is_list and not field.type.member.fixed_size(): > >> + #only accessible by iterator > >> + prefix_str = field.c_iterator_name + "(" + prefix_str_without_lastsep + ")"; > >> + else: > >> + #only accessible by access function > >> + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; > >> > >> return prefix_str > >> # _c_absolute_name > >> > >> def _c_helper_field_mapping(complex_type, prefix, flat=False): > >> """ > >> generate absolute names, based on prefix, for all fields starting from complex_type > >> -- > >> 2.0.1 > >> > >> _______________________________________________ > >> Xcb mailing list > >> Xcb at lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/xcb > > > From debian-backports at lists.debian.org Tue Oct 14 03:00:43 2014 From: debian-backports at lists.debian.org (Alexander Wirt) Date: Tue, 14 Oct 2014 10:00:43 +0000 Subject: [Xcb] xcb-proto_1.10-1~bpo70+1_amd64.changes REJECTED Message-ID: Changes since 1.7.1-1 (stable) missing in changes file. === Please feel free to respond to this email if you don't understand why your files were rejected, or if you upload new files which address our concerns. From ftpmaster at ftp-master.debian.org Tue Oct 14 10:00:11 2014 From: ftpmaster at ftp-master.debian.org (Debian FTP Masters) Date: Tue, 14 Oct 2014 17:00:11 +0000 Subject: [Xcb] xcb-proto_1.10-1~bpo70+1_amd64.changes ACCEPTED into wheezy-backports, wheezy-backports Message-ID: Accepted: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Thu, 09 Oct 2014 19:06:57 -0300 Source: xcb-proto Binary: xcb-proto python-xcbgen Architecture: source all Version: 1.10-1~bpo70+1 Distribution: wheezy-backports Urgency: medium Maintainer: XCB Developers Changed-By: Lisandro Dami?n Nicanor P?rez Meyer Description: python-xcbgen - X C Binding - protocol binding generator xcb-proto - X C Binding - protocol descriptions Changes: xcb-proto (1.10-1~bpo70+1) wheezy-backports; urgency=medium . * Upload to wheezy-backports. * Add myself in Uploaders for the backport. . xcb-proto (1.10-1) unstable; urgency=low . * New upstream release. . [ Michele Cane ] * Bump Standard-version to 3.9.4. . [ Julien Cristau ] * Revert to source format 1.0. . xcb-proto (1.8-1) unstable; urgency=low . * New upstream release. Checksums-Sha1: 8ad09f51b3f9e439794abf18ca124c2e736b2201 2098 xcb-proto_1.10-1~bpo70+1.dsc 171e9cd4e4086be09dfd3855c50fc6a3cc5cd9a2 4442 xcb-proto_1.10-1~bpo70+1.diff.gz 9c105799e08ba7457d2ff4238e39e2fc4c4110ab 96936 xcb-proto_1.10-1~bpo70+1_all.deb 7263eedeceab2bc09744f205778a3d978a333a98 13626 python-xcbgen_1.10-1~bpo70+1_all.deb Checksums-Sha256: 8aeb2312aa26c3df29d3c83c744aadc39523509c3677cd9708354420f0a13a03 2098 xcb-proto_1.10-1~bpo70+1.dsc 6c58074e8139936e15cd04caa7aa8290f955ca47f0974e7d55b7260c9a0727a4 4442 xcb-proto_1.10-1~bpo70+1.diff.gz e8ea6a6b6e75f00d496a1d7bda8a388dae5923195da5ad6acc3a484ac8b451d6 96936 xcb-proto_1.10-1~bpo70+1_all.deb cd5c772176b87ac1ba6b9bfc750ee5f088a4f03a63f5f9c4e05f6bdb4b3db26b 13626 python-xcbgen_1.10-1~bpo70+1_all.deb Files: f5df23d46e1fed722dfb0d49e6a6ce49 2098 libdevel optional xcb-proto_1.10-1~bpo70+1.dsc 4a1e12af9e665c92a4bf9d0e6b0ca636 4442 libdevel optional xcb-proto_1.10-1~bpo70+1.diff.gz b0977d4285f53c2a188a0dad71a8e982 96936 libdevel optional xcb-proto_1.10-1~bpo70+1_all.deb 6f9a164643a42cbb9c2014ad1cf3760c 13626 python optional python-xcbgen_1.10-1~bpo70+1_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUN0V0AAoJEKtkX0BihqfQfIQQALd6NahQhSJ+bowFv6I54KOi DTIeGc8ffqTzN8UVtRnE9BfNtqFCG5Uv1O0pwX26Shpj7R+IgTpklQYqDXXYvbAn XNSJ678vjoVVSyeJOIP75bC1v9QS3KNc3uHt2DQ4JagrWhzsKZqUJIyVwcTL9sES Wg/VrYSSQOX6icwXCEDgTPGW+iDdemQcbZk73H4HO/CFT85COJH6rYdSolOPLlMU +xqUnJt7MxrpaIXjVqGRnxRMolC6NK8G/wJA2VxU3nxLFpjVWiYCJUOK1VXlIzxk YWHEMSdInuciJCMzJb3sRP55WygdJ7rK2a/Y52Qk0nnZZNNrnDSpCtyFzfLq/u83 LX9vyYrc1GUMbRcYjQU/kweBNpn2XCT9Nezc9S+msCCcL70scV1877+0DDav+QmE 67lQ+y/iK8GXVhjNtZLMhmpAB5haRO8ZwWQtecCNlSd//j7H6I4jAOtPAwK3Eqb9 tThiMTofwG65b6pjD3+ooNRDVmlKpoPvTc+8XXv9ak2t1m57g9Sc6OO0/Q2vtlep GTeveJVFUXys3KeQNsRUpzVHbGBWhoAkH1cgBpe5pUZIKV/UiL0JZMCXzFiECnX4 INaER2OlStcF7BJ16v/fV0aGMmQHWBUt41dDTA0uOswVSRNfbR30MbrOQNj/CfR3 gL8qEWGz/aV0jHB0r7l+ =jEx2 -----END PGP SIGNATURE----- Thank you for your contribution to Debian. From arnau at debian.org Tue Oct 14 21:12:20 2014 From: arnau at debian.org (Arnaud Fontaine) Date: Wed, 15 Oct 2014 13:12:20 +0900 Subject: [Xcb] [ANNOUNCE] xcb-util-image 0.4.0 Message-ID: <87h9z60y57.fsf@duckcorp.org> xcb-util-image 0.4.0 is now available. git tag 0.4.0 Changelog ========= Arnaud Fontaine (2): Pick-up changes in m4 submodule as it's better to have all util repos at same m4 level. Release 0.4.0 Bart Massey (8): corrected return value documentation for xcb_image_shm_put() added additional format tests for XY_PIXMAP bit planes changed test_xcb_image to work with XY_PIXMAP with nontrivial planemask Fixed get_image to handle xy format with nontrivial plane_mask. added window names to test_xcb_image windows increased window size for test_xcb_image for usability Fixed endianness bug in xy pixmap getimage. fixed some compiler C90 warnings Gaetan Nadon (10): config: add bug URL to AC_INIT config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES config: remove old dead code for documentation config: use AC_CONFIG_HEADERS to create a config.h file config: add missing COPYING file make: there should be no attempt to remove any Makefile.in file make: using EXTRA_DIST for xcb-util-image.pc.in is redundant make: image is using X11 Protcol headers, so XPROTO_CFLAGS is required test: move test cases into their own directory image: use AM_CPPFLAGS rather than per-target libxcb_image_la_CPPFLAGS Jon TURNEY (1): Fix compilation when NDEBUG is defined Niclas Zeising (1): Check submodules before running autoconf. Download ======== http://xcb.freedesktop.org/dist/xcb-util-image-0.4.0.tar.bz2 md5: 08fe8ffecc8d4e37c0ade7906b3f4c87 sha1: c9c9361781911a47b28f74fc6ebe0abd1273fae4 sha256: 2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc http://xcb.freedesktop.org/dist/xcb-util-image-0.4.0.tar.gz md5: 32c9c2f72ebd58a2b2e210f27fee86f7 sha1: 4982a42b85802d0c5aa5ffc003d197b0cca16c41 sha256: cb2c86190cf6216260b7357a57d9100811bb6f78c24576a3a5bfef6ad3740a42 -- Arnaud Fontaine -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From arnau at debian.org Tue Oct 14 22:34:48 2014 From: arnau at debian.org (Arnaud Fontaine) Date: Wed, 15 Oct 2014 14:34:48 +0900 Subject: [Xcb] [ANNOUNCE] xcb-util 0.4.0 Message-ID: <8738ap28w7.fsf@duckcorp.org> xcb-util 0.4.0 is now available. git tag 0.4.0 Changelog ========= Adam Jackson (1): configure: Remove AM_MAINTAINER_MODE Alan Coopersmith (1): atoms.c: #include for vsnprintf case, not just vasprintf Arnaud Fontaine (2): Follow changes in m4 submodule. Release 0.4.0 Colin Walters (1): autogen.sh: Implement GNOME Build API Gaetan Nadon (8): config: add bug URL to AC_INIT config: use AC_CONFIG_HEADERS to create a config.h file config: remove AC_TYPE_SSIZE_T config: drop the check for sys/types.h config: add missing COPYING file config: remove the dependency on X11 Protocol config: remove old dead code for documentation Pick-up changes in m4 submodule Keith Packard (1): xcb_aux_parse_color should take const char * Niclas Zeising (1): Check submodules before running autoconf. Download ======== http://xcb.freedesktop.org/dist/xcb-util-0.4.0.tar.bz2 md5: 2e97feed81919465a04ccc71e4073313 sha1: 7f2e9b7efcc2c34eb1d6ae312c3d73b075832e46 sha256: 46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9 http://xcb.freedesktop.org/dist/xcb-util-0.4.0.tar.gz md5: 157d82738aa89934b6adaf3ca508a0f5 sha1: 43f889324a1564b682e107130c43643ce3e724b2 sha256: 0ed0934e2ef4ddff53fcc70fc64fb16fe766cd41ee00330312e20a985fd927a7 -- Arnaud Fontaine -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From remi at gentoo.org Wed Oct 15 13:35:12 2014 From: remi at gentoo.org (=?windows-1252?Q?R=E9mi_Cardona?=) Date: Wed, 15 Oct 2014 22:35:12 +0200 Subject: [Xcb] [PATCH libxcb 00/18] Small improvements to the generator In-Reply-To: <20141014114828.GA1444@ran> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <543AEA8A.8000103@gentoo.org> <20141014114828.GA1444@ran> Message-ID: <543EDA80.4090806@gentoo.org> Le 14/10/2014 13:48, Ran Benita a ?crit : > I have made silly mistakes before, but I think it is equivalent, > as in de morgan (just a bit easier to follow - hence the patch). Did I > miss something? No, it's just that the order is different. So the evaluation order is changed. If calling field.type.fixed_size() has no consequence on other attributes, then this indeed looks fine. But Python being an overly dynamic language, this needs review by someone who knows the codegen's internals. Cheers, R?mi From ran234 at gmail.com Thu Oct 16 02:06:38 2014 From: ran234 at gmail.com (Ran Benita) Date: Thu, 16 Oct 2014 12:06:38 +0300 Subject: [Xcb] [PATCH libxcb 00/18] Small improvements to the generator In-Reply-To: <543EDA80.4090806@gentoo.org> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <543AEA8A.8000103@gentoo.org> <20141014114828.GA1444@ran> <543EDA80.4090806@gentoo.org> Message-ID: <20141016090638.GA5076@ran> On Wed, Oct 15, 2014 at 10:35:12PM +0200, R?mi Cardona wrote: > Le 14/10/2014 13:48, Ran Benita a ?crit : > > I have made silly mistakes before, but I think it is equivalent, > > as in de morgan (just a bit easier to follow - hence the patch). Did I > > miss something? > > No, it's just that the order is different. So the evaluation order is > changed. If calling field.type.fixed_size() has no consequence on other > attributes, then this indeed looks fine. > > But Python being an overly dynamic language, this needs review by > someone who knows the codegen's internals. I see what you mean now. Yes, `fixed_size()` is pure. I swapped the order because the new one looks more sensible to me - the `wire` conditions is clearly the "main" condition here, followed by exceptions. Ran > Cheers, > > R?mi > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From chris at DemoRecorder.com Thu Oct 16 02:52:02 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 16 Oct 2014 11:52:02 +0200 Subject: [Xcb] [PATCH libxcb 18/18] c_client.py: make condition easier to follow in _c_complex() In-Reply-To: <1413140300-20075-19-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-19-git-send-email-ran234@gmail.com> Message-ID: <543F9542.5080507@DemoRecorder.com> Very nice simplification. The new code does the same as the old code because fixed_size has no side-effects. ( the rest is correct due to boolean algebra ) Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index bb2de13..d77c836 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1716,9 +1716,7 @@ def _c_complex(self, force_packed = False): > maxtypelen = 0 > > for field in self.fields: > - if not field.type.fixed_size() and not self.is_switch and not self.is_union: > - continue > - if field.wire: > + if field.wire and (field.type.fixed_size() or self.is_switch or self.is_union): > struct_fields.append(field) > > for field in struct_fields: From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 17 11:23:48 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?q?La=C3=A9rcio=20de=20Sousa?=) Date: Fri, 17 Oct 2014 15:23:48 -0300 Subject: [Xcb] [PATCH libxcb] Introduce new funcion xcb_connect_with_auth_file(). Message-ID: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> This patch introduces a function called xcb_connect_with_auth_file(), which is similar to xcb_connect_to_display_with_auth_info(), but expects an authorization file path rather than a xcb_auth_info_t struct. Signed-off-by: La?rcio de Sousa --- src/xcb.h | 21 +++++++++++++++++++++ src/xcb_auth.c | 15 +++++++++++++-- src/xcb_util.c | 27 ++++++++++++++++++++------- src/xcbint.h | 2 +- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/xcb.h b/src/xcb.h index 23fe74e..0314ce5 100644 --- a/src/xcb.h +++ b/src/xcb.h @@ -535,6 +535,27 @@ int xcb_parse_display(const char *name, char **host, int *display, int *screen); xcb_connection_t *xcb_connect(const char *displayname, int *screenp); /** + * @brief Connects to the X server, using and authorization file. + * @param displayname: The name of the display. + * @param authfile: The authorization file path. + * @param screenp: A pointer to a preferred screen number. + * @return A newly allocated xcb_connection_t structure. + * + * Connects to the X server specified by @p displayname, using the + * authorization file @p authfile. If @p authfile value @c NULL, uses + * the value of the XAUTHORITY environment variable. If a particular + * screen on that server is preferred, the int pointed to by @p screenp + * (if not @c NULL) will be set to that screen; otherwise @p screenp + * will be set to 0. + * + * Always returns a non-NULL pointer to a xcb_connection_t, even on failure. + * Callers need to use xcb_connection_has_error() to check for failure. + * When finished, use xcb_disconnect() to close the connection and free + * the structure. + */ +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, const char *authfile, int *screenp); + +/** * @brief Connects to the X server, using an authorization information. * @param display: The name of the display. * @param auth: The authorization information. diff --git a/src/xcb_auth.c b/src/xcb_auth.c index 29e2b6f..284a582 100644 --- a/src/xcb_auth.c +++ b/src/xcb_auth.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef __INTERIX /* _don't_ ask. interix has INADDR_LOOPBACK in here. */ @@ -309,7 +310,7 @@ static struct sockaddr *get_peer_sock_name(int (*socket_func)(int, return NULL; } -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, const char *authfile) { /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c, xtrans/Xtransutils.c */ @@ -334,7 +335,17 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) gotsockname = 1; } - authptr = get_authptr(sockname, display); + if (authfile) { + FILE *f = fopen(authfile, "r"); + + if (f) { + authptr = XauReadAuth(f); + fclose(f); + } + } + else + authptr = get_authptr(sockname, display); + if (authptr == 0) { free(sockname); diff --git a/src/xcb_util.c b/src/xcb_util.c index ba0f108..aafb73d 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -475,12 +475,10 @@ static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen) } #endif -xcb_connection_t *xcb_connect(const char *displayname, int *screenp) -{ - return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp); -} - -xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp) +static xcb_connection_t *_xcb_connect_to_display_with_auth_info_or_file(const char *displayname, + const char *authfile, + xcb_auth_info_t *auth, + int *screenp) { int fd, display = 0; char *host = NULL; @@ -518,7 +516,7 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, goto out; } - if(_xcb_get_auth_info(fd, &ourauth, display)) + if(_xcb_get_auth_info(fd, &ourauth, display, authfile)) { c = xcb_connect_to_fd(fd, &ourauth); free(ourauth.name); @@ -542,3 +540,18 @@ out: free(protocol); return c; } + +xcb_connection_t *xcb_connect(const char *displayname, int *screenp) +{ + return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp); +} + +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, const char *authfile, int *screenp) +{ + return _xcb_connect_to_display_with_auth_info_or_file(displayname, authfile, NULL, screenp); +} + +xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp) +{ + return _xcb_connect_to_display_with_auth_info_or_file(displayname, NULL, auth, screenp); +} diff --git a/src/xcbint.h b/src/xcbint.h index f89deba..01aca8c 100644 --- a/src/xcbint.h +++ b/src/xcbint.h @@ -218,7 +218,7 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vec /* xcb_auth.c */ -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display); +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, const char *authfile); #ifdef GCC_HAS_VISIBILITY #pragma GCC visibility pop -- 1.8.4.5 From laerciosousa at sme-mogidascruzes.sp.gov.br Fri Oct 17 11:39:17 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Fri, 17 Oct 2014 15:39:17 -0300 Subject: [Xcb] Translating XkbApplyMappingChange() et al. to xcb-xkb Message-ID: Hi there! I'm currently working on a full XCB backend for xf86-video-nested driver. I'm able to translate all Xlib-related code in file xlibclient.c to XCB, except some Xkb related parts which force me to maintain a minimal XCB-Xlib mix. I would like to translate some Xkb functions used in xf86-video-nested to xcb-xkb in order to get rid of Xlib stuff, namely: XkbGetKeyboard() XkbGetControls() XkbApplyMappingChange() XkbDDXChangeControls() XkbCopyDeviceKeymap() Is it currently possible to translate these functions to xcb-xkb? The relevant files in which these functions appear are the following: http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ran234 at gmail.com Fri Oct 17 12:41:22 2014 From: ran234 at gmail.com (Ran Benita) Date: Fri, 17 Oct 2014 22:41:22 +0300 Subject: [Xcb] Translating XkbApplyMappingChange() et al. to xcb-xkb In-Reply-To: References: Message-ID: <20141017194122.GA13757@ran> On Fri, Oct 17, 2014 at 03:39:17PM -0300, La?rcio de Sousa wrote: > Hi there! > > I'm currently working on a full XCB backend for xf86-video-nested driver. > I'm able to translate all Xlib-related code in file xlibclient.c to XCB, > except some Xkb related parts which force me to maintain a minimal XCB-Xlib > mix. I am sorry, I am not familiar with this code, but I can offer some pointers. > I would like to translate some Xkb functions used in xf86-video-nested to > xcb-xkb in order to get rid of Xlib stuff, namely: > > XkbGetKeyboard() > > XkbGetControls() You can do the equivalent of these calls using xcb-xkb. From my quick read it appears you use these calls to fill up the server's XKB data structures. I have done something similar, but instead filling somewhat equivalent structures in the libxkbcommon library (mostly like the XkbGetKeyboard function; we don't need most XKB controls. But the call is there). It's a lot of work, but maybe it can help: https://github.com/xkbcommon/libxkbcommon/blob/master/src/x11/keymap.c Note that XkbGetKeyboard translates to many protocol requests. > XkbApplyMappingChange() > > XkbDDXChangeControls() > > XkbCopyDeviceKeymap() These are internal server functions/API, no xlib ones. So I imagine you can keep them? Ran > Is it currently possible to translate these functions to xcb-xkb? The > relevant files in which these functions appear are the following: > > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c > -- > *La?rcio de Sousa* > *Orientador de Inform?tica* > *Escola Municipal "Professor Eul?lio Gruppi"* > *Rua Ismael da Silva Mello, 559, Mogi Moderno* > *Mogi das Cruzes - SPCEP 08717-390* > Telefone: (11) 4726-8313 > _______________________________________________ > xorg-devel at lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel From chris at DemoRecorder.com Sat Oct 18 01:02:15 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 18 Oct 2014 10:02:15 +0200 Subject: [Xcb] Translating XkbApplyMappingChange() et al. to xcb-xkb In-Reply-To: References: Message-ID: <54421E87.90300@DemoRecorder.com> The XCB protocol definitions for XKB are not finished yet, i.e. they contain bugs and some stuff is missing there. I have fixed most of that, but not yet submitted my changes. Reason for not yet submitting: I wait for my XInput stuff to be integrated in upstream before adding more pending stuff to our review-queue that's already quite long. So, you may have to wait until we fix the XKB issues. You can of course start your work now, but don't be surprised if some of your testcases fail due to errors in the XKB-support of XCB. Chris On 10/17/14 20:39, La?rcio de Sousa wrote: > Hi there! > > I'm currently working on a full XCB backend for xf86-video-nested driver. I'm able to translate all Xlib-related code in file xlibclient.c to XCB, except some Xkb related parts which force me to maintain a minimal XCB-Xlib mix. > > I would like to translate some Xkb functions used in xf86-video-nested to xcb-xkb in order to get rid of Xlib stuff, namely: > > XkbGetKeyboard() > > XkbGetControls() > > XkbApplyMappingChange() > > XkbDDXChangeControls() > > XkbCopyDeviceKeymap() > > Is it currently possible to translate these functions to xcb-xkb? The relevant files in which these functions appear are the following: > > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c > -- > *La?rcio de Sousa* > /Orientador de Inform?tica/ > _Escola Municipal "Professor Eul?lio Gruppi"_ > /Rua Ismael da Silva Mello, 559, Mogi Moderno/ > / > /Mogi das Cruzes - SP/ > /CEP 08717-390/ > / > Telefone: (11) 4726-8313 > > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From psychon at znc.in Sat Oct 18 01:17:53 2014 From: psychon at znc.in (Uli Schlachter) Date: Sat, 18 Oct 2014 10:17:53 +0200 Subject: [Xcb] [PATCH libxcb] Introduce new funcion xcb_connect_with_auth_file(). In-Reply-To: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <54422231.6020108@znc.in> Hi, typo in the subject: funcTion I have not much clue about X11 authentication. Could someone else comment on the idea behind this patch? Am 17.10.2014 um 20:23 schrieb La?rcio de Sousa: > This patch introduces a function called xcb_connect_with_auth_file(), > which is similar to xcb_connect_to_display_with_auth_info(), but expects > an authorization file path rather than a xcb_auth_info_t struct. > > Signed-off-by: La?rcio de Sousa > --- > src/xcb.h | 21 +++++++++++++++++++++ > src/xcb_auth.c | 15 +++++++++++++-- > src/xcb_util.c | 27 ++++++++++++++++++++------- > src/xcbint.h | 2 +- > 4 files changed, 55 insertions(+), 10 deletions(-) > > diff --git a/src/xcb.h b/src/xcb.h > index 23fe74e..0314ce5 100644 > --- a/src/xcb.h > +++ b/src/xcb.h > @@ -535,6 +535,27 @@ int xcb_parse_display(const char *name, char **host, int *display, int *screen); > xcb_connection_t *xcb_connect(const char *displayname, int *screenp); > > /** > + * @brief Connects to the X server, using and authorization file. > + * @param displayname: The name of the display. > + * @param authfile: The authorization file path. > + * @param screenp: A pointer to a preferred screen number. > + * @return A newly allocated xcb_connection_t structure. > + * > + * Connects to the X server specified by @p displayname, using the > + * authorization file @p authfile. If @p authfile value @c NULL, uses > + * the value of the XAUTHORITY environment variable. If a particular > + * screen on that server is preferred, the int pointed to by @p screenp > + * (if not @c NULL) will be set to that screen; otherwise @p screenp > + * will be set to 0. > + * > + * Always returns a non-NULL pointer to a xcb_connection_t, even on failure. > + * Callers need to use xcb_connection_has_error() to check for failure. > + * When finished, use xcb_disconnect() to close the connection and free > + * the structure. > + */ > +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, const char *authfile, int *screenp); > + > +/** > * @brief Connects to the X server, using an authorization information. > * @param display: The name of the display. > * @param auth: The authorization information. > diff --git a/src/xcb_auth.c b/src/xcb_auth.c > index 29e2b6f..284a582 100644 > --- a/src/xcb_auth.c > +++ b/src/xcb_auth.c > @@ -34,6 +34,7 @@ > #include > #include > #include > +#include > > #ifdef __INTERIX > /* _don't_ ask. interix has INADDR_LOOPBACK in here. */ > @@ -309,7 +310,7 @@ static struct sockaddr *get_peer_sock_name(int (*socket_func)(int, > return NULL; > } > > -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) > +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, const char *authfile) > { > /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c, > xtrans/Xtransutils.c */ > @@ -334,7 +335,17 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) > gotsockname = 1; > } > > - authptr = get_authptr(sockname, display); > + if (authfile) { > + FILE *f = fopen(authfile, "r"); > + > + if (f) { Instead of ignoring errors, shouldn't this return an error connection to the caller? > + authptr = XauReadAuth(f); Ok, now I actually googled this code and the man page says: XauReadAuth reads the next entry from auth_file. The entry is not statically allocated and should be freed by calling XauDisposeAuth. I have no clue about Xau, but the part that says "the next entry" makes me think that this code doesn't actually work well. And yeah, "xauth list" in a terminal obviously indicates that an XAUTHORITY file can contain multiple authentications. Your code will only use the first one. > + fclose(f); > + } > + } > + else > + authptr = get_authptr(sockname, display); > + > if (authptr == 0) > { > free(sockname); > diff --git a/src/xcb_util.c b/src/xcb_util.c > index ba0f108..aafb73d 100644 > --- a/src/xcb_util.c > +++ b/src/xcb_util.c > @@ -475,12 +475,10 @@ static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen) > } > #endif > > -xcb_connection_t *xcb_connect(const char *displayname, int *screenp) > -{ > - return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp); > -} > - > -xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp) > +static xcb_connection_t *_xcb_connect_to_display_with_auth_info_or_file(const char *displayname, > + const char *authfile, > + xcb_auth_info_t *auth, > + int *screenp) > { > int fd, display = 0; > char *host = NULL; > @@ -518,7 +516,7 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, > goto out; > } > > - if(_xcb_get_auth_info(fd, &ourauth, display)) > + if(_xcb_get_auth_info(fd, &ourauth, display, authfile)) > { > c = xcb_connect_to_fd(fd, &ourauth); > free(ourauth.name); > @@ -542,3 +540,18 @@ out: > free(protocol); > return c; > } > + > +xcb_connection_t *xcb_connect(const char *displayname, int *screenp) > +{ > + return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp); I'd propose to call _xcb_connect_to_display_with_auth_info_or_file() directly (urgh, what a function name...). > +} > + > +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, const char *authfile, int *screenp) > +{ > + return _xcb_connect_to_display_with_auth_info_or_file(displayname, authfile, NULL, screenp); > +} > + > +xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp) > +{ > + return _xcb_connect_to_display_with_auth_info_or_file(displayname, NULL, auth, screenp); > +} > diff --git a/src/xcbint.h b/src/xcbint.h > index f89deba..01aca8c 100644 > --- a/src/xcbint.h > +++ b/src/xcbint.h > @@ -218,7 +218,7 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vec > > /* xcb_auth.c */ > > -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display); > +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, const char *authfile); > > #ifdef GCC_HAS_VISIBILITY > #pragma GCC visibility pop > Cheers, Uli -- A normal person is just someone you don't know well enough yet. - Nettie Wiebe From tiwari.jaya18 at gmail.com Sat Oct 18 01:34:04 2014 From: tiwari.jaya18 at gmail.com (Jaya Tiwari) Date: Sat, 18 Oct 2014 14:04:04 +0530 Subject: [Xcb] Fwd: Changing to in render extension In-Reply-To: References: Message-ID: I am an OPW intern applicant for round 9 and interested in server-side xcb under mentorship of Christian Linhart. For my initial small contribution, I have changed to in two requests of the render extension. The reason is that is recommended in the xml-xcb-spec instead of and the contains a more precise description of the protocol. I have following observations : 1. xcb_render_create_picture_value_list_t : A new structure with value mask names is added. 2. Size computed by function xcb_render_create_picture_value_list_unpack (as used by function xcb_render_create_picture_value_list_sizeof) does essentially the same as the expression with popcount in xcb_render_create_picture_sizeof, but xcb_render_create_picture_ sizeof computes the size of the whole request "render_create_picture" and xcb_render_create_picture_value_list_sizeof only computes the size of the switch ( with name "value_list" ) So it is not directly compatible because the name of the function is different, so it won't compile or link with existing code which uses the previous version. 3. parameter type const uint32_t* of value_list in xcb_render_create_picture and xcb_render_create_picture_checked changed to const void*. 4. In xcb_render_create_picture, again instead of initializing xcb_parts with popcounting elements from value_list, it checks all possible masks using xcb_render_create_picture_value_list_sizeof and initializes xcb_parts. 5. The work of sending request is done in xcb_render_create_picture, same things is again repeated in xcb_render_create_picture_aux (i dont really have much idea of differences in aux and non-aux functions) Along is a xml (render extension) diff along with libxcl implementation header and c files attached. Please comment on the diffs and observations and correct me wherever my understanding fails. Thankyou. Regards, Jaya -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff --git a/before_change/src/render.c b/libxcb/src/render.c index 5ac468c..cae02bd 100644 --- a/before_change/src/render.c +++ b/libxcb/src/render.c @@ -796,24 +796,257 @@ xcb_render_query_pict_index_values_reply (xcb_connection_t } int -xcb_render_create_picture_sizeof (const void *_buffer /**< */) +xcb_render_create_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *_aux /**< */) +{ + char *xcb_out = *_buffer; + unsigned int xcb_buffer_len = 0; + unsigned int xcb_align_to = 0; + + unsigned int xcb_pad = 0; + char xcb_pad0[3] = {0, 0, 0}; + struct iovec xcb_parts[14]; + unsigned int xcb_parts_idx = 0; + unsigned int xcb_block_len = 0; + unsigned int i; + char *xcb_tmp; + + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_create_picture_value_list_t.repeat */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->repeat; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_create_picture_value_list_t.alphamap */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphamap; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphaxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphaxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphayorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphayorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipyorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipyorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_create_picture_value_list_t.clipmask */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipmask; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_create_picture_value_list_t.graphicsexposure */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->graphicsexposure; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_create_picture_value_list_t.subwindowmode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->subwindowmode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_create_picture_value_list_t.polyedge */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polyedge; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_create_picture_value_list_t.polymode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polymode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_create_picture_value_list_t.dither */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->dither; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_create_picture_value_list_t.componentalpha */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->componentalpha; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + /* insert padding */ + xcb_pad = -xcb_block_len & (xcb_align_to - 1); + xcb_buffer_len += xcb_block_len + xcb_pad; + if (0 != xcb_pad) { + xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; + xcb_parts[xcb_parts_idx].iov_len = xcb_pad; + xcb_parts_idx++; + xcb_pad = 0; + } + xcb_block_len = 0; + + if (NULL == xcb_out) { + /* allocate memory */ + xcb_out = malloc(xcb_buffer_len); + *_buffer = xcb_out; + } + + xcb_tmp = xcb_out; + for(i=0; ivalue_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_create_picture_value_list_t.repeat */ + _aux->repeat = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_create_picture_value_list_t.alphamap */ + _aux->alphamap = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphaxorigin */ + _aux->alphaxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphayorigin */ + _aux->alphayorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipxorigin */ + _aux->clipxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipyorigin */ + _aux->clipyorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_create_picture_value_list_t.clipmask */ + _aux->clipmask = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_create_picture_value_list_t.graphicsexposure */ + _aux->graphicsexposure = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_create_picture_value_list_t.subwindowmode */ + _aux->subwindowmode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_create_picture_value_list_t.polyedge */ + _aux->polyedge = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_create_picture_value_list_t.polymode */ + _aux->polymode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_create_picture_value_list_t.dither */ + _aux->dither = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_create_picture_value_list_t.componentalpha */ + _aux->componentalpha = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } /* insert padding */ xcb_pad = -xcb_block_len & (xcb_align_to - 1); xcb_buffer_len += xcb_block_len + xcb_pad; @@ -826,22 +1059,30 @@ xcb_render_create_picture_sizeof (const void *_buffer /**< */) return xcb_buffer_len; } +int +xcb_render_create_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */) +{ + xcb_render_create_picture_value_list_t _aux; + return xcb_render_create_picture_value_list_unpack(_buffer, value_mask, &_aux); +} + xcb_void_cookie_t xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t pid /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CREATE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_create_picture_request_t xcb_out; @@ -854,11 +1095,10 @@ xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_create_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_sizeof (value_list, value_mask); xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); return xcb_ret; @@ -870,16 +1110,16 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CREATE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_create_picture_request_t xcb_out; @@ -892,35 +1132,345 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_create_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_sizeof (value_list, value_mask); + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_create_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CREATE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_create_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.pid = pid; + xcb_out.drawable = drawable; + xcb_out.format = format; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_create_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + free(xcb_aux0); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_create_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CREATE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_create_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.pid = pid; + xcb_out.drawable = drawable; + xcb_out.format = format; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_create_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + free(xcb_aux0); return xcb_ret; } int -xcb_render_change_picture_sizeof (const void *_buffer /**< */) +xcb_render_change_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *_aux /**< */) +{ + char *xcb_out = *_buffer; + unsigned int xcb_buffer_len = 0; + unsigned int xcb_align_to = 0; + + unsigned int xcb_pad = 0; + char xcb_pad0[3] = {0, 0, 0}; + struct iovec xcb_parts[14]; + unsigned int xcb_parts_idx = 0; + unsigned int xcb_block_len = 0; + unsigned int i; + char *xcb_tmp; + + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_change_picture_value_list_t.repeat */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->repeat; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_change_picture_value_list_t.alphamap */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphamap; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphaxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphaxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphayorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphayorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipyorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipyorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_change_picture_value_list_t.clipmask */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipmask; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_change_picture_value_list_t.graphicsexposure */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->graphicsexposure; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_change_picture_value_list_t.subwindowmode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->subwindowmode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_change_picture_value_list_t.polyedge */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polyedge; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_change_picture_value_list_t.polymode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polymode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_change_picture_value_list_t.dither */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->dither; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_change_picture_value_list_t.componentalpha */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->componentalpha; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + /* insert padding */ + xcb_pad = -xcb_block_len & (xcb_align_to - 1); + xcb_buffer_len += xcb_block_len + xcb_pad; + if (0 != xcb_pad) { + xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; + xcb_parts[xcb_parts_idx].iov_len = xcb_pad; + xcb_parts_idx++; + xcb_pad = 0; + } + xcb_block_len = 0; + + if (NULL == xcb_out) { + /* allocate memory */ + xcb_out = malloc(xcb_buffer_len); + *_buffer = xcb_out; + } + + xcb_tmp = xcb_out; + for(i=0; ivalue_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_change_picture_value_list_t.repeat */ + _aux->repeat = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_change_picture_value_list_t.alphamap */ + _aux->alphamap = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphaxorigin */ + _aux->alphaxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphayorigin */ + _aux->alphayorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipxorigin */ + _aux->clipxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipyorigin */ + _aux->clipyorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_change_picture_value_list_t.clipmask */ + _aux->clipmask = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_change_picture_value_list_t.graphicsexposure */ + _aux->graphicsexposure = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_change_picture_value_list_t.subwindowmode */ + _aux->subwindowmode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_change_picture_value_list_t.polyedge */ + _aux->polyedge = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_change_picture_value_list_t.polymode */ + _aux->polymode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_change_picture_value_list_t.dither */ + _aux->dither = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_change_picture_value_list_t.componentalpha */ + _aux->componentalpha = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } /* insert padding */ xcb_pad = -xcb_block_len & (xcb_align_to - 1); xcb_buffer_len += xcb_block_len + xcb_pad; @@ -933,20 +1483,28 @@ xcb_render_change_picture_sizeof (const void *_buffer /**< */) return xcb_buffer_len; } +int +xcb_render_change_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */) +{ + xcb_render_change_picture_value_list_t _aux; + return xcb_render_change_picture_value_list_unpack(_buffer, value_mask, &_aux); +} + xcb_void_cookie_t xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CHANGE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_change_picture_request_t xcb_out; @@ -957,11 +1515,10 @@ xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_change_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_sizeof (value_list, value_mask); xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); return xcb_ret; @@ -971,16 +1528,16 @@ xcb_void_cookie_t xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CHANGE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_change_picture_request_t xcb_out; @@ -991,13 +1548,82 @@ xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_change_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_sizeof (value_list, value_mask); + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_change_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CHANGE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_change_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.picture = picture; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_change_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + free(xcb_aux0); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_change_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CHANGE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_change_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.picture = picture; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_change_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + free(xcb_aux0); return xcb_ret; } -------------- next part -------------- diff --git a/before_change/src/render.h b/libxcb/src/render.h index 8b4a524..ae3aada 100644 --- a/before_change/src/render.h +++ b/libxcb/src/render.h @@ -575,6 +575,25 @@ typedef struct xcb_render_query_pict_index_values_reply_t { uint8_t pad1[20]; /**< */ } xcb_render_query_pict_index_values_reply_t; +/** + * @brief xcb_render_create_picture_value_list_t + **/ +typedef struct xcb_render_create_picture_value_list_t { + uint32_t repeat; /**< */ + uint32_t alphamap; /**< */ + uint32_t alphaxorigin; /**< */ + uint32_t alphayorigin; /**< */ + uint32_t clipxorigin; /**< */ + uint32_t clipyorigin; /**< */ + uint32_t clipmask; /**< */ + uint32_t graphicsexposure; /**< */ + uint32_t subwindowmode; /**< */ + uint32_t polyedge; /**< */ + uint32_t polymode; /**< */ + uint32_t dither; /**< */ + uint32_t componentalpha; /**< */ +} xcb_render_create_picture_value_list_t; + /** Opcode for xcb_render_create_picture. */ #define XCB_RENDER_CREATE_PICTURE 4 @@ -591,6 +610,25 @@ typedef struct xcb_render_create_picture_request_t { uint32_t value_mask; /**< */ } xcb_render_create_picture_request_t; +/** + * @brief xcb_render_change_picture_value_list_t + **/ +typedef struct xcb_render_change_picture_value_list_t { + uint32_t repeat; /**< */ + uint32_t alphamap; /**< */ + uint32_t alphaxorigin; /**< */ + uint32_t alphayorigin; /**< */ + uint32_t clipxorigin; /**< */ + uint32_t clipyorigin; /**< */ + uint32_t clipmask; /**< */ + uint32_t graphicsexposure; /**< */ + uint32_t subwindowmode; /**< */ + uint32_t polyedge; /**< */ + uint32_t polymode; /**< */ + uint32_t dither; /**< */ + uint32_t componentalpha; /**< */ +} xcb_render_change_picture_value_list_t; + /** Opcode for xcb_render_change_picture. */ #define XCB_RENDER_CHANGE_PICTURE 5 @@ -1714,7 +1752,18 @@ xcb_render_query_pict_index_values_reply (xcb_connection_t xcb_generic_error_t **e /**< */); int -xcb_render_create_picture_sizeof (const void *_buffer /**< */); +xcb_render_create_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *_aux /**< */); + +int +xcb_render_create_picture_value_list_unpack (const void *_buffer /**< */, + uint32_t value_mask /**< */, + xcb_render_create_picture_value_list_t *_aux /**< */); + +int +xcb_render_create_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */); /** * @@ -1733,7 +1782,7 @@ xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); /** * @@ -1749,10 +1798,56 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_render_create_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_render_create_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */); + +int +xcb_render_change_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *_aux /**< */); int -xcb_render_change_picture_sizeof (const void *_buffer /**< */); +xcb_render_change_picture_value_list_unpack (const void *_buffer /**< */, + uint32_t value_mask /**< */, + xcb_render_change_picture_value_list_t *_aux /**< */); + +int +xcb_render_change_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */); /** * @@ -1769,7 +1864,7 @@ xcb_void_cookie_t xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); /** * @@ -1783,7 +1878,38 @@ xcb_void_cookie_t xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_render_change_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_render_change_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */); int xcb_render_set_picture_clip_rectangles_sizeof (const void *_buffer /**< */, -------------- next part -------------- diff --git a/home/pratyush/checkout/xorg-build/proto/src/render.xml b/proto/src/render.xml index 55b73f7..6285134 100644 --- a/home/pratyush/checkout/xorg-build/proto/src/render.xml +++ b/proto/src/render.xml @@ -280,16 +280,124 @@ for licensing information. - + + + value_mask + + Repeat + + + + AlphaMap + + + + AlphaXOrigin + + + + AlphaYOrigin + + + + ClipXOrigin + + + + ClipYOrigin + + + + ClipMask + + + + GraphicsExposure + + + + SubwindowMode + + + + PolyEdge + + + + PolyMode + + + + Dither + + + + ComponentAlpha + + + + + - + + + value_mask + + Repeat + + + + AlphaMap + + + + AlphaXOrigin + + + + AlphaYOrigin + + + + ClipXOrigin + + + + ClipYOrigin + + + + ClipMask + + + + GraphicsExposure + + + + SubwindowMode + + + + PolyEdge + + + + PolyMode + + + + Dither + + + + ComponentAlpha + + + From psychon at znc.in Sat Oct 18 01:34:10 2014 From: psychon at znc.in (Uli Schlachter) Date: Sat, 18 Oct 2014 10:34:10 +0200 Subject: [Xcb] [PATCH libxcb] Introduce new funcion xcb_connect_with_auth_file(). In-Reply-To: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> References: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> Message-ID: <54422602.7050104@znc.in> Am 17.10.2014 um 20:23 schrieb La?rcio de Sousa: [...] > @@ -334,7 +335,17 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) > gotsockname = 1; > } > > - authptr = get_authptr(sockname, display); > + if (authfile) { > + FILE *f = fopen(authfile, "r"); [...] Thanks to Windows, this should be "rb" instead of "r" (I was reading through Xau source code and noticed this). Uli -- A normal person is just someone you don't know well enough yet. - Nettie Wiebe From chris at DemoRecorder.com Sat Oct 18 02:07:21 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 18 Oct 2014 11:07:21 +0200 Subject: [Xcb] [PATCH libxcb 1/6] generator: fix absname for fields with only accessor function In-Reply-To: <20141014132438.GD1444@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> <543BD4A3.1020606@DemoRecorder.com> <20141014132438.GD1444@ran> Message-ID: <54422DC9.9020503@DemoRecorder.com> On 10/14/14 15:24, Ran Benita wrote: > On Mon, Oct 13, 2014 at 03:33:23PM +0200, Christian Linhart wrote: >> On 10/12/14 20:07, Ran Benita wrote: >>> On Wed, Sep 03, 2014 at 01:22:36PM +0200, Christian Linhart wrote: [...] >>> This function is strange; most of the time it generates complete garbage >>> (e.g. `foo->...->`) which is subsequently ignored. So it is called for >>> no reason many times. >> I do not understand the problem here, > > Basically, "garbage in, garbage out". The problem is the "garbage in" > part - it shouldn't happen in well-structured code... (of course this > is well before this patchset). OK. I agree with you that this should not happen. We should address this later as it is unrelated to this patchset. For that: Do you have a testcase where such garbage is generated, together with info which garbage is generated, and why this is garbage? [...] >>>> """ >>>> turn prefix, which is a list of tuples (name, separator, Type obj) into a string >>>> representing a valid name in C (based on the context) >>>> if field is not None, append the field name as well >>>> """ >>>> prefix_str = '' >>>> + last_sep ='' >>>> for name, sep, obj in prefix: >>>> + if '' != last_sep: >>>> + prefix_str += last_sep >>>> prefix_str += name >>>> if '' == sep: >>> [...] > > I looked over the callers, and saw that `sep` is never empty. I had a > patch which added `assert sep != ''`. This worked on master, but failed > on top of your patch set. It is probably more "GIGO" but I dropped it > (but forgot to amend this comment). Interesting. Do you remember where sep is empty on top of my patch set? If you don't remember it, no problem, I'll test this myself. Maybe this hints to a bug. [...] >>> >>> This is a formidable list of conditions. Are all of them needed? >> I think that yes they are all needed, but there may be a better alternative ( see below ). >> >>> Can >>> this be extracted to a function `field_needs_accessor` or something like >>> that? >> >> I have thought about that and came to the conclusion that there probably is an even better alternative >> than to encapsulate those conditions in a function: >> >> Probably it is better to set a flag at the place where it has already been decided that this field >> does not appear in a C-struct. ( or use the reverse semantic ) >> Then just use that flag here. >> That would have the advantage that these conditions need not be updated when something is changed somewhere else. > > I wouldn't advocate a state variable over a pure function. But if it is > constant that's the same. I have to analyze the code that does his kind of decision elsewhere. Depending on that code, a state variable may be better than a function or vice versa. > >> Would it be OK to use this patch as it is now >> and that I post a simplification fix later, >> after this is merged to upstream? >> >> Or shall I submit V2 of this patch, with changes as I have suggested above? >> ( This will probably take some time ). > > I'll try to understand the given code. Thank you. If you have questions please tell me and I'll be glad to answer them. If I have time, I'll look into it and check for possibilities of simplification. [...] >>> I'm not entirely convinced that this should be in this function - or the >>> function should be renamed. >> Renaming is a good idea for that function anyways. >> Even the existing version of that function does not compute an "absolute name" but computes a C-expression >> to access a specific field in the context defined by the "prefix" parameter. >> >> I suggest the following name: "_c_helper_field_access_expr" >> ( or something similar) > > If this name is accurate, that would be a big improvement. I have put this on my simplification-TODO list and will rename it once everything is merged in upstream. > >>> Is the above the correct thing to do in all >>> of the callsites? >> Good question. >> >> I am pretty sure that the answer is yes, because of the following: >> >> * The previous version of that function returned a C-expression that can also be used as an lvalue, i.e., C can assign something to it. >> >> * Due to my patches, the returned C-expression may be an rvalue in those cases where the old function returned something that cannot compile. >> ( i.e. these are the cases where the field does not occur in a C-struct) >> >> * So, the behavior only changes for those cases where the existing version of that function returns something that is not compilable. >> So, it doesn't break anything. >> >> * If, in those cases, the output of that function were somewhere inserted in the role of an lvalue, >> the C-compiler would complain. >> But the Compiler does not complain, which means that the resulting C-expression is only used as an rvalue. >> ( at least for all of our current xml-files. ) >> >> I hope that this explains it better. >> >> If you have more questions, please tell me and I'll be glad to answer them. >> >>> >>> Sorry for having more questions than answers; it is not for lack of >>> trying.. >> No problem. >> I wrote the change, so I have find the answers... :-) > > I will take another look. If someday you can simplify this, it would be > nice :) Yes, I'll do that. Once we have the functionality in there, I am also very interested in a cleanup, so that maintenance or adding new functionality in the future will be easier and so that we can be more sure about the reliability and correctness of the whole thing. (My X11 related business is about missing critical code, so I have every interest in reliability of the code. Also, I therefore operate quite differently from a typical commercial software company. I have a zero-known-bug release policy for example, ...) > I hate to say this, but you are paying off some technical debt > left by a previous programmer whose code may be found with "git blame"... Yep, there is some technical debt in this code, but I have seen far worse cases of technical debt. So I think it is still in a state that can be repaired. Or to put it in a bit more positive way, previously some of this code was written with a pioneer attitude to get things working quickly by using a kind of rapid-prototyping-style. This may have been useful for the project to gain some traction, but left some debt which needs cleanup. Actually most commercial code is developed that way, but without the cleanup state, so left in a messy state until the software has to be rewritten from scratch or the company goes belly-up due to exponentially growing maintenance cost. The typical manager speak is: "We agree that cleanup is useful. But we have 23428 more urgent things to do now. We'll do that later." Of course "Later" never happens. I am glad we don't have this kind of pressure and "guidance" in a free software project like this. Chris From chris at DemoRecorder.com Sat Oct 18 02:37:24 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 18 Oct 2014 11:37:24 +0200 Subject: [Xcb] Fwd: Changing to in render extension In-Reply-To: References: Message-ID: <544234D4.9000103@DemoRecorder.com> Thank you for your contribution, Jaya. I think that the diffs and Jaya's analysis show that it is quite feasible to change to in existing protocol definitions. Here's my reasoning: 1. The function xcb_render_create_picture_sizeof is missing when using . But it is probably a rather simple change in the generator to generate it again. Maybe we'll need an xml-attribute such that is generated in "valueparam compatibility mode", so that the additional sizeof-functions are only generated in those cases where they are needed. I think we should postpone changing the generator until all pending patches are merged into upstream and until we'll have done some of the planned code-cleanup stuff. ( To have a stable basis and to avoid too much merging. ) 2. The change of type of the parameter "value_list" as mentioned in point 4 of Jaya's analyis is probably backward compatible due to the following reasons: 2.1. It is calling compatible and linker compatible. Reasons: - C converts all pointer types to void* implicitly. - C does not include types in linktime-names of functions. ( contrary to C++ ) 2.2. There is strong evidence that the data to be passed to that parameter is the same in both vases, i.e., the same memory layout, because in both cases it is simply the protocol representation of this value_list. Of course this requires closer analysis and a testcase before we can be sure. 3. The rest is just new stuff added which does not cause a compatibility problem. So, we have a good chance that we will be able to replace all with . This will also mean that we will then be able to drop support for in the generator, which will help to simplify the generator ( which is always a good thing ). What do you think? Chris On 10/18/14 10:34, Jaya Tiwari wrote: > > I am an OPW intern applicant for round 9 and interested in server-side xcb under mentorship of Christian Linhart. > > For my initial small contribution, > > I have changed to in two requests of the render extension. > The reason is that is recommended in the xml-xcb-spec instead of and the contains a more precise description of the protocol. > > I have following observations : > > 1.xcb_render_create_picture_value_list_t : > A new structure with value mask names is added. > > 2. Size computed by function xcb_render_create_picture_value_list_unpack > (as used by function xcb_render_create_picture_value_list_sizeof) > does essentially the same as the expression with popcount in xcb_render_create_picture_sizeof, but xcb_render_create_picture_ > sizeof computes the size of the whole request "render_create_picture" > and xcb_render_create_picture_value_list_sizeof only computes the size of the switch ( with name "value_list" ) > So it is not directly compatible because the name of the function is different, so it won't compile or link with existing code which uses the previous version. > > 3. parameter type const uint32_t* of value_list in xcb_render_create_picture and xcb_render_create_picture_checked changed to const void*. > > 4. In xcb_render_create_picture, again instead of initializing xcb_parts with popcounting elements from value_list, it checks all possible masks using xcb_render_create_picture_value_list_sizeof and initializes xcb_parts. > > 5. The work of sending request is done in xcb_render_create_picture, same things is again repeated in xcb_render_create_picture_aux (i dont really have much idea of differences in aux and non-aux functions) > > > Along is a xml (render extension) diff along with libxcl implementation header and c files attached. > > Please comment on the diffs and observations and correct me wherever my understanding fails. > > Thankyou. > > Regards, > Jaya > > > > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb From tiwari.jaya18 at gmail.com Fri Oct 17 21:44:58 2014 From: tiwari.jaya18 at gmail.com (Jaya Tiwari) Date: Sat, 18 Oct 2014 10:14:58 +0530 Subject: [Xcb] Fwd: Changing to in render extension In-Reply-To: References: Message-ID: I am an OPW intern applicant for round 9 and interested in server-side xcb under mentorship of Christian Linhart. For my initial small contribution, I have changed to in two requests of the render extension. The reason is that is recommended in the xml-xcb-spec instead of and the contains a more precise description of the protocol. I have following observations : 1. xcb_render_create_picture_value_list_t : A new structure with value mask names is added. 2. Size computed by function xcb_render_create_picture_value_list_unpack (as used by function xcb_render_create_picture_value_list_sizeof) does essentially the same as the expression with popcount in xcb_render_create_picture_sizeof, but xcb_render_create_picture_ sizeof computes the size of the whole request "render_create_picture" and xcb_render_create_picture_value_list_sizeof only computes the size of the switch ( with name "value_list" ) So it is not directly compatible because the name of the function is different, so it won't compile or link with existing code which uses the previous version. 3. parameter type const uint32_t* of value_list in xcb_render_create_picture and xcb_render_create_picture_checked changed to const void*. 4. In xcb_render_create_picture, again instead of initializing xcb_parts with popcounting elements from value_list, it checks all possible masks using xcb_render_create_picture_value_list_sizeof and initializes xcb_parts. 5. The work of sending request is done in xcb_render_create_picture, same things is again repeated in xcb_render_create_picture_aux (i dont really have much idea of differences in aux and non-aux functions) Along is a xml (render extension) diff along with libxcl implementation header and c files attached. Please comment on the diffs and observations and correct me wherever my understanding fails. Thankyou. Regards, Jaya -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff --git a/before_change/src/render.c b/libxcb/src/render.c index 5ac468c..cae02bd 100644 --- a/before_change/src/render.c +++ b/libxcb/src/render.c @@ -796,24 +796,257 @@ xcb_render_query_pict_index_values_reply (xcb_connection_t } int -xcb_render_create_picture_sizeof (const void *_buffer /**< */) +xcb_render_create_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *_aux /**< */) +{ + char *xcb_out = *_buffer; + unsigned int xcb_buffer_len = 0; + unsigned int xcb_align_to = 0; + + unsigned int xcb_pad = 0; + char xcb_pad0[3] = {0, 0, 0}; + struct iovec xcb_parts[14]; + unsigned int xcb_parts_idx = 0; + unsigned int xcb_block_len = 0; + unsigned int i; + char *xcb_tmp; + + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_create_picture_value_list_t.repeat */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->repeat; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_create_picture_value_list_t.alphamap */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphamap; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphaxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphaxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphayorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphayorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipyorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipyorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_create_picture_value_list_t.clipmask */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipmask; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_create_picture_value_list_t.graphicsexposure */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->graphicsexposure; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_create_picture_value_list_t.subwindowmode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->subwindowmode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_create_picture_value_list_t.polyedge */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polyedge; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_create_picture_value_list_t.polymode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polymode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_create_picture_value_list_t.dither */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->dither; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_create_picture_value_list_t.componentalpha */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->componentalpha; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + /* insert padding */ + xcb_pad = -xcb_block_len & (xcb_align_to - 1); + xcb_buffer_len += xcb_block_len + xcb_pad; + if (0 != xcb_pad) { + xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; + xcb_parts[xcb_parts_idx].iov_len = xcb_pad; + xcb_parts_idx++; + xcb_pad = 0; + } + xcb_block_len = 0; + + if (NULL == xcb_out) { + /* allocate memory */ + xcb_out = malloc(xcb_buffer_len); + *_buffer = xcb_out; + } + + xcb_tmp = xcb_out; + for(i=0; ivalue_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_create_picture_value_list_t.repeat */ + _aux->repeat = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_create_picture_value_list_t.alphamap */ + _aux->alphamap = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphaxorigin */ + _aux->alphaxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.alphayorigin */ + _aux->alphayorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipxorigin */ + _aux->clipxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_create_picture_value_list_t.clipyorigin */ + _aux->clipyorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_create_picture_value_list_t.clipmask */ + _aux->clipmask = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_create_picture_value_list_t.graphicsexposure */ + _aux->graphicsexposure = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_create_picture_value_list_t.subwindowmode */ + _aux->subwindowmode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_create_picture_value_list_t.polyedge */ + _aux->polyedge = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_create_picture_value_list_t.polymode */ + _aux->polymode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_create_picture_value_list_t.dither */ + _aux->dither = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_create_picture_value_list_t.componentalpha */ + _aux->componentalpha = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } /* insert padding */ xcb_pad = -xcb_block_len & (xcb_align_to - 1); xcb_buffer_len += xcb_block_len + xcb_pad; @@ -826,22 +1059,30 @@ xcb_render_create_picture_sizeof (const void *_buffer /**< */) return xcb_buffer_len; } +int +xcb_render_create_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */) +{ + xcb_render_create_picture_value_list_t _aux; + return xcb_render_create_picture_value_list_unpack(_buffer, value_mask, &_aux); +} + xcb_void_cookie_t xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t pid /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CREATE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_create_picture_request_t xcb_out; @@ -854,11 +1095,10 @@ xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_create_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_sizeof (value_list, value_mask); xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); return xcb_ret; @@ -870,16 +1110,16 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CREATE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_create_picture_request_t xcb_out; @@ -892,35 +1132,345 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_create_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_sizeof (value_list, value_mask); + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_create_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CREATE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_create_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.pid = pid; + xcb_out.drawable = drawable; + xcb_out.format = format; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_create_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + free(xcb_aux0); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_create_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CREATE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_create_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.pid = pid; + xcb_out.drawable = drawable; + xcb_out.format = format; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_create_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_create_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + free(xcb_aux0); return xcb_ret; } int -xcb_render_change_picture_sizeof (const void *_buffer /**< */) +xcb_render_change_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *_aux /**< */) +{ + char *xcb_out = *_buffer; + unsigned int xcb_buffer_len = 0; + unsigned int xcb_align_to = 0; + + unsigned int xcb_pad = 0; + char xcb_pad0[3] = {0, 0, 0}; + struct iovec xcb_parts[14]; + unsigned int xcb_parts_idx = 0; + unsigned int xcb_block_len = 0; + unsigned int i; + char *xcb_tmp; + + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_change_picture_value_list_t.repeat */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->repeat; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_change_picture_value_list_t.alphamap */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphamap; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphaxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphaxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphayorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->alphayorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipxorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipxorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipyorigin */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipyorigin; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_change_picture_value_list_t.clipmask */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->clipmask; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_change_picture_value_list_t.graphicsexposure */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->graphicsexposure; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_change_picture_value_list_t.subwindowmode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->subwindowmode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_change_picture_value_list_t.polyedge */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polyedge; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_change_picture_value_list_t.polymode */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->polymode; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_change_picture_value_list_t.dither */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->dither; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_change_picture_value_list_t.componentalpha */ + xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->componentalpha; + xcb_block_len += sizeof(uint32_t); + xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); + xcb_parts_idx++; + xcb_align_to = ALIGNOF(uint32_t); + } + /* insert padding */ + xcb_pad = -xcb_block_len & (xcb_align_to - 1); + xcb_buffer_len += xcb_block_len + xcb_pad; + if (0 != xcb_pad) { + xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; + xcb_parts[xcb_parts_idx].iov_len = xcb_pad; + xcb_parts_idx++; + xcb_pad = 0; + } + xcb_block_len = 0; + + if (NULL == xcb_out) { + /* allocate memory */ + xcb_out = malloc(xcb_buffer_len); + *_buffer = xcb_out; + } + + xcb_tmp = xcb_out; + for(i=0; ivalue_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); + if(value_mask & XCB_RENDER_CP_REPEAT) { + /* xcb_render_change_picture_value_list_t.repeat */ + _aux->repeat = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_MAP) { + /* xcb_render_change_picture_value_list_t.alphamap */ + _aux->alphamap = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphaxorigin */ + _aux->alphaxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_ALPHA_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.alphayorigin */ + _aux->alphayorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_X_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipxorigin */ + _aux->clipxorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_Y_ORIGIN) { + /* xcb_render_change_picture_value_list_t.clipyorigin */ + _aux->clipyorigin = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_CLIP_MASK) { + /* xcb_render_change_picture_value_list_t.clipmask */ + _aux->clipmask = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_GRAPHICS_EXPOSURE) { + /* xcb_render_change_picture_value_list_t.graphicsexposure */ + _aux->graphicsexposure = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_SUBWINDOW_MODE) { + /* xcb_render_change_picture_value_list_t.subwindowmode */ + _aux->subwindowmode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_EDGE) { + /* xcb_render_change_picture_value_list_t.polyedge */ + _aux->polyedge = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_POLY_MODE) { + /* xcb_render_change_picture_value_list_t.polymode */ + _aux->polymode = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_DITHER) { + /* xcb_render_change_picture_value_list_t.dither */ + _aux->dither = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } + if(value_mask & XCB_RENDER_CP_COMPONENT_ALPHA) { + /* xcb_render_change_picture_value_list_t.componentalpha */ + _aux->componentalpha = *(uint32_t *)xcb_tmp; + xcb_block_len += sizeof(uint32_t); + xcb_tmp += sizeof(uint32_t); + xcb_align_to = ALIGNOF(uint32_t); + } /* insert padding */ xcb_pad = -xcb_block_len & (xcb_align_to - 1); xcb_buffer_len += xcb_block_len + xcb_pad; @@ -933,20 +1483,28 @@ xcb_render_change_picture_sizeof (const void *_buffer /**< */) return xcb_buffer_len; } +int +xcb_render_change_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */) +{ + xcb_render_change_picture_value_list_t _aux; + return xcb_render_change_picture_value_list_unpack(_buffer, value_mask, &_aux); +} + xcb_void_cookie_t xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CHANGE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_change_picture_request_t xcb_out; @@ -957,11 +1515,10 @@ xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_change_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_sizeof (value_list, value_mask); xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); return xcb_ret; @@ -971,16 +1528,16 @@ xcb_void_cookie_t xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) + const void *value_list /**< */) { static const xcb_protocol_request_t xcb_req = { - /* count */ 4, + /* count */ 3, /* ext */ &xcb_render_id, /* opcode */ XCB_RENDER_CHANGE_PICTURE, /* isvoid */ 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_render_change_picture_request_t xcb_out; @@ -991,13 +1548,82 @@ xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_parts[2].iov_len = sizeof(xcb_out); xcb_parts[3].iov_base = 0; xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; - /* uint32_t value_list */ + /* xcb_render_change_picture_value_list_t value_list */ xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_sizeof (value_list, value_mask); + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_change_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CHANGE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_change_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.picture = picture; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_change_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + free(xcb_aux0); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_render_change_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */) +{ + static const xcb_protocol_request_t xcb_req = { + /* count */ 3, + /* ext */ &xcb_render_id, + /* opcode */ XCB_RENDER_CHANGE_PICTURE, + /* isvoid */ 1 + }; + + struct iovec xcb_parts[5]; + xcb_void_cookie_t xcb_ret; + xcb_render_change_picture_request_t xcb_out; + void *xcb_aux0 = 0; + + xcb_out.picture = picture; + xcb_out.value_mask = value_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_render_change_picture_value_list_t value_list */ + xcb_parts[4].iov_len = + xcb_render_change_picture_value_list_serialize (&xcb_aux0, value_mask, value_list); + xcb_parts[4].iov_base = xcb_aux0; xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + free(xcb_aux0); return xcb_ret; } -------------- next part -------------- diff --git a/before_change/src/render.h b/libxcb/src/render.h index 8b4a524..ae3aada 100644 --- a/before_change/src/render.h +++ b/libxcb/src/render.h @@ -575,6 +575,25 @@ typedef struct xcb_render_query_pict_index_values_reply_t { uint8_t pad1[20]; /**< */ } xcb_render_query_pict_index_values_reply_t; +/** + * @brief xcb_render_create_picture_value_list_t + **/ +typedef struct xcb_render_create_picture_value_list_t { + uint32_t repeat; /**< */ + uint32_t alphamap; /**< */ + uint32_t alphaxorigin; /**< */ + uint32_t alphayorigin; /**< */ + uint32_t clipxorigin; /**< */ + uint32_t clipyorigin; /**< */ + uint32_t clipmask; /**< */ + uint32_t graphicsexposure; /**< */ + uint32_t subwindowmode; /**< */ + uint32_t polyedge; /**< */ + uint32_t polymode; /**< */ + uint32_t dither; /**< */ + uint32_t componentalpha; /**< */ +} xcb_render_create_picture_value_list_t; + /** Opcode for xcb_render_create_picture. */ #define XCB_RENDER_CREATE_PICTURE 4 @@ -591,6 +610,25 @@ typedef struct xcb_render_create_picture_request_t { uint32_t value_mask; /**< */ } xcb_render_create_picture_request_t; +/** + * @brief xcb_render_change_picture_value_list_t + **/ +typedef struct xcb_render_change_picture_value_list_t { + uint32_t repeat; /**< */ + uint32_t alphamap; /**< */ + uint32_t alphaxorigin; /**< */ + uint32_t alphayorigin; /**< */ + uint32_t clipxorigin; /**< */ + uint32_t clipyorigin; /**< */ + uint32_t clipmask; /**< */ + uint32_t graphicsexposure; /**< */ + uint32_t subwindowmode; /**< */ + uint32_t polyedge; /**< */ + uint32_t polymode; /**< */ + uint32_t dither; /**< */ + uint32_t componentalpha; /**< */ +} xcb_render_change_picture_value_list_t; + /** Opcode for xcb_render_change_picture. */ #define XCB_RENDER_CHANGE_PICTURE 5 @@ -1714,7 +1752,18 @@ xcb_render_query_pict_index_values_reply (xcb_connection_t xcb_generic_error_t **e /**< */); int -xcb_render_create_picture_sizeof (const void *_buffer /**< */); +xcb_render_create_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *_aux /**< */); + +int +xcb_render_create_picture_value_list_unpack (const void *_buffer /**< */, + uint32_t value_mask /**< */, + xcb_render_create_picture_value_list_t *_aux /**< */); + +int +xcb_render_create_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */); /** * @@ -1733,7 +1782,7 @@ xcb_render_create_picture_checked (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); /** * @@ -1749,10 +1798,56 @@ xcb_render_create_picture (xcb_connection_t *c /**< */, xcb_drawable_t drawable /**< */, xcb_render_pictformat_t format /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_render_create_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_render_create_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t pid /**< */, + xcb_drawable_t drawable /**< */, + xcb_render_pictformat_t format /**< */, + uint32_t value_mask /**< */, + const xcb_render_create_picture_value_list_t *value_list /**< */); + +int +xcb_render_change_picture_value_list_serialize (void **_buffer /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *_aux /**< */); int -xcb_render_change_picture_sizeof (const void *_buffer /**< */); +xcb_render_change_picture_value_list_unpack (const void *_buffer /**< */, + uint32_t value_mask /**< */, + xcb_render_change_picture_value_list_t *_aux /**< */); + +int +xcb_render_change_picture_value_list_sizeof (const void *_buffer /**< */, + uint32_t value_mask /**< */); /** * @@ -1769,7 +1864,7 @@ xcb_void_cookie_t xcb_render_change_picture_checked (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); /** * @@ -1783,7 +1878,38 @@ xcb_void_cookie_t xcb_render_change_picture (xcb_connection_t *c /**< */, xcb_render_picture_t picture /**< */, uint32_t value_mask /**< */, - const uint32_t *value_list /**< */); + const void *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_render_change_picture_aux_checked (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_render_change_picture_aux (xcb_connection_t *c /**< */, + xcb_render_picture_t picture /**< */, + uint32_t value_mask /**< */, + const xcb_render_change_picture_value_list_t *value_list /**< */); int xcb_render_set_picture_clip_rectangles_sizeof (const void *_buffer /**< */, -------------- next part -------------- diff --git a/home/pratyush/checkout/xorg-build/proto/src/render.xml b/proto/src/render.xml index 55b73f7..6285134 100644 --- a/home/pratyush/checkout/xorg-build/proto/src/render.xml +++ b/proto/src/render.xml @@ -280,16 +280,124 @@ for licensing information. - + + + value_mask + + Repeat + + + + AlphaMap + + + + AlphaXOrigin + + + + AlphaYOrigin + + + + ClipXOrigin + + + + ClipYOrigin + + + + ClipMask + + + + GraphicsExposure + + + + SubwindowMode + + + + PolyEdge + + + + PolyMode + + + + Dither + + + + ComponentAlpha + + + + + - + + + value_mask + + Repeat + + + + AlphaMap + + + + AlphaXOrigin + + + + AlphaYOrigin + + + + ClipXOrigin + + + + ClipYOrigin + + + + ClipMask + + + + GraphicsExposure + + + + SubwindowMode + + + + PolyEdge + + + + PolyMode + + + + Dither + + + + ComponentAlpha + + + From chris at DemoRecorder.com Mon Oct 20 03:17:51 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 12:17:51 +0200 Subject: [Xcb] [PATCH libxcb 4/4 V2] generator: support listelement-ref In-Reply-To: <1409845851-38950-4-git-send-email-chris@demorecorder.com> References: <540888FC.50007@DemoRecorder.com> <1409845851-38950-4-git-send-email-chris@demorecorder.com> Message-ID: <5444E14F.4050807@DemoRecorder.com> Support for listelement-ref needs the following three changes (in the order as they appear in the patch): * making the current list-element accessible with the variable xcb_listelement which is a pointer to the list-element * supporting lists of simple-type for sumof with a nested expression * using the variable for resolving a listelement-ref expression Changes for V2 of this patch: - adapt to removal of patch "libxcb 2/6" from patchset "ListInputDevices". --- src/c_client.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index bd14959..fa0d2fc 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1625,26 +1625,35 @@ def _c_accessor_get_expr(expr, field_mapping): _c_pre.code("%s = %s;", listvar, list_name) _c_pre.code( "for (%s = 0; %s < %s; %s++) {", loopvar, loopvar, lengthvar, loopvar) _c_pre.indent() + # define and set xcb_listelement, so that it can be used by + # listelement-ref expressions. + if expr.contains_listelement_ref: + _c_pre.code( + "const %s *xcb_listelement = %s;", + field.c_field_type, listvar) + + # summation if expr.rhs == None: _c_pre.code("%s += *%s;", sumvar, listvar) else: # sumof has a nested expression which # has to be evaluated in the context of this list element # field mapping for the subexpression needs to include # the fields of the list-member type scoped_field_mapping = field_mapping.copy() - scoped_field_mapping.update( - _c_helper_field_mapping( - field.type.member, - [(listvar, '', field.type.member)])) + if not field.type.member.is_simple: + scoped_field_mapping.update( + _c_helper_field_mapping( + field.type.member, + [( listvar, '', field.type.member )])) # cause pre-code of the subexpression be added right here _c_pre.end() # compute the subexpression rhs_expr_str = _c_accessor_get_expr(expr.rhs, scoped_field_mapping) # resume with our code _c_pre.start() @@ -1654,14 +1658,16 @@ def _c_accessor_get_expr(expr, field_mapping): _c_pre.code("%s++;", listvar); _c_pre.pop_indent() _c_pre.code("}") _c_pre.code("/* sumof end. Result is in %s */", sumvar) _c_pre.end() return sumvar; # return 'xcb_sumof(%s, %s)' % (list_name, c_length_func) + elif expr.op == 'listelement-ref': + return '(*xcb_listelement)'; elif expr.op != None: return ('(' + _c_accessor_get_expr(expr.lhs, field_mapping) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, field_mapping) + ')') elif expr.bitfield: return 'xcb_popcount(' + lenexp + ')' else: -- 2.0.1 _______________________________________________ Xcb mailing list Xcb at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xcb From chris at DemoRecorder.com Mon Oct 20 03:18:15 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 12:18:15 +0200 Subject: [Xcb] [PATCH proto 06/10 V3] xinput: struct DeviceClass: full support In-Reply-To: <543BB371.4060102@DemoRecorder.com> References: <540827B6.6030600@DemoRecorder.com> <1409820801-43629-6-git-send-email-chris@demorecorder.com> <543BB371.4060102@DemoRecorder.com> Message-ID: <5444E167.8090702@DemoRecorder.com> replace uninterpreted_data by switch-case this is needed by struct XIDeviceInfo which is needed by reply XIQueryDevice. changes for V2 of this patch: * remove the pad after "sourceid" because that space is used by the first two bytes defined inside each case of the bit-case. ( noticed that problem by testing ) changes for V3 of this patch: * adapt to removal of patches "proto 6/7 and 7/7" in patchset ListInputDevices: adjust linenumbers in the patch accordingly spec: http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n752 Note: The spec lists TOUCHCLASS.num_touches as a CARD16 but the XI2proto.h header and the xml use the type CARD8 for it. Is this a spec bug? code: http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n138 http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n117 --- src/xinput.xml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/src/xinput.xml b/src/xinput.xml index e5d0d39..e9ff19e 100644 --- a/src/xinput.xml +++ b/src/xinput.xml @@ -43,15 +43,14 @@ This requires enhancements to the xml-schema and generator such as union with selector. This will, e.g., be necessary for automatically generated byte-order conversion code, which will, e.g., be necessary for server-side xcb. This affects the following: * QueryDeviceState reply field "classes" ( structs InputState, ... ) -* struct XIDeviceInfo field "classes" ( structs DeviceClass, ... ) * SendExtensionEvent member "events" ***** xml and generator have to support of all members of a list This is needed for the following XI2-events ( and eventcopies thereof ) @@ -1756,23 +1756,63 @@ - - - - - len - 4 - - 8 - - + + type + + Key + + + num_keys + + + + Button + + + + + num_buttons + 31 + + 32 + + + + num_buttons + + + + Valuator + + + + + + + + + + + Scroll + + + + + + + + Touch + + + + -- 2.0.1 From chris at DemoRecorder.com Mon Oct 20 03:18:37 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 12:18:37 +0200 Subject: [Xcb] [PATCH libxcb 1/6 V2] generator: fix absname for fields with only accessor function In-Reply-To: <20141014132438.GD1444@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> <543BD4A3.1020606@DemoRecorder.com> <20141014132438.GD1444@ran> Message-ID: <5444E17D.3040206@DemoRecorder.com> Fix _c_helper_absolute_name for fields which cannot be accessed as a struct/union member but which can be accessed by an accessor function. The fix calls the accessor function in these cases. Example: len The sumof-expression ( ) refers to mylist1 which is only acessible by an accessor function. Previously, sumof was only used inside bitcases, where such lists are accessible by members of the deserialized parent struct. (there is a difference between deserialization of switches and structs.) V2 of this patch: * replaced "!= None" with "is not None" because that's more pythonic. (according to suggestion from Ran Benita) --- src/c_client.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/c_client.py b/src/c_client.py index 9216c7f..488f0e6 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -430,24 +430,50 @@ def _c_type_setup(self, name, postfix): def _c_helper_absolute_name(prefix, field=None): """ turn prefix, which is a list of tuples (name, separator, Type obj) into a string representing a valid name in C (based on the context) if field is not None, append the field name as well """ prefix_str = '' + last_sep ='' for name, sep, obj in prefix: + if '' != last_sep: + prefix_str += last_sep prefix_str += name if '' == sep: sep = '->' if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase (obj.is_switch and len(obj.parents)>1)): sep = '.' - prefix_str += sep + last_sep = sep + + prefix_str_without_lastsep = prefix_str + prefix_str += last_sep + if field is not None: prefix_str += _cpp(field.field_name) + + + if ( + field is not None + and hasattr(field, 'c_accessor_name') + and field.parent is not None + and field.parent.is_container + and not field.parent.is_switch + and not field.parent.is_case_or_bitcase + and ( #the following conditions are taken from _c_accessors() + ( field.type.is_list and not field.type.fixed_size() ) + or + ( field.prev_varsized_field is not None + or not field.type.fixed_size() + ) + ) + ): + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; + return prefix_str # _c_absolute_name def _c_helper_field_mapping(complex_type, prefix, flat=False): """ generate absolute names, based on prefix, for all fields starting from complex_type if flat == True, nested complex types are not taken into account -- 2.0.1 From chris at DemoRecorder.com Mon Oct 20 04:05:35 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 13:05:35 +0200 Subject: [Xcb] [PATCH libxcb 2/6] generator: fix absname for fields with only iterator function In-Reply-To: <20141014133029.GE1444@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-2-git-send-email-chris@demorecorder.com> <20141012182417.GB8240@ran> <543BD8F6.7060205@DemoRecorder.com> <20141014133029.GE1444@ran> Message-ID: <5444EC7F.4050602@DemoRecorder.com> On 10/14/14 15:30, Ran Benita wrote: [...] >> But I am OK with skipping it. >> >> If we skip this patch, we also have to skip patch "libxcb 6/6" of this patchset. >> >> What do you think: >> Skip it or improve it as outlined above? > > That's easy - skip it :) If we find out eventually that it *is* needed > by xinput or xkb, we can return to it. Yep, that's good. Chances are we'll never need it, so the code stays simpler. If we need it, then it's in the mailing-list archive. I have updated my repos with skipping this and the other patches as discussed elsewhere. Also, the Reviewed-By are updated in my repos. The repos are available at: http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto http://infra-srv1.demorecorder.com/git/free-sw/xcb/libxcb Online browsing is available at: http://infra-srv1.demorecorder.com/gitweb/ Chris P.S.: Actually the following patches are skipped now: * "Implicit-padding option" ( skipped because a better solution has been found ) - QueryDeviceState: patch proto 1/2 '1408653121-21071-1-git-send-email-chris at demorecorder.com' => 1, - QueryDeviceState: patch proto 1/2 V2 '53FDB455.2010203 at DemoRecorder.com' => 1, - QueryDeviceState: patch libxcb 3/3 '1408653356-21191-3-git-send-email-chris at demorecorder.com' => 1, - QueryDeviceState: patch libxcb 3/3 V2 '53FDB45E.4010000 at DemoRecorder.com' => 1, * "removing obsolete structs" ( skipped because we want to maintain backwards compatibility ) - ListInputDevices:patch proto 6/7 Message-ID: 1409743080-302-6-git-send-email-chris at demorecorder.com - ListInputDevices:patch proto 7/7 Message-ID: 1409743080-302-7-git-send-email-chris at demorecorder.com * "sumof of lists with varsize members/only iterator function" ( skipped because we do not need it (yet) ) - ListInputDevices: libxcb 2/6 Message-ID: 1409743361-466-2-git-send-email-chris at demorecorder.com - ListInputDevices: libxcb 6/6 Message-ID: 1409743361-466-6-git-send-email-chris at demorecorder.com From laerciosousa at sme-mogidascruzes.sp.gov.br Mon Oct 20 04:06:19 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Mon, 20 Oct 2014 09:06:19 -0200 Subject: [Xcb] [PATCH libxcb] Introduce new funcion xcb_connect_with_auth_file(). In-Reply-To: <54422231.6020108@znc.in> References: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> <54422231.6020108@znc.in> Message-ID: 2014-10-18 5:17 GMT-03:00 Uli Schlachter : > Hi, > > typo in the subject: funcTion > Fixed. Thanks! > I have not much clue about X11 authentication. Could someone else comment > on the > idea behind this patch? > > Am 17.10.2014 um 20:23 schrieb La?rcio de Sousa: > > This patch introduces a function called xcb_connect_with_auth_file(), > > which is similar to xcb_connect_to_display_with_auth_info(), but expects > > an authorization file path rather than a xcb_auth_info_t struct. > > > > Signed-off-by: La?rcio de Sousa < > laerciosousa at sme-mogidascruzes.sp.gov.br> > > --- > > src/xcb.h | 21 +++++++++++++++++++++ > > src/xcb_auth.c | 15 +++++++++++++-- > > src/xcb_util.c | 27 ++++++++++++++++++++------- > > src/xcbint.h | 2 +- > > 4 files changed, 55 insertions(+), 10 deletions(-) > > > > diff --git a/src/xcb.h b/src/xcb.h > > index 23fe74e..0314ce5 100644 > > --- a/src/xcb.h > > +++ b/src/xcb.h > > @@ -535,6 +535,27 @@ int xcb_parse_display(const char *name, char > **host, int *display, int *screen); > > xcb_connection_t *xcb_connect(const char *displayname, int *screenp); > > > > /** > > + * @brief Connects to the X server, using and authorization file. > > + * @param displayname: The name of the display. > > + * @param authfile: The authorization file path. > > + * @param screenp: A pointer to a preferred screen number. > > + * @return A newly allocated xcb_connection_t structure. > > + * > > + * Connects to the X server specified by @p displayname, using the > > + * authorization file @p authfile. If @p authfile value @c NULL, uses > > + * the value of the XAUTHORITY environment variable. If a particular > > + * screen on that server is preferred, the int pointed to by @p screenp > > + * (if not @c NULL) will be set to that screen; otherwise @p screenp > > + * will be set to 0. > > + * > > + * Always returns a non-NULL pointer to a xcb_connection_t, even on > failure. > > + * Callers need to use xcb_connection_has_error() to check for failure. > > + * When finished, use xcb_disconnect() to close the connection and free > > + * the structure. > > + */ > > +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, > const char *authfile, int *screenp); > > + > > +/** > > * @brief Connects to the X server, using an authorization information. > > * @param display: The name of the display. > > * @param auth: The authorization information. > > diff --git a/src/xcb_auth.c b/src/xcb_auth.c > > index 29e2b6f..284a582 100644 > > --- a/src/xcb_auth.c > > +++ b/src/xcb_auth.c > > @@ -34,6 +34,7 @@ > > #include > > #include > > #include > > +#include > > > > #ifdef __INTERIX > > /* _don't_ ask. interix has INADDR_LOOPBACK in here. */ > > @@ -309,7 +310,7 @@ static struct sockaddr *get_peer_sock_name(int > (*socket_func)(int, > > return NULL; > > } > > > > -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) > > +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, > const char *authfile) > > { > > /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c, > > xtrans/Xtransutils.c */ > > @@ -334,7 +335,17 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t > *info, int display) > > gotsockname = 1; > > } > > > > - authptr = get_authptr(sockname, display); > > + if (authfile) { > > + FILE *f = fopen(authfile, "r"); > > + > > + if (f) { > > Instead of ignoring errors, shouldn't this return an error connection to > the > caller? > > > + authptr = XauReadAuth(f); > > Ok, now I actually googled this code and the man page says: > > XauReadAuth reads the next entry from auth_file. The entry is not > statically allocated and should be freed by calling XauDisposeAuth. > > I have no clue about Xau, but the part that says "the next entry" makes me > think > that this code doesn't actually work well. And yeah, "xauth list" in a > terminal > obviously indicates that an XAUTHORITY file can contain multiple > authentications. Your code will only use the first one. > I'm thinking about this. libxcb currently calls XauGetBestAuthByAddr(), which calls XauReadAuth() on the file name returned by XauFileName() --- namely, the value of XAUTHORITY environment variable or ~/.Xauthority. Maybe the best option would be patching libXau so we can pass explicitly a file name path to XauGetBestAuthByAddr() --- if none is passed, get one by calling XauFileName(). I'm affraid all this is becoming too complex. Maybe I should just give up and call setenv("XAUTHORITY", ...) from my client application before calling xcb_connect(). My main motivation for proposing this patch is about symmetry: if I can call xcb_connect() with an explicit display number --- instead of calling setenv("DISPLAY", ...) and then xcb_connect(NULL,...) --- shouldn't I be able to do the same with the authorization file? > + fclose(f); > > + } > > + } > > + else > > + authptr = get_authptr(sockname, display); > > + > > if (authptr == 0) > > { > > free(sockname); > > diff --git a/src/xcb_util.c b/src/xcb_util.c > > index ba0f108..aafb73d 100644 > > --- a/src/xcb_util.c > > +++ b/src/xcb_util.c > > @@ -475,12 +475,10 @@ static int _xcb_open_abstract(char *protocol, > const char *file, size_t filelen) > > } > > #endif > > > > -xcb_connection_t *xcb_connect(const char *displayname, int *screenp) > > -{ > > - return xcb_connect_to_display_with_auth_info(displayname, NULL, > screenp); > > -} > > - > > -xcb_connection_t *xcb_connect_to_display_with_auth_info(const char > *displayname, xcb_auth_info_t *auth, int *screenp) > > +static xcb_connection_t > *_xcb_connect_to_display_with_auth_info_or_file(const char *displayname, > > + > const char *authfile, > > + > xcb_auth_info_t *auth, > > + > int *screenp) > > { > > int fd, display = 0; > > char *host = NULL; > > @@ -518,7 +516,7 @@ xcb_connection_t > *xcb_connect_to_display_with_auth_info(const char *displayname, > > goto out; > > } > > > > - if(_xcb_get_auth_info(fd, &ourauth, display)) > > + if(_xcb_get_auth_info(fd, &ourauth, display, authfile)) > > { > > c = xcb_connect_to_fd(fd, &ourauth); > > free(ourauth.name); > > @@ -542,3 +540,18 @@ out: > > free(protocol); > > return c; > > } > > + > > +xcb_connection_t *xcb_connect(const char *displayname, int *screenp) > > +{ > > + return xcb_connect_to_display_with_auth_info(displayname, NULL, > screenp); > > I'd propose to call _xcb_connect_to_display_with_auth_info_or_file() > directly > Fixed. Thanks! > (urgh, what a function name...). > I've renamed it to _xcb_connect_to_display_with_auth(). Does it look better now? :-) > > > +} > > + > > +xcb_connection_t *xcb_connect_with_auth_file(const char *displayname, > const char *authfile, int *screenp) > > +{ > > + return _xcb_connect_to_display_with_auth_info_or_file(displayname, > authfile, NULL, screenp); > > +} > > + > > +xcb_connection_t *xcb_connect_to_display_with_auth_info(const char > *displayname, xcb_auth_info_t *auth, int *screenp) > > +{ > > + return _xcb_connect_to_display_with_auth_info_or_file(displayname, > NULL, auth, screenp); > > +} > > diff --git a/src/xcbint.h b/src/xcbint.h > > index f89deba..01aca8c 100644 > > --- a/src/xcbint.h > > +++ b/src/xcbint.h > > @@ -218,7 +218,7 @@ int _xcb_conn_wait(xcb_connection_t *c, > pthread_cond_t *cond, struct iovec **vec > > > > /* xcb_auth.c */ > > > > -int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display); > > +int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display, > const char *authfile); > > > > #ifdef GCC_HAS_VISIBILITY > > #pragma GCC visibility pop > > > > Cheers, > Uli > -- > A normal person is just someone you don't know well enough yet. > - Nettie Wiebe > -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laerciosousa at sme-mogidascruzes.sp.gov.br Mon Oct 20 04:24:06 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Mon, 20 Oct 2014 09:24:06 -0200 Subject: [Xcb] [PATCH libxcb] Introduce new funcion xcb_connect_with_auth_file(). In-Reply-To: <54422602.7050104@znc.in> References: <1413570228-8416-1-git-send-email-laerciosousa@sme-mogidascruzes.sp.gov.br> <54422602.7050104@znc.in> Message-ID: 2014-10-18 5:34 GMT-03:00 Uli Schlachter : > Am 17.10.2014 um 20:23 schrieb La?rcio de Sousa: > [...] > > @@ -334,7 +335,17 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t > *info, int display) > > gotsockname = 1; > > } > > > > - authptr = get_authptr(sockname, display); > > + if (authfile) { > > + FILE *f = fopen(authfile, "r"); > [...] > > Thanks to Windows, this should be "rb" instead of "r" (I was reading > through Xau > source code and noticed this). > FIxed. Thanks! Uli > -- > A normal person is just someone you don't know well enough yet. > - Nettie Wiebe > -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laerciosousa at sme-mogidascruzes.sp.gov.br Mon Oct 20 06:11:17 2014 From: laerciosousa at sme-mogidascruzes.sp.gov.br (=?UTF-8?Q?La=C3=A9rcio_de_Sousa?=) Date: Mon, 20 Oct 2014 11:11:17 -0200 Subject: [Xcb] Translating XkbApplyMappingChange() et al. to xcb-xkb In-Reply-To: <54421E87.90300@DemoRecorder.com> References: <54421E87.90300@DemoRecorder.com> Message-ID: Thank you all for the reply! Looking into libxkbcommon source code, I can see I can use xcb_xkb_get_controls* stuff to get what I want. The remaining step to complete my translation to XCB is to build a new XkbControlsRec struct from the data available in xcb_xkb_get_controls_reply() returned struct. Is there a trivial way to do this, or should I do it member to member? Ex: ctrls->mk_dflt_btn = get_controls_reply->mouseKeysDfltBtn; ctrls->enabled_ctrls = get_controls_reply->enabledControls; etc. NOTE: In my use case, this XkbControlsRec will be passed to XkbDDXChangeControls(). Looking at this function definition, I can see it only acesses members "enabled_ctrls" and "per_key_repeat" of passed XkbControlsRec argument, so I think it will be enough to copy only these members from xcb_xkb_get_controls_reply() returned struct. 2014-10-18 5:02 GMT-03:00 Christian Linhart : > The XCB protocol definitions for XKB are not finished yet, i.e. they > contain bugs and some stuff is missing there. > I have fixed most of that, but not yet submitted my changes. > Reason for not yet submitting: > I wait for my XInput stuff to be integrated in upstream before adding more > pending stuff to our review-queue that's already quite long. > > So, you may have to wait until we fix the XKB issues. > You can of course start your work now, but don't be surprised if some of > your testcases fail due to errors in the XKB-support of XCB. > > Chris > > > On 10/17/14 20:39, La?rcio de Sousa wrote: > > Hi there! > > > > I'm currently working on a full XCB backend for xf86-video-nested > driver. I'm able to translate all Xlib-related code in file xlibclient.c to > XCB, except some Xkb related parts which force me to maintain a minimal > XCB-Xlib mix. > > > > I would like to translate some Xkb functions used in xf86-video-nested > to xcb-xkb in order to get rid of Xlib stuff, namely: > > > > XkbGetKeyboard() > > > > XkbGetControls() > > > > XkbApplyMappingChange() > > > > XkbDDXChangeControls() > > > > XkbCopyDeviceKeymap() > > > > Is it currently possible to translate these functions to xcb-xkb? The > relevant files in which these functions appear are the following: > > > > > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/xlibclient.c > > > http://cgit.freedesktop.org/xorg/driver/xf86-video-nested/tree/src/nested_input.c > > -- > > *La?rcio de Sousa* > > /Orientador de Inform?tica/ > > _Escola Municipal "Professor Eul?lio Gruppi"_ > > /Rua Ismael da Silva Mello, 559, Mogi Moderno/ > > / > > /Mogi das Cruzes - SP/ > > /CEP 08717-390/ > > / > > Telefone: (11) 4726-8313 > > > > > > _______________________________________________ > > Xcb mailing list > > Xcb at lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/xcb > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > -- *La?rcio de Sousa* *Orientador de Inform?tica* *Escola Municipal "Professor Eul?lio Gruppi"* *Rua Ismael da Silva Mello, 559, Mogi Moderno* *Mogi das Cruzes - SPCEP 08717-390* Telefone: (11) 4726-8313 -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick at spellingbeewinnars.org Mon Oct 20 07:00:31 2014 From: patrick at spellingbeewinnars.org (Patrick) Date: Mon, 20 Oct 2014 10:00:31 -0400 Subject: [Xcb] is it possible to monitor events in other windows? Message-ID: <5445157F.3070606@spellingbeewinnars.org> Hi Everyone So this is a bit of a long story and to keep it suitable for the mailing list, I am basically trying to monitor mouse clicks in a terminal under X as opposed to using gpm through ncurses. I have chopped down an example from freedsktop.org and I have it pasted at the end of this email. This is the part I am confused about: xcb_wait_for_event (c) This is responding to events in the window created but is the windows ID passed implicitly ? Is there a way to pass another windows ID ? I am basically planning on creating a small xcb program that will take the window ID of the terminal that the program is running in, I don't want to create another window. Thanks for reading my post-Patrick code-->----------------------------> #include #include #include int main (int argc, int * argv[]) { xcb_connection_t *c; xcb_screen_t *screen; xcb_window_t win; xcb_generic_event_t *e; uint32_t mask = 0; uint32_t values[2]; /* Open the connection to the X server */ c = xcb_connect (NULL, NULL); /* Get the first screen */ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; /* Ask for our window's Id */ win = xcb_generate_id (c); // win = 65574484 ; /* Create the window */ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; values[0] = screen->white_pixel; values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE; xcb_create_window (c, /* Connection */ 0, /* depth */ win, /* window Id */ screen->root, /* parent window */ 0, 0, /* x, y */ 150, 150, /* width, height */ 10, /* border_width */ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */ screen->root_visual, /* visual */ mask, values); /* masks */ /* Map the window on the screen */ xcb_map_window (c, win); xcb_flush (c); //CONFUSED HERE while ( (e = xcb_wait_for_event (c) ) ) { switch (e->response_type & ~0x80) { case XCB_BUTTON_RELEASE: { xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e; printf ("Button %d released in window %ld, at coordinates (%d,%d)\n", ev->detail, ev->event, ev->event_x, ev->event_y); break; } case XCB_KEY_PRESS: { xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e; printf ("Key pressed in window %ld\n", ev->event); break; } case XCB_KEY_RELEASE: { xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e; printf ("Key released in window %ld\n", ev->event); break; } default: ; break; } /* Free the Generic Event */ free (e); } return 0; } From chris at DemoRecorder.com Mon Oct 20 07:53:06 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 16:53:06 +0200 Subject: [Xcb] is it possible to monitor events in other windows? In-Reply-To: <5445157F.3070606@spellingbeewinnars.org> References: <5445157F.3070606@spellingbeewinnars.org> Message-ID: <544521D2.9090601@DemoRecorder.com> Hi Patrick, The function xcb_wait_for_event does not have an implicit window passed. It waits for all events that have been selected using the appropriate X11-requests. There are X11-requests for selecting which events your application subscribes to for which window. Please read the man-pages for the Xlib-functions XSelectInput and XSelectExtensionEvent for details. Selecting events via XCB is similar to the Xlib-functions. You just have to use the underlying X11-request. Hope this helps, Chris P.S.: This mailinglist is primarily for the development for XCB itself. For questions about X11-programming, with or without XCB, there may be better forums or websites. On 10/20/14 16:00, Patrick wrote: > Hi Everyone > > So this is a bit of a long story and to keep it suitable for the mailing list, I am basically trying to monitor mouse clicks in a terminal under X as opposed to using gpm through ncurses. > > I have chopped down an example from freedsktop.org and I have it pasted at the end of this email. > > This is the part I am confused about: > xcb_wait_for_event (c) > > > This is responding to events in the window created but is the windows ID passed implicitly ? Is there a way to pass another windows ID ? I am basically planning on creating a small xcb program that will take the window ID of the terminal that the program is running in, I don't want to create another window. > > Thanks for reading my post-Patrick > > > > > code-->----------------------------> > > #include > #include > #include > > int main (int argc, int * argv[]) > { > xcb_connection_t *c; > xcb_screen_t *screen; > xcb_window_t win; > xcb_generic_event_t *e; > uint32_t mask = 0; > uint32_t values[2]; > > /* Open the connection to the X server */ > c = xcb_connect (NULL, NULL); > > /* Get the first screen */ > screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; > > /* Ask for our window's Id */ > win = xcb_generate_id (c); > // win = 65574484 ; > > /* Create the window */ > mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; > values[0] = screen->white_pixel; > values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE; > xcb_create_window (c, /* Connection */ > 0, /* depth */ > win, /* window Id */ > screen->root, /* parent window */ > 0, 0, /* x, y */ > 150, 150, /* width, height */ > 10, /* border_width */ > XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */ > screen->root_visual, /* visual */ > mask, values); /* masks */ > > /* Map the window on the screen */ > xcb_map_window (c, win); > xcb_flush (c); > //CONFUSED HERE > while ( (e = xcb_wait_for_event (c) ) ) { > switch (e->response_type & ~0x80) { > > case XCB_BUTTON_RELEASE: { > xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e; > printf ("Button %d released in window %ld, at coordinates (%d,%d)\n", ev->detail, ev->event, ev->event_x, ev->event_y); > break; > } > > case XCB_KEY_PRESS: { > xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e; > printf ("Key pressed in window %ld\n", ev->event); > break; > } > case XCB_KEY_RELEASE: { > xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e; > printf ("Key released in window %ld\n", ev->event); > break; > } > default: > ; > break; > } > /* Free the Generic Event */ > free (e); > } > > return 0; > } > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > From patrick at spellingbeewinnars.org Mon Oct 20 07:59:53 2014 From: patrick at spellingbeewinnars.org (Patrick) Date: Mon, 20 Oct 2014 10:59:53 -0400 Subject: [Xcb] is it possible to monitor events in other windows? In-Reply-To: <544521D2.9090601@DemoRecorder.com> References: <5445157F.3070606@spellingbeewinnars.org> <544521D2.9090601@DemoRecorder.com> Message-ID: <54452369.4050400@spellingbeewinnars.org> Thanks Chris I haven't found anywhere else to post about xcb, could you point me somewhere? There are not a lot of xcb examples floating around, I do have xlib books but it's quite the learning curve for both xlib and xcb. I have a lot of amateur questions, i don't want to bog down the development list. Thanks again On 14-10-20 10:53 AM, Christian Linhart wrote: > Hi Patrick, > > The function xcb_wait_for_event does not have an implicit window passed. > It waits for all events that have been selected using the appropriate X11-requests. > > There are X11-requests for selecting which events your application subscribes to for which window. > > Please read the man-pages for the Xlib-functions > XSelectInput > and > XSelectExtensionEvent > for details. > > Selecting events via XCB is similar to the Xlib-functions. > You just have to use the underlying X11-request. > > Hope this helps, > > Chris > > P.S.: This mailinglist is primarily for the development for XCB itself. > For questions about X11-programming, with or without XCB, there may be better forums or websites. > > On 10/20/14 16:00, Patrick wrote: >> Hi Everyone >> >> So this is a bit of a long story and to keep it suitable for the mailing list, I am basically trying to monitor mouse clicks in a terminal under X as opposed to using gpm through ncurses. >> >> I have chopped down an example from freedsktop.org and I have it pasted at the end of this email. >> >> This is the part I am confused about: >> xcb_wait_for_event (c) >> >> >> This is responding to events in the window created but is the windows ID passed implicitly ? Is there a way to pass another windows ID ? I am basically planning on creating a small xcb program that will take the window ID of the terminal that the program is running in, I don't want to create another window. >> >> Thanks for reading my post-Patrick >> >> >> >> >> code-->----------------------------> >> >> #include >> #include >> #include >> >> int main (int argc, int * argv[]) >> { >> xcb_connection_t *c; >> xcb_screen_t *screen; >> xcb_window_t win; >> xcb_generic_event_t *e; >> uint32_t mask = 0; >> uint32_t values[2]; >> >> /* Open the connection to the X server */ >> c = xcb_connect (NULL, NULL); >> >> /* Get the first screen */ >> screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; >> >> /* Ask for our window's Id */ >> win = xcb_generate_id (c); >> // win = 65574484 ; >> >> /* Create the window */ >> mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; >> values[0] = screen->white_pixel; >> values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE; >> xcb_create_window (c, /* Connection */ >> 0, /* depth */ >> win, /* window Id */ >> screen->root, /* parent window */ >> 0, 0, /* x, y */ >> 150, 150, /* width, height */ >> 10, /* border_width */ >> XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */ >> screen->root_visual, /* visual */ >> mask, values); /* masks */ >> >> /* Map the window on the screen */ >> xcb_map_window (c, win); >> xcb_flush (c); >> //CONFUSED HERE >> while ( (e = xcb_wait_for_event (c) ) ) { >> switch (e->response_type & ~0x80) { >> >> case XCB_BUTTON_RELEASE: { >> xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e; >> printf ("Button %d released in window %ld, at coordinates (%d,%d)\n", ev->detail, ev->event, ev->event_x, ev->event_y); >> break; >> } >> >> case XCB_KEY_PRESS: { >> xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e; >> printf ("Key pressed in window %ld\n", ev->event); >> break; >> } >> case XCB_KEY_RELEASE: { >> xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e; >> printf ("Key released in window %ld\n", ev->event); >> break; >> } >> default: >> ; >> break; >> } >> /* Free the Generic Event */ >> free (e); >> } >> >> return 0; >> } >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb >> > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Mon Oct 20 08:25:44 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Mon, 20 Oct 2014 17:25:44 +0200 Subject: [Xcb] is it possible to monitor events in other windows? In-Reply-To: <54452369.4050400@spellingbeewinnars.org> References: <5445157F.3070606@spellingbeewinnars.org> <544521D2.9090601@DemoRecorder.com> <54452369.4050400@spellingbeewinnars.org> Message-ID: <54452978.8080705@DemoRecorder.com> Hi Patrick, I suggest you use websites like stackoverflow.com ubuntuforums.org linuxquestions.org ... They usually pop up first when searching for questions like these. So I guess they are the useful places to ask such questions, too. You can also search for "x11 programming forum" in Google and this gives you several useful websites. Hope this helps, Chris P.S.: I am posting this answer to the list such that searchengine searches will hopefully show this posting from our archives and redirect people to the right places... On 10/20/14 16:59, Patrick wrote: > Thanks Chris > > I haven't found anywhere else to post about xcb, could you point me somewhere? > > There are not a lot of xcb examples floating around, I do have xlib books but it's quite the learning curve for both xlib and xcb. I have a lot of amateur questions, i don't want to bog down the development list. > > Thanks again > > > > On 14-10-20 10:53 AM, Christian Linhart wrote: >> Hi Patrick, >> >> The function xcb_wait_for_event does not have an implicit window passed. >> It waits for all events that have been selected using the appropriate X11-requests. >> >> There are X11-requests for selecting which events your application subscribes to for which window. >> >> Please read the man-pages for the Xlib-functions >> XSelectInput >> and >> XSelectExtensionEvent >> for details. >> >> Selecting events via XCB is similar to the Xlib-functions. >> You just have to use the underlying X11-request. >> >> Hope this helps, >> >> Chris >> >> P.S.: This mailinglist is primarily for the development for XCB itself. >> For questions about X11-programming, with or without XCB, there may be better forums or websites. >> >> On 10/20/14 16:00, Patrick wrote: >>> Hi Everyone >>> >>> So this is a bit of a long story and to keep it suitable for the mailing list, I am basically trying to monitor mouse clicks in a terminal under X as opposed to using gpm through ncurses. >>> >>> I have chopped down an example from freedsktop.org and I have it pasted at the end of this email. >>> >>> This is the part I am confused about: >>> xcb_wait_for_event (c) >>> >>> >>> This is responding to events in the window created but is the windows ID passed implicitly ? Is there a way to pass another windows ID ? I am basically planning on creating a small xcb program that will take the window ID of the terminal that the program is running in, I don't want to create another window. >>> >>> Thanks for reading my post-Patrick >>> >>> >>> >>> >>> code-->----------------------------> >>> >>> #include >>> #include >>> #include >>> >>> int main (int argc, int * argv[]) >>> { >>> xcb_connection_t *c; >>> xcb_screen_t *screen; >>> xcb_window_t win; >>> xcb_generic_event_t *e; >>> uint32_t mask = 0; >>> uint32_t values[2]; >>> >>> /* Open the connection to the X server */ >>> c = xcb_connect (NULL, NULL); >>> >>> /* Get the first screen */ >>> screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data; >>> >>> /* Ask for our window's Id */ >>> win = xcb_generate_id (c); >>> // win = 65574484 ; >>> >>> /* Create the window */ >>> mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; >>> values[0] = screen->white_pixel; >>> values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE; >>> xcb_create_window (c, /* Connection */ >>> 0, /* depth */ >>> win, /* window Id */ >>> screen->root, /* parent window */ >>> 0, 0, /* x, y */ >>> 150, 150, /* width, height */ >>> 10, /* border_width */ >>> XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */ >>> screen->root_visual, /* visual */ >>> mask, values); /* masks */ >>> >>> /* Map the window on the screen */ >>> xcb_map_window (c, win); >>> xcb_flush (c); >>> //CONFUSED HERE >>> while ( (e = xcb_wait_for_event (c) ) ) { >>> switch (e->response_type & ~0x80) { >>> >>> case XCB_BUTTON_RELEASE: { >>> xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e; >>> printf ("Button %d released in window %ld, at coordinates (%d,%d)\n", ev->detail, ev->event, ev->event_x, ev->event_y); >>> break; >>> } >>> >>> case XCB_KEY_PRESS: { >>> xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e; >>> printf ("Key pressed in window %ld\n", ev->event); >>> break; >>> } >>> case XCB_KEY_RELEASE: { >>> xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e; >>> printf ("Key released in window %ld\n", ev->event); >>> break; >>> } >>> default: >>> ; >>> break; >>> } >>> /* Free the Generic Event */ >>> free (e); >>> } >>> >>> return 0; >>> } >>> _______________________________________________ >>> Xcb mailing list >>> Xcb at lists.freedesktop.org >>> http://lists.freedesktop.org/mailman/listinfo/xcb >>> >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb >> > > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > From smout.jan at gmail.com Tue Oct 21 03:49:44 2014 From: smout.jan at gmail.com (Jan Smout) Date: Tue, 21 Oct 2014 12:49:44 +0200 Subject: [Xcb] [PATCH libX11] xcb_io: Fix Xlib 32-bit request number issues In-Reply-To: <867g0pu4p4.fsf@hiro.keithp.com> References: <1411585990-6423-1-git-send-email-jnsptrsn1@gmail.com> <867g0pu4p4.fsf@hiro.keithp.com> Message-ID: Keith, we are approaching the one year anniversary of this bug already. Maybe it is time to finish the patch and leave the issue behind? fyi, I have been running my application with the first version of Jonas's patch for 65 days straight now without a glitch (it used to crash in less than 20 hours). I also intend to restart this long duration test once the final patch will be released On 27 September 2014 05:23, Keith Packard wrote: > Matt Turner writes: > > > On Fri, Sep 26, 2014 at 3:40 AM, Jan Smout wrote: > >> Keith Packard doesn't seem very responsive (as in 'completely ignoring > the > >> subject') > > > > Perhaps you should try Ccing him? (now Cc'd) > > The problem is that reviewing this patch is *really hard*. The last > time, I think I spent a solid couple of days thinking about this and > making sure I'd caught all of the cases. I'm still not sure it's right, > but I guess it's probably better than what we have? > > -- > keith.packard at intel.com > -- Life is complex, it has a real part and an imaginary part. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ran234 at gmail.com Tue Oct 21 11:10:54 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 21 Oct 2014 21:10:54 +0300 Subject: [Xcb] [PATCH libxcb] generator: support parametrized structs In-Reply-To: <1410136268-30377-1-git-send-email-chris@demorecorder.com> References: <540DB5AD.5050600@DemoRecorder.com> <1410136268-30377-1-git-send-email-chris@demorecorder.com> Message-ID: <20141021181054.GA10230@ran> On Mon, Sep 08, 2014 at 02:31:08AM +0200, Christian Linhart wrote: [snip] > + #internal function to compute the parameterlist with given indentation > + #such that the formatting of the additional parameters is consistent with > + #the other parameters. > + def additional_params_to_str(self, indent): > + if len(self) == 0: > + return '' > + else: > + return (',\n' + indent).join([''] + map(lambda p: '%s %s /**< */' % p, self)) Haven't reviewed this one yet, but just an advance comment, or I'll forget. The above line doesn't work with python3, since they changed `map` to reutrn an iterator instead of list, and that cannot be added. I've fixed it with the attached diff locally. However I should also mention that the name `self` here is confusing - it is usually reserved for same as `this` in C++. It also shadows another `self`. In fact all uses of `self` in the generator are confusing for this reason, but oh well.. From chris at DemoRecorder.com Tue Oct 21 12:11:03 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Tue, 21 Oct 2014 21:11:03 +0200 Subject: [Xcb] [PATCH libxcb] generator: support parametrized structs In-Reply-To: <20141021181054.GA10230@ran> References: <540DB5AD.5050600@DemoRecorder.com> <1410136268-30377-1-git-send-email-chris@demorecorder.com> <20141021181054.GA10230@ran> Message-ID: <5446AFC7.3030606@DemoRecorder.com> Hi Ran, Thank you for this comment. I didn't know about the change of the semantic of "map". I'll make a V2 patch which fixes that. Your attached diff didn't make it to the list. Can you resend it please? To the uses of self: I just adapted to the general style there. ;-) I'll change the name of that parameter in the V2 patch. In this kind of code it's somehow hard to know which idioms to adapt to or not. I agree of course that self should be used only in class member functions. Chris On 10/21/14 20:10, Ran Benita wrote: > On Mon, Sep 08, 2014 at 02:31:08AM +0200, Christian Linhart wrote: > [snip] >> + #internal function to compute the parameterlist with given indentation >> + #such that the formatting of the additional parameters is consistent with >> + #the other parameters. >> + def additional_params_to_str(self, indent): >> + if len(self) == 0: >> + return '' >> + else: >> + return (',\n' + indent).join([''] + map(lambda p: '%s %s /**< */' % p, self)) > > Haven't reviewed this one yet, but just an advance comment, or I'll > forget. > > The above line doesn't work with python3, since they changed `map` to > reutrn an iterator instead of list, and that cannot be added. > > I've fixed it with the attached diff locally. However I should also > mention that the name `self` here is confusing - it is usually reserved > for same as `this` in C++. It also shadows another `self`. In fact all > uses of `self` in the generator are confusing for this reason, but oh > well.. > _______________________________________________ > Xcb mailing list > Xcb at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xcb > From ran234 at gmail.com Tue Oct 21 12:30:29 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 21 Oct 2014 22:30:29 +0300 Subject: [Xcb] [PATCH libxcb] generator: support parametrized structs In-Reply-To: <5446AFC7.3030606@DemoRecorder.com> References: <540DB5AD.5050600@DemoRecorder.com> <1410136268-30377-1-git-send-email-chris@demorecorder.com> <20141021181054.GA10230@ran> <5446AFC7.3030606@DemoRecorder.com> Message-ID: <20141021193029.GA28654@ran> On Tue, Oct 21, 2014 at 09:11:03PM +0200, Christian Linhart wrote: > Hi Ran, > > Thank you for this comment. > I didn't know about the change of the semantic of "map". > I'll make a V2 patch which fixes that. Thanks! > Your attached diff didn't make it to the list. > Can you resend it please? Oops, here it is: diff --git a/src/c_client.py b/src/c_client.py index 1b61082..e2b553f 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1876,7 +1876,7 @@ def _c_accessors_list(self, field): if len(self) == 0: return '' else: - return (',\n' + indent).join([''] + map(lambda p: '%s %s /**< */' % p, self)) + return (',\n' + indent).join([''] + ['%s %s /**< */' % p for p in self]) _h_setlevel(1) _c_setlevel(1) > To the uses of self: > I just adapted to the general style there. ;-) > I'll change the name of that parameter in the V2 patch. Thanks! In this case it looks like you can also close over the `additional_params` variable instead of passing it as a parameter. But that's up to personal preference. Ran > In this kind of code it's somehow hard to know which idioms to adapt to or not. > > I agree of course that self should be used only in class member functions. > > Chris From ran234 at gmail.com Tue Oct 21 13:01:26 2014 From: ran234 at gmail.com (Ran Benita) Date: Tue, 21 Oct 2014 23:01:26 +0300 Subject: [Xcb] [PATCH proto 2/2 V2] xinput: rep QueryDeviceState struct InputState: full support In-Reply-To: <5400B9F6.5000208@DemoRecorder.com> References: <53F655AE.5000300@DemoRecorder.com> <1408653121-21071-2-git-send-email-chris@demorecorder.com> <5400B9F6.5000208@DemoRecorder.com> Message-ID: <20141021200126.GA31228@ran> On Fri, Aug 29, 2014 at 07:35:50PM +0200, Christian Linhart wrote: > Full support for the QueryDeviceState reply. > This has been done by changing the struct InputState > with using switch-case and implicit-padding="false". > > Also fixed the type of field valuators of struct ValuatorState > from CARD32 to INT32. > > V2: patch revised: > * removed the implicit-padding="false" attribute, according > to the discussion in this thread. > * give names to the cases, which generates more beautiful code. > > spec: > http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n2082 > http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1728 > --- > src/xinput.xml | 39 +++++++++++++++++++++++++++++---------- > 1 file changed, 29 insertions(+), 10 deletions(-) > > diff --git a/src/xinput.xml b/src/xinput.xml > index 95f0044..cf58a97 100644 > --- a/src/xinput.xml > +++ b/src/xinput.xml > @@ -858,30 +858,49 @@ > > > > > > > > - > + > num_valuators > > Remark/question for the archives: if I get it right, this struct, and also KeyState and ButtonState, are not needed anymore, since they are inlined into InputState, right? At least the test you posted for this request looks like it doesn't use them. So if they are really not needed, maybe you can add them to your struct-removal TODO (if you haven't already). Ran > > > > - > - > - > - > - len > - 4 > - > - > + > + class_id > + > + Key > + > + > + > + 32 > + > + > + > + Button > + > + > + > + 32 > + > + > + > + Valuator > + > + > + > + num_valuators > + > + > + > > > > > > > > -- 2.0.1 From ran234 at gmail.com Tue Oct 21 14:15:05 2014 From: ran234 at gmail.com (Ran Benita) Date: Wed, 22 Oct 2014 00:15:05 +0300 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <5406F80F.4020002@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> Message-ID: <20141021211505.GA15479@ran> On Wed, Sep 03, 2014 at 01:14:23PM +0200, Christian Linhart wrote: > Hi all, > > In this thread I'll post patches which make the ListInputDevice reply work. > > This has also required some changes in the generator: > * generate calls to accessor function or iterator function instead of > a struct-member access for fields which can only be accessed with > accessor function or iterator respectively. > > * make sumof more flexible. Especially support a nested expression which is evaluated > in the scope of each list-element which is iterated to compute sumof. > Example: > > num_class_info > The proto patches as in ListInputDevices-V4 [1], all look good to me. The fact that ref/lenfield_name can now also point to a list depending on if there's an expression is a bit confusing. But summing over an expression is inevitable, and this solves the problem nicely (as far as the xml goes), so no bikeshedding from me (/me resists suggesting unwarranted generalizations of this - or we'll end up with map/reduce :). I'll look at the implementation in the generator next. Ran [1] http://infra-srv1.demorecorder.com/gitweb/?p=free-sw/xcb/proto;a=shortlog;h=refs/heads/ListInputDevices-V4 > Due to using switch-case, some structs have became obsolete. > (and due to using struct STR from xproto instead of DeviceName because these > are the same and the spec uses STR) > > This patchset contains two patches to remove these obsolete structs. > You may reject these patches due to API-compatibility concerns. > On the other hand, probably nobody has used the structs for request ListInputDevice > anyways before because this request/reply didn't work anyways in the previous form. > > You can also get these patches at the following git-repo: > http://infra-srv1.demorecorder.com/git/free-sw/xcb/listinputdevices-sumof-20140903-2/proto > http://infra-srv1.demorecorder.com/git/free-sw/xcb/listinputdevices-sumof-20140903-2/libxcb > > Chris > > > P.S.: The patches are based on the following patches which are not > yet in the official repo: > * my patches from the the Thread > "[Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes" > * my patch in the email > "[Xcb] [PATCH libxcb] no typename for nested structs" > > ( you can get those also at > http://infra-srv1.demorecorder.com/git/free-sw/xcb/20140903-1/proto > http://infra-srv1.demorecorder.com/git/free-sw/xcb/20140903-1/libxcb ) From chris at DemoRecorder.com Wed Oct 22 06:34:01 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Wed, 22 Oct 2014 15:34:01 +0200 Subject: [Xcb] [PATCH libxcb V2] generator: support parametrized structs In-Reply-To: <20141021193029.GA28654@ran> References: <540DB5AD.5050600@DemoRecorder.com> <1410136268-30377-1-git-send-email-chris@demorecorder.com> <20141021181054.GA10230@ran> <5446AFC7.3030606@DemoRecorder.com> <20141021193029.GA28654@ran> Message-ID: <5447B249.9010306@DemoRecorder.com> Parametrized structs contain paramref expressions which refer to the value of a field defined in the context where the struct is used. Implementing the parametrized structs turned out to be somewhat easier than previously thought because the generator already had some support for type-parametrization because this is needed when case or bitcase refers to fields outside of the switch. So I decided to go with the flow and to implement the solution which best fits the current implementation. I did the following: * I provided a way to specify fieldref with an explicitely given type: This resulted in . That can be added later, if needed. ( Wont be too complicated ) * So this is pretty much like the proposal from Ran Benita. changes for V2 of this patch, according to suggestions from Ran Benita: * replace map with list comprehension because map returns an iterator instead of a list from Python 3 on, so it cannot be added to a list anymore. * removed "self" parameter of function additional_params_to_str and accessed the variable additional_params from the outer function directly. --- src/c_client.py | 130 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 110 insertions(+), 20 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index fa0d2fc..cddc680 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -702,14 +702,39 @@ def resolve_expr_fields(complex_obj): # try to resolve expr fields for e in expr_fields: if e not in all_fields and e not in unresolved: unresolved.append(e) return unresolved # resolve_expr_fields() +def resolve_expr_fields_list(self, parents): + """ + Find expr fields appearing in a list and descendents + that cannot be resolved within the parents of the list. + These are normally fields that need to be given as function parameters + for length and iterator functions. + """ + all_fields = [] + expr_fields = get_expr_fields(self) + unresolved = [] + + for complex_obj in parents: + for field in complex_obj.fields: + if field.wire: + all_fields.append(field) + + # try to resolve expr fields + for e in expr_fields: + if e not in all_fields and e not in unresolved: + unresolved.append(e) + + return unresolved +# resolve_expr_fields_list() + + def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): """ functions like _serialize(), _unserialize(), and _unpack() sometimes need additional parameters: E.g. in order to unpack switch, extra parameters might be needed to evaluate the switch expression. This function tries to resolve all fields within a structure, and returns the unresolved fields as the list of external parameters. """ @@ -906,14 +931,25 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr #remove trailing ", " from c_field_names because it will be used at end of arglist my_c_field_names = c_field_names[:-2] length = "%s( xcb_tmp, %s )" % ( field.type.c_sizeof_name, my_c_field_names ) return length # _c_serialize_helper_switch_field() +def _c_get_additional_type_params(self): + """ + compute list of additional params for functions created for the given type + """ + if self.is_simple: + return [] + else: + param_fields, wire_fields, params = get_serialize_params('sizeof', self) + return params[1:] +# _c_get_additional_type_params() + def _c_serialize_helper_list_field(context, self, field, code_lines, temp_vars, space, prefix): """ helper function to cope with lists of variable length """ expr = field.type.expr @@ -944,36 +980,44 @@ def _c_serialize_helper_list_field(context, self, field, list_length = _c_accessor_get_expr(expr, field_mapping) # default: list with fixed size elements length = '%s * sizeof(%s)' % (list_length, field.type.member.c_wiretype) # list with variable-sized elements if not field.type.member.fixed_size(): + # compute string for argumentlist for member-type functions + member_params = _c_get_additional_type_params(field.type.member) + member_arg_names = [p[2] for p in member_params] + member_arg_str = '' + for member_arg_name in member_arg_names: + member_arg_str += ', ' + field_mapping[member_arg_name][0] + + # length = '' if context in ('unserialize', 'sizeof', 'unpack'): int_i = ' unsigned int i;' xcb_tmp_len = ' unsigned int xcb_tmp_len;' if int_i not in temp_vars: temp_vars.append(int_i) if xcb_tmp_len not in temp_vars: temp_vars.append(xcb_tmp_len) # loop over all list elements and call sizeof repeatedly # this should be a bit faster than using the iterators code_lines.append("%s for(i=0; i<%s; i++) {" % (space, list_length)) - code_lines.append("%s xcb_tmp_len = %s(xcb_tmp);" % - (space, field.type.c_sizeof_name)) + code_lines.append("%s xcb_tmp_len = %s(xcb_tmp%s);" % + (space, field.type.c_sizeof_name, member_arg_str)) code_lines.append("%s xcb_block_len += xcb_tmp_len;" % space) code_lines.append("%s xcb_tmp += xcb_tmp_len;" % space) code_lines.append("%s }" % space) elif 'serialize' == context: code_lines.append('%s xcb_parts[xcb_parts_idx].iov_len = 0;' % space) code_lines.append('%s xcb_tmp = (char *) %s%s;' % (space, prefix_str, field.c_field_name)) code_lines.append('%s for(i=0; i<%s; i++) { ' % (space, list_length)) - code_lines.append('%s xcb_block_len = %s(xcb_tmp);' % (space, field.type.c_sizeof_name)) + code_lines.append('%s xcb_block_len = %s(xcb_tmp%s);' % (space, field.type.c_sizeof_name, member_arg_str)) code_lines.append('%s xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;' % space) code_lines.append('%s }' % space) code_lines.append('%s xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;' % space) return length # _c_serialize_helper_list_field() @@ -1478,14 +1522,22 @@ def _c_iterator(self, name): _h('/**') _h(' * @brief %s', self.c_iterator_type) _h(' **/') _h('typedef struct %s {', self.c_iterator_type) _h(' %s *data; /**< */', self.c_type) _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) + # add additional params of the type "self" as fields to the iterator struct + # so that they can be passed to the sizeof-function by the iterator's next-function + params = _c_get_additional_type_params(self) + for param in params: + _h(' %s%s %s; /**< */', + param[0], + ' ' * (len(self.c_type) + 1 - len(param[0])), + param[2]) _h('} %s;', self.c_iterator_type) _h_setlevel(1) _c_setlevel(1) _h('') _h('/**') _h(' * Get the next element of the iterator') @@ -1505,17 +1557,22 @@ def _c_iterator(self, name): _c(' %s *R = i->data;', self.c_type) if self.is_union: # FIXME - how to determine the size of a variable size union?? _c(' /* FIXME - determine the size of the union %s */', self.c_type) else: if self.c_need_sizeof: + # compute the string of additional arguments for the sizeof-function + additional_args = '' + for param in params: + additional_args += ', i->' + param[2] + _c(' xcb_generic_iterator_t child;') - _c(' child.data = (%s *)(((char *)R) + %s(R));', - self.c_type, self.c_sizeof_name) + _c(' child.data = (%s *)(((char *)R) + %s(R%s));', + self.c_type, self.c_sizeof_name, additional_args) _c(' i->index = (char *) child.data - (char *) i->data;') else: _c(' xcb_generic_iterator_t child = %s;', _c_iterator_get_end(self.last_varsized_field, 'R')) _c(' i->index = child.index;') _c(' --i->rem;') _c(' i->data = (%s *) child.data;', self.c_type) @@ -1826,14 +1883,37 @@ def _c_accessors_list(self, field): if not p.is_case_or_bitcase or (p.is_case_or_bitcase and p.has_name): prefix.append((p.name[-1], '.', p)) fields.update(_c_helper_field_mapping(p, prefix, flat=True)) # auxiliary object for 'S' parameter S_obj = parents[1] + # for functions generated below: + # * compute list of additional parameters which contains as parameter + # any expr fields that cannot be resolved within self and descendants. + # * and make sure that they are accessed without prefix within the function. + unresolved_fields = resolve_expr_fields_list(list, parents) + additional_params = [] + additional_param_names = set(); + for f in unresolved_fields: + if f.c_field_name not in additional_param_names: + # add to the list of additional params + additional_params.append((f.c_field_type, f.c_field_name)); + # make sure that the param is accessed without prefix within the function + fields[ f.c_field_name ] = (f.c_field_name, f) + + #internal function to compute the parameterlist with given indentation + #such that the formatting of the additional parameters is consistent with + #the other parameters. + def additional_params_to_str(indent): + if len(additional_params) == 0: + return '' + else: + return (',\n' + indent).join([''] + ['%s %s /**< */' % p for p in additional_params]) + _h_setlevel(1) _c_setlevel(1) if list.member.fixed_size(): idx = 1 if switch_obj is not None else 0 _hc('') _hc('%s *', field.c_field_type) @@ -1856,38 +1936,40 @@ def _c_accessors_list(self, field): _c_iterator_get_end(prev_varsized_field, 'R')) _c(' return (%s *) ((char *) prev.data + %s + %d);', field.c_field_type, align_pad, field.prev_varsized_offset) _c('}') _hc('') _hc('int') + spacing = ' '*(len(field.c_length_name)+2) + add_param_str = additional_params_to_str(spacing) if switch_obj is not None: _hc('%s (const %s *R /**< */,', field.c_length_name, R_obj.c_type) - spacing = ' '*(len(field.c_length_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S /**< */%s);', spacing, S_obj.c_type, add_param_str) + _c('%sconst %s *S /**< */%s)', spacing, S_obj.c_type, add_param_str) else: - _h('%s (const %s *R /**< */);', field.c_length_name, c_type) - _c('%s (const %s *R /**< */)', field.c_length_name, c_type) + _h('%s (const %s *R /**< */%s);', field.c_length_name, c_type, add_param_str) + _c('%s (const %s *R /**< */%s)', field.c_length_name, c_type, add_param_str) _c('{') length = _c_accessor_get_expr(field.type.expr, fields) _c(' return %s;', length) _c('}') if field.type.member.is_simple: _hc('') _hc('xcb_generic_iterator_t') + spacing = ' '*(len(field.c_end_name)+2) + add_param_str = additional_params_to_str(spacing) if switch_obj is not None: _hc('%s (const %s *R /**< */,', field.c_end_name, R_obj.c_type) - spacing = ' '*(len(field.c_end_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S /**< */%s);', spacing, S_obj.c_type, add_param_str) + _c('%sconst %s *S /**< */%s)', spacing, S_obj.c_type, add_param_str) else: - _h('%s (const %s *R /**< */);', field.c_end_name, c_type) - _c('%s (const %s *R /**< */)', field.c_end_name, c_type) + _h('%s (const %s *R /**< */%s);', field.c_end_name, c_type, add_param_str) + _c('%s (const %s *R /**< */%s)', field.c_end_name, c_type, add_param_str) _c('{') _c(' xcb_generic_iterator_t i;') param = 'R' if switch_obj is None else 'S' if switch_obj is not None: _c(' i.data = %s + %s;', fields[field.c_field_name][0], _c_accessor_get_expr(field.type.expr, fields)) @@ -1904,22 +1986,23 @@ def _c_accessors_list(self, field): _c(' i.index = (char *) i.data - (char *) %s;', param) _c(' return i;') _c('}') else: _hc('') _hc('%s', field.c_iterator_type) + spacing = ' '*(len(field.c_iterator_name)+2) + add_param_str = additional_params_to_str(spacing) if switch_obj is not None: _hc('%s (const %s *R /**< */,', field.c_iterator_name, R_obj.c_type) - spacing = ' '*(len(field.c_iterator_name)+2) - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) + _h('%sconst %s *S /**< */%s);', spacing, S_obj.c_type, add_param_str) + _c('%sconst %s *S /**< */%s)', spacing, S_obj.c_type, add_param_str) else: - _h('%s (const %s *R /**< */);', field.c_iterator_name, c_type) - _c('%s (const %s *R /**< */)', field.c_iterator_name, c_type) + _h('%s (const %s *R /**< */%s);', field.c_iterator_name, c_type, add_param_str) + _c('%s (const %s *R /**< */%s)', field.c_iterator_name, c_type, add_param_str) _c('{') _c(' %s i;', field.c_iterator_type) _c_pre.start() length_expr_str = _c_accessor_get_expr(field.type.expr, fields) if switch_obj is not None: @@ -1941,14 +2024,21 @@ def _c_accessors_list(self, field): _c_pre.end() _c(' i.data = (%s *) ((char *) prev.data + %s);', field.c_field_type, align_pad) if switch_obj is None: _c(' i.rem = %s;', length_expr_str ) _c(' i.index = (char *) i.data - (char *) %s;', 'R' if switch_obj is None else 'S' ) + + # initialize additional iterator fields + # which are derived from additional type parameters for the list member type. + additional_iter_fields = _c_get_additional_type_params(field.type.member) + for iter_field in additional_iter_fields: + _c(' i.%s = %s;', iter_field[2], fields[iter_field[2]][0]) + _c(' return i;') _c('}') def _c_accessors(self, name, base): ''' Declares the accessor functions for the fields of a structure. ''' -- 2.0.1 From chris at DemoRecorder.com Sat Oct 25 08:38:06 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 25 Oct 2014 17:38:06 +0200 Subject: [Xcb] [PATCH libxcb 17/18] c_client.py: remove duplicated `cookie_type` argument for requests In-Reply-To: <1413140300-20075-18-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-18-git-send-email-ran234@gmail.com> Message-ID: <544BC3DE.6080807@DemoRecorder.com> Nice simplification. Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > It is implied already inside the function by the `void` argument. > > Signed-off-by: Ran Benita > --- > src/c_client.py | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index e22dc52..bb2de13 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1772,7 +1772,7 @@ def c_union(self, name): > _c_complex(self) > _c_iterator(self, name) > > -def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_fds=False): > +def _c_request_helper(self, name, void, regular, aux=False, reply_fds=False): > ''' > Declares a request function. > ''' > @@ -1910,7 +1910,7 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > _h(' * placed in the event queue.') > _h(' */') > _c('') > - _hc('%s', cookie_type) > + _hc('%s', func_cookie) > > spacing = ' ' * (maxtypelen - len('xcb_connection_t')) > comma = ',' if len(param_fields) else ');' > @@ -2217,7 +2217,7 @@ def _c_cookie(self, name): > _h(' unsigned int sequence;') > _h('} %s;', self.c_cookie_type) > > -def _man_request(self, name, cookie_type, void, aux): > +def _man_request(self, name, void, aux): > param_fields = [f for f in self.fields if f.visible] > > func_name = self.c_request_name if not aux else self.c_aux_name > @@ -2263,7 +2263,8 @@ def _man_request(self, name, cookie_type, void, aux): > f.write('.SS Request function\n') > f.write('.HP\n') > base_func_name = self.c_request_name if not aux else self.c_aux_name > - f.write('%s \\fB%s\\fP(xcb_connection_t\\ *\\fIconn\\fP, %s\n' % (cookie_type, base_func_name, prototype)) > + func_cookie = 'xcb_void_cookie_t' if void else self.c_cookie_type > + f.write('%s \\fB%s\\fP(xcb_connection_t\\ *\\fIconn\\fP, %s\n' % (func_cookie, base_func_name, prototype)) > create_link('%s_%s' % (base_func_name, ('checked' if void else 'unchecked'))) > if not void: > f.write('.PP\n') > @@ -2559,7 +2560,7 @@ def _man_request(self, name, cookie_type, void, aux): > 'handle errors in the event loop instead, use ' > '\\fI%s_unchecked\\fP. See \\fBxcb-requests(%s)\\fP for ' > 'details.\n') % > - (cookie_type, self.c_reply_name, base_func_name, section)) > + (self.c_cookie_type, self.c_reply_name, base_func_name, section)) > f.write('.SH ERRORS\n') > if hasattr(self, "doc") and self.doc: > for errtype, errtext in sorted(self.doc.errors.items()): > @@ -2749,11 +2750,11 @@ def c_request(self, name): > _c_complex(self.reply) > # Request prototypes > has_fds = _c_reply_has_fds(self.reply) > - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=False, reply_fds=has_fds) > - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=False, reply_fds=has_fds) > + _c_request_helper(self, name, void=False, regular=True, aux=False, reply_fds=has_fds) > + _c_request_helper(self, name, void=False, regular=False, aux=False, reply_fds=has_fds) > if self.c_need_aux: > - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=True, reply_fs=has_fds) > - _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=True, reply_fs=has_fds) > + _c_request_helper(self, name, void=False, regular=True, aux=True, reply_fs=has_fds) > + _c_request_helper(self, name, void=False, regular=False, aux=True, reply_fs=has_fds) > # Reply accessors > _c_accessors(self.reply, name + ('reply',), name) > _c_reply(self, name) > @@ -2761,16 +2762,15 @@ def c_request(self, name): > _c_reply_fds(self, name) > else: > # Request prototypes > - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False) > - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True) > + _c_request_helper(self, name, void=True, regular=False) > + _c_request_helper(self, name, void=True, regular=True) > if self.c_need_aux: > - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False, aux=True) > - _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True, aux=True) > + _c_request_helper(self, name, void=True, regular=False, aux=True) > + _c_request_helper(self, name, void=True, regular=True, aux=True) > > # We generate the manpage afterwards because _c_type_setup has been called. > # TODO: what about aux helpers? > - cookie_type = self.c_cookie_type if self.reply else 'xcb_void_cookie_t' > - _man_request(self, name, cookie_type, void=not self.reply, aux=False) > + _man_request(self, name, void=not self.reply, aux=False) > > def c_event(self, name): > ''' From chris at DemoRecorder.com Sat Oct 25 08:42:06 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 25 Oct 2014 17:42:06 +0200 Subject: [Xcb] [PATCH libxcb 16/18] c_client.py: spell out keyword arguments in c_request() for clarity In-Reply-To: <1413140300-20075-17-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-17-git-send-email-ran234@gmail.com> Message-ID: <544BC4CE.3000805@DemoRecorder.com> This helps readability. Reviewed-by: Christian Linhart The long parameter lists hint to some design problem however. ( The generator should have been written in OO-design using classes instead of just a collection of many functions ) Maybe we'll have time for fixing that design issue, after we'll have reviewed and merged all pending patches into upstream. Chris On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index d561e04..e22dc52 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -2749,11 +2749,11 @@ def c_request(self, name): > _c_complex(self.reply) > # Request prototypes > has_fds = _c_reply_has_fds(self.reply) > - _c_request_helper(self, name, self.c_cookie_type, False, True, False, has_fds) > - _c_request_helper(self, name, self.c_cookie_type, False, False, False, has_fds) > + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=False, reply_fds=has_fds) > + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=False, reply_fds=has_fds) > if self.c_need_aux: > - _c_request_helper(self, name, self.c_cookie_type, False, True, True, has_fds) > - _c_request_helper(self, name, self.c_cookie_type, False, False, True, has_fds) > + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=True, aux=True, reply_fs=has_fds) > + _c_request_helper(self, name, self.c_cookie_type, void=False, regular=False, aux=True, reply_fs=has_fds) > # Reply accessors > _c_accessors(self.reply, name + ('reply',), name) > _c_reply(self, name) > @@ -2761,16 +2761,16 @@ def c_request(self, name): > _c_reply_fds(self, name) > else: > # Request prototypes > - _c_request_helper(self, name, 'xcb_void_cookie_t', True, False) > - _c_request_helper(self, name, 'xcb_void_cookie_t', True, True) > + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False) > + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True) > if self.c_need_aux: > - _c_request_helper(self, name, 'xcb_void_cookie_t', True, False, True) > - _c_request_helper(self, name, 'xcb_void_cookie_t', True, True, True) > + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=False, aux=True) > + _c_request_helper(self, name, 'xcb_void_cookie_t', void=True, regular=True, aux=True) > > # We generate the manpage afterwards because _c_type_setup has been called. > # TODO: what about aux helpers? > cookie_type = self.c_cookie_type if self.reply else 'xcb_void_cookie_t' > - _man_request(self, name, cookie_type, not self.reply, False) > + _man_request(self, name, cookie_type, void=not self.reply, aux=False) > > def c_event(self, name): > ''' From chris at DemoRecorder.com Sat Oct 25 08:52:15 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 25 Oct 2014 17:52:15 +0200 Subject: [Xcb] [PATCH libxcb 15/18] c_client.py: simplify _c_reply_has_fds() In-Reply-To: <1413140300-20075-16-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-16-git-send-email-ran234@gmail.com> Message-ID: <544BC72F.9050707@DemoRecorder.com> It's funny that the old implementation almost matches the definition of builtin function "any" at https://docs.python.org/2/library/functions.html#any The difference is of course that we have a member access here. That's why the iteration is needed in the argument-list of "any". Reviewed-by: Christian Linhart On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 686eca5..d561e04 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -2165,10 +2165,7 @@ def _c_reply(self, name): > _c('}') > > def _c_reply_has_fds(self): > - for field in self.fields: > - if field.isfd: > - return True > - return False > + return any(field.isfd for field in self.fields) > > def _c_reply_fds(self, name): > ''' From chris at DemoRecorder.com Sat Oct 25 08:57:26 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 25 Oct 2014 17:57:26 +0200 Subject: [Xcb] [PATCH libxcb 14/18] c_client.py: remove commented debug statements In-Reply-To: <1413140300-20075-15-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-15-git-send-email-ran234@gmail.com> Message-ID: <544BC866.4000300@DemoRecorder.com> This just removes comments. Therefore the code remains the same. Therefore: Reviewed-by: Christian Linhart It's good to get rid of these debug statements. If something has to be debugged, appropriate debug statements can be entered anyways. And they probably will be needed in different locations that the ones which are removed here. Debug statements should be temporary anyways, unless some complex and useful stuff has to be done there, in which case the complex stuff should be put in an extra function or class. On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index 1c77bb0..686eca5 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -648,7 +648,6 @@ def get_serialize_params(context, self, buffer_var='_buffer', aux_var='_aux'): > def _c_serialize_helper_insert_padding(context, code_lines, space, postpone): > code_lines.append('%s /* insert padding */' % space) > code_lines.append('%s xcb_pad = -xcb_block_len & (xcb_align_to - 1);' % space) > -# code_lines.append('%s printf("automatically inserting padding: %%%%d\\n", xcb_pad);' % space) > code_lines.append('%s xcb_buffer_len += xcb_block_len + xcb_pad;' % space) > > if not postpone: > @@ -1971,8 +1970,6 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > _c(' unsigned int xcb_tmp_len;') > _c(' char *xcb_tmp;') > _c('') > - # simple request call tracing > -# _c(' printf("in function %s\\n");' % func_name) > > # fixed size fields > for field in wire_fields: From chris at DemoRecorder.com Sat Oct 25 09:26:15 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Sat, 25 Oct 2014 18:26:15 +0200 Subject: [Xcb] [PATCH libxcb 13/18] c_client.py: use C99 initializers instead of comments In-Reply-To: <1413140300-20075-14-git-send-email-ran234@gmail.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-14-git-send-email-ran234@gmail.com> Message-ID: <544BCF27.60302@DemoRecorder.com> Sequence and names do match correctly as can be seen by comparing it with the definition of xcb_protocol_request_t: http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcbext.h#n47 Therefore this does the same, however there may be another problem: Is this the first instance in XCB which requires a C99-compliant compiler? Intuitively it should be safe to assume that a C99 compliant compiler is available on all relevant platforms. But I have one test computer which uses X11 and where this is not the case. This test computer is from one of my customers and matches their production system ( at least somehow ). XCB may become relevant on that computer. This may be a hint that there are more users where pre-C99 compatibility can be relevant. Chris On 10/12/14 20:58, Ran Benita wrote: > Signed-off-by: Ran Benita > --- > src/c_client.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/c_client.py b/src/c_client.py > index eab4006..1c77bb0 100644 > --- a/src/c_client.py > +++ b/src/c_client.py > @@ -1948,10 +1948,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f > > _c('{') > _c(' static const xcb_protocol_request_t xcb_req = {') > - _c(' /* count */ %d,', count) > - _c(' /* ext */ %s,', func_ext_global) > - _c(' /* opcode */ %s,', self.c_request_name.upper()) > - _c(' /* isvoid */ %d', 1 if void else 0) > + _c(' .count = %d,', count) > + _c(' .ext = %s,', func_ext_global) > + _c(' .opcode = %s,', self.c_request_name.upper()) > + _c(' .isvoid = %d', 1 if void else 0) > _c(' };') > _c('') > From ran234 at gmail.com Sun Oct 26 08:33:50 2014 From: ran234 at gmail.com (Ran Benita) Date: Sun, 26 Oct 2014 17:33:50 +0200 Subject: [Xcb] [PATCH libxcb 13/18] c_client.py: use C99 initializers instead of comments In-Reply-To: <544BCF27.60302@DemoRecorder.com> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-14-git-send-email-ran234@gmail.com> <544BCF27.60302@DemoRecorder.com> Message-ID: <20141026153350.GA3781@ran> On Sat, Oct 25, 2014 at 06:26:15PM +0200, Christian Linhart wrote: > Sequence and names do match correctly as can be seen by comparing it > with the definition of xcb_protocol_request_t: > http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcbext.h#n47 > > Therefore this does the same, however there may be another problem: > > Is this the first instance in XCB which requires a C99-compliant compiler? I found a use of "static inline" in xcb_out.c and the following in xcb_conn.c: #if HAVE_SENDMSG [...] struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = *vector, .msg_iovlen = n, .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(c->out.out_fd.nfd * sizeof (int)), }; And we also use AC_PROG_CC_99 (through xorg-macros) so I think it's OK. > Intuitively it should be safe to assume that a C99 compliant compiler is available on all relevant platforms. > > But I have one test computer which uses X11 and where this is not the case. > This test computer is from one of my customers and matches their production system ( at least somehow ). > XCB may become relevant on that computer. > > This may be a hint that there are more users where pre-C99 compatibility can be relevant. If xcb needs to be more portable to old compilers, there are few enough c99isms that I think a patch to remove them will be accepted. But it's probably better to first see which parts fail to compile. Ran From chris at demorecorder.com Sun Oct 26 10:19:52 2014 From: chris at demorecorder.com (chris at demorecorder.com) Date: Sun, 26 Oct 2014 18:19:52 +0100 (CET) Subject: [Xcb] [PATCH libxcb 13/18] c_client.py: use C99 initializers instead of comments In-Reply-To: <20141026153350.GA3781@ran> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-14-git-send-email-ran234@gmail.com> <544BCF27.60302@DemoRecorder.com><20141026153350.GA3781@ran> Message-ID: <20141026171952.0FF9E3E41157@dd25728.kasserver.com> Hi Ran, Thank you for these infos. Yes, you are right, this can be handled with a patch. Therefore: Reviewed-by: Christian Linhart Chris Ran Benita wrote on 26.10.2014 16:33: > On Sat, Oct 25, 2014 at 06:26:15PM +0200, Christian Linhart wrote: >> Sequence and names do match correctly as can be seen by comparing it >> with the definition of xcb_protocol_request_t: >> http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcbext.h#n47 >> >> Therefore this does the same, however there may be another problem: >> >> Is this the first instance in XCB which requires a C99-compliant compiler? > > I found a use of "static inline" in xcb_out.c and the following in > xcb_conn.c: > > #if HAVE_SENDMSG > [...] > struct msghdr msg = { > .msg_name = NULL, > .msg_namelen = 0, > .msg_iov = *vector, > .msg_iovlen = n, > .msg_control = cmsgbuf.buf, > .msg_controllen = CMSG_LEN(c->out.out_fd.nfd * sizeof (int)), > }; > > And we also use AC_PROG_CC_99 (through xorg-macros) so I think it's OK. > >> Intuitively it should be safe to assume that a C99 compliant compiler is >> available on all relevant platforms. >> >> But I have one test computer which uses X11 and where this is not the case. >> This test computer is from one of my customers and matches their production >> system ( at least somehow ). >> XCB may become relevant on that computer. >> >> This may be a hint that there are more users where pre-C99 compatibility can >> be relevant. > > If xcb needs to be more portable to old compilers, there are few enough > c99isms that I think a patch to remove them will be accepted. But it's > probably better to first see which parts fail to compile. > > Ran > From asalle.kim at gmail.com Mon Oct 27 10:58:34 2014 From: asalle.kim at gmail.com (Asalle Kim) Date: Mon, 27 Oct 2014 19:58:34 +0200 Subject: [Xcb] [XCB] OPW applicant's testcase for changing to in render extension Message-ID: <544E87CA.70305@gmail.com> Good evenig, I am an OPW Round 9 applicant. I am interested to become an intern of XCB server-side project under the mentorship of Christian Linhart. As my initial contribution I made a little testcase for Jaya's changes in render.xml with some very valuable advices and help of Christian. The testcase should view blank screen, after user presses any key a blue rect should be painted, after another key pressing a cyan line should be painted. After the last key pressing the window holds waiting for interrupt signal (usually emited with Ctrl+C combination). This testcase uses the xcb_render_create_picture_checked function and some others. I tried to * run testcase connecting to prior to Jaya's changes version of the library, then to the improved version using the LD_LIBRARY_PATH (not re-compiling sources with the new version) both work the same way, this shows binary backward compatibility of the Jaya's changes. * compile testcase with the sources of the improved library and then run, it also works as expected and shows the source code compability of improved version. * run some programs(eog, shotwell) with the improved version -- it works as usual. I believe this proves that Jaya's change are backward compatible. This task was rather challenging for me and also a great experience; I am very thankful to OPW and Christian Linhart personally for giving me an unique opportunity to contribute a bit to such a great and widely used project. Best regards, Asalle From asalle.kim at gmail.com Mon Oct 27 11:01:10 2014 From: asalle.kim at gmail.com (Asalle Kim) Date: Mon, 27 Oct 2014 20:01:10 +0200 Subject: [Xcb] [XCB] OPW applicant's testcase for changing to in render extension In-Reply-To: <544E87CA.70305@gmail.com> References: <544E87CA.70305@gmail.com> Message-ID: <544E8866.9040309@gmail.com> > The testcase should view blank screen, after user presses any key a > blue rect > should be painted, after another key pressing a cyan line should be > painted. > After the last key pressing the window holds waiting for interrupt signal > (usually emited with Ctrl+C combination). best regards, Asalle -------------- next part -------------- A non-text attachment was scrubbed... Name: libxcb_test_3.c Type: text/x-csrc Size: 5998 bytes Desc: not available URL: From smout.jan at gmail.com Tue Oct 28 04:51:55 2014 From: smout.jan at gmail.com (Jan Smout) Date: Tue, 28 Oct 2014 12:51:55 +0100 Subject: [Xcb] [PATCH libX11] xcb_io: Fix Xlib 32-bit request number issues In-Reply-To: References: <1411585990-6423-1-git-send-email-jnsptrsn1@gmail.com> <867g0pu4p4.fsf@hiro.keithp.com> Message-ID: reminder... On 21 October 2014 12:49, Jan Smout wrote: > > Keith, we are approaching the one year anniversary of this bug already. > Maybe it is time to finish the patch and leave the issue behind? > > > fyi, I have been running my application with the first version of Jonas's > patch for 65 days straight now without a glitch (it used to crash in less > than 20 hours). > > I also intend to restart this long duration test once the final patch will > be released > > > On 27 September 2014 05:23, Keith Packard wrote: > >> Matt Turner writes: >> >> > On Fri, Sep 26, 2014 at 3:40 AM, Jan Smout wrote: >> >> Keith Packard doesn't seem very responsive (as in 'completely ignoring >> the >> >> subject') >> > >> > Perhaps you should try Ccing him? (now Cc'd) >> >> The problem is that reviewing this patch is *really hard*. The last >> time, I think I spent a solid couple of days thinking about this and >> making sure I'd caught all of the cases. I'm still not sure it's right, >> but I guess it's probably better than what we have? >> >> -- >> keith.packard at intel.com >> > > > > -- > Life is complex, it has a real part and an imaginary part. > -- Life is complex, it has a real part and an imaginary part. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at DemoRecorder.com Tue Oct 28 09:38:50 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Tue, 28 Oct 2014 17:38:50 +0100 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <20141014121842.GC1444@ran> References: <5406F80F.4020002@DemoRecorder.com> <20141012183906.GC8240@ran> <543BA278.3050406@DemoRecorder.com> <20141014121842.GC1444@ran> Message-ID: <544FC69A.1060203@DemoRecorder.com> On 10/14/14 14:18, Ran Benita wrote: > On Mon, Oct 13, 2014 at 11:59:20AM +0200, Christian Linhart wrote: [...] >> Here's an example: >> The sumof-code is between the comments /* sumof start */ and /* sumof end. Result is in xcb_pre_tmp_7 */. >> >> ==================== >> xcb_input_list_input_devices_infos_length (const xcb_input_list_input_devices_reply_t *R /**< */) >> { >> int xcb_pre_tmp_5; /* sumof length */ >> int xcb_pre_tmp_6; /* sumof loop counter */ >> int64_t xcb_pre_tmp_7; /* sumof sum */ >> const xcb_input_device_info_t* xcb_pre_tmp_8; /* sumof list ptr */ >> /* sumof start */ >> xcb_pre_tmp_5 = R->devices_len; >> xcb_pre_tmp_7 = 0; >> xcb_pre_tmp_8 = xcb_input_list_input_devices_devices(R); >> for (xcb_pre_tmp_6 = 0; xcb_pre_tmp_6 < xcb_pre_tmp_5; xcb_pre_tmp_6++) { >> xcb_pre_tmp_7 += xcb_pre_tmp_8->num_class_info; >> xcb_pre_tmp_8++; >> } >> /* sumof end. Result is in xcb_pre_tmp_7 */ >> return xcb_pre_tmp_7; >> } >> ==================== >> >> So, the non-polymorphicness of function xcb_sumof is not an issue because this function is not used anymore. >> (but kept in there for compatibility reasons, for the case that some user-code uses it directly somewhere...) > > Yes, this looks like the sanest (only?) way to handle this in C. I thought a while about how to do it before I made this implementation. This way is probably one of the most straightforward ways in C because there are no lambda expressions and templates in C. When GNU-compiler extensions were allowed, then it could also be generated as a code block inside an expression which will result in simpler code: This is by using ({ statements; expr }) in an expression, possibly generated by a macro. Unfortunately, this construct is still not included in the latest official C standard, even though it is probably quite easy to implement in a compiler. But we probably should stick to official standards. > > Re. compatability, not sure if xcbext.h is considered API, but probably > not a bad idea to keep it as it's very small. Yes, I agree to keep the function "xcb_sumof", even if we won't use it anymore after this patchset. Since it is probably available as a shared-lib symbol it'll probably be used somewhere given the huge code-base using XCB. > [... obsolete structs due to switch-case...] >> So I suggest the following procedure: >> * drop patches "proto 6/7" and "proto 7/7" now >> (I'll update my patch-repo accordingly. I'll send another message when that repo is updated. ) > > Yes, that will be the safe thing to do. Probably nobody's using them, > especially if the request is broken. But we had some issues with xkb in > the past.. ...so it's better to keep these structs to avoid similar issues. > >> * after all my of patches are merged: >> mark all obsolete structs as deprecated: >> - with a comment? >> - or with a xml-attribute that is translated to some comment in the C-code, >> and possibly with some macro that expands to "__declspec( deprecated )" or "__attribute__(deprecated)" >> depending on the compiler used. >> >> What do you think? > > Both sound OK to me. OK. I think that an xml-attribute is better than just a comment because it can be processed automatically. This is one of the things we can do after all of the pending patches are merged. I have written it on my TODO-list so we don't forget it. > They can also be changed to typedefs maybe. I do not think that they can be changed to typedefs because there are no equivalent structs which they could be typedefed to. Actually, in most of the cases, the first few fields of such a struct are generic, and therefore end up before the switch. The rest becomes a case-branch of the switch. Chris P.S.: Sorry for the long delay of my answer. I am catching up with my email backlog now that I have finished some time-critical work. > > Ran > >> Chris >> >> _______________________________________________ >> Xcb mailing list >> Xcb at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/xcb > From chris at DemoRecorder.com Tue Oct 28 23:43:25 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Wed, 29 Oct 2014 07:43:25 +0100 Subject: [Xcb] [PATCH proto 2/2 V2] xinput: rep QueryDeviceState struct InputState: full support In-Reply-To: <20141021200126.GA31228@ran> References: <53F655AE.5000300@DemoRecorder.com> <1408653121-21071-2-git-send-email-chris@demorecorder.com> <5400B9F6.5000208@DemoRecorder.com> <20141021200126.GA31228@ran> Message-ID: <54508C8D.5040006@DemoRecorder.com> On 10/21/14 22:01, Ran Benita wrote: > On Fri, Aug 29, 2014 at 07:35:50PM +0200, Christian Linhart wrote: [...] >> >> >> >> >> >> - >> + >> num_valuators >> >> > > Remark/question for the archives: if I get it right, this struct, and > also KeyState and ButtonState, are not needed anymore, since they are > inlined into InputState, right? Yes, you are right. They are just kept in there for compatibility reasons as we have discussed and decided elsewhere. > At least the test you posted for this > request looks like it doesn't use them. > > So if they are really not needed, maybe you can add them to your > struct-removal TODO (if you haven't already). Added them now to my TODO. After we'll have merged all the current pending patches to upstream, we can add the possibility to mark stuff as deprecated and then we can mark these structs as deprecated. BTW, At some point in the future, an automatic dead-code analyis tool for xml-xcb would be nice, so we can detect all the structs, enums, typedefs etc which are not used anymore. Chris From chris at DemoRecorder.com Tue Oct 28 23:57:15 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Wed, 29 Oct 2014 07:57:15 +0100 Subject: [Xcb] xinput: make ListInputDevices work, sumof with nested expr, ... In-Reply-To: <20141021211505.GA15479@ran> References: <5406F80F.4020002@DemoRecorder.com> <20141021211505.GA15479@ran> Message-ID: <54508FCB.9080009@DemoRecorder.com> On 10/21/14 23:15, Ran Benita wrote: > On Wed, Sep 03, 2014 at 01:14:23PM +0200, Christian Linhart wrote: [...] >> * make sumof more flexible. Especially support a nested expression which is evaluated >> in the scope of each list-element which is iterated to compute sumof. >> Example: >> >> num_class_info >> > > The proto patches as in ListInputDevices-V4 [1], all look good to me. The > fact that ref/lenfield_name can now also point to a list depending on if > there's an expression is a bit confusing. But summing over an expression > is inevitable, and this solves the problem nicely (as far as the xml > goes), so no bikeshedding from me Thank you. Can I count that as a Reviewed-By from you for the xml-changes? Or will you send these separately as a reply to each individual xml-change? > (/me resists suggesting unwarranted > generalizations of this - or we'll end up with map/reduce :). Yep, thinking about map and reduce is tempting as an intellectual exercise. I have to force my mind to stop working on ideas for that. :-) Seriously, I hope that we'll never have a protocol-spec that needs map or reduce. > > I'll look at the implementation in the generator next. Thank you! Chris > > Ran > > [1] http://infra-srv1.demorecorder.com/gitweb/?p=free-sw/xcb/proto;a=shortlog;h=refs/heads/ListInputDevices-V4 From chris at DemoRecorder.com Wed Oct 29 00:33:01 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Wed, 29 Oct 2014 08:33:01 +0100 Subject: [Xcb] [PATCH libxcb 11/18] c_client.py: don't generate useless empty /** < */ comments In-Reply-To: <20141014115151.GB1444@ran> References: <1413140300-20075-1-git-send-email-ran234@gmail.com> <1413140300-20075-12-git-send-email-ran234@gmail.com> <543BF4CB.3020702@DemoRecorder.com> <20141014115151.GB1444@ran> Message-ID: <5450982D.9040106@DemoRecorder.com> On 10/14/14 13:51, Ran Benita wrote: > Hi Chris, thanks for reviewing! > > On Mon, Oct 13, 2014 at 05:50:35PM +0200, Christian Linhart wrote: >> Some of these changes will be lots of work to merge with my pending changes. >> (trivial work, but lots of it) >> >> Therefore I suggest to skip this patch for now, >> and recreate it after my changes have been merged to upstream. > > Sure, any of these can be skipped if they cause trouble. Good, thank you. When I review your patches, I keep an eye on possible merge conflicts. Your other changes that I have reviewed so far, look good in this respect. So far, only this change causes trouble. > Easy conflicts > though can be readily resolved by the one doing the merging. Yep. But we have to be careful because merging is always a risk to introduce new bugs. I have some special and painful experience about that from a project with a big source-code base: At some point it was decided to create a lot of branches because of some perceived advantages for QA. The result was a lot of merging of course. And it turned out that merging causes at least the following two types of bugs: 1. Bugs which are created by human error, i.e., when manually resolving merge conflicts. 2. Bugs which are created automatically: This can happen when there is no textual merge conflict, but a semantic merge conflict. In that case, the merge tool automatically performs the textual merge without flagging that as a conflict. Therefore, merging can create a code-mixture that was neither written by a human not read by a human, and that does not make any sense. But the compiler may still accept it. Of course, bugs of type 2 are harder to avoid. To mitigate the issue we made it mandatory to review all merges, including the code which showed no textual merge conflicts. As you can imagine, the productivity of the development department dropped very significantly to the point where development essentially came to a grinding halt. Result: change of policy to minimize the need of merging. Almost following a mantra like "Merging considered harmful". *** That's why I am reviewing your patches for merge-conflicts before the actual merge happens. And that's also why I wait for all pending patches merged into upstream before I'll post any new changes. (some of which I have already implemented. And I am using them already in the temporary private fork of XCB which I use in my product.) Chris > >> Recreating this patch should be easy because it looks like global replace in the editor. > > Yep. Good. I have written that on my TODO-list, so that we'll think about recreating this patch after we'll have merged all pending patches to upstream. Chris > > Ran > >> Chris >> >> On 10/12/14 20:58, Ran Benita wrote: >>> (This does not change doxygen's output or warnings). >>> >>> Signed-off-by: Ran Benita >>> --- >>> src/c_client.py | 88 ++++++++++++++++++++++++++++----------------------------- >>> 1 file changed, 44 insertions(+), 44 deletions(-) >>> >>> diff --git a/src/c_client.py b/src/c_client.py >>> index 4c19722..c1839c7 100644 >>> --- a/src/c_client.py >>> +++ b/src/c_client.py >>> @@ -1111,7 +1111,7 @@ def _c_serialize(context, self): >>> for p in params: >>> typespec, pointerspec, field_name = p >>> spacing = ' '*(maxtypelen-len(typespec)-len(pointerspec)) >>> - param_str.append("%s%s%s %s%s /**< */" % (indent, typespec, spacing, pointerspec, field_name)) >>> + param_str.append("%s%s%s %s%s" % (indent, typespec, spacing, pointerspec, field_name)) >>> # insert function name >>> param_str[0] = "%s (%s" % (func_name, param_str[0].strip()) >>> param_str = ["%s," % x for x in param_str] >>> @@ -1292,9 +1292,9 @@ def _c_iterator(self, name): >>> _h(' * @brief %s', self.c_iterator_type) >>> _h(' **/') >>> _h('typedef struct %s {', self.c_iterator_type) >>> - _h(' %s *data; /**< */', self.c_type) >>> - _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) >>> - _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) >>> + _h(' %s *data;', self.c_type) >>> + _h(' int%s rem;', ' ' * (len(self.c_type) - 2)) >>> + _h(' int%s index;', ' ' * (len(self.c_type) - 2)) >>> _h('} %s;', self.c_iterator_type) >>> >>> _h_setlevel(1) >>> @@ -1310,8 +1310,8 @@ def _c_iterator(self, name): >>> _h(' */') >>> _c('') >>> _hc('void') >>> - _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type) >>> - _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type) >>> + _h('%s (%s *i);', self.c_next_name, self.c_iterator_type) >>> + _c('%s (%s *i)', self.c_next_name, self.c_iterator_type) >>> _c('{') >>> >>> if not self.fixed_size(): >>> @@ -1351,8 +1351,8 @@ def _c_iterator(self, name): >>> _h(' */') >>> _c('') >>> _hc('xcb_generic_iterator_t') >>> - _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type) >>> - _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type) >>> + _h('%s (%s i);', self.c_end_name, self.c_iterator_type) >>> + _c('%s (%s i)', self.c_end_name, self.c_iterator_type) >>> _c('{') >>> _c(' xcb_generic_iterator_t ret;') >>> >>> @@ -1457,8 +1457,8 @@ def _c_accessors_field(self, field): >>> if field.type.is_simple: >>> _hc('') >>> _hc('%s', field.c_field_type) >>> - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) >>> - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) >>> + _h('%s (const %s *R);', field.c_accessor_name, c_type) >>> + _c('%s (const %s *R)', field.c_accessor_name, c_type) >>> _c('{') >>> if field.prev_varsized_field is None: >>> _c(' return (%s *) (R + 1);', field.c_field_type) >>> @@ -1475,8 +1475,8 @@ def _c_accessors_field(self, field): >>> return_type = '%s *' % field.c_field_type >>> >>> _hc(return_type) >>> - _h('%s (const %s *R /**< */);', field.c_accessor_name, c_type) >>> - _c('%s (const %s *R /**< */)', field.c_accessor_name, c_type) >>> + _h('%s (const %s *R);', field.c_accessor_name, c_type) >>> + _c('%s (const %s *R)', field.c_accessor_name, c_type) >>> _c('{') >>> if field.prev_varsized_field is None: >>> _c(' return (%s) (R + 1);', return_type) >>> @@ -1562,8 +1562,8 @@ def _c_accessors_list(self, field): >>> _hc('') >>> _hc('%s *', field.c_field_type) >>> >>> - _h('%s (%s /**< */);', field.c_accessor_name, params[idx][0]) >>> - _c('%s (%s /**< */)', field.c_accessor_name, params[idx][0]) >>> + _h('%s (%s);', field.c_accessor_name, params[idx][0]) >>> + _c('%s (%s)', field.c_accessor_name, params[idx][0]) >>> >>> _c('{') >>> if switch_obj is not None: >>> @@ -1586,14 +1586,14 @@ def _c_accessors_list(self, field): >>> _hc('') >>> _hc('int') >>> if switch_obj is not None: >>> - _hc('%s (const %s *R /**< */,', field.c_length_name, R_obj.c_type) >>> + _hc('%s (const %s *R,', field.c_length_name, R_obj.c_type) >>> spacing = ' '*(len(field.c_length_name)+2) >>> - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) >>> - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) >>> + _h('%sconst %s *S);', spacing, S_obj.c_type) >>> + _c('%sconst %s *S)', spacing, S_obj.c_type) >>> length = _c_accessor_get_expr(field.type.expr, fields) >>> else: >>> - _h('%s (const %s *R /**< */);', field.c_length_name, c_type) >>> - _c('%s (const %s *R /**< */)', field.c_length_name, c_type) >>> + _h('%s (const %s *R);', field.c_length_name, c_type) >>> + _c('%s (const %s *R)', field.c_length_name, c_type) >>> length = _c_accessor_get_expr(field.type.expr, fields) >>> _c('{') >>> _c(' return %s;', length) >>> @@ -1603,13 +1603,13 @@ def _c_accessors_list(self, field): >>> _hc('') >>> _hc('xcb_generic_iterator_t') >>> if switch_obj is not None: >>> - _hc('%s (const %s *R /**< */,', field.c_end_name, R_obj.c_type) >>> + _hc('%s (const %s *R,', field.c_end_name, R_obj.c_type) >>> spacing = ' '*(len(field.c_end_name)+2) >>> - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) >>> - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) >>> + _h('%sconst %s *S);', spacing, S_obj.c_type) >>> + _c('%sconst %s *S)', spacing, S_obj.c_type) >>> else: >>> - _h('%s (const %s *R /**< */);', field.c_end_name, c_type) >>> - _c('%s (const %s *R /**< */)', field.c_end_name, c_type) >>> + _h('%s (const %s *R);', field.c_end_name, c_type) >>> + _c('%s (const %s *R)', field.c_end_name, c_type) >>> _c('{') >>> _c(' xcb_generic_iterator_t i;') >>> >>> @@ -1635,13 +1635,13 @@ def _c_accessors_list(self, field): >>> _hc('') >>> _hc('%s', field.c_iterator_type) >>> if switch_obj is not None: >>> - _hc('%s (const %s *R /**< */,', field.c_iterator_name, R_obj.c_type) >>> + _hc('%s (const %s *R,', field.c_iterator_name, R_obj.c_type) >>> spacing = ' '*(len(field.c_iterator_name)+2) >>> - _h('%sconst %s *S /**< */);', spacing, S_obj.c_type) >>> - _c('%sconst %s *S /**< */)', spacing, S_obj.c_type) >>> + _h('%sconst %s *S);', spacing, S_obj.c_type) >>> + _c('%sconst %s *S)', spacing, S_obj.c_type) >>> else: >>> - _h('%s (const %s *R /**< */);', field.c_iterator_name, c_type) >>> - _c('%s (const %s *R /**< */)', field.c_iterator_name, c_type) >>> + _h('%s (const %s *R);', field.c_iterator_name, c_type) >>> + _c('%s (const %s *R)', field.c_iterator_name, c_type) >>> _c('{') >>> _c(' %s i;', field.c_iterator_type) >>> >>> @@ -1736,10 +1736,10 @@ def _c_complex(self, force_packed = False): >>> # necessary for unserialize to work >>> (self.is_switch and field.type.is_switch)): >>> spacing = ' ' * (maxtypelen - len(field.c_field_type)) >>> - _h('%s %s%s %s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> + _h('%s %s%s %s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> else: >>> spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) >>> - _h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> + _h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> >>> if not self.is_switch: >>> for field in struct_fields: >>> @@ -1916,9 +1916,9 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f >>> >>> spacing = ' ' * (maxtypelen - len('xcb_connection_t')) >>> comma = ',' if len(param_fields) else ');' >>> - _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) >>> + _h('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) >>> comma = ',' if len(param_fields) else ')' >>> - _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) >>> + _c('%s (xcb_connection_t%s *c%s', func_name, spacing, comma) >>> >>> func_spacing = ' ' * (len(func_name) + 2) >>> count = len(param_fields) >>> @@ -1931,10 +1931,10 @@ def _c_request_helper(self, name, cookie_type, void, regular, aux=False, reply_f >>> c_pointer = '*' >>> spacing = ' ' * (maxtypelen - len(c_field_const_type)) >>> comma = ',' if count else ');' >>> - _h('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, >>> + _h('%s%s%s %s%s%s', func_spacing, c_field_const_type, >>> spacing, c_pointer, field.c_field_name, comma) >>> comma = ',' if count else ')' >>> - _c('%s%s%s %s%s /**< */%s', func_spacing, c_field_const_type, >>> + _c('%s%s%s %s%s%s', func_spacing, c_field_const_type, >>> spacing, c_pointer, field.c_field_name, comma) >>> >>> count = 2 >>> @@ -2132,10 +2132,10 @@ def _c_reply(self, name): >>> _h(' */') >>> _c('') >>> _hc('%s *', self.c_reply_type) >>> - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1) >>> - _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type) >>> - _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2) >>> - _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2) >>> + _hc('%s (xcb_connection_t%s *c,', self.c_reply_name, spacing1) >>> + _hc('%s%s cookie,', spacing3, self.c_cookie_type) >>> + _h('%sxcb_generic_error_t%s **e);', spacing3, spacing2) >>> + _c('%sxcb_generic_error_t%s **e)', spacing3, spacing2) >>> _c('{') >>> >>> if len(unserialize_fields)>0: >>> @@ -2192,9 +2192,9 @@ def _c_reply_fds(self, name): >>> _h(' */') >>> _c('') >>> _hc('int *') >>> - _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_fds_name, spacing1) >>> - _h('%s%s *reply /**< */);', spacing3, self.c_reply_type) >>> - _c('%s%s *reply /**< */)', spacing3, self.c_reply_type) >>> + _hc('%s (xcb_connection_t%s *c,', self.c_reply_fds_name, spacing1) >>> + _h('%s%s *reply);', spacing3, self.c_reply_type) >>> + _c('%s%s *reply)', spacing3, self.c_reply_type) >>> _c('{') >>> >>> _c(' return xcb_get_reply_fds(c, reply, sizeof(%s) + 4 * reply->length);', self.c_reply_type) >>> @@ -2221,7 +2221,7 @@ def _c_cookie(self, name): >>> _h(' * @brief %s', self.c_cookie_type) >>> _h(' **/') >>> _h('typedef struct %s {', self.c_cookie_type) >>> - _h(' unsigned int sequence; /**< */') >>> + _h(' unsigned int sequence;') >>> _h('} %s;', self.c_cookie_type) >>> >>> def _man_request(self, name, cookie_type, void, aux): >>> @@ -2304,7 +2304,7 @@ def _man_request(self, name, cookie_type, void, aux): >>> else: >>> spacing = ' ' * (maxtypelen - (len(field.c_field_type) + 1)) >>> f.write('ELSE %s = %s\n' % (field.c_field_type, field.c_field_name)) >>> - #_h('%s %s%s *%s%s; /**< */', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> + #_h('%s %s%s *%s%s;', space, field.c_field_type, spacing, field.c_field_name, field.c_subscript) >>> >>> if not self.is_switch: >>> for field in struct_fields: >> > From chris at DemoRecorder.com Thu Oct 30 05:56:33 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 13:56:33 +0100 Subject: [Xcb] [PATCH libxcb 1/6 V3] generator: fix absname for fields with only accessor function In-Reply-To: <5444E17D.3040206@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> <543BD4A3.1020606@DemoRecorder.com> <20141014132438.GD1444@ran> <5444E17D.3040206@DemoRecorder.com> Message-ID: <54523581.2020200@DemoRecorder.com> Fix _c_helper_absolute_name for fields which cannot be accessed as a struct/union member but which can be accessed by an accessor function. The fix generates calls to the accessor function in these cases. Example: len The sumof-expression ( ) refers to mylist1 which is only acessible by an accessor function. Previously, sumof was only used inside bitcases, where such lists are accessible by members of the deserialized parent struct. (there is a difference between deserialization of switches and structs.) V2 of this patch: * replaced "!= None" with "is not None" because that's more pythonic. (according to suggestion from Ran Benita) V3 of this patch: simplification: * fixed the recursion in _c_type_setup so that _c_helper_absolute_name does not need check a gazillion things as a workaround anymore. * simplified _c_helper_absolute_name - remove unneeded check for empty string before append of last_sep to prefix_str - removed those if-conditions which are not needed anymore after fixing the recursion in _c_type_setup. - extract functionality for checking whether a field needs an accessor ( and which type of accessor ) in functions. (also extracted from _c_accessors) - rearrange the condition branches and actions for more readability. V3 generates exactly the same *.c and *.h files as V2. --- src/c_client.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 56a1766..4b35ec8 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -332,20 +332,14 @@ def _c_type_setup(self, name, postfix): self.c_container = 'union' if self.is_union else 'struct' prev_varsized_field = None prev_varsized_offset = 0 first_field_after_varsized = None for field in self.fields: - _c_type_setup(field.type, field.field_type, ()) - if field.type.is_list: - _c_type_setup(field.type.member, field.field_type, ()) - if (field.type.nmemb is None): - self.c_need_sizeof = True - field.c_field_type = _t(field.field_type) field.c_field_const_type = ('' if field.type.nmemb == 1 else 'const ') + field.c_field_type field.c_field_name = _cpp(field.field_name) field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb and field.type.nmemb > 1) else '' field.c_pointer = ' ' if field.type.nmemb == 1 else '*' # correct the c_pointer field for variable size non-list types @@ -387,14 +381,25 @@ def _c_type_setup(self, name, postfix): prev_varsized_field = field prev_varsized_offset = 0 if self.c_var_followed_by_fixed_fields: if field.type.fixed_size(): field.prev_varsized_field = None + # recurse into this field + # this has to be done here, i.e., after the field has been set up + # Otherwise the function _c_helper_absolute_name + # will produce garbage or crash + _c_type_setup(field.type, field.field_type, ()) + if field.type.is_list: + _c_type_setup(field.type.member, field.field_type, ()) + if (field.type.nmemb is None): + self.c_need_sizeof = True + + if self.c_need_serialize: # when _unserialize() is wanted, create _sizeof() as well for consistency reasons self.c_need_sizeof = True # as switch does never appear at toplevel, # continue here with type construction if self.is_switch: @@ -423,31 +428,80 @@ def _c_type_setup(self, name, postfix): if self.c_need_sizeof: if self.c_sizeof_name not in finished_sizeof: if not module.namespace.is_ext or self.name[:2] == module.namespace.prefix: finished_sizeof.append(self.c_sizeof_name) _c_serialize('sizeof', self) # _c_type_setup() +# Functions for querying field properties +def _c_field_needs_list_accessor(field): + return field.type.is_list and not field.type.fixed_size() + +def _c_field_needs_field_accessor(field): + if field.type.is_list: + return False + else: + return ( + field.prev_varsized_field is not None + or not field.type.fixed_size() + ) + +def _c_field_needs_accessor(field): + return ( + _c_field_needs_list_accessor(field) + or + _c_field_needs_field_accessor(field) + ) + +def _c_field_is_member_of_case_or_bitcase(field): + if field.parent is None: + return False + elif field.parent.is_case_or_bitcase: + return True + else: + return False + +# end of Functions for querying field properties + def _c_helper_absolute_name(prefix, field=None): """ turn prefix, which is a list of tuples (name, separator, Type obj) into a string representing a valid name in C (based on the context) if field is not None, append the field name as well """ prefix_str = '' + last_sep ='' for name, sep, obj in prefix: - prefix_str += name + prefix_str += last_sep + name if '' == sep: sep = '->' if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase (obj.is_switch and len(obj.parents)>1)): sep = '.' - prefix_str += sep - if field is not None: - prefix_str += _cpp(field.field_name) + last_sep = sep + + if field is None: + # add separator for access to a yet unknown field + prefix_str += last_sep + else: + if _c_field_needs_accessor(field): + if _c_field_is_member_of_case_or_bitcase(field): + # case members are available in the deserialized struct, + # so there is no need to use the accessor function + # (also, their accessor function needs a different arglist + # so this would require special treatment here) + # Therefore: Access as struct member + prefix_str += last_sep + _cpp(field.field_name) + else: + # Access with the accessor function + prefix_str = field.c_accessor_name + "(" + prefix_str + ")" + else: + # Access as struct member + prefix_str += last_sep + _cpp(field.field_name) + return prefix_str # _c_absolute_name def _c_helper_field_mapping(complex_type, prefix, flat=False): """ generate absolute names, based on prefix, for all fields starting from complex_type if flat == True, nested complex types are not taken into account @@ -1730,17 +1784,17 @@ def _c_accessors(self, name, base): # switch always needs to be unpacked explicitly # if self.is_switch: # pass # else: if True: for field in self.fields: if not field.type.is_pad: - if field.type.is_list and not field.type.fixed_size(): + if _c_field_needs_list_accessor(field): _c_accessors_list(self, field) - elif field.prev_varsized_field is not None or not field.type.fixed_size(): + elif _c_field_needs_field_accessor(field): _c_accessors_field(self, field) def c_simple(self, name): ''' Exported function that handles cardinal type declarations. These are types which are typedef'd to one of the CARDx's, char, float, etc. ''' -- 2.0.1 From chris at DemoRecorder.com Thu Oct 30 07:12:41 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 15:12:41 +0100 Subject: [Xcb] [PATCH libxcb 5/6 V2] generator: sumof with nested expression In-Reply-To: <1409743361-466-5-git-send-email-chris@demorecorder.com> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-5-git-send-email-chris@demorecorder.com> Message-ID: <54524759.5080804@DemoRecorder.com> Support sumof with a nested expression. The nested expression is computed for every list-element and the result of the computation is added to the sum. This way, sumof can be applied to a list of structs, and, e.g., compute the sum of a specific field of that struct. example: len bar generated tmpvar: int xcb_pre_tmp_1; /* sumof length */ int xcb_pre_tmp_2; /* sumof loop counter */ int64_t xcb_pre_tmp_3; /* sumof sum */ const xcb_input_sumof_test_element_t* xcb_pre_tmp_4; /* sumof list ptr */ generated code: /* mylist2 */ /* sumof start */ xcb_pre_tmp_1 = _aux->len; xcb_pre_tmp_3 = 0; xcb_pre_tmp_4 = xcb_input_sumof_test_field_access_mylist_1(_aux); for ( xcb_pre_tmp_2 = 0; xcb_pre_tmp_2 < xcb_pre_tmp_1; xcb_pre_tmp_2++) { xcb_pre_tmp_3 += xcb_pre_tmp_4->bar; xcb_pre_tmp_4++; } /* sumof end. Result is in xcb_pre_tmp_3 */ xcb_block_len += xcb_pre_tmp_3 * sizeof(uint16_t); changes for V2 of this patch: * explicitely set the member access operator in the prefix-tuple passed to function _c_helper_field_mapping. This enables us to simplify function "_c_helper_absolute_name" (which will be renamed "_c_helper_fieldaccess_expr" soon) --- src/c_client.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/c_client.py b/src/c_client.py index 6b694d5..6169175 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -4,14 +4,15 @@ from os.path import basename from functools import reduce import getopt import os import sys import errno import time import re +import copy # Jump to the bottom of this file for the main routine # Some hacks to make the API more readable, and to keep backwards compability _cname_re = re.compile('([A-Z0-9][a-z]+|[A-Z0-9]+(?![a-z])|[a-z]+)') _cname_special_cases = {'DECnet':'decnet'} @@ -1629,15 +1630,38 @@ def _c_accessor_get_expr(expr, field_mapping): _c_pre.code( "%s = %s;", lengthvar, c_length_func ) _c_pre.code( "%s = 0;", sumvar ) _c_pre.code( "%s = %s;", listvar, list_name ) _c_pre.code( "for ( %s = 0; %s < %s; %s++) {", loopvar, loopvar, lengthvar, loopvar ) _c_pre.indent() - _c_pre.code( "%s += *%s;", sumvar, listvar ) + + if expr.rhs == None: + _c_pre.code( "%s += *%s;", sumvar, listvar ) + else: + #sumof has a nested expression which + #has to be evaluated in the context of this list element + + #field mapping for the subexpression needs to include + #the fields of the list-member type + scoped_field_mapping = field_mapping.copy() + scoped_field_mapping.update( + _c_helper_field_mapping( + field.type.member, + [( listvar, '->', field.type.member )] ) ) + + #cause pre-code of the subexpression be added right here + _c_pre.end() + #compute the subexpression + rhs_expr_str = _c_accessor_get_expr(expr.rhs, scoped_field_mapping) + #resume with our code + _c_pre.start() + #output the summation expression + _c_pre.code( "%s += %s;", sumvar, rhs_expr_str ) + _c_pre.code( "%s++;", listvar ); _c_pre.pop_indent() _c_pre.code( "}" ) _c_pre.code( "/* sumof end. Result is in %s */", sumvar ) _c_pre.end() return sumvar; #return 'xcb_sumof(%s, %s)' % (list_name, c_length_func) -- 2.0.1 _______________________________________________ Xcb mailing list Xcb at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xcb From chris at DemoRecorder.com Thu Oct 30 07:12:52 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 15:12:52 +0100 Subject: [Xcb] [PATCH libxcb 4/4 V3] generator: support listelement-ref In-Reply-To: <5444E14F.4050807@DemoRecorder.com> References: <540888FC.50007@DemoRecorder.com> <1409845851-38950-4-git-send-email-chris@demorecorder.com> <5444E14F.4050807@DemoRecorder.com> Message-ID: <54524764.9050200@DemoRecorder.com> Support for listelement-ref needs the following three changes (in the order as they appear in the patch): * making the current list-element accessible with the variable xcb_listelement which is a pointer to the list-element * supporting lists of simple-type for sumof with a nested expression * using the variable for resolving a listelement-ref expression Changes for V2 of this patch: - adapt to removal of patch "libxcb 2/6" from patchset "ListInputDevices". Changes for V3 of this patch: - adapt to V2 of patch "libxcb 5/6" from patchset "ListInputDevices" --- src/c_client.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index bd14959..fa0d2fc 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -1625,26 +1625,35 @@ def _c_accessor_get_expr(expr, field_mapping): _c_pre.code("%s = %s;", listvar, list_name) _c_pre.code( "for (%s = 0; %s < %s; %s++) {", loopvar, loopvar, lengthvar, loopvar) _c_pre.indent() + # define and set xcb_listelement, so that it can be used by + # listelement-ref expressions. + if expr.contains_listelement_ref: + _c_pre.code( + "const %s *xcb_listelement = %s;", + field.c_field_type, listvar) + + # summation if expr.rhs == None: _c_pre.code("%s += *%s;", sumvar, listvar) else: # sumof has a nested expression which # has to be evaluated in the context of this list element # field mapping for the subexpression needs to include # the fields of the list-member type scoped_field_mapping = field_mapping.copy() - scoped_field_mapping.update( - _c_helper_field_mapping( - field.type.member, - [(listvar, '->', field.type.member)])) + if not field.type.member.is_simple: + scoped_field_mapping.update( + _c_helper_field_mapping( + field.type.member, + [( listvar, '->', field.type.member )])) # cause pre-code of the subexpression be added right here _c_pre.end() # compute the subexpression rhs_expr_str = _c_accessor_get_expr(expr.rhs, scoped_field_mapping) # resume with our code _c_pre.start() @@ -1654,14 +1658,16 @@ def _c_accessor_get_expr(expr, field_mapping): _c_pre.code("%s++;", listvar); _c_pre.pop_indent() _c_pre.code("}") _c_pre.code("/* sumof end. Result is in %s */", sumvar) _c_pre.end() return sumvar; # return 'xcb_sumof(%s, %s)' % (list_name, c_length_func) + elif expr.op == 'listelement-ref': + return '(*xcb_listelement)'; elif expr.op != None: return ('(' + _c_accessor_get_expr(expr.lhs, field_mapping) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, field_mapping) + ')') elif expr.bitfield: return 'xcb_popcount(' + lenexp + ')' else: -- 2.0.1 _______________________________________________ Xcb mailing list Xcb at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xcb _______________________________________________ Xcb mailing list Xcb at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xcb From chris at demorecorder.com Thu Oct 30 07:31:58 2014 From: chris at demorecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 15:31:58 +0100 Subject: [Xcb] [PATCH libxcb 7/9] rename _c_helper_absolute_name to _c_helper_fieldaccess_expr In-Reply-To: <5406F80F.4020002@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> Message-ID: <1414679520-50871-1-git-send-email-chris@demorecorder.com> The function _c_helper_absolute_name was named in a misleading way. It computes a C-expression for accessing a field of an xcb-type. Therefore the name _c_helper_fieldaccess_expr is more appropriate. Signed-off-by: Christian Linhart --- src/c_client.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 929d70e..aaaac0a 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -480,15 +480,15 @@ def _c_type_setup(self, name, postfix): if self.c_var_followed_by_fixed_fields: if field.type.fixed_size(): field.prev_varsized_field = None # recurse into this field # this has to be done here, i.e., after the field has been set up - # Otherwise the function _c_helper_absolute_name + # Otherwise the function _c_helper_fieldaccess_expr # will produce garbage or crash _c_type_setup(field.type, field.field_type, ()) if field.type.is_list: _c_type_setup(field.type.member, field.field_type, ()) if (field.type.nmemb is None): self.c_need_sizeof = True @@ -555,15 +555,15 @@ def _c_field_is_member_of_case_or_bitcase(field): elif field.parent.is_case_or_bitcase: return True else: return False # end of Functions for querying field properties -def _c_helper_absolute_name(prefix, field=None): +def _c_helper_fieldaccess_expr(prefix, field=None): """ turn prefix, which is a list of tuples (name, separator, Type obj) into a string representing a valid name in C (based on the context) if field is not None, append the field name as well """ prefix_str = '' last_sep ='' @@ -612,15 +612,15 @@ def _c_helper_field_mapping(complex_type, prefix, flat=False): else: bitcase_prefix = prefix if (True==flat and not b.type.has_name) or False==flat: all_fields.update(_c_helper_field_mapping(b.type, bitcase_prefix, flat)) else: for f in complex_type.fields: - fname = _c_helper_absolute_name(prefix, f) + fname = _c_helper_fieldaccess_expr(prefix, f) if f.field_name in all_fields: raise Exception("field name %s has been registered before" % f.field_name) all_fields[f.field_name] = (fname, f) if f.type.is_container and flat==False: if f.type.is_case_or_bitcase and not f.type.has_name: new_prefix = prefix @@ -897,15 +897,15 @@ def _c_serialize_helper_switch(context, self, complex_name, def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, prefix): """ handle switch by calling _serialize() or _unpack(), depending on context """ # switch is handled by this function as a special case param_fields, wire_fields, params = get_serialize_params(context, self) field_mapping = _c_helper_field_mapping(self, prefix) - prefix_str = _c_helper_absolute_name(prefix) + prefix_str = _c_helper_fieldaccess_expr(prefix) # find the parameters that need to be passed to _serialize()/_unpack(): # all switch expr fields must be given as parameters args = get_expr_fields(field.type) # length fields for variable size types in switch, normally only some of need # need to be passed as parameters switch_len_fields = resolve_expr_fields(field.type) @@ -941,15 +941,15 @@ def _c_serialize_helper_switch_field(context, self, field, c_switch_variable, pr def _c_serialize_helper_list_field(context, self, field, code_lines, temp_vars, space, prefix): """ helper function to cope with lists of variable length """ expr = field.type.expr - prefix_str = _c_helper_absolute_name(prefix) + prefix_str = _c_helper_fieldaccess_expr(prefix) param_fields, wire_fields, params = get_serialize_params('sizeof', self) param_names = [p[2] for p in params] expr_fields_names = [f.field_name for f in get_expr_fields(field.type)] resolved = list(filter(lambda x: x in param_names, expr_fields_names)) unresolved = list(filter(lambda x: x not in param_names, expr_fields_names)) @@ -1012,15 +1012,15 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, if not self.is_case_or_bitcase: code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name)) else: scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)] typename = reduce(lambda x,y: "%s.%s" % (x, y), scoped_name) code_lines.append('%s /* %s.%s */' % (space, typename, field.c_field_name)) - abs_field_name = _c_helper_absolute_name(prefix, field) + abs_field_name = _c_helper_fieldaccess_expr(prefix, field) # default for simple cases: call sizeof() length = "sizeof(%s)" % field.c_field_type if context in ('unserialize', 'unpack', 'sizeof'): # default: simple cast value = ' %s = *(%s *)xcb_tmp;' % (abs_field_name, field.c_field_type) @@ -1074,15 +1074,15 @@ def _c_serialize_helper_fields_fixed_size(context, self, field, return (value, length) # _c_serialize_helper_fields_fixed_size() def _c_serialize_helper_fields_variable_size(context, self, field, code_lines, temp_vars, space, prefix): - prefix_str = _c_helper_absolute_name(prefix) + prefix_str = _c_helper_fieldaccess_expr(prefix) if context in ('unserialize', 'unpack', 'sizeof'): value = '' var_field_name = 'xcb_tmp' # special case: intermixed fixed and variable size fields if self.c_var_followed_by_fixed_fields and 'unserialize' == context: -- 2.0.1 From chris at demorecorder.com Thu Oct 30 07:31:59 2014 From: chris at demorecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 15:31:59 +0100 Subject: [Xcb] [PATCH libxcb 8/9] function _c_helper_fieldaccess_expr: improve description In-Reply-To: <5406F80F.4020002@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> Message-ID: <1414679520-50871-2-git-send-email-chris@demorecorder.com> Signed-off-by: Christian Linhart --- src/c_client.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index aaaac0a..4fedf45 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -558,16 +558,25 @@ def _c_field_is_member_of_case_or_bitcase(field): return False # end of Functions for querying field properties def _c_helper_fieldaccess_expr(prefix, field=None): """ turn prefix, which is a list of tuples (name, separator, Type obj) into a string - representing a valid name in C (based on the context) - if field is not None, append the field name as well + representing a valid field-access-expression in C (based on the context) + if field is not None, append access to the field as well. + + "separator" is one of the C-operators "." or "->". + + A field access expression can consist of the following components: + * struct/union member access from a value with the "."-operator + * struct/union member access from a pointer with "->"-operator + * function-call of an accessor function: + This is used when a xcb-field is not contained in a struct. + This can, e.g., happen for fields after var-sized fields, etc. """ prefix_str = '' last_sep ='' for name, sep, obj in prefix: prefix_str += last_sep + name if '' == sep: sep = '->' -- 2.0.1 From chris at demorecorder.com Thu Oct 30 07:32:00 2014 From: chris at demorecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 15:32:00 +0100 Subject: [Xcb] [PATCH libxcb 9/9] _c_helper_fieldaccess_expr: remove handling for empty sep In-Reply-To: <5406F80F.4020002@DemoRecorder.com> References: <5406F80F.4020002@DemoRecorder.com> Message-ID: <1414679520-50871-3-git-send-email-chris@demorecorder.com> The loop-variable "sep" is never empty in function "_c_helper_fieldaccess_expr", after a fix elsewhere. Therefore I removed the handling of the case of "sep" being empty. Thanks to Ran Benita for the hint that this can be removed. Signed-off-by: Christian Linhart --- src/c_client.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 4fedf45..a174e1b 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -574,19 +574,14 @@ def _c_helper_fieldaccess_expr(prefix, field=None): This is used when a xcb-field is not contained in a struct. This can, e.g., happen for fields after var-sized fields, etc. """ prefix_str = '' last_sep ='' for name, sep, obj in prefix: prefix_str += last_sep + name - if '' == sep: - sep = '->' - if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase - (obj.is_switch and len(obj.parents)>1)): - sep = '.' last_sep = sep if field is None: # add separator for access to a yet unknown field prefix_str += last_sep else: if _c_field_needs_accessor(field): -- 2.0.1 From chris at DemoRecorder.com Thu Oct 30 08:21:25 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 16:21:25 +0100 Subject: [Xcb] Renamed and simplified function _c_helper_absolute_name / Temp repo updated In-Reply-To: <20141014132438.GD1444@ran> References: <5406F80F.4020002@DemoRecorder.com> <1409743361-466-1-git-send-email-chris@demorecorder.com> <20141012180722.GA8240@ran> <543BD4A3.1020606@DemoRecorder.com> <20141014132438.GD1444@ran> Message-ID: <54525775.3010900@DemoRecorder.com> Hi Ran, Today I had finally time to analyze, simplify and rename the function "_c_helper_absolute_name" aka "_c_helper_fieldaccess_expr". I hope this all makes the code better and reviewing easier. See the patches that I have just posted for this patchset (and one patch in a subsequent patchset to adapt for the changes.) All these simplifications do not alter the output of the generator. (That's a nice thing about xcb: You can test refactorings in the generator easily by comparing the generated code with "diff".) I have also updated the temp-repo accordingly. http://infra-srv1.demorecorder.com/git/free-sw/xcb/libxcb http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto Here's a summary of what I have done: * I have experimented with the long list of conditions of one "if" in this function ( as we have discussed in this thread ). After some debugging I have found out that most conditions are actually a workaround for a bug elsewhere: The function "_c_type_setup" has recursed into a field-object *before* setting some essential member-variables of this field-object. The function "_c_helper_fieldaccess_expr" is called indirectly there. Several sub-conditions of the long if-condition had the purpose to filter away those fields which have an unfinished parent or which are themselves unfinished. If have fixed the recursion in "_c_type_setup" so that the recursion is done *after* the member-variables of the field-object have been set. ( see patch "libxcb 1/6 V3" ) So, Ran, you had the right gut feeling that there's something wrong with this long list of conditions. Thank you! Maybe, fixing this recursion-bug will also reduce the internal garbage generated by this function? ( I cannot tell because I don't know what kind of garbage it has generated. ) * then, I have extracted the remaining conditions into functions with meaningful names. ( see patch "libxcb 1/6 V3" ) ( I have also replaced these conditions with function calls in function "_c_accessors". There are more places where these conditions are used. I'll replace them with the function calls, too, in an extra cleanup-patchset which I'll post later.) * after these simplifications I saw some more ways to simplify the control-flow of this function. ( see patch "libxcb 1/6 V3" ) * I have renamed function "_c_helper_absolute_name" to "_c_helper_fieldaccess_expr" as we have discussed. and improved the description of this function. ( patches "libxcb 7/9" and "libxcb 8/9" ) * I have identified and fixed the place which caused "sep" to be empty. ( patch "libxcb 5/6 V2" of this patchset and patch "libxcb 4/4 V3" of patchset "PopcountList" ) Therefore I could remove the handling for "sep" being empty. ( patch "libxcb 9/9" ) I hope this helps with code-quality and reviewing. Chris On 10/14/14 15:24, Ran Benita wrote: > On Mon, Oct 13, 2014 at 03:33:23PM +0200, Christian Linhart wrote: >> On 10/12/14 20:07, Ran Benita wrote: >>> On Wed, Sep 03, 2014 at 01:22:36PM +0200, Christian Linhart wrote: >>>> Fix _c_helper_absolute_name for fields which cannot be accessed >>>> as a struct/union member but which can be accessed by an >>>> accessor function. >>>> >>>> The fix calls the accessor function in these cases. >>>> >>>> Example: >>>> >>>> >>>> >>>> len >>>> >>>> >>>> >>>> >>>> >>>> >>>> The sumof-expression ( ) refers to mylist1 >>>> which is only acessible by an accessor function. >>>> >>>> Previously, sumof was only used inside bitcases, >>>> where such lists are accessible by members of the >>>> deserialized parent struct. >>>> (there is a difference between deserialization of switches >>>> and structs.) >>>> --- >>>> src/c_client.py | 28 +++++++++++++++++++++++++++- >>>> 1 file changed, 27 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/src/c_client.py b/src/c_client.py >>>> index 9216c7f..488f0e6 100644 >>>> --- a/src/c_client.py >>>> +++ b/src/c_client.py >>>> @@ -430,24 +430,50 @@ def _c_type_setup(self, name, postfix): >>>> def _c_helper_absolute_name(prefix, field=None): >>> >>> This function is strange; most of the time it generates complete garbage >>> (e.g. `foo->...->`) which is subsequently ignored. So it is called for >>> no reason many times. >> I do not understand the problem here, > > Basically, "garbage in, garbage out". The problem is the "garbage in" > part - it shouldn't happen in well-structured code... (of course this > is well before this patchset). So that makes it hard to figure out what > it *does*. This patch: > http://lists.freedesktop.org/archives/xcb/2014-October/009939.html > removes some garbage calls, but there are still a lot left. > >> The output *is* used sometimes and that counts for the output. >> >> In most cases a symbol-resolution table is filled with all fields >> that are accessible starting from a given scope/type. >> For each field, the C-expression which accesses the field, is computed here. >> Of course, only a subset of that symbol-resolution table is used later. >> In that sense, most of the output is subsequently ignored. > > Yes, that's ok. My problem is that some entires are nonsense! > >> ( for example the function "_c_helper_field_mapping" builds such a table ) >> >>> >>>> """ >>>> turn prefix, which is a list of tuples (name, separator, Type obj) into a string >>>> representing a valid name in C (based on the context) >>>> if field is not None, append the field name as well >>>> """ >>>> prefix_str = '' >>>> + last_sep ='' >>>> for name, sep, obj in prefix: >>>> + if '' != last_sep: >>>> + prefix_str += last_sep >>>> prefix_str += name >>>> if '' == sep: >>> >>> (This can never happen. I have a patch to remove this). >> By quick analysis I can confirm that because the blank >> seps are already filled in _c_helper_resolve_field_names. >> >> How did you come to the conclusion that sep can never be the empty string here? >> >> Since this is old code not affected by my patch >> and since you didn't post your patch yet as far as I can tell, >> I suggest that you post your patch after this patchset has been merged into upstream. >> ( to avoid unnecessary merge-work ) >> >> Of course I could include that change in V2 of that patch but that way >> we would have two unrelated changes in one patch which is not good. > > I looked over the callers, and saw that `sep` is never empty. I had a > patch which added `assert sep != ''`. This worked on master, but failed > on top of your patch set. It is probably more "GIGO" but I dropped it > (but forgot to amend this comment). > >>> >>>> sep = '->' >>>> if ((obj.is_case_or_bitcase and obj.has_name) or # named bitcase >>>> (obj.is_switch and len(obj.parents)>1)): >>>> sep = '.' >>>> - prefix_str += sep >>>> + last_sep = sep >>>> + >>>> + prefix_str_without_lastsep = prefix_str >>>> + prefix_str += last_sep >>>> + >>>> if field is not None: >>>> prefix_str += _cpp(field.field_name) >>>> + >>>> + >>>> + if ( >>> >>> This is a formidable list of conditions. Are all of them needed? >> I think that yes they are all needed, but there may be a better alternative ( see below ). >> >>> Can >>> this be extracted to a function `field_needs_accessor` or something like >>> that? >> >> I have thought about that and came to the conclusion that there probably is an even better alternative >> than to encapsulate those conditions in a function: >> >> Probably it is better to set a flag at the place where it has already been decided that this field >> does not appear in a C-struct. ( or use the reverse semantic ) >> Then just use that flag here. >> That would have the advantage that these conditions need not be updated when something is changed somewhere else. > > I wouldn't advocate a state variable over a pure function. But if it is > constant that's the same. > >> Would it be OK to use this patch as it is now >> and that I post a simplification fix later, >> after this is merged to upstream? >> >> Or shall I submit V2 of this patch, with changes as I have suggested above? >> ( This will probably take some time ). > > I'll try to understand the given code. > >>> >>>> + field != None >>> >>> With `None` it is customary to write `field is None`, `field is not >>> None`. >> Yes, I am sorry for that. >> I have noticed that in the meantime. >> >>> >>>> + and hasattr(field, 'c_accessor_name') >>>> + and field.parent != None >>>> + and field.parent.is_container >>>> + and not field.parent.is_switch >>>> + and not field.parent.is_case_or_bitcase >>>> + and ( #the following conditions are taken from _c_accessors() >>>> + ( field.type.is_list and not field.type.fixed_size() ) >>>> + or >>>> + ( field.prev_varsized_field is not None >>>> + or not field.type.fixed_size() >>> >>> This says `or` but the parens make it look like it should be `and`? >> I have copied that condition from function _c_accessors and it is used like that >> there. The outer "or" combines the condition of an "if" and the condition of an "elif". >> Of course, boolean algebra would allow to remove the parentheses around the inner or. >> >> It is important that this is consistent with "_c_accessors". > > OK, this just looked "suspicous", like the for loop described in this > article: http://lwn.net/Articles/453685/ > >> >>> >>>> + ) >>>> + ) >>>> + ): >>>> + prefix_str = field.c_accessor_name + "(" + prefix_str_without_lastsep + ")"; >>> >>> I'm not entirely convinced that this should be in this function - or the >>> function should be renamed. >> Renaming is a good idea for that function anyways. >> Even the existing version of that function does not compute an "absolute name" but computes a C-expression >> to access a specific field in the context defined by the "prefix" parameter. >> >> I suggest the following name: "_c_helper_field_access_expr" >> ( or something similar) > > If this name is accurate, that would be a big improvement. > >>> Is the above the correct thing to do in all >>> of the callsites? >> Good question. >> >> I am pretty sure that the answer is yes, because of the following: >> >> * The previous version of that function returned a C-expression that can also be used as an lvalue, i.e., C can assign something to it. >> >> * Due to my patches, the returned C-expression may be an rvalue in those cases where the old function returned something that cannot compile. >> ( i.e. these are the cases where the field does not occur in a C-struct) >> >> * So, the behavior only changes for those cases where the existing version of that function returns something that is not compilable. >> So, it doesn't break anything. >> >> * If, in those cases, the output of that function were somewhere inserted in the role of an lvalue, >> the C-compiler would complain. >> But the Compiler does not complain, which means that the resulting C-expression is only used as an rvalue. >> ( at least for all of our current xml-files. ) >> >> I hope that this explains it better. >> >> If you have more questions, please tell me and I'll be glad to answer them. >> >>> >>> Sorry for having more questions than answers; it is not for lack of >>> trying.. >> No problem. >> I wrote the change, so I have find the answers... :-) > > I will take another look. If someday you can simplify this, it would be > nice :) I hate to say this, but you are paying off some technical debt > left by a previous programmer whose code may be found with "git blame"... > > Ran > >> Chris >> >>> >>> Ran >>> >>>> + >>>> return prefix_str >>>> # _c_absolute_name >>>> >>>> def _c_helper_field_mapping(complex_type, prefix, flat=False): >>>> """ >>>> generate absolute names, based on prefix, for all fields starting from complex_type >>>> if flat == True, nested complex types are not taken into account >>>> -- >>>> 2.0.1 >>>> >>>> _______________________________________________ >>>> Xcb mailing list >>>> Xcb at lists.freedesktop.org >>>> http://lists.freedesktop.org/mailman/listinfo/xcb >>> >> > From pharris at opentext.com Thu Oct 30 09:16:37 2014 From: pharris at opentext.com (Peter Harris) Date: Thu, 30 Oct 2014 12:16:37 -0400 Subject: [Xcb] QueryDeviceState: new git repo/branch for pulling In-Reply-To: <540B4D38.2040101@DemoRecorder.com> References: <53F655AE.5000300@DemoRecorder.com> <540B4D38.2040101@DemoRecorder.com> Message-ID: <54526465.5070701@opentext.com> On 2014-09-06 14:06, Christian Linhart wrote: > Hi, > > Here's the new info for pulling the patches of this thread: > > Repo-Urls: > http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto QueryDeviceState-V3 of proto pulled and pushed out. Thanks, Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From pharris at opentext.com Thu Oct 30 09:13:36 2014 From: pharris at opentext.com (Peter Harris) Date: Thu, 30 Oct 2014 12:13:36 -0400 Subject: [Xcb] NestedStructTypenames: new git repo/branch for pulling In-Reply-To: <540B4D4B.9000608@DemoRecorder.com> References: <5405C23C.6010507@DemoRecorder.com> <20140902152227.GA16521@thin> <5405F3C7.5060704@DemoRecorder.com> <20140902184205.GB15560@cloud> <5406C66B.4050803@DemoRecorder.com> <540B4D4B.9000608@DemoRecorder.com> Message-ID: <545263B0.40906@opentext.com> On 2014-09-06 14:07, Christian Linhart wrote: > Hi, > > Here's the new info for pulling the patches of this thread: > > Repo-Urls: > http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto > http://infra-srv1.demorecorder.com/git/free-sw/xcb/libxcb > > Branch: NestedStructTypenames > > The actual branch to be used can have a version added. > such as "NestedStructTypenames-V4". > > Always use the branch with the highest version, please. NestedStructTypenames-V5 (which includes QueryDeviceState-V5) pulled and pushed out. Thanks, Peter Harris -- Open Text Connectivity Solutions Group Peter Harris http://connectivity.opentext.com/ Research and Development Phone: +1 905 762 6001 pharris at opentext.com Toll Free: 1 877 359 4866 From chris at DemoRecorder.com Thu Oct 30 12:49:46 2014 From: chris at DemoRecorder.com (Christian Linhart) Date: Thu, 30 Oct 2014 20:49:46 +0100 Subject: [Xcb] QueryDeviceState: new git repo/branch for pulling In-Reply-To: <54526465.5070701@opentext.com> References: <53F655AE.5000300@DemoRecorder.com> <540B4D38.2040101@DemoRecorder.com> <54526465.5070701@opentext.com> Message-ID: <5452965A.6090806@DemoRecorder.com> Hi Peter, Thank you for pulling the reviewed branches of proto and libxcb and pushing them to upstream. I have updated the master branch in the temp repos at infra-srv1.demorecorder.com to match upstream, so that further merges will work smoothly. (Default HEAD in the temp repos is not "master" but the newest pending patch branch. ) Chris On 10/30/14 17:16, Peter Harris wrote: > On 2014-09-06 14:06, Christian Linhart wrote: >> Hi, >> >> Here's the new info for pulling the patches of this thread: >> >> Repo-Urls: >> http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto > > QueryDeviceState-V3 of proto pulled and pushed out. > > Thanks, > Peter Harris