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

Side by Side Diff: xfa/src/fxbarcode/oned/BC_OnedCode39Reader.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, 9 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 : m_usingCheckDigit(usingCheckDigit), m_extendedMode(extendedMode) { 51 : m_usingCheckDigit(usingCheckDigit), m_extendedMode(extendedMode) {
52 } 52 }
53 CBC_OnedCode39Reader::~CBC_OnedCode39Reader() {} 53 CBC_OnedCode39Reader::~CBC_OnedCode39Reader() {}
54 CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber, 54 CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber,
55 CBC_CommonBitArray* row, 55 CBC_CommonBitArray* row,
56 int32_t hints, 56 int32_t hints,
57 int32_t& e) { 57 int32_t& e) {
58 CFX_Int32Array* start = FindAsteriskPattern(row, e); 58 CFX_Int32Array* start = FindAsteriskPattern(row, e);
59 BC_EXCEPTION_CHECK_ReturnValue(e, ""); 59 BC_EXCEPTION_CHECK_ReturnValue(e, "");
60 int32_t nextStart = (*start)[1]; 60 int32_t nextStart = (*start)[1];
61 if (start != NULL) { 61 delete start;
62 delete start;
63 start = NULL;
64 }
65 int32_t end = row->GetSize(); 62 int32_t end = row->GetSize();
66 while (nextStart < end && !row->Get(nextStart)) { 63 while (nextStart < end && !row->Get(nextStart)) {
67 nextStart++; 64 nextStart++;
68 } 65 }
69 CFX_ByteString result; 66 CFX_ByteString result;
70 CFX_Int32Array counters; 67 CFX_Int32Array counters;
71 counters.SetSize(9); 68 counters.SetSize(9);
72 FX_CHAR decodedChar; 69 FX_CHAR decodedChar;
73 int32_t lastStart; 70 int32_t lastStart;
74 do { 71 do {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 break; 283 break;
287 } 284 }
288 decoded += decodedChar; 285 decoded += decodedChar;
289 i++; 286 i++;
290 } else { 287 } else {
291 decoded += c; 288 decoded += c;
292 } 289 }
293 } 290 }
294 return decoded; 291 return decoded;
295 } 292 }
OLDNEW
« no previous file with comments | « xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp ('k') | xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698