[Xcb] [patch] Define and use the opcode numbers.

Zephaniah E. Hull warp at aehallh.com
Wed Aug 23 09:47:45 PDT 2006

On Fri, Aug 18, 2006 at 08:02:54PM -0700, Josh Triplett wrote:
> Zephaniah E. Hull wrote:
> > Hard coding the opcode numbers in the function just makes it harder to
> > figure out what's going on, but much more to the point, not defining the
> > opcodes in the header makes it impossible to use the generated headers
> > instead of the x11proto headers in the server.
> > 
> > This is bad, and the attached patch fixes it.
> Looks like a good idea to me; very happy to hear that the headers could
> get used in the server.  One comment below.
> > diff --git a/xcb/src/c-client.xsl b/xcb/src/c-client.xsl
> > index 218e093..598be4d 100644
> > --- a/xcb/src/c-client.xsl
> > +++ b/xcb/src/c-client.xsl
> > @@ -235,7 +235,7 @@ authorization from the authors.
> >        </xsl:attribute>
> >        <field type="XCBConnection *" name="c" />
> >        <xsl:apply-templates select="$req/*[not(self::reply)]" mode="param" />
> > -      <do-request ref="XCB{$ext}{$req/@name}Req" opcode="{$req/@opcode}"
> > +      <do-request ref="XCB{$ext}{$req/@name}Req" opcode="XCB_{$ext}{@name}"
> >                    checked="{$checked}">
> In the request-function template, you need to use $req/@name, not just
> @name.  While it just so happens that the context node points to the
> request node at the current callers of this function, the function
> should not actually rely on this, but should instead use its $req
> parameter to refer to the request node.  (In fact, in an alternate
> implementation of this function, it got called from an xsl:for-each loop
> instead, which changed the context; we switched to the current
> implementation before committing to work around a bug in xsltproc.)

Ah, alright.

One of these days I need to find the time to actually learn xslt, but
probably not this week. :)

I'll get an updated patch with this covered shortly, along with the
issues mentioned in the other patch.

Zephaniah E. Hull.
(Sorry about the time it took to reply, having a busy week.)

	  1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
	   92ED 94E4 B1E6 3624 226D  5727 4453 008B E65A 7801
	    CCs of replies from mailing lists are requested.

<Deek> If the user points the gun at his foot and pulls the trigger, it
       is our job to ensure the bullet gets where it's supposed to.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060823/288f47e2/attachment.pgp

More information about the Xcb mailing list