Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus committed Feb 18, 2016
1 parent ef92f56 commit 5fb8953
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions libsolidity/ast/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ MemberList& MemberList::operator=(MemberList&& _other)
{
assert(&_other != this);

m_memberTypes = std::move(_other.m_memberTypes);
m_storageOffsets = std::move(_other.m_storageOffsets);
m_memberTypes = move(_other.m_memberTypes);
m_storageOffsets = move(_other.m_storageOffsets);
return *this;
}

Expand All @@ -91,7 +91,7 @@ void MemberList::combine(MemberList const & _other)
m_memberTypes += _other.m_memberTypes;
}

std::pair<u256, unsigned> const* MemberList::memberStorageOffset(string const& _name) const
pair<u256, unsigned> const* MemberList::memberStorageOffset(string const& _name) const
{
if (!m_storageOffsets)
{
Expand Down Expand Up @@ -119,7 +119,7 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken)
{
char const* tokenCstr = Token::toString(_typeToken);
solAssert(Token::isElementaryTypeName(_typeToken),
"Expected an elementary type name but got " + ((tokenCstr) ? std::string(Token::toString(_typeToken)) : ""));
"Expected an elementary type name but got " + ((tokenCstr) ? string(Token::toString(_typeToken)) : ""));

if (Token::Int <= _typeToken && _typeToken <= Token::Bytes32)
{
Expand Down Expand Up @@ -153,7 +153,7 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken)
return make_shared<ArrayType>(DataLocation::Storage, true);
else
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment(
"Unable to convert elementary typename " + std::string(Token::toString(_typeToken)) + " to type."
"Unable to convert elementary typename " + string(Token::toString(_typeToken)) + " to type."
));
}

Expand Down Expand Up @@ -242,8 +242,10 @@ IntegerType::IntegerType(int _bits, IntegerType::Modifier _modifier):
{
if (isAddress())
m_bits = 160;
solAssert(m_bits > 0 && m_bits <= 256 && m_bits % 8 == 0,
"Invalid bit number for integer type: " + dev::toString(_bits));
solAssert(
m_bits > 0 && m_bits <= 256 && m_bits % 8 == 0,
"Invalid bit number for integer type: " + dev::toString(_bits)
);
}

bool IntegerType::isImplicitlyConvertibleTo(Type const& _convertTo) const
Expand Down Expand Up @@ -496,7 +498,7 @@ TypePointer IntegerConstantType::binaryOperatorResult(Token::Value _operator, Ty
case Token::Exp:
if (other.m_value < 0)
return TypePointer();
else if (other.m_value > std::numeric_limits<unsigned int>::max())
else if (other.m_value > numeric_limits<unsigned int>::max())
return TypePointer();
else
value = boost::multiprecision::pow(m_value, other.m_value.convert_to<unsigned int>());
Expand Down Expand Up @@ -969,9 +971,9 @@ TypePointer ArrayType::interfaceType(bool _inLibrary) const
return TypePointer();

if (isDynamicallySized())
return std::make_shared<ArrayType>(DataLocation::Memory, baseExt);
return make_shared<ArrayType>(DataLocation::Memory, baseExt);
else
return std::make_shared<ArrayType>(DataLocation::Memory, baseExt, m_length);
return make_shared<ArrayType>(DataLocation::Memory, baseExt, m_length);
}

u256 ArrayType::memorySize() const
Expand Down Expand Up @@ -1484,7 +1486,7 @@ FunctionType::FunctionType(const EventDefinition& _event):
swap(paramNames, m_parameterNames);
}

std::vector<string> FunctionType::parameterNames() const
vector<string> FunctionType::parameterNames() const
{
if (!bound())
return m_parameterNames;
Expand Down Expand Up @@ -1668,7 +1670,7 @@ bool FunctionType::canTakeArguments(TypePointers const& _argumentTypes, TypePoin
else if (_argumentTypes.size() != paramTypes.size())
return false;
else
return std::equal(
return equal(
_argumentTypes.cbegin(),
_argumentTypes.cend(),
paramTypes.cbegin(),
Expand Down

0 comments on commit 5fb8953

Please sign in to comment.