aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-01 19:56:03 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-02 01:37:56 +0000
commit06a1f4670e329f47e7199d59f7b712520e117035 (patch)
tree13f5b103f5b41821a34b7c85aa795c2164efa71c
parent454fd6e9eb3009cd346443ba06498904d6cea228 (diff)
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>
-rwxr-xr-xtools/convert_proto_tree_add_text.pl13
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";
}