Rename to isHexNumber()

This commit is contained in:
Alex Beregszaszi 2017-06-28 16:59:34 +01:00
parent 8b0c866f02
commit 06fe61f89b
3 changed files with 5 additions and 5 deletions

View File

@ -1886,7 +1886,7 @@ void TypeChecker::expectType(Expression const& _expression, Type const& _expecte
{ {
auto literal = dynamic_cast<Literal const*>(&_expression); auto literal = dynamic_cast<Literal const*>(&_expression);
if (literal && !literal->hasHexPrefix()) if (literal && !literal->isHexNumber())
m_errorReporter.warning( m_errorReporter.warning(
_expression.location(), _expression.location(),
"Decimal literal assigned to bytesXX variable will be left-aligned. " "Decimal literal assigned to bytesXX variable will be left-aligned. "

View File

@ -530,7 +530,7 @@ IdentifierAnnotation& Identifier::annotation() const
return dynamic_cast<IdentifierAnnotation&>(*m_annotation); return dynamic_cast<IdentifierAnnotation&>(*m_annotation);
} }
bool Literal::hasHexPrefix() const bool Literal::isHexNumber() const
{ {
if (token() != Token::Number) if (token() != Token::Number)
return false; return false;
@ -542,7 +542,7 @@ bool Literal::looksLikeAddress() const
if (subDenomination() != SubDenomination::None) if (subDenomination() != SubDenomination::None)
return false; return false;
if (!hasHexPrefix()) if (!isHexNumber())
return false; return false;
return abs(int(value().length()) - 42) <= 1; return abs(int(value().length()) - 42) <= 1;
@ -550,6 +550,6 @@ bool Literal::looksLikeAddress() const
bool Literal::passesAddressChecksum() const bool Literal::passesAddressChecksum() const
{ {
solAssert(hasHexPrefix(), "Expected hex prefix"); solAssert(isHexNumber(), "Expected hex number");
return dev::passesAddressChecksum(value(), true); return dev::passesAddressChecksum(value(), true);
} }

View File

@ -1591,7 +1591,7 @@ public:
SubDenomination subDenomination() const { return m_subDenomination; } SubDenomination subDenomination() const { return m_subDenomination; }
/// @returns true if this is a number with a hex prefix. /// @returns true if this is a number with a hex prefix.
bool hasHexPrefix() const; bool isHexNumber() const;
/// @returns true if this looks like a checksummed address. /// @returns true if this looks like a checksummed address.
bool looksLikeAddress() const; bool looksLikeAddress() const;