diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/convert_proto_tree_add_text.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/convert_proto_tree_add_text.pl b/tools/convert_proto_tree_add_text.pl index b77d6258f0..8155394a87 100755 --- a/tools/convert_proto_tree_add_text.pl +++ b/tools/convert_proto_tree_add_text.pl @@ -618,23 +618,20 @@ sub output_hf { my $index; my $key; + open(FCO, ">", $fileName . ".hf"); + + print FCO "/* Generated from convert_proto_tree_add_text.pl */\n"; + #add hfs to hash table to prevent against (accidental) duplicates for ($index=0;$index<@proto_tree_list;$index++) { if ($proto_tree_list[$index][1] eq "1") { $hfs{$proto_tree_list[$index][3]} = $proto_tree_list[$index][3]; + print FCO "static int $proto_tree_list[$index][3] = -1;\n"; } elsif ($proto_tree_list[$index][1] eq "2") { $eis{$proto_tree_list[$index][3]} = $proto_tree_list[$index][3]; } } - open(FCO, ">", $fileName . ".hf"); - - print FCO "/* Generated from convert_proto_tree_add_text.pl */\n"; - - foreach $key (keys %hfs) { - print FCO "static int $key = -1;\n"; - } - if (scalar keys %hfs > 0) { print FCO "\n\n"; } |