From 5f1ebdf61d3bd1119c1906d22e06cf7c2a9c05da Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Fri, 11 Mar 2016 12:34:32 +0000
Subject: [PATCH] Don't declare variables in a switch-case

---
 src/single_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/single_io.c b/src/single_io.c
index bf7146646b..7071482ee2 100644
--- a/src/single_io.c
+++ b/src/single_io.c
@@ -468,6 +468,7 @@ void write_output_single(struct engine* e, struct UnitSystem* us) {
   int numFiles = 1;
   struct part* parts = e->s->parts;
   struct gpart* gparts = e->s->gparts;
+  struct gpart* dmparts = NULL;
   static int outputCount = 0;
 
   /* Number of particles of each type */
@@ -575,7 +576,6 @@ void write_output_single(struct engine* e, struct UnitSystem* us) {
 
       case DM:
         /* Allocate temporary array */
-	struct gpart* dmparts = NULL;
         if (posix_memalign((void*)&dmparts, gpart_align,
                            Ndm * sizeof(struct gpart)) != 0)
           error("Error while allocating temporart memory for DM particles");
-- 
GitLab