OLD | NEW |
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 continue; \ | 168 continue; \ |
169 } \ | 169 } \ |
170 } | 170 } |
171 | 171 |
172 extern "C" double FXstrtod(const char* nptr, char** endptr) { | 172 extern "C" double FXstrtod(const char* nptr, char** endptr) { |
173 double ret = 0.0; | 173 double ret = 0.0; |
174 const char* ptr = nptr; | 174 const char* ptr = nptr; |
175 const char* exp_ptr = NULL; | 175 const char* exp_ptr = NULL; |
176 int e_number = 0, e_signal = 0, e_point = 0, is_negative = 0; | 176 int e_number = 0, e_signal = 0, e_point = 0, is_negative = 0; |
177 int exp_ret = 0, exp_sig = 1, fra_ret = 0, fra_count = 0, fra_base = 1; | 177 int exp_ret = 0, exp_sig = 1, fra_ret = 0, fra_count = 0, fra_base = 1; |
178 if (nptr == NULL) { | 178 if (!nptr) { |
179 return 0.0; | 179 return 0.0; |
180 } | 180 } |
181 for (;; ptr++) { | 181 for (;; ptr++) { |
182 if (!e_number && !e_point && (*ptr == '\t' || *ptr == ' ')) | 182 if (!e_number && !e_point && (*ptr == '\t' || *ptr == ' ')) |
183 continue; | 183 continue; |
184 | 184 |
185 if (std::isdigit(*ptr)) { | 185 if (std::isdigit(*ptr)) { |
186 if (!e_number) | 186 if (!e_number) |
187 e_number = 1; | 187 e_number = 1; |
188 | 188 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 int nComps, | 481 int nComps, |
482 int bpc) { | 482 int bpc) { |
483 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; | 483 CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; |
484 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, | 484 if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, |
485 bpc)) { | 485 bpc)) { |
486 delete pRLScanlineDecoder; | 486 delete pRLScanlineDecoder; |
487 return NULL; | 487 return NULL; |
488 } | 488 } |
489 return pRLScanlineDecoder; | 489 return pRLScanlineDecoder; |
490 } | 490 } |
OLD | NEW |