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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 { | 139 { |
140 return FXSYS_log(x) / FXSYS_log(b); | 140 return FXSYS_log(x) / FXSYS_log(b); |
141 } | 141 } |
142 FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) | 142 FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) |
143 { | 143 { |
144 FXSYS_assert(pcsStr != NULL); | 144 FXSYS_assert(pcsStr != NULL); |
145 if (iLength < 0) { | 145 if (iLength < 0) { |
146 iLength = (FX_INT32)FXSYS_strlen(pcsStr); | 146 iLength = (FX_INT32)FXSYS_strlen(pcsStr); |
147 } | 147 } |
148 CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); | 148 CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength); |
149 return FXSYS_wcstof((FX_LPCWSTR)ws, iLength, pUsedLen); | 149 return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen); |
150 } | 150 } |
151 FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) | 151 FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen) |
152 { | 152 { |
153 FXSYS_assert(pwsStr != NULL); | 153 FXSYS_assert(pwsStr != NULL); |
154 if (iLength < 0) { | 154 if (iLength < 0) { |
155 iLength = (FX_INT32)FXSYS_wcslen(pwsStr); | 155 iLength = (FX_INT32)FXSYS_wcslen(pwsStr); |
156 } | 156 } |
157 if (iLength == 0) { | 157 if (iLength == 0) { |
158 return 0.0f; | 158 return 0.0f; |
159 } | 159 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 { | 376 { |
377 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 377 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
378 FX_GenerateCryptoRandom(pBuffer, iCount); | 378 FX_GenerateCryptoRandom(pBuffer, iCount); |
379 #else | 379 #else |
380 FX_Random_GenerateBase(pBuffer, iCount); | 380 FX_Random_GenerateBase(pBuffer, iCount); |
381 #endif | 381 #endif |
382 } | 382 } |
383 #ifdef __cplusplus | 383 #ifdef __cplusplus |
384 } | 384 } |
385 #endif | 385 #endif |
OLD | NEW |