summaryrefslogtreecommitdiffstats
path: root/mozglue/misc
diff options
context:
space:
mode:
Diffstat (limited to 'mozglue/misc')
-rw-r--r--mozglue/misc/TimeStamp.h2
-rw-r--r--mozglue/misc/decimal/Decimal.cpp10
-rw-r--r--mozglue/misc/decimal/Decimal.h6
3 files changed, 5 insertions, 13 deletions
diff --git a/mozglue/misc/TimeStamp.h b/mozglue/misc/TimeStamp.h
index b38882b250..635b62cf13 100644
--- a/mozglue/misc/TimeStamp.h
+++ b/mozglue/misc/TimeStamp.h
@@ -469,7 +469,7 @@ class TimeStamp {
static MFBT_API void RecordProcessRestart();
#ifdef XP_LINUX
- uint64_t RawClockMonotonicNanosecondsSinceBoot() {
+ uint64_t RawClockMonotonicNanosecondsSinceBoot() const {
return static_cast<uint64_t>(mValue);
}
#endif
diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp
index 7d2bcfa712..e4db6a0f1e 100644
--- a/mozglue/misc/decimal/Decimal.cpp
+++ b/mozglue/misc/decimal/Decimal.cpp
@@ -239,11 +239,6 @@ Decimal::Decimal(int32_t i32)
Decimal::Decimal(Sign sign, int exponent, uint64_t coefficient)
: m_data(sign, coefficient ? exponent : 0, coefficient) {}
-Decimal::Decimal(const EncodedData& data)
- : m_data(data)
-{
-}
-
Decimal::Decimal(const Decimal& other)
: m_data(other.m_data)
{
@@ -853,11 +848,6 @@ Decimal Decimal::infinity(const Sign sign)
return Decimal(EncodedData(sign, EncodedData::ClassInfinity));
}
-Decimal Decimal::nan()
-{
- return Decimal(EncodedData(Positive, EncodedData::ClassNaN));
-}
-
Decimal Decimal::remainder(const Decimal& rhs) const
{
const Decimal quotient = *this / rhs;
diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h
index 4bb9a841e5..8d9adbff4f 100644
--- a/mozglue/misc/decimal/Decimal.h
+++ b/mozglue/misc/decimal/Decimal.h
@@ -234,11 +234,13 @@ public:
// Note: fromString doesn't support "infinity" and "nan".
static MFBT_API Decimal fromString(const std::string& aValue);
static MFBT_API Decimal infinity(Sign);
- static MFBT_API Decimal nan();
+ static constexpr Decimal nan() {
+ return Decimal(EncodedData(Positive, EncodedData::ClassNaN));
+ }
static MFBT_API Decimal zero(Sign);
// You should not use below methods. We expose them for unit testing.
- MFBT_API explicit Decimal(const EncodedData&);
+ constexpr explicit Decimal(const EncodedData& data) : m_data(data) {}
const EncodedData& value() const { return m_data; }
private: