Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1172)

Unified Diff: xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp

Issue 1734823002: Get rid of CBC_AutoPtr and use std::unique_ptr instead. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index 78c5bdc5e283569b3abd329df4ebb1319a14742c..3e6de6ef06f24a59ba044229c0c9bfa13a43126f 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();

Powered by Google App Engine
This is Rietveld 408576698