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 <stddef.h> // For offsetof(). | 7 #include <stddef.h> // For offsetof(). |
8 | 8 |
9 #include "../../include/fxcrt/fx_basic.h" | 9 #include "../../include/fxcrt/fx_basic.h" |
10 #include "../../../third_party/base/numerics/safe_math.h" | 10 #include "../../../third_party/base/numerics/safe_math.h" |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 va_start(argList, lpszFormat); | 973 va_start(argList, lpszFormat); |
974 FormatV(lpszFormat, argList); | 974 FormatV(lpszFormat, argList); |
975 va_end(argList); | 975 va_end(argList); |
976 } | 976 } |
977 FX_FLOAT FX_wtof(const FX_WCHAR* str, int len) | 977 FX_FLOAT FX_wtof(const FX_WCHAR* str, int len) |
978 { | 978 { |
979 if (len == 0) { | 979 if (len == 0) { |
980 return 0.0; | 980 return 0.0; |
981 } | 981 } |
982 int cc = 0; | 982 int cc = 0; |
983 bool bNegative = false; | 983 FX_BOOL bNegative = FALSE; |
984 if (str[0] == '+') { | 984 if (str[0] == '+') { |
985 cc++; | 985 cc++; |
986 } else if (str[0] == '-') { | 986 } else if (str[0] == '-') { |
987 bNegative = true; | 987 bNegative = TRUE; |
988 cc++; | 988 cc++; |
989 } | 989 } |
990 int integer = 0; | 990 int integer = 0; |
991 while (cc < len) { | 991 while (cc < len) { |
992 if (str[cc] == '.') { | 992 if (str[cc] == '.') { |
993 break; | 993 break; |
994 } | 994 } |
995 integer = integer * 10 + str[cc] - '0'; | 995 integer = integer * 10 + str[cc] - '0'; |
996 cc ++; | 996 cc ++; |
997 } | 997 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 return (CFX_CharMap*)&g_DefaultJISMapper; | 1080 return (CFX_CharMap*)&g_DefaultJISMapper; |
1081 case 936: | 1081 case 936: |
1082 return (CFX_CharMap*)&g_DefaultGBKMapper; | 1082 return (CFX_CharMap*)&g_DefaultGBKMapper; |
1083 case 949: | 1083 case 949: |
1084 return (CFX_CharMap*)&g_DefaultUHCMapper; | 1084 return (CFX_CharMap*)&g_DefaultUHCMapper; |
1085 case 950: | 1085 case 950: |
1086 return (CFX_CharMap*)&g_DefaultBig5Mapper; | 1086 return (CFX_CharMap*)&g_DefaultBig5Mapper; |
1087 } | 1087 } |
1088 return NULL; | 1088 return NULL; |
1089 } | 1089 } |
OLD | NEW |