mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Mark a lot of functions static (where possible)
This commit is contained in:
@@ -119,7 +119,7 @@ private:
|
||||
);
|
||||
std::string sourceLocationToString(SourceLocation const& _location) const;
|
||||
std::string namePathToString(std::vector<ASTString> const& _namePath) const;
|
||||
Json::Value idOrNull(ASTNode const* _pt) const
|
||||
static Json::Value idOrNull(ASTNode const* _pt)
|
||||
{
|
||||
return _pt ? Json::Value(nodeId(*_pt)) : Json::nullValue;
|
||||
}
|
||||
@@ -134,12 +134,12 @@ private:
|
||||
std::string literalTokenKind(Token::Value _token);
|
||||
std::string type(Expression const& _expression);
|
||||
std::string type(VariableDeclaration const& _varDecl);
|
||||
int nodeId(ASTNode const& _node) const
|
||||
static int nodeId(ASTNode const& _node)
|
||||
{
|
||||
return _node.id();
|
||||
}
|
||||
template<class Container>
|
||||
Json::Value getContainerIds(Container const& container) const
|
||||
static Json::Value getContainerIds(Container const& container)
|
||||
{
|
||||
Json::Value tmp(Json::arrayValue);
|
||||
for (auto const& element: container)
|
||||
|
||||
@@ -1056,7 +1056,7 @@ string ABIFunctions::createFunction(string const& _name, function<string ()> con
|
||||
return _name;
|
||||
}
|
||||
|
||||
size_t ABIFunctions::headSize(TypePointers const& _targetTypes) const
|
||||
size_t ABIFunctions::headSize(TypePointers const& _targetTypes)
|
||||
{
|
||||
size_t headSize = 0;
|
||||
for (auto const& t: _targetTypes)
|
||||
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
std::string createFunction(std::string const& _name, std::function<std::string()> const& _creator);
|
||||
|
||||
/// @returns the size of the static part of the encoding of the given types.
|
||||
size_t headSize(TypePointers const& _targetTypes) const;
|
||||
static size_t headSize(TypePointers const& _targetTypes);
|
||||
|
||||
/// Map from function name to code for a multi-use function.
|
||||
std::map<std::string, std::string> m_requestedFunctions;
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
LabelID assemblyTagToIdentifier(eth::AssemblyItem const& _tag) const
|
||||
static LabelID assemblyTagToIdentifier(eth::AssemblyItem const& _tag)
|
||||
{
|
||||
u256 id = _tag.data();
|
||||
solAssert(id <= std::numeric_limits<LabelID>::max(), "Tag id too large.");
|
||||
|
||||
Reference in New Issue
Block a user