[Xcb-commit] 2 commits - src

Jamey Sharp jamey at kemper.freedesktop.org
Sun Nov 19 21:10:52 PST 2006


 src/c-client.xsl |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

New commits:
diff-tree 3fa50020d2d9b78e22cf3597f4688c4e22df5121 (from 16e7328b4a366b29d54696aafffe62c92e0e0130)
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun Nov 19 18:31:48 2006 -0800

    Remove support for the <localfield> tag: nothing needs it.
    
    Only one use of <localfield> remained, for a list length expression in
    xv.xml. List length parameters that don't actually appear in the
    protocol should be left implicit: if no length expression is given, then
    a localfield will be automatically created by c-client.xsl.

diff --git a/src/c-client.xsl b/src/c-client.xsl
index 0f7c025..8b951cb 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -590,7 +590,7 @@ authorization from the authors.
     </list>
   </xsl:template>
 
-  <xsl:template match="field|localfield" mode="param">
+  <xsl:template match="field" mode="param">
     <field>
       <xsl:attribute name="type">
         <xsl:call-template name="canonical-type-name" />
diff-tree 16e7328b4a366b29d54696aafffe62c92e0e0130 (from 6eee1707ea7bc303620e39911706d5fb71fa16b0)
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun Nov 19 17:56:32 2006 -0800

    Bug #5958: zero out padding bytes in requests.

diff --git a/src/c-client.xsl b/src/c-client.xsl
index d5d2b35..0f7c025 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -47,6 +47,8 @@ authorization from the authors.
 
   <xsl:variable name="h" select="$mode = 'header'" />
   <xsl:variable name="c" select="$mode = 'source'" />
+
+  <xsl:variable name="need-string-h" select="//request/pad[@bytes != 1]" />
   
   <!-- String used to indent lines of code. -->
   <xsl:variable name="indent-string" select="'    '" />
@@ -720,7 +722,7 @@ authorization from the authors.
     <l><xsl:value-of select="@ref" /> xcb_out;</l>
 
     <l />
-    <xsl:apply-templates select="$struct//*[(self::field or self::exprfield)
+    <xsl:apply-templates select="$struct//*[(self::field or self::exprfield or self::pad)
                                             and not(boolean(@no-assign))]"
                          mode="assign" />
 
@@ -779,6 +781,14 @@ authorization from the authors.
     </l>
   </xsl:template>
 
+  <xsl:template match="pad" mode="assign">
+    <xsl:variable name="padnum"><xsl:number /></xsl:variable>
+    <l><xsl:choose>
+        <xsl:when test="@bytes = 1">xcb_out.pad<xsl:value-of select="$padnum - 1" /> = 0;</xsl:when>
+        <xsl:otherwise>memset(xcb_out.pad<xsl:value-of select="$padnum - 1" />, 0, <xsl:value-of select="@bytes" />);</xsl:otherwise>
+    </xsl:choose></l>
+  </xsl:template>
+
   <xsl:template match="iterator" mode="pass2">
     <struct name="{@ref}_iterator_t">
       <field type="{@ref}_t *" name="data" />
@@ -1013,7 +1023,10 @@ authorization from the authors.
   </xsl:choose>
 </xsl:if>
 
-<xsl:if test="$c"><xsl:text>
+<xsl:if test="$c">
+<xsl:if test="$need-string-h">
+#include &lt;string.h&gt;</xsl:if>
+<xsl:text>
 #include &lt;assert.h&gt;
 #include "xcbext.h"
 #include "</xsl:text><xsl:value-of select="$header" /><xsl:text>.h"


More information about the xcb-commit mailing list