Commit b46953f4 authored by Jamey Sharp's avatar Jamey Sharp
Browse files

Use XPath position() function instead of xsl:number, to evaluate array indices...

Use XPath position() function instead of xsl:number, to evaluate array indices while generating code for easier readability.
parent 5e115e24
......@@ -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, <!--
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment