-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As described here: #317 (comment) we shouldn't call `getenv` twice. This commit uses a `envval` variable to store the value of `getenv`. Signed-off-by: thb-sb <[email protected]>
- Loading branch information
thb-sb
committed
Mar 19, 2024
1 parent
f581687
commit c3e61c1
Showing
3 changed files
with
360 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
{% set cnt = namespace(val=-2) %} | ||
{ const char* envval = NULL; | ||
{%- for sig in config['sigs'] %} | ||
{%- for variant in sig['variants'] %} | ||
{%- set cnt.val = cnt.val + 2 %} | ||
if (getenv("OQS_ENCODING_{{variant['name']|upper}}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}"); | ||
if (getenv("OQS_ENCODING_{{variant['name']|upper}}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}_ALGNAME"); | ||
if ((envval = getenv("OQS_ENCODING_{{variant['name']|upper}}"))) oqs_alg_encoding_list[{{ cnt.val }}] = envval; | ||
if ((envval = getenv("OQS_ENCODING_{{variant['name']|upper}}_ALGNAME"))) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = envval; | ||
{%- for classical_alg in variant['mix_with'] %} | ||
{%- set cnt.val = cnt.val + 2 %} | ||
if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}"); | ||
if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME"); | ||
if ((envval = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}"))) oqs_alg_encoding_list[{{ cnt.val }}] = envval; | ||
if ((envval = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME"))) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = envval; | ||
{%- endfor %} | ||
{%- endfor %} | ||
{%- endfor %} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.