From 5122feb59382409385da128b744fe3955a58d28e Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 22 Jun 2020 21:09:38 +0200
Subject: [PATCH] Rename the function io_check_output_fields() to
 io_prepare_output_fields() to better represent what it does.

---
 examples/main.c          |  6 +++---
 src/common_io.c          | 14 ++++++++------
 src/common_io.h          |  6 +++---
 tests/testSelectOutput.c |  4 ++--
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/examples/main.c b/examples/main.c
index 43d8aa611f..b9a59c97e1 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -840,9 +840,9 @@ int main(int argc, char *argv[]) {
 
   } else {
 
-    /* Verify that the fields to dump actually exist */
-    io_check_output_fields(output_options, with_cosmology, with_fof,
-                           with_structure_finding);
+    /* Prepare and verify the selection of outputs */
+    io_prepare_output_fields(output_options, with_cosmology, with_fof,
+                             with_structure_finding);
 
     /* Not restarting so look for the ICs. */
     /* Initialize unit system and constants */
diff --git a/src/common_io.c b/src/common_io.c
index a775db6638..15160078eb 100644
--- a/src/common_io.c
+++ b/src/common_io.c
@@ -2274,15 +2274,17 @@ void io_collect_gparts_background_to_write(
 }
 
 /**
- * @brief Verify that the output selection file is valid.
+ * @brief Prepare the output option fields according to the user's choices and
+ * verify that they are valid.
  *
- * @param params The #swift_params instance corresponding to the select_output
- *               file.
+ * @param output_options The #output_options for this run
  * @param with_cosmolgy Ran with cosmology?
+ * @param with_fof Are we running with on-the-fly Fof?
+ * @param with_stf Are we running with on-the-fly structure finder?
  */
-void io_check_output_fields(struct output_options* output_options,
-                            const int with_cosmology, const int with_fof,
-                            const int with_stf) {
+void io_prepare_output_fields(struct output_options* output_options,
+                              const int with_cosmology, const int with_fof,
+                              const int with_stf) {
 
   const int MAX_NUM_PTYPE_FIELDS = 100;
 
diff --git a/src/common_io.h b/src/common_io.h
index 3677ae556e..1c89176e27 100644
--- a/src/common_io.h
+++ b/src/common_io.h
@@ -172,9 +172,9 @@ void io_duplicate_black_holes_gparts(struct threadpool* tp,
                                      struct gpart* const gparts, size_t Nstars,
                                      size_t Ndm);
 
-void io_check_output_fields(struct output_options* output_options,
-                            const int with_cosmology, const int with_fof,
-                            const int with_stf);
+void io_prepare_output_fields(struct output_options* output_options,
+                              const int with_cosmology, const int with_fof,
+                              const int with_stf);
 
 void io_write_output_field_parameter(const char* filename, int with_cosmology);
 
diff --git a/tests/testSelectOutput.c b/tests/testSelectOutput.c
index d84e42812a..8b5cd44193 100644
--- a/tests/testSelectOutput.c
+++ b/tests/testSelectOutput.c
@@ -159,8 +159,8 @@ int main(int argc, char *argv[]) {
 
   /* check output selection */
   message("Checking output parameters.");
-  io_check_output_fields(&output_options, /*with_cosmology=*/0, /*with_fof=*/0,
-                         /*with_structure_finding=*/0);
+  io_prepare_output_fields(&output_options, /*with_cosmology=*/0, /*with_fof=*/0,
+			   /*with_structure_finding=*/0);
 
   /* write output file */
   message("Writing output.");
-- 
GitLab