summaryrefslogtreecommitdiff
path: root/fxbarcode/common
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-25 12:03:18 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-25 19:16:31 +0000
commit797ca5cad52edde7c65da45a15216f20b1bfd8fd (patch)
tree811a96d5f505e7cff89395cea7dff89604fc9133 /fxbarcode/common
parent3a4c408554f2f2ffb5a143f6dadcdd528fcf106e (diff)
downloadpdfium-797ca5cad52edde7c65da45a15216f20b1bfd8fd.tar.xz
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 <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/common')
-rw-r--r--fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp6
-rw-r--r--fxbarcode/common/reedsolomon/BC_ReedSolomon.h2
2 files changed, 4 insertions, 4 deletions
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<CBC_ReedSolomonGF256Poly>(m_field, 1));
+ pdfium::MakeUnique<CBC_ReedSolomonGF256Poly>(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<int32_t> 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<int32_t>* 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<CBC_ReedSolomonGF256> const m_field;
std::vector<std::unique_ptr<CBC_ReedSolomonGF256Poly>> m_cachedGenerators;
};