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 "xfa/fgas/crt/fgas_system.h" | 7 #include "xfa/fgas/crt/fgas_system.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return iLen; | 54 return iLen; |
55 #endif | 55 #endif |
56 } | 56 } |
57 | 57 |
58 FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size) { | 58 FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size) { |
59 FXSYS_assert(file != NULL); | 59 FXSYS_assert(file != NULL); |
60 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 60 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
61 return _chsize(_fileno(file), size) == 0; | 61 return _chsize(_fileno(file), size) == 0; |
62 #elif _FX_OS_ == _FX_WIN32_MOBILE_ | 62 #elif _FX_OS_ == _FX_WIN32_MOBILE_ |
63 HANDLE hFile = _fileno(file); | 63 HANDLE hFile = _fileno(file); |
64 FX_DWORD dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); | 64 uint32_t dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); |
65 ::SetFilePointer(hFile, size, 0, FILE_BEGIN); | 65 ::SetFilePointer(hFile, size, 0, FILE_BEGIN); |
66 FX_BOOL bRet = ::SetEndOfFile(hFile); | 66 FX_BOOL bRet = ::SetEndOfFile(hFile); |
67 ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN); | 67 ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN); |
68 return bRet; | 68 return bRet; |
69 #else | 69 #else |
70 return FALSE; | 70 return FALSE; |
71 #endif | 71 #endif |
72 } | 72 } |
73 | 73 |
74 FX_FLOAT FX_wcstof(const FX_WCHAR* pwsStr, int32_t iLength, int32_t* pUsedLen) { | 74 FX_FLOAT FX_wcstof(const FX_WCHAR* pwsStr, int32_t iLength, int32_t* pUsedLen) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } else { | 108 } else { |
109 break; | 109 break; |
110 } | 110 } |
111 } | 111 } |
112 } | 112 } |
113 if (pUsedLen) { | 113 if (pUsedLen) { |
114 *pUsedLen = iUsedLen; | 114 *pUsedLen = iUsedLen; |
115 } | 115 } |
116 return bNegtive ? -fValue : fValue; | 116 return bNegtive ? -fValue : fValue; |
117 } | 117 } |
OLD | NEW |