summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/errl/parser')
-rwxr-xr-xsrc/usr/errl/parser/genErrlParsers.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl
index e246e1a8a..fde5799a5 100755
--- a/src/usr/errl/parser/genErrlParsers.pl
+++ b/src/usr/errl/parser/genErrlParsers.pl
@@ -1058,6 +1058,14 @@ $outputFileName = $outputDir . "/../errldisplaydata.C";
open(OFILE, ">", $outputFileName . ".tmp") or
die("Cannot open: $outputFileName.tmp: $!");
+#------------------------------------------------------------------------------
+# Helper function for sort method, convert hex string to decimal and compare
+#------------------------------------------------------------------------------
+sub hexToDecCmp
+{
+ hex($a) <=> hex($b);
+}
+
print OFILE "/*\n";
print OFILE " * Automatically generated by Hostboot's $0\n";
print OFILE " * Do not modify this file in the hostboot tree, it is automatically\n";
@@ -1071,9 +1079,9 @@ print OFILE "#include <stdlib.h>\n\n";
print OFILE "namespace ERRORLOGDISPLAY\n{\n\n";
print OFILE "// Error Info Table\n";
print OFILE "ErrLogDisplay::errLogInfo ErrLogDisplay::errorInfo [] = {\n";
-foreach my $modID (sort keys %displayDataEntries)
+foreach my $modID (sort hexToDecCmp keys(%displayDataEntries))
{
- foreach my $rc (sort keys %{$displayDataEntries{$modID}})
+ foreach my $rc (sort hexToDecCmp keys(%{$displayDataEntries{$modID}}))
{
print OFILE $displayDataEntries{$modID}{$rc};
}
OpenPOWER on IntegriCloud