Address review comments

- Use switch case instead of loop to generate faster code
- Add #if defined to address compiler error

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav Aggarwal 2020-04-09 11:39:04 -07:00
parent a9f64006ea
commit a4a2aa5169
3 changed files with 884 additions and 420 deletions

View file

@ -119,13 +119,13 @@ foreach my $line (@matches)
{
$code_check = \$ll_code_check;
$old_define = \$ll_old_define;
$white_space = ' ';
$white_space = ' ';
}
else
{
$code_check = \$hl_code_check;
$old_define = \$hl_old_define;
$white_space = ' ';
$white_space = ' ';
}
if ($define_name ne ${$old_define})
@ -160,7 +160,9 @@ foreach my $line (@matches)
${$old_define} = $define_name;
}
${$code_check} .= "${white_space}\{.code = -($error_name), .description=\"$module_name - $description\"},\n";
${$code_check} .= "${white_space}case -($error_name):\n".
"${white_space} error_description = \"$module_name - $description\";\n".
"${white_space} break;\n"
};
if ($ll_old_define ne "")