OLD | NEW |
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 | 6 |
7 #include "core/include/fxcrt/fx_basic.h" | 7 #include "core/include/fxcrt/fx_basic.h" |
8 #include "core/include/fxcrt/fx_ext.h" | 8 #include "core/include/fxcrt/fx_ext.h" |
9 #include "core/src/fxcrt/extension.h" | 9 #include "core/src/fxcrt/extension.h" |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) { | 126 FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) { |
127 return FXSYS_log(x) / FXSYS_log(b); | 127 return FXSYS_log(x) / FXSYS_log(b); |
128 } | 128 } |
129 FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr, | 129 FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr, |
130 int32_t iLength, | 130 int32_t iLength, |
131 int32_t* pUsedLen) { | 131 int32_t* pUsedLen) { |
132 FXSYS_assert(pcsStr); | 132 FXSYS_assert(pcsStr); |
133 if (iLength < 0) { | 133 if (iLength < 0) { |
134 iLength = (int32_t)FXSYS_strlen(pcsStr); | 134 iLength = (int32_t)FXSYS_strlen(pcsStr); |
135 } | 135 } |
136 CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); | 136 CFX_WideString ws = |
| 137 CFX_WideString::FromLocal(CFX_ByteString(pcsStr, iLength)); |
137 return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen); | 138 return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen); |
138 } | 139 } |
139 FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, | 140 FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, |
140 int32_t iLength, | 141 int32_t iLength, |
141 int32_t* pUsedLen) { | 142 int32_t* pUsedLen) { |
142 FXSYS_assert(pwsStr); | 143 FXSYS_assert(pwsStr); |
143 if (iLength < 0) { | 144 if (iLength < 0) { |
144 iLength = (int32_t)FXSYS_wcslen(pwsStr); | 145 iLength = (int32_t)FXSYS_wcslen(pwsStr); |
145 } | 146 } |
146 if (iLength == 0) { | 147 if (iLength == 0) { |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 b = ((const uint8_t*)pGUID)[i]; | 387 b = ((const uint8_t*)pGUID)[i]; |
387 *pBuf++ = gs_FX_pHexChars[b >> 4]; | 388 *pBuf++ = gs_FX_pHexChars[b >> 4]; |
388 *pBuf++ = gs_FX_pHexChars[b & 0x0F]; | 389 *pBuf++ = gs_FX_pHexChars[b & 0x0F]; |
389 if (bSeparator && (i == 3 || i == 5 || i == 7 || i == 9)) { | 390 if (bSeparator && (i == 3 || i == 5 || i == 7 || i == 9)) { |
390 *pBuf++ = L'-'; | 391 *pBuf++ = L'-'; |
391 } | 392 } |
392 } | 393 } |
393 bsStr.ReleaseBuffer(bSeparator ? 36 : 32); | 394 bsStr.ReleaseBuffer(bSeparator ? 36 : 32); |
394 } | 395 } |
395 #endif // PDF_ENABLE_XFA | 396 #endif // PDF_ENABLE_XFA |
OLD | NEW |