mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix style of "const".
This commit is contained in:
parent
dbb5438fed
commit
17ea467e5b
@ -123,7 +123,7 @@ static inline void keccakf(void* state) {
|
|||||||
FOR(i, 1, len, S); \
|
FOR(i, 1, len, S); \
|
||||||
}
|
}
|
||||||
#define mkapply_sd(NAME, S) \
|
#define mkapply_sd(NAME, S) \
|
||||||
static inline void NAME(const uint8_t* src, \
|
static inline void NAME(uint8_t const* src, \
|
||||||
uint8_t* dst, \
|
uint8_t* dst, \
|
||||||
size_t len) { \
|
size_t len) { \
|
||||||
FOR(i, 1, len, S); \
|
FOR(i, 1, len, S); \
|
||||||
|
@ -77,7 +77,7 @@ bool isWellFormed(unsigned char byte1, unsigned char byte2)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validateUTF8(const unsigned char *_input, size_t _length, size_t& _invalidPosition)
|
bool validateUTF8(unsigned char const* _input, size_t _length, size_t& _invalidPosition)
|
||||||
{
|
{
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
@ -1380,7 +1380,7 @@ string StringLiteralType::richIdentifier() const
|
|||||||
return "t_stringliteral_" + toHex(keccak256(m_value).asBytes());
|
return "t_stringliteral_" + toHex(keccak256(m_value).asBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StringLiteralType::operator==(const Type& _other) const
|
bool StringLiteralType::operator==(Type const& _other) const
|
||||||
{
|
{
|
||||||
if (_other.category() != category())
|
if (_other.category() != category())
|
||||||
return false;
|
return false;
|
||||||
@ -1463,7 +1463,7 @@ TypeResult FixedBytesType::binaryOperatorResult(Token _operator, TypePointer con
|
|||||||
return TypePointer();
|
return TypePointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
MemberList::MemberMap FixedBytesType::nativeMembers(const ContractDefinition*) const
|
MemberList::MemberMap FixedBytesType::nativeMembers(ContractDefinition const*) const
|
||||||
{
|
{
|
||||||
return MemberList::MemberMap{MemberList::Member{"length", make_shared<IntegerType>(8)}};
|
return MemberList::MemberMap{MemberList::Member{"length", make_shared<IntegerType>(8)}};
|
||||||
}
|
}
|
||||||
@ -1611,7 +1611,7 @@ string ReferenceType::identifierLocationSuffix() const
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoolResult ArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const
|
BoolResult ArrayType::isImplicitlyConvertibleTo(Type const& _convertTo) const
|
||||||
{
|
{
|
||||||
if (_convertTo.category() != category())
|
if (_convertTo.category() != category())
|
||||||
return false;
|
return false;
|
||||||
@ -1651,7 +1651,7 @@ BoolResult ArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BoolResult ArrayType::isExplicitlyConvertibleTo(const Type& _convertTo) const
|
BoolResult ArrayType::isExplicitlyConvertibleTo(Type const& _convertTo) const
|
||||||
{
|
{
|
||||||
if (isImplicitlyConvertibleTo(_convertTo))
|
if (isImplicitlyConvertibleTo(_convertTo))
|
||||||
return true;
|
return true;
|
||||||
@ -2010,7 +2010,7 @@ vector<tuple<VariableDeclaration const*, u256, unsigned>> ContractType::stateVar
|
|||||||
return variablesAndOffsets;
|
return variablesAndOffsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoolResult StructType::isImplicitlyConvertibleTo(const Type& _convertTo) const
|
BoolResult StructType::isImplicitlyConvertibleTo(Type const& _convertTo) const
|
||||||
{
|
{
|
||||||
if (_convertTo.category() != category())
|
if (_convertTo.category() != category())
|
||||||
return false;
|
return false;
|
||||||
@ -3298,7 +3298,7 @@ MemberList::MemberMap TypeType::nativeMembers(ContractDefinition const* _current
|
|||||||
return members;
|
return members;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifierType::ModifierType(const ModifierDefinition& _modifier)
|
ModifierType::ModifierType(ModifierDefinition const& _modifier)
|
||||||
{
|
{
|
||||||
TypePointers params;
|
TypePointers params;
|
||||||
params.reserve(_modifier.parameters().size());
|
params.reserve(_modifier.parameters().size());
|
||||||
|
@ -707,7 +707,7 @@ public:
|
|||||||
BoolResult isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
BoolResult isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||||
BoolResult isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
BoolResult isExplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||||
std::string richIdentifier() const override;
|
std::string richIdentifier() const override;
|
||||||
bool operator==(const Type& _other) const override;
|
bool operator==(Type const& _other) const override;
|
||||||
unsigned calldataEncodedSize(bool _padded) const override;
|
unsigned calldataEncodedSize(bool _padded) const override;
|
||||||
bool isDynamicallySized() const override { return m_hasDynamicLength; }
|
bool isDynamicallySized() const override { return m_hasDynamicLength; }
|
||||||
bool isDynamicallyEncoded() const override;
|
bool isDynamicallyEncoded() const override;
|
||||||
@ -823,7 +823,7 @@ public:
|
|||||||
Category category() const override { return Category::Struct; }
|
Category category() const override { return Category::Struct; }
|
||||||
explicit StructType(StructDefinition const& _struct, DataLocation _location = DataLocation::Storage):
|
explicit StructType(StructDefinition const& _struct, DataLocation _location = DataLocation::Storage):
|
||||||
ReferenceType(_location), m_struct(_struct) {}
|
ReferenceType(_location), m_struct(_struct) {}
|
||||||
BoolResult isImplicitlyConvertibleTo(const Type& _convertTo) const override;
|
BoolResult isImplicitlyConvertibleTo(Type const& _convertTo) const override;
|
||||||
std::string richIdentifier() const override;
|
std::string richIdentifier() const override;
|
||||||
bool operator==(Type const& _other) const override;
|
bool operator==(Type const& _other) const override;
|
||||||
unsigned calldataEncodedSize(bool _padded) const override;
|
unsigned calldataEncodedSize(bool _padded) const override;
|
||||||
|
@ -1262,7 +1262,7 @@ string ABIFunctions::abiDecodingFunction(Type const& _type, bool _fromMemory, bo
|
|||||||
return abiDecodingFunctionValueType(_type, _fromMemory);
|
return abiDecodingFunctionValueType(_type, _fromMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
string ABIFunctions::abiDecodingFunctionValueType(const Type& _type, bool _fromMemory)
|
string ABIFunctions::abiDecodingFunctionValueType(Type const& _type, bool _fromMemory)
|
||||||
{
|
{
|
||||||
TypePointer decodingType = _type.decodingType();
|
TypePointer decodingType = _type.decodingType();
|
||||||
solAssert(decodingType, "");
|
solAssert(decodingType, "");
|
||||||
|
@ -265,7 +265,7 @@ unsigned CompilerContext::currentToBaseStackOffset(unsigned _offset) const
|
|||||||
return m_asm->deposit() - _offset - 1;
|
return m_asm->deposit() - _offset - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pair<u256, unsigned> CompilerContext::storageLocationOfVariable(const Declaration& _declaration) const
|
pair<u256, unsigned> CompilerContext::storageLocationOfVariable(Declaration const& _declaration) const
|
||||||
{
|
{
|
||||||
auto it = m_stateVariables.find(&_declaration);
|
auto it = m_stateVariables.find(&_declaration);
|
||||||
solAssert(it != m_stateVariables.end(), "Variable not found in storage.");
|
solAssert(it != m_stateVariables.end(), "Variable not found in storage.");
|
||||||
|
@ -267,7 +267,7 @@ private:
|
|||||||
std::vector<ContractDefinition const*>::const_iterator _searchStart
|
std::vector<ContractDefinition const*>::const_iterator _searchStart
|
||||||
);
|
);
|
||||||
/// @returns an iterator to the contract directly above the given contract.
|
/// @returns an iterator to the contract directly above the given contract.
|
||||||
std::vector<ContractDefinition const*>::const_iterator superContract(const ContractDefinition &_contract) const;
|
std::vector<ContractDefinition const*>::const_iterator superContract(ContractDefinition const& _contract) const;
|
||||||
/// Updates source location set in the assembly.
|
/// Updates source location set in the assembly.
|
||||||
void updateSourceLocation();
|
void updateSourceLocation();
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ private:
|
|||||||
Declaration const* nextFunctionToCompile() const;
|
Declaration const* nextFunctionToCompile() const;
|
||||||
/// Informs the queue that we are about to compile the given function, i.e. removes
|
/// Informs the queue that we are about to compile the given function, i.e. removes
|
||||||
/// the function from the queue of functions to compile.
|
/// the function from the queue of functions to compile.
|
||||||
void startFunction(const Declaration &_function);
|
void startFunction(Declaration const& _function);
|
||||||
|
|
||||||
/// Labels pointing to the entry points of functions.
|
/// Labels pointing to the entry points of functions.
|
||||||
std::map<Declaration const*, eth::AssemblyItem> m_entryLabels;
|
std::map<Declaration const*, eth::AssemblyItem> m_entryLabels;
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
void appendStateVariableAccessor(VariableDeclaration const& _varDecl);
|
void appendStateVariableAccessor(VariableDeclaration const& _varDecl);
|
||||||
|
|
||||||
/// Appends code for a Constant State Variable accessor function
|
/// Appends code for a Constant State Variable accessor function
|
||||||
void appendConstStateVariableAccessor(const VariableDeclaration& _varDecl);
|
void appendConstStateVariableAccessor(VariableDeclaration const& _varDecl);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool visit(Conditional const& _condition) override;
|
bool visit(Conditional const& _condition) override;
|
||||||
|
@ -127,7 +127,7 @@ private:
|
|||||||
YulStringRepository::Handle m_handle{ 0, YulStringRepository::emptyHash() };
|
YulStringRepository::Handle m_handle{ 0, YulStringRepository::emptyHash() };
|
||||||
};
|
};
|
||||||
|
|
||||||
inline YulString operator "" _yulstring(const char *_string, std::size_t _size)
|
inline YulString operator "" _yulstring(char const* _string, std::size_t _size)
|
||||||
{
|
{
|
||||||
return YulString(std::string(_string, _size));
|
return YulString(std::string(_string, _size));
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ string IPCSocket::sendRequest(string const& _req)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
RPCSession& RPCSession::instance(const string& _path)
|
RPCSession& RPCSession::instance(string const& _path)
|
||||||
{
|
{
|
||||||
static RPCSession session(_path);
|
static RPCSession session(_path);
|
||||||
BOOST_REQUIRE_EQUAL(session.m_ipcSocket.path(), _path);
|
BOOST_REQUIRE_EQUAL(session.m_ipcSocket.path(), _path);
|
||||||
@ -358,7 +358,7 @@ string const& RPCSession::accountCreateIfNotExists(size_t _id)
|
|||||||
return m_accounts[_id];
|
return m_accounts[_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
RPCSession::RPCSession(const string& _path):
|
RPCSession::RPCSession(string const& _path):
|
||||||
m_ipcSocket(_path)
|
m_ipcSocket(_path)
|
||||||
{
|
{
|
||||||
accountCreate();
|
accountCreate();
|
||||||
|
@ -544,7 +544,7 @@ BOOST_AUTO_TEST_CASE(keyword_is_reserved)
|
|||||||
"unchecked"
|
"unchecked"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto& keyword: keywords)
|
for (auto const& keyword: keywords)
|
||||||
{
|
{
|
||||||
auto text = std::string("contract ") + keyword + " {}";
|
auto text = std::string("contract ") + keyword + " {}";
|
||||||
CHECK_PARSE_ERROR(text.c_str(), string("Expected identifier but got reserved keyword '") + keyword + "'");
|
CHECK_PARSE_ERROR(text.c_str(), string("Expected identifier but got reserved keyword '") + keyword + "'");
|
||||||
|
Loading…
Reference in New Issue
Block a user