summaryrefslogtreecommitdiff
path: root/src/c-client.xsl
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-03-02 23:05:08 -0800
committerJamey Sharp <jamey@minilop.net>2006-03-02 23:05:08 -0800
commitb46953f46c7d0fd8cbb73f922524968c1ac86fa4 (patch)
tree08b17a1a561047c8940e9b59b3ddf6bb0bb4ef8a /src/c-client.xsl
parent5e115e2441ed32f5fa495370b36b01c03bbff66d (diff)
Use XPath position() function instead of xsl:number, to evaluate array indices while generating code for easier readability.
Diffstat (limited to 'src/c-client.xsl')
-rw-r--r--src/c-client.xsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/c-client.xsl b/src/c-client.xsl
index bee7275..45e2cfe 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -602,17 +602,17 @@ authorization from the authors.
<l>xcb_parts[1].iov_len = -xcb_parts[0].iov_len &amp; 3;</l>
<xsl:for-each select="$struct/list">
- <l>xcb_parts[<xsl:number /> * 2].iov_base = (void *) <!--
+ <l>xcb_parts[<xsl:value-of select="position() * 2"/>].iov_base = (void *) <!--
--><xsl:value-of select="@name" />;</l>
- <l>xcb_parts[<xsl:number /> * 2].iov_len = <!--
+ <l>xcb_parts[<xsl:value-of select="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>
- <l>xcb_parts[<xsl:number /> * 2 + 1].iov_base = 0;</l>
- <l>xcb_parts[<xsl:number /> * 2 + 1].iov_len = -xcb_parts[<xsl:number /> * 2].iov_len &amp; 3;</l>
+ <l>xcb_parts[<xsl:value-of select="1 + position() * 2"/>].iov_base = 0;</l>
+ <l>xcb_parts[<xsl:value-of select="1 + position() * 2"/>].iov_len = -xcb_parts[<xsl:value-of select="position() * 2"/>].iov_len &amp; 3;</l>
</xsl:for-each>
<l>XCBSendRequest(c, &amp;xcb_ret.sequence, <!--