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

Side by Side Diff: xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 10 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 22 matching lines...) Expand all
33 CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = NULL; 33 CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = NULL;
34 CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = NULL; 34 CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = NULL;
35 CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = NULL; 35 CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = NULL;
36 CBC_QRCoderMode::CBC_QRCoderMode(int32_t* characterCountBitsForVersions, 36 CBC_QRCoderMode::CBC_QRCoderMode(int32_t* characterCountBitsForVersions,
37 int32_t x1, 37 int32_t x1,
38 int32_t x2, 38 int32_t x2,
39 int32_t x3, 39 int32_t x3,
40 int32_t bits, 40 int32_t bits,
41 CFX_ByteString name) { 41 CFX_ByteString name) {
42 m_characterCountBitsForVersions = characterCountBitsForVersions; 42 m_characterCountBitsForVersions = characterCountBitsForVersions;
43 if (m_characterCountBitsForVersions != NULL) { 43 if (m_characterCountBitsForVersions) {
44 m_characterCountBitsForVersions[0] = x1; 44 m_characterCountBitsForVersions[0] = x1;
45 m_characterCountBitsForVersions[1] = x2; 45 m_characterCountBitsForVersions[1] = x2;
46 m_characterCountBitsForVersions[2] = x3; 46 m_characterCountBitsForVersions[2] = x3;
47 } 47 }
48 m_name += name; 48 m_name += name;
49 m_bits = bits; 49 m_bits = bits;
50 } 50 }
51 CBC_QRCoderMode::~CBC_QRCoderMode() { 51 CBC_QRCoderMode::~CBC_QRCoderMode() {
52 if (m_characterCountBitsForVersions != NULL) { 52 FX_Free(m_characterCountBitsForVersions);
53 FX_Free(m_characterCountBitsForVersions);
54 }
55 } 53 }
56 void CBC_QRCoderMode::Initialize() { 54 void CBC_QRCoderMode::Initialize() {
57 sBYTE = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE"); 55 sBYTE = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE");
58 sALPHANUMERIC = 56 sALPHANUMERIC =
59 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, "ALPHANUMERIC"); 57 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, "ALPHANUMERIC");
60 sECI = new CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI"); 58 sECI = new CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI");
61 sKANJI = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI"); 59 sKANJI = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI");
62 sNUMERIC = 60 sNUMERIC =
63 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC"); 61 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC");
64 sGBK = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK"); 62 sGBK = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK");
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 168 }
171 if (sFNC1_SECOND_POSITION) { 169 if (sFNC1_SECOND_POSITION) {
172 delete CBC_QRCoderMode::sFNC1_SECOND_POSITION; 170 delete CBC_QRCoderMode::sFNC1_SECOND_POSITION;
173 sFNC1_SECOND_POSITION = NULL; 171 sFNC1_SECOND_POSITION = NULL;
174 } 172 }
175 if (sSTRUCTURED_APPEND) { 173 if (sSTRUCTURED_APPEND) {
176 delete CBC_QRCoderMode::sSTRUCTURED_APPEND; 174 delete CBC_QRCoderMode::sSTRUCTURED_APPEND;
177 sSTRUCTURED_APPEND = NULL; 175 sSTRUCTURED_APPEND = NULL;
178 } 176 }
179 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698