diff options
author | Jamey Sharp <jamey@minilop.net> | 2006-03-02 15:35:31 -0800 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2006-03-02 15:35:31 -0800 |
commit | 5e115e2441ed32f5fa495370b36b01c03bbff66d (patch) | |
tree | cf1695c201016f291ab8e9ca717796871660a0ce /src/c-client.xsl | |
parent | ed823bf65192a72f8c3060698c9bded9f77d49c2 (diff) |
API/ABI change: XCBSendRequest callers must pad to 4-byte boundaries now. When not in RAW mode, a null pointer for iov_base is replaced by up to 3 padding bytes.
Diffstat (limited to 'src/c-client.xsl')
-rw-r--r-- | src/c-client.xsl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/c-client.xsl b/src/c-client.xsl index 3ab2889..bee7275 100644 --- 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="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> @@ -586,7 +586,7 @@ authorization from the authors. <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> @@ -598,17 +598,21 @@ authorization from the authors. <l /> <l>xcb_parts[0].iov_base = &xcb_out;</l> <l>xcb_parts[0].iov_len = sizeof(xcb_out);</l> + <l>xcb_parts[1].iov_base = 0;</l> + <l>xcb_parts[1].iov_len = -xcb_parts[0].iov_len & 3;</l> <xsl:for-each select="$struct/list"> - <l>xcb_parts[<xsl:number />].iov_base = (void *) <!-- + <l>xcb_parts[<xsl:number /> * 2].iov_base = (void *) <!-- --><xsl:value-of select="@name" />;</l> - <l>xcb_parts[<xsl:number />].iov_len = <!-- + <l>xcb_parts[<xsl:number /> * 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> </xsl:for-each> <l>XCBSendRequest(c, &xcb_ret.sequence, <!-- |