Skip to content
Snippets Groups Projects
Commit b1f2facc authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Use unused not non-used or indeed not-used, these parameters, in an ideal...

Use unused not non-used or indeed not-used, these parameters, in an ideal circumstance, should be intentionally not used, so unused is more correct. Also fix up small issues in whitespace in the code and output
parent ac91143d
No related branches found
No related tags found
1 merge request!557Parser improvement
...@@ -915,9 +915,9 @@ int main(int argc, char *argv[]) { ...@@ -915,9 +915,9 @@ int main(int argc, char *argv[]) {
/* used parameters */ /* used parameters */
parser_write_params_to_file(params, "used_parameters.yml", 1); parser_write_params_to_file(params, "used_parameters.yml", 1);
/* non used parameters */ /* unused parameters */
parser_write_params_to_file(params, "non_used_parameters.yml", 0); parser_write_params_to_file(params, "unused_parameters.yml", 0);
/* Main simulation loop */ /* Main simulation loop */
/* ==================== */ /* ==================== */
int force_stop = 0; int force_stop = 0;
......
...@@ -624,7 +624,7 @@ int parser_get_opt_param_int(struct swift_params *params, ...@@ -624,7 +624,7 @@ int parser_get_opt_param_int(struct swift_params *params,
/* this parameter has been used */ /* this parameter has been used */
params->data[i].used = 1; params->data[i].used = 1;
return retParam; return retParam;
} }
} }
...@@ -637,7 +637,7 @@ int parser_get_opt_param_int(struct swift_params *params, ...@@ -637,7 +637,7 @@ int parser_get_opt_param_int(struct swift_params *params,
/* Set parameter as used */ /* Set parameter as used */
params->data[params->paramCount-1].used = 1; params->data[params->paramCount-1].used = 1;
return def; return def;
} }
...@@ -829,7 +829,7 @@ void parser_print_params(const struct swift_params *params) { ...@@ -829,7 +829,7 @@ void parser_print_params(const struct swift_params *params) {
* *
* @param params Structure that holds the parameters * @param params Structure that holds the parameters
* @param file_name Name of file to be written * @param file_name Name of file to be written
* @param write_used Write used fields or non used fields. * @param write_used Write used fields or unused fields.
*/ */
void parser_write_params_to_file(const struct swift_params *params, void parser_write_params_to_file(const struct swift_params *params,
const char *file_name, int write_used) { const char *file_name, int write_used) {
...@@ -845,8 +845,8 @@ void parser_write_params_to_file(const struct swift_params *params, ...@@ -845,8 +845,8 @@ void parser_write_params_to_file(const struct swift_params *params,
if (write_used && !params->data[i].used) { if (write_used && !params->data[i].used) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
message("Parameter `%s` was not used. " message("Parameter `%s` was not used. "
"Only the parameter used are written.", "Only the parameter used are written.",
params->data[i].name); params->data[i].name);
#endif #endif
continue; continue;
} }
...@@ -877,7 +877,7 @@ void parser_write_params_to_file(const struct swift_params *params, ...@@ -877,7 +877,7 @@ void parser_write_params_to_file(const struct swift_params *params,
} }
/* End of file identifier in YAML. */ /* End of file identifier in YAML. */
fprintf(file, PARSER_END_OF_FILE); fprintf(file, "%s\n", PARSER_END_OF_FILE);
fclose(file); fclose(file);
} }
...@@ -889,10 +889,10 @@ void parser_write_params_to_file(const struct swift_params *params, ...@@ -889,10 +889,10 @@ void parser_write_params_to_file(const struct swift_params *params,
* *
* @param params Structure that holds the parameters * @param params Structure that holds the parameters
* @param grp HDF5 group * @param grp HDF5 group
* @param write_used Write used fields or non used fields. * @param write_used Write used fields or unused fields.
*/ */
void parser_write_params_to_hdf5(const struct swift_params *params, hid_t grp, void parser_write_params_to_hdf5(const struct swift_params *params, hid_t grp,
int write_used) { int write_used) {
for (int i = 0; i < params->paramCount; i++) { for (int i = 0; i < params->paramCount; i++) {
if (write_used && !params->data[i].used) if (write_used && !params->data[i].used)
......
...@@ -61,7 +61,7 @@ void parser_read_file(const char *file_name, struct swift_params *params); ...@@ -61,7 +61,7 @@ void parser_read_file(const char *file_name, struct swift_params *params);
void parser_print_params(const struct swift_params *params); void parser_print_params(const struct swift_params *params);
void parser_write_params_to_file(const struct swift_params *params, void parser_write_params_to_file(const struct swift_params *params,
const char *file_name, const char *file_name,
int write_all); int write_all);
void parser_set_param(struct swift_params *params, const char *desc); void parser_set_param(struct swift_params *params, const char *desc);
char parser_get_param_char(struct swift_params *params, const char *name); char parser_get_param_char(struct swift_params *params, const char *name);
...@@ -87,7 +87,7 @@ void parser_get_opt_param_string(struct swift_params *params, ...@@ -87,7 +87,7 @@ void parser_get_opt_param_string(struct swift_params *params,
#if defined(HAVE_HDF5) #if defined(HAVE_HDF5)
void parser_write_params_to_hdf5(const struct swift_params *params, hid_t grp, void parser_write_params_to_hdf5(const struct swift_params *params, hid_t grp,
int write_all); int write_all);
#endif #endif
/* Dump/restore. */ /* Dump/restore. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment