From 152f4a9ccee7575b04665d35e36cfaa3e1e39c29 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Mon, 6 Aug 2018 21:12:53 +0200 Subject: [PATCH] Use clang-format-5.0 instead of clang-format-3.8 for the code's style. --- .clang-format | 1 + CONTRIBUTING.md | 4 ++-- INSTALL.swift | 2 +- README.md | 2 +- format.sh | 2 +- src/approx_math.h | 15 ++++++------- src/chemistry/EAGLE/chemistry_io.h | 5 +++-- src/engine.c | 4 ++-- src/gravity/Default/gravity_iact.h | 20 ++++++++--------- src/gravity/Potential/gravity_iact.h | 24 ++++++++++----------- src/kernel_gravity.h | 7 +++--- src/kernel_hydro.h | 3 ++- src/parallel_io.c | 11 +++++----- src/partition.c | 32 +++++++++++++--------------- src/proxy.c | 8 +++---- src/riemann/riemann_exact.h | 10 ++++----- src/riemann/riemann_hllc.h | 20 +++++++---------- src/runner.c | 2 +- tests/test125cells.c | 16 ++++++++------ tests/test27cells.c | 4 ++-- tests/testEOS.c | 5 +++-- tests/testInteractions.c | 2 +- tests/testLogger.c | 12 ++++++----- tests/testPeriodicBC.c | 2 +- tests/testPotentialPair.c | 5 +++-- tests/testPotentialSelf.c | 5 +++-- 26 files changed, 112 insertions(+), 111 deletions(-) diff --git a/.clang-format b/.clang-format index 542c97e89..49524f944 100644 --- a/.clang-format +++ b/.clang-format @@ -2,4 +2,5 @@ Language: Cpp BasedOnStyle: Google KeepEmptyLinesAtTheStartOfBlocks: true +PenaltyBreakAssignment: 2 ... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1248883c0..3db4be05b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ The SWIFT source code is using a variation of the 'Google' formatting style. -The script 'format.sh' in the root directory applies the clang-format-3.8 +The script 'format.sh' in the root directory applies the clang-format-5.0 tool with our style choices to all the SWIFT C source file. Please apply the formatting script to the files before submitting a merge request. @@ -9,4 +9,4 @@ check` in the root directory. Please check that the test suite still runs with your changes applied before submitting a merge request and add relevant unit tests probing the correctness of new modules. An example of how to add a test to the suite can be found by considering the tests/testGreeting -case. \ No newline at end of file +case. diff --git a/INSTALL.swift b/INSTALL.swift index 999a8d365..db6c6677b 100644 --- a/INSTALL.swift +++ b/INSTALL.swift @@ -182,6 +182,6 @@ before you can build it. ================== The SWIFT source code uses a variation of 'Google' style. The script -'format.sh' in the root directory applies the clang-format-3.8 tool with our +'format.sh' in the root directory applies the clang-format-5.0 tool with our style choices to all the SWIFT C source file. Please apply the formatting script to the files before submitting a merge request. diff --git a/README.md b/README.md index 8ef8a65e8..e9ce99f10 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Contribution Guidelines ----------------------- The SWIFT source code uses a variation of the 'Google' formatting style. -The script 'format.sh' in the root directory applies the clang-format-3.8 +The script 'format.sh' in the root directory applies the clang-format-5.0 tool with our style choices to all the SWIFT C source file. Please apply the formatting script to the files before submitting a pull request. diff --git a/format.sh b/format.sh index 5bf78c5bb..9fea13bf3 100755 --- a/format.sh +++ b/format.sh @@ -1,3 +1,3 @@ #!/bin/bash -clang-format-3.8 -style=file -i src/*.[ch] src/*/*.[ch] src/*/*/*.[ch] examples/main.c tests/*.[ch] +clang-format-5.0 -style=file -i src/*.[ch] src/*/*.[ch] src/*/*/*.[ch] examples/main.c tests/*.[ch] diff --git a/src/approx_math.h b/src/approx_math.h index 1445a84ab..90ea4eb99 100644 --- a/src/approx_math.h +++ b/src/approx_math.h @@ -44,10 +44,9 @@ __attribute__((always_inline, const)) INLINE static float good_approx_expf( float x) { return 1.f + x * (1.f + - x * (0.5f + - x * ((1.f / 6.f) + - x * ((1.f / 24.f) + - x * ((1.f / 120.f) + (1.f / 720.f) * x))))); + x * (0.5f + x * ((1.f / 6.f) + + x * ((1.f / 24.f) + + x * ((1.f / 120.f) + (1.f / 720.f) * x))))); } /** @@ -56,11 +55,9 @@ __attribute__((always_inline, const)) INLINE static float good_approx_expf( __attribute__((always_inline, const)) INLINE static double good_approx_exp( double x) { return 1. + - x * (1. + - x * (0.5 + - x * ((1. / 6.) + - x * ((1. / 24.) + - x * ((1. / 120.) + (1. / 720.) * x))))); + x * (1. + x * (0.5 + x * ((1. / 6.) + + x * ((1. / 24.) + + x * ((1. / 120.) + (1. / 720.) * x))))); } #endif /* SWIFT_APPROX_MATH_H */ diff --git a/src/chemistry/EAGLE/chemistry_io.h b/src/chemistry/EAGLE/chemistry_io.h index a717318c1..d78a5f19a 100644 --- a/src/chemistry/EAGLE/chemistry_io.h +++ b/src/chemistry/EAGLE/chemistry_io.h @@ -109,8 +109,9 @@ INLINE static void chemistry_write_flavour(hid_t h_grp) { for (int elem = 0; elem < chemistry_element_count; ++elem) { char buffer[20]; sprintf(buffer, "Element %d", elem); - io_write_attribute_s(h_grp, buffer, chemistry_get_element_name( - (enum chemistry_element)elem)); + io_write_attribute_s( + h_grp, buffer, + chemistry_get_element_name((enum chemistry_element)elem)); } } #endif diff --git a/src/engine.c b/src/engine.c index 369dba72b..b88f8a3f4 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4794,8 +4794,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/Default/gravity_iact.h b/src/gravity/Default/gravity_iact.h index 6fd7ae205..71e5007a4 100644 --- a/src/gravity/Default/gravity_iact.h +++ b/src/gravity/Default/gravity_iact.h @@ -176,13 +176,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_grav_pm_full( #if SELF_GRAVITY_MULTIPOLE_ORDER > 0 -/* 1st order contributions */ + /* 1st order contributions */ -/* 1st order contributions are all 0 since the dipole is 0 */ + /* 1st order contributions are all 0 since the dipole is 0 */ -/* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ -/* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ -/* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ + /* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ + /* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ + /* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ #endif @@ -281,13 +281,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_grav_pm_truncated( #if SELF_GRAVITY_MULTIPOLE_ORDER > 0 -/* 1st order contributions */ + /* 1st order contributions */ -/* 1st order contributions are all 0 since the dipole is 0 */ + /* 1st order contributions are all 0 since the dipole is 0 */ -/* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ -/* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ -/* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ + /* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ + /* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ + /* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ #endif diff --git a/src/gravity/Potential/gravity_iact.h b/src/gravity/Potential/gravity_iact.h index 7d6029b96..fdc8c17da 100644 --- a/src/gravity/Potential/gravity_iact.h +++ b/src/gravity/Potential/gravity_iact.h @@ -180,14 +180,14 @@ __attribute__((always_inline)) INLINE static void runner_iact_grav_pm_full( #if SELF_GRAVITY_MULTIPOLE_ORDER > 0 -/* 1st order contributions */ + /* 1st order contributions */ -/* 1st order contributions are all 0 since the dipole is 0 */ + /* 1st order contributions are all 0 since the dipole is 0 */ -/* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ -/* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ -/* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ -/* *pot = m->M_001 * d.D_001 + m->M_010 * d.D_010 + m->M_100 * d.D_100 ; */ + /* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ + /* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ + /* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ + /* *pot = m->M_001 * d.D_001 + m->M_010 * d.D_010 + m->M_100 * d.D_100 ; */ #endif @@ -292,14 +292,14 @@ __attribute__((always_inline)) INLINE static void runner_iact_grav_pm_truncated( #if SELF_GRAVITY_MULTIPOLE_ORDER > 0 -/* 1st order contributions */ + /* 1st order contributions */ -/* 1st order contributions are all 0 since the dipole is 0 */ + /* 1st order contributions are all 0 since the dipole is 0 */ -/* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ -/* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ -/* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ -/* *pot = m->M_001 * d.D_001 + m->M_010 * d.D_010 + m->M_100 * d.D_100 ; */ + /* *f_x = m->M_001 * d.D_101 + m->M_010 * d.D_110 + m->M_100 * d.D_200 ; */ + /* *f_y = m->M_001 * d.D_011 + m->M_010 * d.D_020 + m->M_100 * d.D_110 ; */ + /* *f_z = m->M_001 * d.D_002 + m->M_010 * d.D_011 + m->M_100 * d.D_101 ; */ + /* *pot = m->M_001 * d.D_001 + m->M_010 * d.D_010 + m->M_100 * d.D_100 ; */ #endif diff --git a/src/kernel_gravity.h b/src/kernel_gravity.h index 8fc278273..39608530f 100644 --- a/src/kernel_gravity.h +++ b/src/kernel_gravity.h @@ -53,9 +53,10 @@ __attribute__((always_inline)) INLINE static void kernel_grav_pot_eval( if (u < 0.5f) *W = -2.8f + u * u * (5.333333333333f + u * u * (6.4f * u - 9.6f)); else - *W = -3.2f + 0.066666666667f / u + - u * u * (10.666666666667f + - u * (-16.f + u * (9.6f - 2.133333333333f * u))); + *W = + -3.2f + 0.066666666667f / u + + u * u * + (10.666666666667f + u * (-16.f + u * (9.6f - 2.133333333333f * u))); #else /* W(u) = 3u^7 - 15u^6 + 28u^5 - 21u^4 + 7u^2 - 3 */ diff --git a/src/kernel_hydro.h b/src/kernel_hydro.h index 788a9037a..aac06c19c 100644 --- a/src/kernel_hydro.h +++ b/src/kernel_hydro.h @@ -346,7 +346,8 @@ __attribute__((always_inline)) INLINE static void kernel_eval_dWdx( *dW_dx = dw_dx * kernel_constant * kernel_gamma_inv_dim_plus_one; } -/* ------------------------------------------------------------------------- */ + /* ------------------------------------------------------------------------- + */ #ifdef WITH_OLD_VECTORIZATION /** diff --git a/src/parallel_io.c b/src/parallel_io.c index 7e8921542..b82443b33 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -490,9 +490,10 @@ void writeArray_chunk(struct engine* e, hid_t h_data, else H5Sselect_none(h_filespace); -/* message("Writing %lld '%s', %zd elements = %zd bytes (int=%d) at offset - * %zd", N, props.name, N * props.dimension, N * props.dimension * typeSize, */ -/* (int)(N * props.dimension * typeSize), offset); */ + /* message("Writing %lld '%s', %zd elements = %zd bytes (int=%d) at offset + * %zd", N, props.name, N * props.dimension, N * props.dimension * typeSize, + */ + /* (int)(N * props.dimension * typeSize), offset); */ #ifdef IO_SPEED_MEASUREMENT MPI_Barrier(MPI_COMM_WORLD); @@ -1180,8 +1181,8 @@ void write_output_parallel(struct engine* e, const char* baseName, * broadcast from there */ MPI_Bcast(&N_total, 6, MPI_LONG_LONG_INT, mpi_size - 1, comm); -/* Now everybody konws its offset and the total number of - * particles of each type */ + /* Now everybody konws its offset and the total number of + * particles of each type */ #ifdef IO_SPEED_MEASUREMENT ticks tic = getticks(); diff --git a/src/partition.c b/src/partition.c index f7a708a15..98e3e7b67 100644 --- a/src/partition.c +++ b/src/partition.c @@ -156,17 +156,17 @@ static void split_vector(struct space *s, int nregions, int *samplecells) { } #endif -/* METIS support - * ============= - * - * METIS partitions using a multi-level k-way scheme. We support using this in - * a unweighted scheme, which works well and seems to be guaranteed, and a - * weighted by the number of particles scheme. Note METIS is optional. - * - * Repartitioning is based on METIS and uses weights determined from the times - * that cell tasks have taken. These weight the graph edges and vertices, or - * just the edges, with vertex weights from the particle counts or none. - */ + /* METIS support + * ============= + * + * METIS partitions using a multi-level k-way scheme. We support using this in + * a unweighted scheme, which works well and seems to be guaranteed, and a + * weighted by the number of particles scheme. Note METIS is optional. + * + * Repartitioning is based on METIS and uses weights determined from the times + * that cell tasks have taken. These weight the graph edges and vertices, or + * just the edges, with vertex weights from the particle counts or none. + */ #if defined(WITH_MPI) && defined(HAVE_METIS) /** @@ -926,9 +926,8 @@ void partition_initial_partition(struct partition *initial_partition, struct cell *c; /* If we've got the wrong number of nodes, fail. */ - if (nr_nodes != - initial_partition->grid[0] * initial_partition->grid[1] * - initial_partition->grid[2]) + if (nr_nodes != initial_partition->grid[0] * initial_partition->grid[1] * + initial_partition->grid[2]) error("Grid size does not match number of nodes."); /* Run through the cells and set their nodeID. */ @@ -937,9 +936,8 @@ void partition_initial_partition(struct partition *initial_partition, c = &s->cells_top[k]; for (j = 0; j < 3; j++) ind[j] = c->loc[j] / s->dim[j] * initial_partition->grid[j]; - c->nodeID = ind[0] + - initial_partition->grid[0] * - (ind[1] + initial_partition->grid[1] * ind[2]); + c->nodeID = ind[0] + initial_partition->grid[0] * + (ind[1] + initial_partition->grid[1] * ind[2]); // message("cell at [%e,%e,%e]: ind = [%i,%i,%i], nodeID = %i", c->loc[0], // c->loc[1], c->loc[2], ind[0], ind[1], ind[2], c->nodeID); } diff --git a/src/proxy.c b/src/proxy.c index ff7d12d92..9d170a517 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -88,8 +88,8 @@ void proxy_cells_exch1(struct proxy *p) { p->nodeID * proxy_tag_shift + proxy_tag_count, MPI_COMM_WORLD, &p->req_cells_count_in); if (err != MPI_SUCCESS) mpi_error(err, "Failed to irecv nr of pcells."); -// message( "irecv pcells count on node %i from node %i." , p->mynodeID , -// p->nodeID ); fflush(stdout); + // message( "irecv pcells count on node %i from node %i." , p->mynodeID , + // p->nodeID ); fflush(stdout); #else error("SWIFT was not compiled with MPI support."); @@ -113,8 +113,8 @@ void proxy_cells_exch2(struct proxy *p) { MPI_COMM_WORLD, &p->req_cells_in); if (err != MPI_SUCCESS) mpi_error(err, "Failed to irecv part data."); -// message( "irecv pcells (%i) on node %i from node %i." , p->size_pcells_in , -// p->mynodeID , p->nodeID ); fflush(stdout); + // message( "irecv pcells (%i) on node %i from node %i." , p->size_pcells_in + // , p->mynodeID , p->nodeID ); fflush(stdout); #else error("SWIFT was not compiled with MPI support."); diff --git a/src/riemann/riemann_exact.h b/src/riemann/riemann_exact.h index 9a671559c..e19ead499 100644 --- a/src/riemann/riemann_exact.h +++ b/src/riemann/riemann_exact.h @@ -388,9 +388,8 @@ __attribute__((always_inline)) INLINE static void riemann_solver_solve( pdpR = p / WR[4]; if (p > WR[4]) { /* shockwave */ - SR = vR + - aR * sqrtf(hydro_gamma_plus_one_over_two_gamma * pdpR + - hydro_gamma_minus_one_over_two_gamma); + SR = vR + aR * sqrtf(hydro_gamma_plus_one_over_two_gamma * pdpR + + hydro_gamma_minus_one_over_two_gamma); if (SR > 0.0f) { Whalf[0] = WR[0] * (pdpR + hydro_gamma_minus_one_over_gamma_plus_one) / (hydro_gamma_minus_one_over_gamma_plus_one * pdpR + 1.0f); @@ -436,9 +435,8 @@ __attribute__((always_inline)) INLINE static void riemann_solver_solve( pdpL = p / WL[4]; if (p > WL[4]) { /* shockwave */ - SL = vL - - aL * sqrtf(hydro_gamma_plus_one_over_two_gamma * pdpL + - hydro_gamma_minus_one_over_two_gamma); + SL = vL - aL * sqrtf(hydro_gamma_plus_one_over_two_gamma * pdpL + + hydro_gamma_minus_one_over_two_gamma); if (SL < 0.0f) { Whalf[0] = WL[0] * (pdpL + hydro_gamma_minus_one_over_gamma_plus_one) / (hydro_gamma_minus_one_over_gamma_plus_one * pdpL + 1.0f); diff --git a/src/riemann/riemann_hllc.h b/src/riemann/riemann_hllc.h index 68a92111d..d7e376fe6 100644 --- a/src/riemann/riemann_hllc.h +++ b/src/riemann/riemann_hllc.h @@ -78,15 +78,13 @@ __attribute__((always_inline)) INLINE static void riemann_solve_for_flux( all these speeds are along the interface normal, since uL and uR are */ float qL = 1.f; if (pstar > WL[4] && WL[4] > 0.f) { - qL = sqrtf(1.f + - 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * - (pstar / WL[4] - 1.f)); + qL = sqrtf(1.f + 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * + (pstar / WL[4] - 1.f)); } float qR = 1.f; if (pstar > WR[4] && WR[4] > 0.f) { - qR = sqrtf(1.f + - 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * - (pstar / WR[4] - 1.f)); + qR = sqrtf(1.f + 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * + (pstar / WR[4] - 1.f)); } const float SL = uL - aL * qL; const float SR = uR + aR * qR; @@ -230,15 +228,13 @@ riemann_solve_for_middle_state_flux(const float *WL, const float *WR, all these speeds are along the interface normal, since uL and uR are */ float qL = 1.f; if (pstar > WL[4] && WL[4] > 0.f) { - qL = sqrtf(1.f + - 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * - (pstar / WL[4] - 1.f)); + qL = sqrtf(1.f + 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * + (pstar / WL[4] - 1.f)); } float qR = 1.f; if (pstar > WR[4] && WR[4] > 0.f) { - qR = sqrtf(1.f + - 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * - (pstar / WR[4] - 1.f)); + qR = sqrtf(1.f + 0.5f * hydro_gamma_plus_one * hydro_one_over_gamma * + (pstar / WR[4] - 1.f)); } const float SL = uL - aL * qL; const float SR = uR + aR * qR; diff --git a/src/runner.c b/src/runner.c index c444fe9e1..43c01c716 100644 --- a/src/runner.c +++ b/src/runner.c @@ -827,7 +827,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { } } -/* We now have a particle whose smoothing length has converged */ + /* We now have a particle whose smoothing length has converged */ #ifdef EXTRA_HYDRO_LOOP diff --git a/tests/test125cells.c b/tests/test125cells.c index ddce3176d..70af9dfb1 100644 --- a/tests/test125cells.c +++ b/tests/test125cells.c @@ -238,9 +238,10 @@ void reset_particles(struct cell *c, struct hydro_space *hs, p->conserved.momentum[2] = p->conserved.mass * p->v[2]; p->conserved.energy = p->primitives.P / hydro_gamma_minus_one * volume + - 0.5f * (p->conserved.momentum[0] * p->conserved.momentum[0] + - p->conserved.momentum[1] * p->conserved.momentum[1] + - p->conserved.momentum[2] * p->conserved.momentum[2]) / + 0.5f * + (p->conserved.momentum[0] * p->conserved.momentum[0] + + p->conserved.momentum[1] * p->conserved.momentum[1] + + p->conserved.momentum[2] * p->conserved.momentum[2]) / p->conserved.mass; #endif } @@ -325,9 +326,10 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h, part->conserved.momentum[2] = part->conserved.mass * part->v[2]; part->conserved.energy = part->primitives.P / hydro_gamma_minus_one * volume + - 0.5f * (part->conserved.momentum[0] * part->conserved.momentum[0] + - part->conserved.momentum[1] * part->conserved.momentum[1] + - part->conserved.momentum[2] * part->conserved.momentum[2]) / + 0.5f * + (part->conserved.momentum[0] * part->conserved.momentum[0] + + part->conserved.momentum[1] * part->conserved.momentum[1] + + part->conserved.momentum[2] * part->conserved.momentum[2]) / part->conserved.mass; #endif @@ -429,7 +431,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, #else 0.f, 0.f, 0.f #endif - ); + ); } if (with_solution) { diff --git a/tests/test27cells.c b/tests/test27cells.c index f62c16948..1ca6b2c54 100644 --- a/tests/test27cells.c +++ b/tests/test27cells.c @@ -291,7 +291,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, #else 0., 0., 0., 0. #endif - ); + ); } /* Write all other cells */ @@ -325,7 +325,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, #else 0., 0., 0., 0. #endif - ); + ); } } } diff --git a/tests/testEOS.c b/tests/testEOS.c index 595dd0726..d090d83d7 100644 --- a/tests/testEOS.c +++ b/tests/testEOS.c @@ -250,8 +250,9 @@ int main(int argc, char *argv[]) { log_u += log_u_step; if (do_output == 1) - fprintf(f, "%.6e ", A1_u[i] * units_cgs_conversion_factor( - &us, UNIT_CONV_ENERGY_PER_UNIT_MASS)); + fprintf(f, "%.6e ", + A1_u[i] * units_cgs_conversion_factor( + &us, UNIT_CONV_ENERGY_PER_UNIT_MASS)); } if (do_output == 1) fprintf(f, "\n"); diff --git a/tests/testInteractions.c b/tests/testInteractions.c index b8d4073c1..0a7354f0d 100644 --- a/tests/testInteractions.c +++ b/tests/testInteractions.c @@ -154,7 +154,7 @@ void dump_indv_particle_fields(char *fileName, struct part *p) { #else 0.f, 0.f, 0.f #endif - ); + ); fclose(file); } diff --git a/tests/testLogger.c b/tests/testLogger.c index b954b67ad..ee933500a 100644 --- a/tests/testLogger.c +++ b/tests/testLogger.c @@ -43,9 +43,10 @@ void test_log_parts(struct dump *d) { size_t offset = d->count; /* Write the full part. */ - logger_log_part(&p, logger_mask_x | logger_mask_v | logger_mask_a | - logger_mask_u | logger_mask_h | logger_mask_rho | - logger_mask_consts, + logger_log_part(&p, + logger_mask_x | logger_mask_v | logger_mask_a | + logger_mask_u | logger_mask_h | logger_mask_rho | + logger_mask_consts, &offset, d); printf("Wrote part at offset %#016zx.\n", offset); @@ -112,8 +113,9 @@ void test_log_gparts(struct dump *d) { size_t offset = d->count; /* Write the full part. */ - logger_log_gpart(&p, logger_mask_x | logger_mask_v | logger_mask_a | - logger_mask_h | logger_mask_consts, + logger_log_gpart(&p, + logger_mask_x | logger_mask_v | logger_mask_a | + logger_mask_h | logger_mask_consts, &offset, d); printf("Wrote gpart at offset %#016zx.\n", offset); diff --git a/tests/testPeriodicBC.c b/tests/testPeriodicBC.c index ffaa3bda0..de30b1af9 100644 --- a/tests/testPeriodicBC.c +++ b/tests/testPeriodicBC.c @@ -252,7 +252,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, int i, int j, #else 0., 0., 0., 0. #endif - ); + ); } fclose(file); } diff --git a/tests/testPotentialPair.c b/tests/testPotentialPair.c index fd6534342..380d1fc97 100644 --- a/tests/testPotentialPair.c +++ b/tests/testPotentialPair.c @@ -82,8 +82,9 @@ double acceleration(double mass, double r, double H, double rlr) { if (u > 1.) acc = -mass / (r * r * r); else - acc = -mass * (21. * u * u * u * u * u - 90. * u * u * u * u + - 140. * u * u * u - 84. * u * u + 14.) / + acc = -mass * + (21. * u * u * u * u * u - 90. * u * u * u * u + 140. * u * u * u - + 84. * u * u + 14.) / (H * H * H); return r * acc * (4. * x * S_prime(2 * x) - 2. * S(2. * x) + 2.); diff --git a/tests/testPotentialSelf.c b/tests/testPotentialSelf.c index 8687e82a2..6bf5dbd40 100644 --- a/tests/testPotentialSelf.c +++ b/tests/testPotentialSelf.c @@ -78,8 +78,9 @@ double acceleration(double mass, double r, double H, double rlr) { if (u > 1.) acc = -mass / (r * r * r); else - acc = -mass * (21. * u * u * u * u * u - 90. * u * u * u * u + - 140. * u * u * u - 84. * u * u + 14.) / + acc = -mass * + (21. * u * u * u * u * u - 90. * u * u * u * u + 140. * u * u * u - + 84. * u * u + 14.) / (H * H * H); return r * acc * (4. * x * S_prime(2 * x) - 2. * S(2. * x) + 2.); -- GitLab