From 797ca5cad52edde7c65da45a15216f20b1bfd8fd Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 25 May 2017 12:03:18 -0700 Subject: Mass conversion of all const-lifetime class members Sed + minimal conversions to compile, including moving some constructors into the .cpp file. Any that caused ASAN issues during the tests were omitted rather than trying to resolve the underlying issue. Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335 Reviewed-on: https://pdfium-review.googlesource.com/5891 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp | 6 +++--- fxbarcode/common/reedsolomon/BC_ReedSolomon.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'fxbarcode/common') diff --git a/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp index ca65f72043..2be74c7fa3 100644 --- a/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp +++ b/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp @@ -36,7 +36,7 @@ CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder() {} void CBC_ReedSolomonEncoder::Init() { m_cachedGenerators.push_back( - pdfium::MakeUnique(m_field, 1)); + pdfium::MakeUnique(m_field.Get(), 1)); } CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator( @@ -46,7 +46,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator( for (size_t d = m_cachedGenerators.size(); d <= degree; ++d) { std::vector temp = {1, m_field->Exp(d - 1)}; CBC_ReedSolomonGF256Poly temp_poly; - if (!temp_poly.Init(m_field, &temp)) + if (!temp_poly.Init(m_field.Get(), &temp)) return nullptr; auto nextGenerator = lastGenerator->Multiply(&temp_poly); @@ -78,7 +78,7 @@ bool CBC_ReedSolomonEncoder::Encode(std::vector* toEncode, infoCoefficients[x] = (*toEncode)[x]; CBC_ReedSolomonGF256Poly info; - if (!info.Init(m_field, &infoCoefficients)) + if (!info.Init(m_field.Get(), &infoCoefficients)) return false; auto infoTemp = info.MultiplyByMonomial(ecBytes, 1); diff --git a/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/fxbarcode/common/reedsolomon/BC_ReedSolomon.h index 68d4ee0624..2838e13cee 100644 --- a/fxbarcode/common/reedsolomon/BC_ReedSolomon.h +++ b/fxbarcode/common/reedsolomon/BC_ReedSolomon.h @@ -26,7 +26,7 @@ class CBC_ReedSolomonEncoder { private: CBC_ReedSolomonGF256Poly* BuildGenerator(size_t degree); - CBC_ReedSolomonGF256* const m_field; + CFX_UnownedPtr const m_field; std::vector> m_cachedGenerators; }; -- cgit v1.2.3