Add an expression construct <bit bit="n"/>
authorIan Osgood <iano@quirkster.com>
Tue, 14 Mar 2006 18:18:22 +0000 (10:18 -0800)
committerIan Osgood <iano@quirkster.com>
Tue, 14 Mar 2006 18:18:22 +0000 (10:18 -0800)
for mask enumerations such as CW flags.
Replaces the C-specific use of 1<<n in xproto.xml

src/c-client.xsl

index 054d84a..6306a5c 100644 (file)
@@ -1089,6 +1089,12 @@ authorization from the authors.
     <xsl:text>)</xsl:text>
   </xsl:template>
 
+  <xsl:template match="bit" mode="output-expression">
+    <xsl:text>(1 &lt;&lt; </xsl:text>
+    <xsl:value-of select="@bit" />
+    <xsl:text>)</xsl:text>
+  </xsl:template>
+
   <xsl:template match="function-call" mode="output-expression">
     <xsl:param name="field-prefix" />
     <xsl:value-of select="@name" />