diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be0e1d56..3a3c8d02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: rev: 0.8.0 hooks: - id: cpplint - args: [--linelength=100, "--filter=-runtime/references,-readability/braces,-build/include,-build/c++11"] + args: [--linelength=100, "--filter=-runtime/references,-readability/braces,-build/include,-build/c++17"] types_or: [c, c++, cuda] - repo: https://github.com/compilerla/conventional-pre-commit rev: v3.4.0 diff --git a/libs/cartesiandomain/add_supers_at_domain_top.cpp b/libs/cartesiandomain/add_supers_at_domain_top.cpp index 55b443db..ea74004f 100644 --- a/libs/cartesiandomain/add_supers_at_domain_top.cpp +++ b/libs/cartesiandomain/add_supers_at_domain_top.cpp @@ -290,7 +290,7 @@ std::pair CreateSuperdrop::new_xi_radius(const double gbxvolume) const auto radius = double{std::pow(10.0, log10r)}; const auto nconc = dist.droplet_numconc_distribution(log10r, log10rup, log10rlow); - const auto xi = (uint64_t)std::round(nconc * gbxvolume); // cast double to uint64_t + const auto xi = static_cast(std::round(nconc * gbxvolume)); return std::make_pair(xi, radius); // xi_radius } diff --git a/libs/cleoconstants.hpp b/libs/cleoconstants.hpp index 8064026d..b56dcd95 100644 --- a/libs/cleoconstants.hpp +++ b/libs/cleoconstants.hpp @@ -114,10 +114,8 @@ constexpr double surfconst = 4.0 * DC::SURFSIGMA * std::numbers::pi * R0 * R0; * */ namespace LIMITVALUES { -constexpr unsigned int uintmax = - std::numeric_limits::max(); /**< Maximum unsigned int. */ -constexpr uint64_t uint64_t_max = - std::numeric_limits::max(); /**< Maximum 64 byte unsigned int. */ +constexpr unsigned int uintmax = std::numeric_limits::max(); /**< Max unsigned int. */ +constexpr uint64_t uint64_t_max = std::numeric_limits::max(); /**< Max 64 byte u-int. */ constexpr double llim = -1.0 * std::numeric_limits::max(); /**< Maximum negative double. */ constexpr double ulim = std::numeric_limits::max(); /**< Maximum positive double. */ diff --git a/libs/superdrops/collisions/breakup.hpp b/libs/superdrops/collisions/breakup.hpp index 3fc15e04..120391f2 100644 --- a/libs/superdrops/collisions/breakup.hpp +++ b/libs/superdrops/collisions/breakup.hpp @@ -167,8 +167,8 @@ KOKKOS_FUNCTION void DoBreakup::twin_superdroplet_breakup(Superdrop &dro const auto totnfrags = double{nfrags(drop1, drop2) * old_xi}; assert(((totnfrags / old_xi) > 2.5) && "nfrags must be > 2.5"); - const auto new_xi1 = (uint64_t)Kokkos::round(totnfrags / 2); // cast double to uint64_t - const auto new_xi2 = (uint64_t)Kokkos::round(totnfrags - new_xi1); // cast double to uint64_t + const auto new_xi1 = static_cast(Kokkos::round(totnfrags / 2)); + const auto new_xi2 = static_cast(Kokkos::round(totnfrags - new_xi1)); const auto new_xitot = new_xi1 + new_xi2; assert((new_xi2 > old_xi) && "nfrags must increase the drop2's multiplicity during breakup"); assert((new_xitot > (old_xi * 2)) && "nfrags must increase total multiplicity during breakup"); @@ -205,7 +205,7 @@ KOKKOS_FUNCTION void DoBreakup::different_superdroplet_breakup(Superdrop drop1.set_xi(new_xi1); const auto totnfrags = double{nfrags(drop1, drop2) * old_xi2}; - const auto new_xi2 = (uint64_t)Kokkos::round(totnfrags); // cast double to uint64_t + const auto new_xi2 = static_cast(Kokkos::round(totnfrags)); assert(((totnfrags / old_xi2) > 2.5) && "nfrags must be > 2.5"); assert((new_xi2 > old_xi2) && "nfrags must increase the drop2's multiplicity during breakup");