Have hf variables outputted in the order they were found in the file.

Previously they were "randomly sorted" in the hash table.  The hf "array" is outputted in the order found, so have the hf variable declaration match.

Change-Id: I4b078a6328ba7c2781f07bb41d701412fc74ba22
Reviewed-on: https://code.wireshark.org/review/6219
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-01-01 19:56:03 -05:00
parent 454fd6e9eb
commit 06a1f4670e
1 changed files with 8 additions and 11 deletions

View File

@ -618,21 +618,18 @@ sub output_hf {
my $index;
my $key;
#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];
} 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";
#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];
}
}
if (scalar keys %hfs > 0) {