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

Side by Side Diff: xfa/src/fxbarcode/oned/BC_OneDimReader.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase 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
« no previous file with comments | « xfa/src/fxbarcode/oned/BC_OneDReader.cpp ('k') | xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 int32_t& e) { 45 int32_t& e) {
46 FX_BOOL foundStart = FALSE; 46 FX_BOOL foundStart = FALSE;
47 CFX_Int32Array* startRange = NULL; 47 CFX_Int32Array* startRange = NULL;
48 CFX_Int32Array startEndPattern; 48 CFX_Int32Array startEndPattern;
49 startEndPattern.SetSize(3); 49 startEndPattern.SetSize(3);
50 startEndPattern[0] = START_END_PATTERN[0]; 50 startEndPattern[0] = START_END_PATTERN[0];
51 startEndPattern[1] = START_END_PATTERN[1]; 51 startEndPattern[1] = START_END_PATTERN[1];
52 startEndPattern[2] = START_END_PATTERN[2]; 52 startEndPattern[2] = START_END_PATTERN[2];
53 int32_t nextStart = 0; 53 int32_t nextStart = 0;
54 while (!foundStart) { 54 while (!foundStart) {
55 if (startRange != NULL) { 55 delete startRange;
56 delete startRange;
57 startRange = NULL;
58 }
59 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e); 56 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e);
60 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); 57 BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
61 int32_t start = (*startRange)[0]; 58 int32_t start = (*startRange)[0];
62 nextStart = (*startRange)[1]; 59 nextStart = (*startRange)[1];
63 if (start <= 1) { 60 if (start <= 1) {
64 break; 61 break;
65 } 62 }
66 int32_t quietStart = start - (nextStart - start); 63 int32_t quietStart = start - (nextStart - start);
67 if (quietStart >= 0) { 64 if (quietStart >= 0) {
68 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e); 65 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 210 }
214 } 211 }
215 if (bestMatch >= 0) { 212 if (bestMatch >= 0) {
216 return bestMatch; 213 return bestMatch;
217 } else { 214 } else {
218 e = BCExceptionNotFound; 215 e = BCExceptionNotFound;
219 return 0; 216 return 0;
220 } 217 }
221 return 0; 218 return 0;
222 } 219 }
OLDNEW
« no previous file with comments | « xfa/src/fxbarcode/oned/BC_OneDReader.cpp ('k') | xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698