From aaa1618bf96b84a356ea0127d29f894345167c14 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Thu, 10 Mar 2016 19:04:53 +0000
Subject: [PATCH] Code formatting

---
 examples/main.c |  6 +++---
 src/common_io.c |  4 ++--
 src/engine.c    | 15 ++++++++++-----
 src/map.c       |  4 ++--
 src/space.c     |  5 ++---
 5 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/examples/main.c b/examples/main.c
index d06bf85bc2..62d7d877c6 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -380,9 +380,9 @@ int main(int argc, char *argv[]) {
   N_total[0] = Ngas;
   N_total[1] = Ngpart - Ngas;
 #endif
-      if (myrank == 0)
-      message("Read %lld gas particles and %lld DM particles from the ICs",
-              N_total[0], N_total[1]);
+  if (myrank == 0)
+    message("Read %lld gas particles and %lld DM particles from the ICs",
+            N_total[0], N_total[1]);
 
   /* Apply h scaling */
   if (scaling != 1.0)
diff --git a/src/common_io.c b/src/common_io.c
index efeed75f01..30ac6de81c 100644
--- a/src/common_io.c
+++ b/src/common_io.c
@@ -489,8 +489,8 @@ void prepare_dm_gparts(struct gpart* gparts, int Ndm) {
   for (int i = 0; i < Ndm; ++i) {
 
     /* 0 ir negative ids are not allowed */
-    if(gparts[i].id <= 0) error("0 or negative ID for DM particle");
-    
+    if (gparts[i].id <= 0) error("0 or negative ID for DM particle");
+
     gparts[i].id = -gparts[i].id;
   }
 }
diff --git a/src/engine.c b/src/engine.c
index e40f82b29c..c34214c05b 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -797,11 +797,13 @@ void engine_maketasks(struct engine *e) {
   /* /\* Add the gravity mm tasks. *\/ */
   /* for (int i = 0; i < nr_cells; i++) */
   /*   if (cells[i].gcount > 0) { */
-  /*     scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */
+  /*     scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0,
+   */
   /*                       &cells[i], NULL, 0); */
   /*     for (int j = i + 1; j < nr_cells; j++) */
   /*       if (cells[j].gcount > 0) */
-  /*         scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */
+  /*         scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1,
+   * 0, */
   /*                           &cells[i], &cells[j], 0); */
   /* } */
 
@@ -817,16 +819,19 @@ void engine_maketasks(struct engine *e) {
     error("Failed to allocate cell-task links.");
   e->nr_links = 0;
 
-  /* /\* Add the gravity up/down tasks at the top-level cells and push them down. *\/ */
+  /* /\* Add the gravity up/down tasks at the top-level cells and push them
+   * down. *\/ */
   /* for (int k = 0; k < nr_cells; k++) */
   /*   if (cells[k].nodeID == nodeID && cells[k].gcount > 0) { */
 
   /*     /\* Create tasks at top level. *\/ */
   /*     struct task *up = */
-  /*         scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0, 0, */
+  /*         scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0,
+   * 0, */
   /*                           &cells[k], NULL, 0); */
   /*     struct task *down = */
-  /*         scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0, 0, */
+  /*         scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0,
+   * 0, */
   /*                           &cells[k], NULL, 0); */
 
   /*     /\* Push tasks down the cell hierarchy. *\/ */
diff --git a/src/map.c b/src/map.c
index 4766f070de..96f3981f8d 100644
--- a/src/map.c
+++ b/src/map.c
@@ -121,14 +121,14 @@ void map_cellcheck(struct cell *c, void *data) {
         p->x[0] > c->loc[0] + c->h[0] || p->x[1] > c->loc[1] + c->h[1] ||
         p->x[2] > c->loc[2] + c->h[2]) {
       printf(
-          "map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell [ "
+          "map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell "
+          "[ "
           "%.16e %.16e %.16e ] - [ %.16e %.16e %.16e ].\n",
           p->x[0], p->x[1], p->x[2], c->loc[0], c->loc[1], c->loc[2],
           c->loc[0] + c->h[0], c->loc[1] + c->h[1], c->loc[2] + c->h[2]);
       error("g-particle out of bounds!");
     }
   }
-
 }
 
 /**
diff --git a/src/space.c b/src/space.c
index 93e3a09cfc..04ce059a25 100644
--- a/src/space.c
+++ b/src/space.c
@@ -456,13 +456,12 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
 
   /* Exchange the strays, note that this potentially re-allocates
      the parts arrays. */
-  //s->nr_gparts =
+  // s->nr_gparts =
   //    nr_gparts + engine_exchange_strays(s->e, nr_gparts, &ind[nr_gparts],
   //                                        s->nr_gparts - nr_gparts);
-  if(nr_gparts > 0)
+  if (nr_gparts > 0)
     error("Need to implement the exchange of strays for the gparts");
 
-
   /* Re-allocate the index array if needed.. */
   if (s->nr_gparts > gind_size) {
     size_t *gind_new;
-- 
GitLab