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

Unified Diff: xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h

Issue 2221023003: Use smart pointers for class owned pointers in xfa/fxbarcode (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 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/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
index cd788111ed72bc9a02946ae6be333b757ae003da..ec0f1ff549ff42ba273038c3756c5695dc189c03 100644
--- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
+++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
@@ -7,20 +7,23 @@
#ifndef XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_
#define XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_
+#include <memory>
+
#include "core/fxcrt/include/fx_basic.h"
#include "xfa/fxbarcode/utils.h"
class CBC_ReedSolomonGF256Poly;
+
class CBC_ReedSolomonGF256 {
public:
+ explicit CBC_ReedSolomonGF256(int32_t primitive);
+ virtual ~CBC_ReedSolomonGF256();
+
static void Initialize();
static void Finalize();
- static CBC_ReedSolomonGF256* QRCodeFild;
- static CBC_ReedSolomonGF256* DataMatrixField;
- CBC_ReedSolomonGF256(int32_t primitive);
- virtual ~CBC_ReedSolomonGF256();
- CBC_ReedSolomonGF256Poly* GetZero();
- CBC_ReedSolomonGF256Poly* GetOne();
+
+ CBC_ReedSolomonGF256Poly* GetZero() const;
+ CBC_ReedSolomonGF256Poly* GetOne() const;
CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree,
int32_t coefficient,
int32_t& e);
@@ -31,11 +34,14 @@ class CBC_ReedSolomonGF256 {
int32_t Multiply(int32_t a, int32_t b);
virtual void Init();
+ static CBC_ReedSolomonGF256* QRCodeField;
+ static CBC_ReedSolomonGF256* DataMatrixField;
+
private:
int32_t m_expTable[256];
int32_t m_logTable[256];
- CBC_ReedSolomonGF256Poly* m_zero;
- CBC_ReedSolomonGF256Poly* m_one;
+ std::unique_ptr<CBC_ReedSolomonGF256Poly> m_zero;
+ std::unique_ptr<CBC_ReedSolomonGF256Poly> m_one;
};
#endif // XFA_FXBARCODE_COMMON_REEDSOLOMON_BC_REEDSOLOMONGF256_H_
« no previous file with comments | « xfa/fxbarcode/common/BC_CommonByteArray.cpp ('k') | xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698