Use XPath position() function instead of xsl:number, to evaluate array indices while generating code for easier readability.
This commit is contained in:
parent
5e115e2441
commit
b46953f46c
|
@ -602,17 +602,17 @@ authorization from the authors.
|
|||
<l>xcb_parts[1].iov_len = -xcb_parts[0].iov_len & 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 & 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 & 3;</l>
|
||||
</xsl:for-each>
|
||||
|
||||
<l>XCBSendRequest(c, &xcb_ret.sequence, <!--
|
||||
|
|
Loading…
Reference in New Issue