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

Side by Side Diff: xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp

Issue 2649563003: Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t> (Closed)
Patch Set: re-upload Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 // Original code is licensed as follows: 6 // Original code is licensed as follows:
7 /* 7 /*
8 * Copyright 2007 ZXing authors 8 * Copyright 2007 ZXing authors
9 * 9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * Licensed under the Apache License, Version 2.0 (the "License");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int32_t& e) { 78 int32_t& e) {
79 if (degree < 0) { 79 if (degree < 0) {
80 e = BCExceptionDegreeIsNegative; 80 e = BCExceptionDegreeIsNegative;
81 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); 81 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
82 } 82 }
83 if (coefficient == 0) { 83 if (coefficient == 0) {
84 CBC_ReedSolomonGF256Poly* temp = m_zero->Clone(e); 84 CBC_ReedSolomonGF256Poly* temp = m_zero->Clone(e);
85 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); 85 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
86 return temp; 86 return temp;
87 } 87 }
88 CFX_Int32Array coefficients; 88 CFX_ArrayTemplate<int32_t> coefficients;
89 coefficients.SetSize(degree + 1); 89 coefficients.SetSize(degree + 1);
90 coefficients[0] = coefficient; 90 coefficients[0] = coefficient;
91 CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly(); 91 CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
92 temp->Init(this, &coefficients, e); 92 temp->Init(this, &coefficients, e);
93 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); 93 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
94 return temp; 94 return temp;
95 } 95 }
96 96
97 int32_t CBC_ReedSolomonGF256::AddOrSubtract(int32_t a, int32_t b) { 97 int32_t CBC_ReedSolomonGF256::AddOrSubtract(int32_t a, int32_t b) {
98 return a ^ b; 98 return a ^ b;
(...skipping 24 matching lines...) Expand all
123 return 0; 123 return 0;
124 } 124 }
125 if (a == 1) { 125 if (a == 1) {
126 return b; 126 return b;
127 } 127 }
128 if (b == 1) { 128 if (b == 1) {
129 return a; 129 return a;
130 } 130 }
131 return m_expTable[(m_logTable[a] + m_logTable[b]) % 255]; 131 return m_expTable[(m_logTable[a] + m_logTable[b]) % 255];
132 } 132 }
OLDNEW
« no previous file with comments | « xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp ('k') | xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698