projects
/
free-sw
/
xcb
/
libxcb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changes to makefile to build libXCBxtest
[free-sw/xcb/libxcb]
/
src
/
c-client.xsl
diff --git
a/src/c-client.xsl
b/src/c-client.xsl
index
3ab2889
..
56dbaac
100644
(file)
--- a/
src/c-client.xsl
+++ b/
src/c-client.xsl
@@
-567,7
+567,7
@@
authorization from the authors.
<xsl:variable name="struct"
select="$pass1/xcb/struct[@name=current()/@ref]" />
<xsl:variable name="struct"
select="$pass1/xcb/struct[@name=current()/@ref]" />
- <xsl:variable name="num-parts" select="
1+count($struct/list)
" />
+ <xsl:variable name="num-parts" select="
(1+count($struct/list))*2
" />
<l>static const XCBProtocolRequest xcb_req = {</l>
<indent>
<l>static const XCBProtocolRequest xcb_req = {</l>
<indent>
@@
-586,7
+586,7
@@
authorization from the authors.
<l>};</l>
<l />
<l>};</l>
<l />
- <l>struct iovec xcb_parts[<xsl:value-of select="$num-parts" />];</l>
+ <l>struct iovec xcb_parts[<xsl:value-of select="$num-parts
+2
" />];</l>
<l><xsl:value-of select="../@type" /> xcb_ret;</l>
<l><xsl:value-of select="@ref" /> xcb_out;</l>
<l><xsl:value-of select="../@type" /> xcb_ret;</l>
<l><xsl:value-of select="@ref" /> xcb_out;</l>
@@
-596,26
+596,30
@@
authorization from the authors.
mode="assign" />
<l />
mode="assign" />
<l />
- <l>xcb_parts[0].iov_base = &xcb_out;</l>
- <l>xcb_parts[0].iov_len = sizeof(xcb_out);</l>
+ <l>xcb_parts[2].iov_base = (char *) &xcb_out;</l>
+ <l>xcb_parts[2].iov_len = sizeof(xcb_out);</l>
+ <l>xcb_parts[3].iov_base = 0;</l>
+ <l>xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;</l>
<xsl:for-each select="$struct/list">
<xsl:for-each select="$struct/list">
- <l>xcb_parts[<xsl:
number />].iov_base = (void
*) <!--
+ <l>xcb_parts[<xsl:
value-of select="2 + position() * 2"/>].iov_base = (char
*) <!--
--><xsl:value-of select="@name" />;</l>
--><xsl:value-of select="@name" />;</l>
- <l>xcb_parts[<xsl:
number
/>].iov_len = <!--
+ <l>xcb_parts[<xsl:
value-of select="2 + position() * 2"
/>].iov_len = <!--
--><xsl:apply-templates mode="output-expression" /><!--
--><xsl:if test="not(@type = 'void')">
<xsl:text> * sizeof(</xsl:text>
<xsl:value-of select="@type" />
<xsl:text>)</xsl:text>
</xsl:if>;</l>
--><xsl:apply-templates mode="output-expression" /><!--
--><xsl:if test="not(@type = 'void')">
<xsl:text> * sizeof(</xsl:text>
<xsl:value-of select="@type" />
<xsl:text>)</xsl:text>
</xsl:if>;</l>
+ <l>xcb_parts[<xsl:value-of select="3 + position() * 2"/>].iov_base = 0;</l>
+ <l>xcb_parts[<xsl:value-of select="3 + position() * 2"/>].iov_len = -xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_len & 3;</l>
</xsl:for-each>
</xsl:for-each>
- <l>
XCBSendRequest(c, &xcb_ret.sequence
, <!--
+ <l>
xcb_ret.sequence = XCBSendRequest(c
, <!--
--><xsl:choose>
<xsl:when test="@has-reply">XCB_REQUEST_CHECKED</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
--><xsl:choose>
<xsl:when test="@has-reply">XCB_REQUEST_CHECKED</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>, xcb_parts, &xcb_req);</l>
+ </xsl:choose>, xcb_parts
+ 2
, &xcb_req);</l>
<l>return xcb_ret;</l>
</xsl:template>
<l>return xcb_ret;</l>
</xsl:template>
@@
-1085,6
+1089,12
@@
authorization from the authors.
<xsl:text>)</xsl:text>
</xsl:template>
<xsl:text>)</xsl:text>
</xsl:template>
+ <xsl:template match="bit" mode="output-expression">
+ <xsl:text>(1 << </xsl:text>
+ <xsl:value-of select="." />
+ <xsl:text>)</xsl:text>
+ </xsl:template>
+
<xsl:template match="function-call" mode="output-expression">
<xsl:param name="field-prefix" />
<xsl:value-of select="@name" />
<xsl:template match="function-call" mode="output-expression">
<xsl:param name="field-prefix" />
<xsl:value-of select="@name" />