From a6eebbe9bd414ff71d8fdc25aa2a8effb42cc14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 20 May 2025 15:27:38 +0200 Subject: [PATCH] removed extra const on return type, added cast (#177) Fixed warnings on apple clang: - removed extra const on return type - added cast to suppress a float to double conversion warning --- include/aare/ClusterVector.hpp | 4 ++-- include/aare/Interpolator.hpp | 4 ++-- src/Fit.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/aare/ClusterVector.hpp b/include/aare/ClusterVector.hpp index c8b1ea1..9d575d9 100644 --- a/include/aare/ClusterVector.hpp +++ b/include/aare/ClusterVector.hpp @@ -133,9 +133,9 @@ class ClusterVector> { */ size_t capacity() const { return m_data.capacity(); } - const auto begin() const { return m_data.begin(); } + auto begin() const { return m_data.begin(); } - const auto end() const { return m_data.end(); } + auto end() const { return m_data.end(); } /** * @brief Return the size in bytes of a single cluster diff --git a/include/aare/Interpolator.hpp b/include/aare/Interpolator.hpp index d2b2322..8e65f38 100644 --- a/include/aare/Interpolator.hpp +++ b/include/aare/Interpolator.hpp @@ -51,7 +51,7 @@ Interpolator::interpolate(const ClusterVector &clusters) { Photon photon; photon.x = cluster.x; photon.y = cluster.y; - photon.energy = eta.sum; + photon.energy = static_cast(eta.sum); // auto ie = nearest_index(m_energy_bins, photon.energy)-1; // auto ix = nearest_index(m_etabinsx, eta.x)-1; @@ -99,7 +99,7 @@ Interpolator::interpolate(const ClusterVector &clusters) { Photon photon; photon.x = cluster.x; photon.y = cluster.y; - photon.energy = eta.sum; + photon.energy = static_cast(eta.sum); // Now do some actual interpolation. // Find which energy bin the cluster is in diff --git a/src/Fit.cpp b/src/Fit.cpp index d104675..25000de 100644 --- a/src/Fit.cpp +++ b/src/Fit.cpp @@ -105,7 +105,7 @@ std::array gaus_init_par(const NDView x, const NDView *e / 2; }) * + [e](double val) { return val > *e / 2; }) * delta / 2.35; return start_par;