From 2bc92f5b10404441359db21ee0e2ef974c39544f Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 19 Jan 2026 14:30:57 +0100 Subject: [PATCH 1/2] set default before bit computation --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 5d5078cc2e9..0a23c37fdd7 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -98,7 +98,8 @@ void encode16bit(int const& n, uint8_t& low, uint8_t& up) if (n >= (1 << 16)) { low = up = -1; return; - } + } else + low = up = 0; int bbyte = 8; for (int b{0}; b < bbyte; ++b) { int bl = (n & (1 << b)) >> b; From cd6159acb352a13941928868d39720167870a3f6 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 19 Jan 2026 14:37:36 +0100 Subject: [PATCH 2/2] fix linter --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 0a23c37fdd7..7a072171e0b 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -98,15 +98,16 @@ void encode16bit(int const& n, uint8_t& low, uint8_t& up) if (n >= (1 << 16)) { low = up = -1; return; - } else + } else { low = up = 0; - int bbyte = 8; - for (int b{0}; b < bbyte; ++b) { - int bl = (n & (1 << b)) >> b; - int bu = (n & (1 << (b + bbyte))) >> (b + bbyte); - if (bl > 0) + } + int bByte = 8; + for (int b{0}; b < bByte; ++b) { + int bL = (n & (1 << b)) >> b; + int bU = (n & (1 << (b + bByte))) >> (b + bByte); + if (bL > 0) low += (1 << b); - if (bu > 0) + if (bU > 0) up += (1 << b); } }