Browse Source

More style changes in enums

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
e296d86cc6
  1. 2
      libsolidity/AST.cpp
  2. 10
      libsolidity/AST.h
  3. 10
      libsolidity/Types.cpp

2
libsolidity/AST.cpp

@ -602,7 +602,7 @@ Literal::Literal(Location const& _location, Token::Value _token,
if (Token::isEtherSubdenomination(_sub))
m_subDenomination = static_cast<Literal::SubDenomination>(_sub);
else
m_subDenomination = Literal::SubDenomination::NONE;
m_subDenomination = Literal::SubDenomination::None;
}
void Literal::checkTypeRequirements()

10
libsolidity/AST.h

@ -1119,11 +1119,11 @@ class Literal: public PrimaryExpression
public:
enum class SubDenomination
{
NONE = Token::ILLEGAL,
WEI = Token::SubWei,
SZABO = Token::SubSzabo,
FINNEY = Token::SubFinney,
ETHER = Token::SubEther
None = Token::ILLEGAL,
Wei = Token::SubWei,
Szabo = Token::SubSzabo,
Finney = Token::SubFinney,
Ether = Token::SubEther
};
Literal(Location const& _location, Token::Value _token,
ASTPointer<ASTString> const& _value,

10
libsolidity/Types.cpp

@ -343,16 +343,16 @@ u256 IntegerConstantType::literalValue(Literal const* _literal) const
Literal::SubDenomination sub =_literal->getSubDenomination();
switch(sub)
{
case Literal::SubDenomination::WEI:
case Literal::SubDenomination::NONE:
case Literal::SubDenomination::Wei:
case Literal::SubDenomination::None:
break;
case Literal::SubDenomination::SZABO:
case Literal::SubDenomination::Szabo:
value *= u256(1000000000000);
break;
case Literal::SubDenomination::FINNEY:
case Literal::SubDenomination::Finney:
value *= u256(1000000000000000);
break;
case Literal::SubDenomination::ETHER:
case Literal::SubDenomination::Ether:
value *= u256(1000000000000000000);
break;
}

Loading…
Cancel
Save