mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Renaming a function for clarity
This commit is contained in:
parent
8c1d928c94
commit
f09c6fffc9
2
AST.cpp
2
AST.cpp
@ -502,7 +502,7 @@ void FunctionCall::checkTypeRequirements()
|
|||||||
#endif
|
#endif
|
||||||
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[0]))
|
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[0]))
|
||||||
BOOST_THROW_EXCEPTION(createTypeError(std::string("SHA3 argument ") +
|
BOOST_THROW_EXCEPTION(createTypeError(std::string("SHA3 argument ") +
|
||||||
boost::lexical_cast<std::string>(i) +
|
boost::lexical_cast<std::string>(i + 1) +
|
||||||
std::string("can't be converted to hash")));
|
std::string("can't be converted to hash")));
|
||||||
|
|
||||||
} else if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i]))
|
} else if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i]))
|
||||||
|
@ -275,7 +275,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
|||||||
m_context << u256(0) << eth::Instruction::CODECOPY;
|
m_context << u256(0) << eth::Instruction::CODECOPY;
|
||||||
|
|
||||||
unsigned length = bytecode.size();
|
unsigned length = bytecode.size();
|
||||||
length += appendArgumentCopyToMemory(function.getParameterTypes(), arguments, length);
|
length += appendArgumentsCopyToMemory(function.getParameterTypes(), arguments, length);
|
||||||
// size, offset, endowment
|
// size, offset, endowment
|
||||||
m_context << u256(length) << u256(0);
|
m_context << u256(length) << u256(0);
|
||||||
if (function.valueSet())
|
if (function.valueSet())
|
||||||
@ -800,7 +800,7 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
|
|||||||
|
|
||||||
// reserve space for the function identifier
|
// reserve space for the function identifier
|
||||||
unsigned dataOffset = bare ? 0 : CompilerUtils::dataStartOffset;
|
unsigned dataOffset = bare ? 0 : CompilerUtils::dataStartOffset;
|
||||||
dataOffset += appendArgumentCopyToMemory(_functionType.getParameterTypes(), _arguments, dataOffset);
|
dataOffset += appendArgumentsCopyToMemory(_functionType.getParameterTypes(), _arguments, dataOffset);
|
||||||
|
|
||||||
//@todo only return the first return value for now
|
//@todo only return the first return value for now
|
||||||
Type const* firstType = _functionType.getReturnParameterTypes().empty() ? nullptr :
|
Type const* firstType = _functionType.getReturnParameterTypes().empty() ? nullptr :
|
||||||
@ -836,7 +836,7 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned ExpressionCompiler::appendArgumentCopyToMemory(TypePointers const& _types,
|
unsigned ExpressionCompiler::appendArgumentsCopyToMemory(TypePointers const& _types,
|
||||||
vector<ASTPointer<Expression const>> const& _arguments,
|
vector<ASTPointer<Expression const>> const& _arguments,
|
||||||
unsigned _memoryOffset)
|
unsigned _memoryOffset)
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ private:
|
|||||||
bool bare = false);
|
bool bare = false);
|
||||||
/// Appends code that copies the given arguments to memory (with optional offset).
|
/// Appends code that copies the given arguments to memory (with optional offset).
|
||||||
/// @returns the number of bytes copied to memory
|
/// @returns the number of bytes copied to memory
|
||||||
unsigned appendArgumentCopyToMemory(TypePointers const& _types,
|
unsigned appendArgumentsCopyToMemory(TypePointers const& _types,
|
||||||
std::vector<ASTPointer<Expression const>> const& _arguments,
|
std::vector<ASTPointer<Expression const>> const& _arguments,
|
||||||
unsigned _memoryOffset = 0);
|
unsigned _memoryOffset = 0);
|
||||||
/// Appends code that copies the given arguments that should all have the
|
/// Appends code that copies the given arguments that should all have the
|
||||||
|
Loading…
Reference in New Issue
Block a user