From edb8535702e5c87f52e744ace16c91cd944237b8 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 26 Aug 2024 11:12:43 +0200 Subject: [PATCH] Fix suggestions about size_t from #222 --- k4FWCore/include/k4FWCore/Consumer.h | 2 +- k4FWCore/include/k4FWCore/Transformer.h | 2 +- .../src/components/ExampleFunctionalMetadataConsumer.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k4FWCore/include/k4FWCore/Consumer.h b/k4FWCore/include/k4FWCore/Consumer.h index af0c282b..493cc1b2 100644 --- a/k4FWCore/include/k4FWCore/Consumer.h +++ b/k4FWCore/include/k4FWCore/Consumer.h @@ -98,7 +98,7 @@ namespace k4FWCore { * @param i The index of the input * @return A range of the input locations */ - auto inputLocations(unsigned i) const { + auto inputLocations(size_t i) const { if (i >= sizeof...(In)) { throw std::out_of_range("Called inputLocations with an index out of range, index: " + std::to_string(i) + ", number of inputs: " + std::to_string(sizeof...(In))); diff --git a/k4FWCore/include/k4FWCore/Transformer.h b/k4FWCore/include/k4FWCore/Transformer.h index 78043ed8..ea0c70ae 100644 --- a/k4FWCore/include/k4FWCore/Transformer.h +++ b/k4FWCore/include/k4FWCore/Transformer.h @@ -131,7 +131,7 @@ namespace k4FWCore { * @param i The index of the input * @return A range of the input locations */ - auto inputLocations(unsigned i) const { + auto inputLocations(size_t i) const { if (i >= sizeof...(In)) { throw std::out_of_range("Called inputLocations with an index out of range, index: " + std::to_string(i) + ", number of inputs: " + std::to_string(sizeof...(In))); diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalMetadataConsumer.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalMetadataConsumer.cpp index 05fb679f..040dfce1 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalMetadataConsumer.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalMetadataConsumer.cpp @@ -61,7 +61,7 @@ struct ExampleFunctionalMetadataConsumer final : k4FWCore::Consumer("NumberOfParticles", this).value_or(-1); - if (input.size() != (size_t)particleNum) { + if (input.size() != static_cast(particleNum)) { error() << "Input MCParticleCollection size is not " << particleNum << endmsg; return; }