Skip to content

Commit cd6da4d

Browse files
committed
Checkers unused constants fix
1 parent ef0bfec commit cd6da4d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/src/private/src/mli_check.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,13 @@ mli_status mli_chk_lut(const mli_lut * lut, int buff_size) {
173173
/************************************************************
174174
* mli_tensor quantization parameters correctness checking
175175
*************************************************************/
176-
constexpr unsigned kZeroPointBitsZero = 0;
177-
constexpr unsigned kZeroPointBitsByteRange = (sizeof(int8_t) * 8) - 1;
178-
constexpr unsigned kZeroPointBitsMaxRange = (sizeof(int16_t) * 8) - 1;
179-
176+
#if MLI_DBG_ENABLE_RETURNCODES
177+
// These constants are used in debug mode only.
178+
// To not rise a warning in release mode we exclude it by pre-processor.
179+
static constexpr unsigned kZeroPointBitsZero = 0;
180+
static constexpr unsigned kZeroPointBitsByteRange = (sizeof(int8_t) * 8) - 1;
181+
#endif
182+
static constexpr unsigned kZeroPointBitsMaxRange = (sizeof(int16_t) * 8) - 1;
180183
mli_status mli_chk_tensor_quant_params(const mli_tensor* in, unsigned zp_used_bits = kZeroPointBitsMaxRange) {
181184
MLI_ASSERT(zp_used_bits <= kZeroPointBitsMaxRange);
182185
MLI_ASSERT(in != nullptr);

0 commit comments

Comments
 (0)