From c07c0c94d7bd95209c641dd0718c55ad0553fe5f Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Fri, 30 Mar 2018 12:54:19 +0200 Subject: [PATCH] Code formatting and uninitialization fix. --- src/debug.c | 11 ++++++----- src/engine.c | 4 ++-- src/gravity.c | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/debug.c b/src/debug.c index b8938346f7..b1e2cb08bc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -305,8 +305,8 @@ static void dumpCells_map(struct cell *c, void *data) { /* Only cells with particles are dumped. */ if (c->count > 0 || c->gcount > 0 || c->scount > 0) { -/* In MPI mode we may only output cells with foreign partners. - * These define the edges of the partitions. */ + /* In MPI mode we may only output cells with foreign partners. + * These define the edges of the partitions. */ int ismpiactive = 0; #if WITH_MPI ismpiactive = (c->send_xv != NULL); @@ -326,7 +326,8 @@ static void dumpCells_map(struct cell *c, void *data) { /* So output local super cells that are active and have MPI * tasks as requested. */ - if (c->nodeID == e->nodeID && (!super ||(super && c->super == c)) && active && mpiactive) { + if (c->nodeID == e->nodeID && (!super || (super && c->super == c)) && + active && mpiactive) { /* If requested we work out how many particles are active in this cell. */ int pactcount = 0; @@ -370,8 +371,8 @@ static void dumpCells_map(struct cell *c, void *data) { * @param rank node ID of MPI rank, or 0 if not relevant. * @param step the current engine step, or some unique integer. */ -void dumpCells(const char *prefix, int super, int active, int mpiactive, int pactive, - struct space *s, int rank, int step) { +void dumpCells(const char *prefix, int super, int active, int mpiactive, + int pactive, struct space *s, int rank, int step) { FILE *file = NULL; diff --git a/src/engine.c b/src/engine.c index 0684ecd619..47c96abab2 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4431,8 +4431,8 @@ void engine_step(struct engine *e) { /* Print the number of active tasks ? */ if (e->verbose) engine_print_task_counts(e); - /* Dump local cells and active particle counts. */ - /* dumpCells("cells", 0, 0, 0, 0, e->s, e->nodeID, e->step); */ +/* Dump local cells and active particle counts. */ +/* dumpCells("cells", 0, 0, 0, 0, e->s, e->nodeID, e->step); */ #ifdef SWIFT_DEBUG_CHECKS /* Check that we have the correct total mass in the top-level multipoles */ diff --git a/src/gravity.c b/src/gravity.c index 36f3cc4ae5..1642d37f7a 100644 --- a/src/gravity.c +++ b/src/gravity.c @@ -410,7 +410,7 @@ void gravity_exact_force_compute_mapper(void *map_data, int nr_gparts, struct gpart *gpi = &gparts[i]; - long long id; + long long id = 0; if (gpi->type == swift_type_gas) id = parts[-gpi->id_or_neg_offset].id; else if (gpi->type == swift_type_star) @@ -597,7 +597,7 @@ void gravity_exact_force_check(struct space *s, const struct engine *e, struct gpart *gpi = &s->gparts[i]; - long long id; + long long id = 0; if (gpi->type == swift_type_gas) id = parts[-gpi->id_or_neg_offset].id; else if (gpi->type == swift_type_star) @@ -648,7 +648,7 @@ void gravity_exact_force_check(struct space *s, const struct engine *e, struct gpart *gpi = &s->gparts[i]; - long long id; + long long id = 0; if (gpi->type == swift_type_gas) id = parts[-gpi->id_or_neg_offset].id; else if (gpi->type == swift_type_star) -- GitLab