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 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 inline int32_t FX_tolower(int32_t ch) { | 26 inline int32_t FX_tolower(int32_t ch) { |
27 return FX_isupper(ch) ? (ch + 0x20) : ch; | 27 return FX_isupper(ch) ? (ch + 0x20) : ch; |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 int32_t FX_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) { | 32 int32_t FX_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) { |
33 FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); | 33 FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); |
34 FX_WCHAR wch1 = 0, wch2 = 0; | 34 FX_WCHAR wch1 = 0; |
| 35 FX_WCHAR wch2 = 0; |
35 while (count-- > 0) { | 36 while (count-- > 0) { |
36 wch1 = (FX_WCHAR)FX_tolower(*s1++); | 37 wch1 = (FX_WCHAR)FX_tolower(*s1++); |
37 wch2 = (FX_WCHAR)FX_tolower(*s2++); | 38 wch2 = (FX_WCHAR)FX_tolower(*s2++); |
38 if (wch1 != wch2) { | 39 if (wch1 != wch2) { |
39 break; | 40 break; |
40 } | 41 } |
41 } | 42 } |
42 return wch1 - wch2; | 43 return wch1 - wch2; |
43 } | 44 } |
44 | 45 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } else { | 109 } else { |
109 break; | 110 break; |
110 } | 111 } |
111 } | 112 } |
112 } | 113 } |
113 if (pUsedLen) { | 114 if (pUsedLen) { |
114 *pUsedLen = iUsedLen; | 115 *pUsedLen = iUsedLen; |
115 } | 116 } |
116 return bNegtive ? -fValue : fValue; | 117 return bNegtive ? -fValue : fValue; |
117 } | 118 } |
OLD | NEW |