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

Side by Side Diff: core/fxcrt/fx_basic_bstring.cpp

Issue 2477443002: Remove FX_BOOL from core (Closed)
Patch Set: Created 4 years, 1 month 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/fxcrt/fx_basic_array.cpp ('k') | core/fxcrt/fx_basic_coords.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> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cctype> 10 #include <cctype>
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const { 959 uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const {
960 return AsStringC().GetID(start_pos); 960 return AsStringC().GetID(start_pos);
961 } 961 }
962 FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf) { 962 FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf) {
963 buf[0] = '0'; 963 buf[0] = '0';
964 buf[1] = '\0'; 964 buf[1] = '\0';
965 if (d == 0.0f) { 965 if (d == 0.0f) {
966 return 1; 966 return 1;
967 } 967 }
968 FX_BOOL bNegative = FALSE; 968 bool bNegative = false;
969 if (d < 0) { 969 if (d < 0) {
970 bNegative = TRUE; 970 bNegative = true;
971 d = -d; 971 d = -d;
972 } 972 }
973 int scale = 1; 973 int scale = 1;
974 int scaled = FXSYS_round(d); 974 int scaled = FXSYS_round(d);
975 while (scaled < 100000) { 975 while (scaled < 100000) {
976 if (scale == 1000000) { 976 if (scale == 1000000) {
977 break; 977 break;
978 } 978 }
979 scale *= 10; 979 scale *= 10;
980 scaled = FXSYS_round(d * scale); 980 scaled = FXSYS_round(d * scale);
(...skipping 22 matching lines...) Expand all
1003 fraction %= scale; 1003 fraction %= scale;
1004 scale /= 10; 1004 scale /= 10;
1005 } 1005 }
1006 return buf_size; 1006 return buf_size;
1007 } 1007 }
1008 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { 1008 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) {
1009 FX_CHAR buf[32]; 1009 FX_CHAR buf[32];
1010 FX_STRSIZE len = FX_ftoa(d, buf); 1010 FX_STRSIZE len = FX_ftoa(d, buf);
1011 return CFX_ByteString(buf, len); 1011 return CFX_ByteString(buf, len);
1012 } 1012 }
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic_array.cpp ('k') | core/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698