diff options
Diffstat (limited to 'xfa/fxbarcode')
-rw-r--r-- | xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp | 41 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OneDimReader.cpp | 4 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedCode128Reader.cpp | 4 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp | 5 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp | 4 |
5 files changed, 19 insertions, 39 deletions
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp index b3c4326ed6..aec4a1ca22 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp @@ -104,14 +104,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Clone(int32_t& e) { CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract( CBC_ReedSolomonGF256Poly* other, int32_t& e) { - if (IsZero()) { + if (IsZero()) return other->Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - } - if (other->IsZero()) { + if (other->IsZero()) return Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - } + CFX_Int32Array smallerCoefficients; smallerCoefficients.Copy(m_coefficients); CFX_Int32Array largerCoefficients; @@ -141,11 +138,9 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract( CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply( CBC_ReedSolomonGF256Poly* other, int32_t& e) { - if (IsZero() || other->IsZero()) { - CBC_ReedSolomonGF256Poly* temp = m_field->GetZero()->Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - return temp; - } + if (IsZero() || other->IsZero()) + return m_field->GetZero()->Clone(e); + CFX_Int32Array aCoefficients; aCoefficients.Copy(m_coefficients); int32_t aLength = m_coefficients.GetSize(); @@ -169,15 +164,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply( } CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, int32_t& e) { - if (scalar == 0) { - CBC_ReedSolomonGF256Poly* temp = m_field->GetZero()->Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - return temp; - } - if (scalar == 1) { + if (scalar == 0) + return m_field->GetZero()->Clone(e); + if (scalar == 1) return Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - } + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size); @@ -195,13 +186,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial( int32_t& e) { if (degree < 0) { e = BCExceptionDegreeIsNegative; - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - } - if (coefficient == 0) { - CBC_ReedSolomonGF256Poly* temp = m_field->GetZero()->Clone(e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - return temp; + return nullptr; } + if (coefficient == 0) + return m_field->GetZero()->Clone(e); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size + degree); @@ -219,7 +208,7 @@ CFX_ArrayTemplate<CBC_ReedSolomonGF256Poly*>* CBC_ReedSolomonGF256Poly::Divide( int32_t& e) { if (other->IsZero()) { e = BCExceptionDivideByZero; - BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); + return nullptr; } std::unique_ptr<CBC_ReedSolomonGF256Poly> quotient( m_field->GetZero()->Clone(e)); diff --git a/xfa/fxbarcode/oned/BC_OneDimReader.cpp b/xfa/fxbarcode/oned/BC_OneDimReader.cpp index 5187c34af9..a1cfc9b492 100644 --- a/xfa/fxbarcode/oned/BC_OneDimReader.cpp +++ b/xfa/fxbarcode/oned/BC_OneDimReader.cpp @@ -211,9 +211,7 @@ int32_t CBC_OneDimReader::DecodeDigit(CBC_CommonBitArray* row, } if (bestMatch >= 0) { return bestMatch; - } else { - e = BCExceptionNotFound; - return 0; } + e = BCExceptionNotFound; return 0; } diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Reader.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Reader.cpp index b5f5aa5fe4..a0479e7f6d 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode128Reader.cpp +++ b/xfa/fxbarcode/oned/BC_OnedCode128Reader.cpp @@ -150,10 +150,8 @@ int32_t CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray* row, } if (bestMatch >= 0) { return bestMatch; - } else { - e = BCExceptionNotFound; - return 0; } + e = BCExceptionNotFound; return 0; } CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber, diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp index 5806b3d09d..bc9b14f04e 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp @@ -45,10 +45,7 @@ FX_BOOL CBC_OnedCode128Writer::CheckContentValidity( if (m_codeFormat == BC_CODE128_B || m_codeFormat == BC_CODE128_C) { while (position < contents.GetLength()) { patternIndex = (int32_t)contents.GetAt(position); - if (patternIndex >= 32 && patternIndex <= 126 && patternIndex != 34) { - position++; - continue; - } else { + if (patternIndex < 32 || patternIndex > 126 || patternIndex == 34) { ret = FALSE; break; } diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp index 50a8fbb2f9..eb197b916c 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp @@ -89,9 +89,7 @@ CFX_ByteString CBC_OnedUPCAReader::MaybeReturnResult(CFX_ByteString& result, if (result[0] == '0') { result.Delete(0); return result; - } else { - e = BCExceptionFormatException; - return ""; } + e = BCExceptionFormatException; return ""; } |