aboutsummaryrefslogtreecommitdiffstats
path: root/fix/hfDecl.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'fix/hfDecl.xsl')
-rw-r--r--fix/hfDecl.xsl17
1 files changed, 8 insertions, 9 deletions
diff --git a/fix/hfDecl.xsl b/fix/hfDecl.xsl
index b44d32e85c..ae50d80bcd 100644
--- a/fix/hfDecl.xsl
+++ b/fix/hfDecl.xsl
@@ -6,14 +6,8 @@
<xsl:template match="text()"/>
- <xsl:template match="/">
-static fix_field fix_fields[] = {
-<xsl:apply-templates/>
- };
-</xsl:template>
-
-
<xsl:template match="fields">
+static const fix_field fix_fields[] = {
<xsl:for-each select="field">
<xsl:sort select="@number" data-type="number"/>
<xsl:choose>
@@ -25,10 +19,15 @@ static fix_field fix_fields[] = {
<xsl:otherwise>2</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- { <xsl:value-of select="@number"/>, -1, <xsl:copy-of select="$val_type" />, <xsl:value-of select="@name"/>_val },</xsl:when>
+ { <xsl:value-of select="@number"/>, <xsl:copy-of select="$val_type" />, <xsl:value-of select="@name"/>_val },</xsl:when>
<xsl:otherwise>
- { <xsl:value-of select="@number"/>, -1, 0, NULL }, /* <xsl:value-of select="@name"/> */</xsl:otherwise>
+ { <xsl:value-of select="@number"/>, 0, NULL }, /* <xsl:value-of select="@name"/> */</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
+ };
+
+<xsl:text>static int fix_hf[</xsl:text>
+<xsl:value-of select="count( field )"/>
+<xsl:text>];</xsl:text>
</xsl:template>
</xsl:stylesheet>