From b22d8248ea1ec7e4c9545ce31472006267bf93bf Mon Sep 17 00:00:00 2001
From: Josh Borrow <joshua.borrow@durham.ac.uk>
Date: Tue, 2 Jun 2020 09:00:28 +0100
Subject: [PATCH] Changed "Default" for an equivalent #define in output_options

---
 src/distributed_io.c | 3 ++-
 src/output_list.c    | 3 ++-
 src/output_options.h | 3 +++
 src/parallel_io.c    | 6 ++++--
 src/serial_io.c      | 3 ++-
 src/single_io.c      | 3 ++-
 6 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/distributed_io.c b/src/distributed_io.c
index 9f08ca929b..000033b91a 100644
--- a/src/distributed_io.c
+++ b/src/distributed_io.c
@@ -358,7 +358,8 @@ void write_output_distributed(struct engine* e,
 
   /* Determine if we are writing a reduced snapshot, and if so which
    * output selection type to use */
-  char current_selection_name[FIELD_BUFFER_SIZE] = "Default";
+  char current_selection_name[FIELD_BUFFER_SIZE] =
+      select_output_header_default_name;
   if (output_list) {
     /* Users could have specified a different Select Output scheme for each
      * snapshot. */
diff --git a/src/output_list.c b/src/output_list.c
index 4bc43f5ea4..b1a01aa218 100644
--- a/src/output_list.c
+++ b/src/output_list.c
@@ -111,7 +111,8 @@ void output_list_read_file(struct output_list *output_list,
   size_t ind = 0;
   int read_successfully = 0;
   int found_select_output = 0;
-  char select_output_buffer[FIELD_BUFFER_SIZE] = "Default";
+  char select_output_buffer[FIELD_BUFFER_SIZE] =
+      select_output_header_default_name;
   while (getline(&line, &len, file) != -1) {
     double *time = &output_list->times[ind];
     /* Write data to output_list */
diff --git a/src/output_options.h b/src/output_options.h
index 065b5a91ae..99176e6375 100644
--- a/src/output_options.h
+++ b/src/output_options.h
@@ -36,6 +36,9 @@ enum compression_levels {
 /* Default value for SelectOutput */
 #define compression_level_default compression_write_lossless
 
+/* Default name for the SelectOutput header */
+#define select_output_header_default_name "Default"
+
 /**
  * @brief Names of the compression levels, used in the select_output.yml
  *        parameter file.
diff --git a/src/parallel_io.c b/src/parallel_io.c
index f697623f13..37999d01eb 100644
--- a/src/parallel_io.c
+++ b/src/parallel_io.c
@@ -1105,7 +1105,8 @@ void prepare_file(struct engine* e, const char* fileName,
 
   /* Determine if we are writing a reduced snapshot, and if so which
    * output selection type to use */
-  char current_selection_name[FIELD_BUFFER_SIZE] = "Default";
+  char current_selection_name[FIELD_BUFFER_SIZE] =
+      select_output_header_default_name;
   if (output_list) {
     /* Users could have specified a different Select Output scheme for each
      * snapshot. */
@@ -1781,7 +1782,8 @@ void write_output_parallel(struct engine* e,
     }
 
     /* Write everything that is not cancelled */
-    char current_selection_name[FIELD_BUFFER_SIZE] = "Default";
+    char current_selection_name[FIELD_BUFFER_SIZE] =
+        select_output_header_default_name;
     if (output_list) {
       /* Users could have specified a different Select Output scheme for each
        * snapshot. */
diff --git a/src/serial_io.c b/src/serial_io.c
index da84d0b90d..43de9c19a8 100644
--- a/src/serial_io.c
+++ b/src/serial_io.c
@@ -925,7 +925,8 @@ void write_output_serial(struct engine* e,
   /* Determine if we are writing a reduced snapshot, and if so which
    * output selection type to use. Can just create a copy of this on
    * each rank. */
-  char current_selection_name[FIELD_BUFFER_SIZE] = "Default";
+  char current_selection_name[FIELD_BUFFER_SIZE] =
+      select_output_header_default_name;
   if (output_list) {
     /* Users could have specified a different Select Output scheme for each
      * snapshot. */
diff --git a/src/single_io.c b/src/single_io.c
index 1d104f0aec..0f22ddeb2a 100644
--- a/src/single_io.c
+++ b/src/single_io.c
@@ -817,7 +817,8 @@ void write_output_single(struct engine* e,
 
   /* Determine if we are writing a reduced snapshot, and if so which
    * output selection type to use */
-  char current_selection_name[FIELD_BUFFER_SIZE] = "Default";
+  char current_selection_name[FIELD_BUFFER_SIZE] =
+      select_output_header_default_name;
   if (output_list) {
     /* Users could have specified a different Select Output scheme for each
      * snapshot. */
-- 
GitLab