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

Side by Side Diff: third_party/WebKit/Source/platform/Decimal.h

Issue 1746283002: Rename enums/functions that collide in chromium style in platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get-names-13-platform: . Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool operator!=(const EncodedData& another) const { return !operator==(a nother); } 69 bool operator!=(const EncodedData& another) const { return !operator==(a nother); }
70 70
71 uint64_t coefficient() const { return m_coefficient; } 71 uint64_t coefficient() const { return m_coefficient; }
72 int countDigits() const; 72 int countDigits() const;
73 int exponent() const { return m_exponent; } 73 int exponent() const { return m_exponent; }
74 bool isFinite() const { return !isSpecial(); } 74 bool isFinite() const { return !isSpecial(); }
75 bool isInfinity() const { return m_formatClass == ClassInfinity; } 75 bool isInfinity() const { return m_formatClass == ClassInfinity; }
76 bool isNaN() const { return m_formatClass == ClassNaN; } 76 bool isNaN() const { return m_formatClass == ClassNaN; }
77 bool isSpecial() const { return m_formatClass == ClassInfinity || m_form atClass == ClassNaN; } 77 bool isSpecial() const { return m_formatClass == ClassInfinity || m_form atClass == ClassNaN; }
78 bool isZero() const { return m_formatClass == ClassZero; } 78 bool isZero() const { return m_formatClass == ClassZero; }
79 Sign sign() const { return m_sign; } 79 Sign getSign() const { return m_sign; }
80 void setSign(Sign sign) { m_sign = sign; } 80 void setSign(Sign sign) { m_sign = sign; }
81 81
82 private: 82 private:
83 enum FormatClass { 83 enum FormatClass {
84 ClassInfinity, 84 ClassInfinity,
85 ClassNormal, 85 ClassNormal,
86 ClassNaN, 86 ClassNaN,
87 ClassZero, 87 ClassZero,
88 }; 88 };
89 89
90 EncodedData(Sign, FormatClass); 90 EncodedData(Sign, FormatClass);
91 FormatClass formatClass() const { return m_formatClass; } 91 FormatClass getFormatClass() const { return m_formatClass; }
92 92
93 uint64_t m_coefficient; 93 uint64_t m_coefficient;
94 int16_t m_exponent; 94 int16_t m_exponent;
95 FormatClass m_formatClass; 95 FormatClass m_formatClass;
96 Sign m_sign; 96 Sign m_sign;
97 }; 97 };
98 98
99 Decimal(int32_t = 0); 99 Decimal(int32_t = 0);
100 Decimal(Sign, int exponent, uint64_t coefficient); 100 Decimal(Sign, int exponent, uint64_t coefficient);
101 Decimal(const Decimal&); 101 Decimal(const Decimal&);
(...skipping 20 matching lines...) Expand all
122 122
123 int exponent() const 123 int exponent() const
124 { 124 {
125 ASSERT(isFinite()); 125 ASSERT(isFinite());
126 return m_data.exponent(); 126 return m_data.exponent();
127 } 127 }
128 128
129 bool isFinite() const { return m_data.isFinite(); } 129 bool isFinite() const { return m_data.isFinite(); }
130 bool isInfinity() const { return m_data.isInfinity(); } 130 bool isInfinity() const { return m_data.isInfinity(); }
131 bool isNaN() const { return m_data.isNaN(); } 131 bool isNaN() const { return m_data.isNaN(); }
132 bool isNegative() const { return sign() == Negative; } 132 bool isNegative() const { return getSign() == Negative; }
133 bool isPositive() const { return sign() == Positive; } 133 bool isPositive() const { return getSign() == Positive; }
134 bool isSpecial() const { return m_data.isSpecial(); } 134 bool isSpecial() const { return m_data.isSpecial(); }
135 bool isZero() const { return m_data.isZero(); } 135 bool isZero() const { return m_data.isZero(); }
136 136
137 Decimal abs() const; 137 Decimal abs() const;
138 Decimal ceil() const; 138 Decimal ceil() const;
139 Decimal floor() const; 139 Decimal floor() const;
140 Decimal remainder(const Decimal&) const; 140 Decimal remainder(const Decimal&) const;
141 Decimal round() const; 141 Decimal round() const;
142 142
143 double toDouble() const; 143 double toDouble() const;
(...skipping 23 matching lines...) Expand all
167 uint64_t rhsCoefficient; 167 uint64_t rhsCoefficient;
168 int exponent; 168 int exponent;
169 }; 169 };
170 170
171 Decimal(double); 171 Decimal(double);
172 Decimal compareTo(const Decimal&) const; 172 Decimal compareTo(const Decimal&) const;
173 173
174 static AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs) ; 174 static AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs) ;
175 static inline Sign invertSign(Sign sign) { return sign == Negative ? Positiv e : Negative; } 175 static inline Sign invertSign(Sign sign) { return sign == Negative ? Positiv e : Negative; }
176 176
177 Sign sign() const { return m_data.sign(); } 177 Sign getSign() const { return m_data.getSign(); }
178 178
179 EncodedData m_data; 179 EncodedData m_data;
180 }; 180 };
181 181
182 } // namespace blink 182 } // namespace blink
183 183
184 #endif // Decimal_h 184 #endif // Decimal_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/DateComponents.h ('k') | third_party/WebKit/Source/platform/Decimal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698