Skip to content

Commit 87e7b13

Browse files
committed
mpi_t: Rename variable for clarity
Whether or not the user has set an environment variable is tracked by the return codes of various MPL_env2* functions. If a variable is set and debugging is enabled, the setting gets printed out for the user. Rename got_rc->is_set to better indicate what the value represents.
1 parent 36a4e3d commit 87e7b13

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

maint/extractcvars

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ print OUTPUT_C <<EOT;
247247
int ${fn_ns}_init(void)
248248
{
249249
int mpi_errno = MPI_SUCCESS;
250-
int rc, got_rc;
250+
int rc, is_set;
251251
const char *tmp_str;
252252
MPIR_T_cvar_value_t defaultval;
253253
@@ -327,33 +327,33 @@ foreach my $p (@cvars) {
327327
push @env_names, "${alt_ns}_" . $p->{name};
328328
push @env_names, "${uc_ns}_" . $p->{name};
329329

330-
print OUTPUT_C " got_rc = 0;\n";
330+
print OUTPUT_C " is_set = 0;\n";
331331
foreach my $env_name (@env_names) {
332332
# assumes rc is defined
333333
if ($p->{type} eq 'range') {
334334
print OUTPUT_C <<EOT;
335335
rc = MPL_env2${env_fn}("$env_name", &($var_name.low), &($var_name.high));
336336
MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
337-
got_rc += rc;
337+
is_set += rc;
338338
EOT
339339
}
340340
elsif ($p->{type} eq 'string' or $p->{type} eq 'enum') {
341341
print OUTPUT_C <<EOT;
342342
rc = MPL_env2${env_fn}("$env_name", &tmp_str);
343-
got_rc += rc;
343+
is_set += rc;
344344
EOT
345345
}
346346
else {
347347
print OUTPUT_C <<EOT;
348348
rc = MPL_env2${env_fn}("$env_name", &($var_name));
349349
MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
350-
got_rc += rc;
350+
is_set += rc;
351351
EOT
352352
}
353353
}
354354

355355
# debugging
356-
print OUTPUT_C " if (got_rc && debug) {\n";
356+
print OUTPUT_C " if (is_set && debug) {\n";
357357
if ($p->{type} eq 'string' or $p->{type} eq 'enum') {
358358
print OUTPUT_C " printf(\"CVAR: $var_name = %s\\n\", tmp_str);\n";
359359
} elsif ($p->{type} eq "range") {

0 commit comments

Comments
 (0)