| 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 "../../include/fxcrt/fx_ext.h" | 7 #include "../../include/fxcrt/fx_ext.h" |
| 8 #include "extension.h" | 8 #include "extension.h" |
| 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 10 #include <wincrypt.h> | 10 #include <wincrypt.h> |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 { | 151 { |
| 152 return FXSYS_log(x) / FXSYS_log(b); | 152 return FXSYS_log(x) / FXSYS_log(b); |
| 153 } | 153 } |
| 154 FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) | 154 FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) |
| 155 { | 155 { |
| 156 FXSYS_assert(pcsStr != NULL); | 156 FXSYS_assert(pcsStr != NULL); |
| 157 if (iLength < 0) { | 157 if (iLength < 0) { |
| 158 iLength = (FX_INT32)FXSYS_strlen(pcsStr); | 158 iLength = (FX_INT32)FXSYS_strlen(pcsStr); |
| 159 } | 159 } |
| 160 CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); | 160 CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); |
| 161 return FXSYS_wcstof((FX_LPCWSTR)ws, iLength, pUsedLen); | 161 return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen); |
| 162 } | 162 } |
| 163 FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) | 163 FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) |
| 164 { | 164 { |
| 165 FXSYS_assert(pwsStr != NULL); | 165 FXSYS_assert(pwsStr != NULL); |
| 166 if (iLength < 0) { | 166 if (iLength < 0) { |
| 167 iLength = (FX_INT32)FXSYS_wcslen(pwsStr); | 167 iLength = (FX_INT32)FXSYS_wcslen(pwsStr); |
| 168 } | 168 } |
| 169 if (iLength == 0) { | 169 if (iLength == 0) { |
| 170 return 0.0f; | 170 return 0.0f; |
| 171 } | 171 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 *pBuf ++ = gs_FX_pHexChars[b & 0x0F]; | 425 *pBuf ++ = gs_FX_pHexChars[b & 0x0F]; |
| 426 if (bSeparator && (i == 3 || i == 5 || i == 7 || i == 9)) { | 426 if (bSeparator && (i == 3 || i == 5 || i == 7 || i == 9)) { |
| 427 *pBuf ++ = L'-'; | 427 *pBuf ++ = L'-'; |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 bsStr.ReleaseBuffer(bSeparator ? 36 : 32); | 430 bsStr.ReleaseBuffer(bSeparator ? 36 : 32); |
| 431 } | 431 } |
| 432 #ifdef __cplusplus | 432 #ifdef __cplusplus |
| 433 } | 433 } |
| 434 #endif | 434 #endif |
| OLD | NEW |