diff --git a/examples/main.c b/examples/main.c index d17121694c72c861cf1a06f0453b886bd860b1e4..ccf25c22c113e343f69c38582f3bb73e8e0b1eab 100644 --- a/examples/main.c +++ b/examples/main.c @@ -915,9 +915,9 @@ int main(int argc, char *argv[]) { /* used parameters */ parser_write_params_to_file(params, "used_parameters.yml", 1); - /* non used parameters */ - parser_write_params_to_file(params, "non_used_parameters.yml", 0); - + /* unused parameters */ + parser_write_params_to_file(params, "unused_parameters.yml", 0); + /* Main simulation loop */ /* ==================== */ int force_stop = 0; diff --git a/src/parser.c b/src/parser.c index 78fea7b6260cc742eefd405513eb9758fb8ba1bc..58f5632ee045608c9738a7cabce639971f05db55 100644 --- a/src/parser.c +++ b/src/parser.c @@ -624,7 +624,7 @@ int parser_get_opt_param_int(struct swift_params *params, /* this parameter has been used */ params->data[i].used = 1; - + return retParam; } } @@ -637,7 +637,7 @@ int parser_get_opt_param_int(struct swift_params *params, /* Set parameter as used */ params->data[params->paramCount-1].used = 1; - + return def; } @@ -829,7 +829,7 @@ void parser_print_params(const struct swift_params *params) { * * @param params Structure that holds the parameters * @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, const char *file_name, int write_used) { @@ -845,8 +845,8 @@ void parser_write_params_to_file(const struct swift_params *params, if (write_used && !params->data[i].used) { #ifdef SWIFT_DEBUG_CHECKS message("Parameter `%s` was not used. " - "Only the parameter used are written.", - params->data[i].name); + "Only the parameter used are written.", + params->data[i].name); #endif continue; } @@ -877,7 +877,7 @@ void parser_write_params_to_file(const struct swift_params *params, } /* End of file identifier in YAML. */ - fprintf(file, PARSER_END_OF_FILE); + fprintf(file, "%s\n", PARSER_END_OF_FILE); fclose(file); } @@ -889,10 +889,10 @@ void parser_write_params_to_file(const struct swift_params *params, * * @param params Structure that holds the parameters * @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, - int write_used) { + int write_used) { for (int i = 0; i < params->paramCount; i++) { if (write_used && !params->data[i].used) diff --git a/src/parser.h b/src/parser.h index a45fc381e2dc35288bb818a75d2bc2bee5a4abb2..09e787b9cdfc6c12045d8ac96c159d8e571491d8 100644 --- a/src/parser.h +++ b/src/parser.h @@ -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_write_params_to_file(const struct swift_params *params, const char *file_name, - int write_all); + int write_all); void parser_set_param(struct swift_params *params, const char *desc); 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, #if defined(HAVE_HDF5) void parser_write_params_to_hdf5(const struct swift_params *params, hid_t grp, - int write_all); + int write_all); #endif /* Dump/restore. */