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[1].iov_base = 0;</l>
- <l>xcb_parts[1].iov_len = -xcb_parts[0].iov_len & 3;</l>
+ <l>xcb_parts[2].iov_base = &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">
- <l>xcb_parts[<xsl:value-of select="position() * 2"/>].iov_base = (void *) <!--
+ <l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (void *) <!--
--><xsl:value-of select="@name" />;</l>
- <l>xcb_parts[<xsl:value-of select="position() * 2"/>].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>
- <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>
+ <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>
<l>XCBSendRequest(c, &xcb_ret.sequence, <!--
--><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>
((CARD16 *) vector[0].iov_base)[1] = shortlen;
if(!shortlen)
{
- memmove(vector + 1, vector, veclen++ * sizeof(*vector));
- ++veclen;
+ --vector, ++veclen;
vector[0].iov_base = prefix;
vector[0].iov_len = sizeof(prefix);
prefix[0] = ((CARD32 *) vector[0].iov_base)[0];
{
memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len);
c->out.queue_len += vector[0].iov_len;
+ vector[0].iov_base = (char *) vector[0].iov_base + vector[0].iov_len;
+ vector[0].iov_len = 0;
++vector, --count;
}
if(!count)
return 1;
- memmove(vector + 1, vector, count++ * sizeof(struct iovec));
+ --vector, ++count;
vector[0].iov_base = c->out.queue;
vector[0].iov_len = c->out.queue_len;
c->out.queue_len = 0;