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

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

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 months 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_util.cpp ('k') | core/src/fxcrt/fx_extension.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 <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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 va_start(argList, lpszFormat); 970 va_start(argList, lpszFormat);
971 FormatV(lpszFormat, argList); 971 FormatV(lpszFormat, argList);
972 va_end(argList); 972 va_end(argList);
973 } 973 }
974 FX_FLOAT FX_wtof(const FX_WCHAR* str, int len) 974 FX_FLOAT FX_wtof(const FX_WCHAR* str, int len)
975 { 975 {
976 if (len == 0) { 976 if (len == 0) {
977 return 0.0; 977 return 0.0;
978 } 978 }
979 int cc = 0; 979 int cc = 0;
980 FX_BOOL bNegative = FALSE; 980 bool bNegative = false;
981 if (str[0] == '+') { 981 if (str[0] == '+') {
982 cc++; 982 cc++;
983 } else if (str[0] == '-') { 983 } else if (str[0] == '-') {
984 bNegative = TRUE; 984 bNegative = true;
985 cc++; 985 cc++;
986 } 986 }
987 int integer = 0; 987 int integer = 0;
988 while (cc < len) { 988 while (cc < len) {
989 if (str[cc] == '.') { 989 if (str[cc] == '.') {
990 break; 990 break;
991 } 991 }
992 integer = integer * 10 + str[cc] - '0'; 992 integer = integer * 10 + str[cc] - '0';
993 cc ++; 993 cc ++;
994 } 994 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 return (CFX_CharMap*)&g_DefaultJISMapper; 1077 return (CFX_CharMap*)&g_DefaultJISMapper;
1078 case 936: 1078 case 936:
1079 return (CFX_CharMap*)&g_DefaultGBKMapper; 1079 return (CFX_CharMap*)&g_DefaultGBKMapper;
1080 case 949: 1080 case 949:
1081 return (CFX_CharMap*)&g_DefaultUHCMapper; 1081 return (CFX_CharMap*)&g_DefaultUHCMapper;
1082 case 950: 1082 case 950:
1083 return (CFX_CharMap*)&g_DefaultBig5Mapper; 1083 return (CFX_CharMap*)&g_DefaultBig5Mapper;
1084 } 1084 }
1085 return NULL; 1085 return NULL;
1086 } 1086 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_util.cpp ('k') | core/src/fxcrt/fx_extension.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698