From a4373714084dfd9a86eba9fc9b7963e4b95d1075 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 17 Nov 2022 17:51:22 +0300 Subject: [PATCH] light: ambiguous numeric type --- code/espurna/light.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/espurna/light.cpp b/code/espurna/light.cpp index 6307774d..496e21b9 100644 --- a/code/espurna/light.cpp +++ b/code/espurna/light.cpp @@ -1584,11 +1584,11 @@ namespace { // TODO: input value modifier, instead of a transition-only thing? // TODO: calculate on the fly instead of limiting this to an 8bit value? -constexpr long LightGammaMin { 0 }; -constexpr long LightGammaMax { 255 }; +static constexpr long LightGammaMin { 0 }; +static constexpr long LightGammaMax { 255 }; -long _lightGammaMap(size_t index) { - const static std::array Gamma PROGMEM { +long _lightGammaValue(size_t index) { + static const std::array Gamma PROGMEM { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, @@ -1622,7 +1622,7 @@ long _lightGammaMap(long value) { if (Divisor != 0l) { const long Scaled { (value - espurna::light::ValueMin) * (LightGammaMax - LightGammaMin) / Divisor + LightGammaMin }; - return _lightGammaMap(static_cast(Scaled)); + return _lightGammaValue(static_cast(Scaled)); } return espurna::light::ValueMin;