summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
commit2e6864282e65c55ff6809f5aaae011b31c3a361a (patch)
tree98daecaf078529986a4efc2c43a3f43c0dcc01dd /xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
parent969ea09df096b987662b9658e3ffa023ca4ebf70 (diff)
downloadpdfium-2e6864282e65c55ff6809f5aaae011b31c3a361a.tar.xz
Get rid of CBC_AutoPtr and use std::unique_ptr instead.
Also fix IWYU in various fxbarcode headers. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1734823002 .
Diffstat (limited to 'xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp')
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index 78c5bdc5e2..3e6de6ef06 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -21,6 +21,9 @@
*/
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h"
@@ -74,12 +77,11 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array* toEncode,
CBC_ReedSolomonGF256Poly info;
info.Init(m_field, &infoCoefficients, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- CBC_ReedSolomonGF256Poly* rsg = info.MultiplyByMonomial(ecBytes, 1, e);
+ std::unique_ptr<CBC_ReedSolomonGF256Poly> infoTemp(
+ info.MultiplyByMonomial(ecBytes, 1, e));
BC_EXCEPTION_CHECK_ReturnVoid(e);
- CBC_AutoPtr<CBC_ReedSolomonGF256Poly> infoTemp(rsg);
- CFX_PtrArray* pa = infoTemp->Divide(generator, e);
+ std::unique_ptr<CFX_PtrArray> temp(infoTemp->Divide(generator, e));
BC_EXCEPTION_CHECK_ReturnVoid(e);
- CBC_AutoPtr<CFX_PtrArray> temp(pa);
CBC_ReedSolomonGF256Poly* remainder =
(CBC_ReedSolomonGF256Poly*)(temp->operator[](1));
CFX_Int32Array* coefficients = remainder->GetCoefficients();