From 743827c7c86f8de14b50ca76b05530e3ea30259f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 6 Dec 2019 12:21:19 +0100 Subject: [PATCH] Fix cppcheck warnings --- rtengine/canon_cr3_decoder.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/rtengine/canon_cr3_decoder.cc b/rtengine/canon_cr3_decoder.cc index ba92bf04a..9e3b3ef4b 100644 --- a/rtengine/canon_cr3_decoder.cc +++ b/rtengine/canon_cr3_decoder.cc @@ -1004,10 +1004,8 @@ bool crxDecodeLine(CrxBandParam* param) if (param->lineBuf1[0] != param->lineBuf0[1] || param->lineBuf1[0] != param->lineBuf0[2]) { crxDecodeSymbolL1(param, true, true); } else { - int nSyms = 0; - if (crxBitstreamGetBits(¶m->bitStream, 1)) { - nSyms = 1; + int nSyms = 1; while (crxBitstreamGetBits(¶m->bitStream, 1)) { nSyms += JS[param->sParam]; @@ -1338,10 +1336,8 @@ bool crxDecodeTopLine(CrxBandParam* param) if (param->lineBuf1[0]) { param->lineBuf1[1] = param->lineBuf1[0]; } else { - int nSyms = 0; - if (crxBitstreamGetBits(¶m->bitStream, 1)) { - nSyms = 1; + int nSyms = 1; while (crxBitstreamGetBits(¶m->bitStream, 1)) { nSyms += JS[param->sParam]; @@ -1781,7 +1777,7 @@ bool crxDecodeLineWithIQuantization(CrxSubband* subband) return false; } - if (subband->width <= 0) { + if (subband->width == 0) { return true; } @@ -2039,7 +2035,6 @@ bool crxIdwt53FilterTransform(CrxPlaneComp* comp, std::uint32_t level) std::int32_t* lineBufL0 = wavelet->lineBuf[0]; std::int32_t* lineBufL1 = wavelet->lineBuf[1]; - const std::int32_t* lineBufL2 = wavelet->lineBuf[2]; const std::int32_t* const lineBufH0 = wavelet->lineBuf[wavelet->fltTapH + 3]; std::int32_t* const lineBufH1 = wavelet->lineBuf[(wavelet->fltTapH + 1) % 5 + 3]; std::int32_t* const lineBufH2 = wavelet->lineBuf[(wavelet->fltTapH + 2) % 5 + 3]; @@ -2110,7 +2105,7 @@ bool crxIdwt53FilterTransform(CrxPlaneComp* comp, std::uint32_t level) // process H bands lineBufL0 = wavelet->lineBuf[0]; lineBufL1 = wavelet->lineBuf[1]; - lineBufL2 = wavelet->lineBuf[2]; + const std::int32_t* lineBufL2 = wavelet->lineBuf[2]; for (std::int32_t i = 0; i < wavelet->width; ++i) { const std::int32_t delta = lineBufL0[i] - ((lineBufL2[i] + lineBufL1[i] + 2) >> 2); @@ -2731,7 +2726,7 @@ bool crxReadSubbandHeaders( } band->dataSize = subbandSize - (bitData & 0x7FF); - band->supportsPartial = bitData & 0x8000 ? 1 : 0; + band->supportsPartial = (bitData & 0x8000) ? 1 : 0; band->dataOffset = subbandOffset; band->quantValue = (bitData >> 19) & 0xFF; band->paramK = 0;