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

Side by Side Diff: core/src/fxcodec/codec/fx_codec.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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 | « core/src/fpdftext/fpdf_text_search.cpp ('k') | core/src/fxcodec/codec/fx_codec_flate.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 1
2 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Copyright 2014 PDFium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 7
8 #include "core/include/fxcodec/fx_codec.h" 8 #include "core/include/fxcodec/fx_codec.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 continue; \ 161 continue; \
162 } \ 162 } \
163 } 163 }
164 164
165 extern "C" double FXstrtod(const char* nptr, char** endptr) { 165 extern "C" double FXstrtod(const char* nptr, char** endptr) {
166 double ret = 0.0; 166 double ret = 0.0;
167 const char* ptr = nptr; 167 const char* ptr = nptr;
168 const char* exp_ptr = NULL; 168 const char* exp_ptr = NULL;
169 int e_number = 0, e_signal = 0, e_point = 0, is_negative = 0; 169 int e_number = 0, e_signal = 0, e_point = 0, is_negative = 0;
170 int exp_ret = 0, exp_sig = 1, fra_ret = 0, fra_count = 0, fra_base = 1; 170 int exp_ret = 0, exp_sig = 1, fra_ret = 0, fra_count = 0, fra_base = 1;
171 if (nptr == NULL) { 171 if (!nptr) {
172 return 0.0; 172 return 0.0;
173 } 173 }
174 for (;; ptr++) { 174 for (;; ptr++) {
175 if (!e_number && !e_point && (*ptr == '\t' || *ptr == ' ')) 175 if (!e_number && !e_point && (*ptr == '\t' || *ptr == ' '))
176 continue; 176 continue;
177 177
178 if (std::isdigit(*ptr)) { 178 if (std::isdigit(*ptr)) {
179 if (!e_number) 179 if (!e_number)
180 e_number = 1; 180 e_number = 1;
181 181
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 int nComps, 454 int nComps,
455 int bpc) { 455 int bpc) {
456 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; 456 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder;
457 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, 457 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps,
458 bpc)) { 458 bpc)) {
459 delete pRLScanlineDecoder; 459 delete pRLScanlineDecoder;
460 return NULL; 460 return NULL;
461 } 461 }
462 return pRLScanlineDecoder; 462 return pRLScanlineDecoder;
463 } 463 }
OLDNEW
« no previous file with comments | « core/src/fpdftext/fpdf_text_search.cpp ('k') | core/src/fxcodec/codec/fx_codec_flate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698