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

Side by Side Diff: xfa/fxbarcode/common/BC_CommonByteArray.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 2008 ZXing authors 8 * Copyright 2008 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 m_size = capacity; 78 m_size = capacity;
79 } 79 }
80 } 80 }
81 void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count) { 81 void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count) {
82 FX_Free(m_bytes); 82 FX_Free(m_bytes);
83 m_bytes = FX_Alloc(uint8_t, count); 83 m_bytes = FX_Alloc(uint8_t, count);
84 m_size = count; 84 m_size = count;
85 FXSYS_memcpy(m_bytes, source + offset, count); 85 FXSYS_memcpy(m_bytes, source + offset, count);
86 m_index = count; 86 m_index = count;
87 } 87 }
88 void CBC_CommonByteArray::Set(CFX_ByteArray* source, 88 void CBC_CommonByteArray::Set(CFX_ArrayTemplate<uint8_t>* source,
89 int32_t offset, 89 int32_t offset,
90 int32_t count) { 90 int32_t count) {
91 FX_Free(m_bytes); 91 FX_Free(m_bytes);
92 m_bytes = FX_Alloc(uint8_t, count); 92 m_bytes = FX_Alloc(uint8_t, count);
93 m_size = count; 93 m_size = count;
94 int32_t i; 94 int32_t i;
95 for (i = 0; i < count; i++) { 95 for (i = 0; i < count; i++) {
96 m_bytes[i] = source->operator[](i + offset); 96 m_bytes[i] = source->operator[](i + offset);
97 } 97 }
98 m_index = m_size; 98 m_index = m_size;
99 } 99 }
OLDNEW
« no previous file with comments | « xfa/fxbarcode/common/BC_CommonByteArray.h ('k') | xfa/fxbarcode/common/reedsolomon/BC_ReedSolomon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698