From 301d489e1ebeef04376610da739f12eb36347288 Mon Sep 17 00:00:00 2001 From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de> Date: Wed, 18 Oct 2023 17:10:01 +0000 Subject: [PATCH] algo: Fix warnings. --- algo/detectors/sts/Hitfinder.cxx | 2 +- algo/detectors/sts/Hitfinder.h | 2 ++ algo/detectors/sts/HitfinderChain.cxx | 8 ++++---- algo/unpack/Unpack.cxx | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/algo/detectors/sts/Hitfinder.cxx b/algo/detectors/sts/Hitfinder.cxx index 0ecb4b2154..986e81aaba 100644 --- a/algo/detectors/sts/Hitfinder.cxx +++ b/algo/detectors/sts/Hitfinder.cxx @@ -520,7 +520,7 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const sts::Cluster* clusterDataB = &clusterDataPerModule[offsetB]; int nClustersF = nClustersPerModule[iModuleF]; int nClustersB = nClustersPerModule[iModuleB]; - int nHitsWritten = nHitsPerModule[iModule]; + size_t nHitsWritten = nHitsPerModule[iModule]; if (nClustersF == 0 || nClustersB == 0) return; diff --git a/algo/detectors/sts/Hitfinder.h b/algo/detectors/sts/Hitfinder.h index e1f80a47e7..d0e06e799b 100644 --- a/algo/detectors/sts/Hitfinder.h +++ b/algo/detectors/sts/Hitfinder.h @@ -268,6 +268,7 @@ namespace cbm::algo::sts // Number of clusters in each module // size = 2 * nModules + // FIXME: Should be size_t! xpu::buffer<int> nClustersPerModule; // Max time error of clusters on front- and backside of a module @@ -287,6 +288,7 @@ namespace cbm::algo::sts // Number of hits in each module // size = nModules + // FIXME: Should be size_t! xpu::buffer<int> nHitsPerModule; public: diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx index d49866ef87..4daa50c861 100644 --- a/algo/detectors/sts/HitfinderChain.cxx +++ b/algo/detectors/sts/HitfinderChain.cxx @@ -29,8 +29,8 @@ sts::HitfinderMonitor sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi xpu::push_timer("STS Hitfinder"); - int nModules = fPars->modules.size(); - int nModuleSides = nModules * 2; + size_t nModules = fPars->modules.size(); + size_t nModuleSides = nModules * 2; size_t nDigisTotal = digis.size(); xpu::t_add_bytes(nDigisTotal * sizeof(CbmStsDigi)); @@ -167,7 +167,7 @@ sts::HitfinderMonitor sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi << " clusters were discarded!"; for (size_t m = 0; m < nModules * 2; m++) { - if (nClusters[m] > hfc.maxClustersPerModule) { + if (static_cast<size_t>(nClusters[m]) > hfc.maxClustersPerModule) { L_(error) << "STS Hitfinder Chain: Cluster bucket overflow in module " << m << " with " << nClusters[m] << " (of " << hfc.maxClustersPerModule << " max)" << " clusters!"; @@ -181,7 +181,7 @@ sts::HitfinderMonitor sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi << " hits were discarded!"; for (size_t m = 0; m < nModules; m++) { - if (nHits[m] > hfc.maxHitsPerModule) { + if (static_cast<size_t>(nHits[m]) > hfc.maxHitsPerModule) { L_(error) << "STS Hitfinder Chain: Hit bucket overflow in module " << m << " with " << nHits[m] << " (of " << hfc.maxHitsPerModule << " max)" << " hits!"; diff --git a/algo/unpack/Unpack.cxx b/algo/unpack/Unpack.cxx index 266e6d1827..0c9ada648e 100644 --- a/algo/unpack/Unpack.cxx +++ b/algo/unpack/Unpack.cxx @@ -149,7 +149,6 @@ namespace cbm::algo sizeBytes += ts.size_component(comp); numMs += numMsInComp; for (u64 mslice = 0; mslice < numMsInComp; mslice++) { - uint64_t msByteSize = ts.descriptor(comp, mslice).size; msEqIds.push_back(componentId); msDesc.push_back(ts.descriptor(comp, mslice)); msContent.push_back(ts.content(comp, mslice)); -- GitLab