From a434b42f4c3d4c713133aed57cf4bab1d37f83ba Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Wed, 4 Sep 2024 15:59:20 +0100 Subject: [PATCH] Fix clang-tidy warnings --- ratecoeff.h | 4 ++-- rpkt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ratecoeff.h b/ratecoeff.h index 8cceeb11d..c53b5264d 100644 --- a/ratecoeff.h +++ b/ratecoeff.h @@ -65,7 +65,7 @@ constexpr auto simpson_integrator(auto ¶ms, double a, double b, int sampleco weight = 4.; } - const double x = a + deltax * i; + const double x = a + (deltax * i); integral += weight * func_integrand(x, ¶ms) * deltax; } @@ -79,7 +79,7 @@ auto integrator(auto params, double a, double b, double epsabs, double epsrel, i double *abserr) { if constexpr (USE_SIMPSON_INTEGRATOR) { // need an odd number for Simpson rule - const int samplecount = std::max(1, static_cast((b / a) / globals::NPHIXSNUINCREMENT)) * 4 + 1; + const int samplecount = (std::max(1, static_cast((b / a) / globals::NPHIXSNUINCREMENT)) * 4) + 1; *result = simpson_integrator(params, a, b, samplecount); *abserr = 0.; diff --git a/rpkt.h b/rpkt.h index 75cb5fa44..059ea3947 100644 --- a/rpkt.h +++ b/rpkt.h @@ -65,7 +65,7 @@ void MPI_Bcast_binned_opacities(int modelgridindex, int root_node_id); assert_testmodeonly(ion < get_nions(element) - 1); const int groundcontindex = globals::elements[element].ions[ion].groundcontindex; assert_always(groundcontindex >= 0); - return nonemptymgi * globals::nbfcontinua_ground + groundcontindex; + return (nonemptymgi * globals::nbfcontinua_ground) + groundcontindex; } inline auto keep_this_cont(int element, const int ion, const int level, const int modelgridindex,