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

Side by Side Diff: core/src/fxcrt/fx_extension.cpp

Issue 733693003: Getting rid of more (FX_LPCWSTR) casts and fixing two bugs revealed by this. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Simplified GetAttrValue to just assign *pValue and to share code. Created 6 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/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxcrt/fx_xml_parser.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 // 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
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
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
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxcrt/fx_xml_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698