aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/ast/Types.cpp6
-rw-r--r--libsolidity/ast/Types.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 11d7160c..56d41974 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -595,13 +595,13 @@ MemberList::MemberMap IntegerType::nativeMembers(ContractDefinition const*) cons
return MemberList::MemberMap();
}
-FixedPointType::FixedPointType(int _totalBits, int _fractionalDigits, FixedPointType::Modifier _modifier):
+FixedPointType::FixedPointType(unsigned _totalBits, unsigned _fractionalDigits, FixedPointType::Modifier _modifier):
m_totalBits(_totalBits), m_fractionalDigits(_fractionalDigits), m_modifier(_modifier)
{
solAssert(
8 <= m_totalBits && m_totalBits <= 256 && m_totalBits % 8 == 0 &&
- 0 <= m_fractionalDigits && m_fractionalDigits <= 80,
- "Invalid bit number(s) for fixed type: " +
+ 0 <= m_fractionalDigits && m_fractionalDigits <= 80,
+ "Invalid bit number(s) for fixed type: " +
dev::toString(_totalBits) + "x" + dev::toString(_fractionalDigits)
);
}
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index ca6822c9..7e6a93b5 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -366,7 +366,7 @@ public:
};
virtual Category category() const override { return Category::FixedPoint; }
- explicit FixedPointType(int _totalBits, int _fractionalDigits, Modifier _modifier = Modifier::Unsigned);
+ explicit FixedPointType(unsigned _totalBits, unsigned _fractionalDigits, Modifier _modifier = Modifier::Unsigned);
virtual std::string richIdentifier() const override;
virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
@@ -386,9 +386,9 @@ public:
virtual TypePointer interfaceType(bool) const override { return shared_from_this(); }
/// Number of bits used for this type in total.
- int numBits() const { return m_totalBits; }
+ unsigned numBits() const { return m_totalBits; }
/// Number of decimal digits after the radix point.
- int fractionalDigits() const { return m_fractionalDigits; }
+ unsigned fractionalDigits() const { return m_fractionalDigits; }
bool isSigned() const { return m_modifier == Modifier::Signed; }
/// @returns the largest integer value this type con hold. Note that this is not the
/// largest value in general.
@@ -401,8 +401,8 @@ public:
std::shared_ptr<IntegerType> asIntegerType() const;
private:
- int m_totalBits;
- int m_fractionalDigits;
+ unsigned m_totalBits;
+ unsigned m_fractionalDigits;
Modifier m_modifier;
};