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

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: 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 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 int32_t& e) { 43 int32_t& e) {
44 FX_BOOL foundStart = FALSE; 44 FX_BOOL foundStart = FALSE;
45 CFX_Int32Array* startRange = NULL; 45 CFX_Int32Array* startRange = NULL;
46 CFX_Int32Array startEndPattern; 46 CFX_Int32Array startEndPattern;
47 startEndPattern.SetSize(3); 47 startEndPattern.SetSize(3);
48 startEndPattern[0] = START_END_PATTERN[0]; 48 startEndPattern[0] = START_END_PATTERN[0];
49 startEndPattern[1] = START_END_PATTERN[1]; 49 startEndPattern[1] = START_END_PATTERN[1];
50 startEndPattern[2] = START_END_PATTERN[2]; 50 startEndPattern[2] = START_END_PATTERN[2];
51 int32_t nextStart = 0; 51 int32_t nextStart = 0;
52 while (!foundStart) { 52 while (!foundStart) {
53 if (startRange != NULL) { 53 delete startRange;
54 delete startRange;
55 startRange = NULL;
56 }
57 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e); 54 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e);
58 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); 55 BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
59 int32_t start = (*startRange)[0]; 56 int32_t start = (*startRange)[0];
60 nextStart = (*startRange)[1]; 57 nextStart = (*startRange)[1];
61 if (start <= 1) { 58 if (start <= 1) {
62 break; 59 break;
63 } 60 }
64 int32_t quietStart = start - (nextStart - start); 61 int32_t quietStart = start - (nextStart - start);
65 if (quietStart >= 0) { 62 if (quietStart >= 0) {
66 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e); 63 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 208 }
212 } 209 }
213 if (bestMatch >= 0) { 210 if (bestMatch >= 0) {
214 return bestMatch; 211 return bestMatch;
215 } else { 212 } else {
216 e = BCExceptionNotFound; 213 e = BCExceptionNotFound;
217 return 0; 214 return 0;
218 } 215 }
219 return 0; 216 return 0;
220 } 217 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698