diff options
author | daniel <danieljoonlee@gmail.com> | 2018-05-01 13:58:04 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-05-04 06:11:34 +0800 |
commit | aa1542a9e12177311e7d426b7606823ae45ee88e (patch) | |
tree | 1f5775b95f3bcc3a4d05d01e5ab8a2d2ffd91cc2 /libsolidity/ast | |
parent | b34428249a24c29e17de8636c2d3011d95d052cc (diff) | |
download | dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar.gz dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar.bz2 dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar.lz dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar.xz dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.tar.zst dexon-solidity-aa1542a9e12177311e7d426b7606823ae45ee88e.zip |
Change bytes to unsigned in FixedBytesType
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 5 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index f41a4a37..dc548538 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -599,8 +599,7 @@ FixedPointType::FixedPointType(unsigned _totalBits, unsigned _fractionalDigits, 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, + 8 <= m_totalBits && m_totalBits <= 256 && m_totalBits % 8 == 0 && m_fractionalDigits <= 80, "Invalid bit number(s) for fixed type: " + dev::toString(_totalBits) + "x" + dev::toString(_fractionalDigits) ); @@ -1264,7 +1263,7 @@ bool StringLiteralType::isValidUTF8() const return dev::validateUTF8(m_value); } -FixedBytesType::FixedBytesType(int _bytes): m_bytes(_bytes) +FixedBytesType::FixedBytesType(unsigned _bytes): m_bytes(_bytes) { solAssert( m_bytes > 0 && m_bytes <= 32, diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index d39c395a..6defacfc 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -506,7 +506,7 @@ class FixedBytesType: public Type public: virtual Category category() const override { return Category::FixedBytes; } - explicit FixedBytesType(int _bytes); + explicit FixedBytesType(unsigned _bytes); virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override; virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override; @@ -524,10 +524,10 @@ public: virtual TypePointer encodingType() const override { return shared_from_this(); } virtual TypePointer interfaceType(bool) const override { return shared_from_this(); } - int numBytes() const { return m_bytes; } + unsigned numBytes() const { return m_bytes; } private: - int m_bytes; + unsigned m_bytes; }; /** |